Static Arrays
Statically sized arrays for Julia
StaticArrays provides a framework for implementing statically sized arrays in Julia (≥ 0.5), using the abstract type StaticArray{Size,T,N} <: AbstractArray{T,N}
. Subtypes of StaticArray
will provide fast implementations of common array and linear algebra operations. Note that here "statically sized" means that the size can be determined from the type, and "static" does not necessarily imply immutable
.
The package also provides some concrete static array types: SVector
, SMatrix
and SArray
, which may be used as-is (or else embedded in your own type). Mutable versions MVector
, MMatrix
and MArray
are also exported, as well as SizedArray
for annotating standard Array
s with static size information. Further, the abstract FieldVector
can be used to make fast static vectors out of any uniform Julia "struct".
Migrating code from Julia v0.6 to Julia v0.7
When upgrading code that is depending on StaticArrays the following notes may be helpful
chol
has been renamed tocholesky
and return a factorization object. To obtain the factor useC = cholesky(A).U
, just like for regular Julia arrays.lu
now return a factorization object instead of a tuple withL
,U
, andp
. They can be obtained by destructing via iteration (L, U, p = lu(A)
) or by usinggetfield
(F = lu(A); L, U, p = F.L, F.U, F.p
).qr
now return a factorization object instead of a tuple withQ
andR
. They can be obtained by destructing via iteration (Q, R = qr(A)
) or by usinggetfield
(F = qr(A); Q, R = F.Q, F.R
)eig
has been renamed toeigen
, which return a factorization object, rather than a tuple with(values, vectors)
. They can be obtained by destructing via iteration (values, vectors = eigen(A)
) or by usinggetfield
(E = eigen(A); values, vectors = E.values, E.vectors
).unshift
andshift
have been renamed topushfirst
andpopfirst
.