Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop subtyping of DenseArray #55

Closed
andyferris opened this issue Oct 27, 2016 · 5 comments
Closed

Drop subtyping of DenseArray #55

andyferris opened this issue Oct 27, 2016 · 5 comments

Comments

@andyferris
Copy link
Member

andyferris commented Oct 27, 2016

I had originally defined

abstract StaticArray{T,N} <: DenseArray{T,N}

with the thought that a lot of functionality could be shared with Base.LinAlg functions, such as automatically calling out to BLAS functions and so-on.

In the end, I don't feel this has been as successful as I hoped. Most of the functions lack type-stability because Base makes a habit of calling similar (with the same size). So not only do users not get, e.g., an SMatrix back (they get an MMatrix), the code inside the functions (and sometimes the output) is frequently not type-stable and is probably much slower than just using Base.Array.

Further, most of the decompositions actually fail. Only eig seems to work well, and it is also not type stable internally.

And finally, we already have StaticArrays which are not dense, like Rotation and probably in the future things like static unit ranges and so-on.

So the proposal is to change to

abstract StaticArray{T,N} <: AbstractArray{T,N}

and to therefore drop some free functionality (and implement things ourselves).

@c42f
Copy link
Member

c42f commented Oct 27, 2016

👍 from me, these reasons seem compelling.

@andyferris
Copy link
Member Author

The question is then whether to do this separately from an attempt to add the size as a type parameter.

@andyferris
Copy link
Member Author

Though I'm leaning towards traits for that.

@c42f
Copy link
Member

c42f commented Oct 31, 2016

The options for putting the size as a type parameter seem somewhat poor without better compiler support. I think it'd be worth trying a traits-based version.

@andyferris
Copy link
Member Author

See #57

oschulz pushed a commit to oschulz/StaticArrays.jl that referenced this issue Apr 4, 2023
* lazy docs

* Document lazy things

* More care with indexing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants