StaticArrays SArray typealias

Hi!

I think that the problem is that typealias doesn’t support making a tuple in that way. The good news is that in v0.6, StaticArrays has changed a little and you now specify the size of an SArray as SArray{Tuple{3, N, N}, Float64} - which typealias (or the equivalent in v0.6) does support.

Basically the size parameter is going from a tuple instance to a tuple type, and one of the main motivations is to support this kind of type alias. We will have typealias SVector{N, T} SArray{Tuple{N}, T, N}, for instance.

The bad news relates to that final N in the last expression. For technical reasons, the compiler needs to know the length of the array (i.e. the product of the dimensions, e.g. N*N for your MyMat{N}) for the concrete types in order to make the code fast, so that in cases where you want to store MyMat in a struct or an array, you would really need typealias MyMat{N} SMatrix{N, N, Float64, N*N}. Unfortunately, all non-trivial operations are forbidden here by typealias, including multiplication (and creating a tuple, as above).

One possible workaround is having typealias MyMat{N, L} SMatrix{N, N, Float64, L}. (You will only benefit from specifying L when you explicitly need to name the element type of an array or a user defined struct - in other places e.g. the constructor for MyMat{N} should still work fine.)

Anyway, I realize it’s all a bit confusing, so let me know if you have any more questions.