QuoteOriginally posted by: outrun I was thinkin to support compile time NxM and see if we can get a little extra performance, but that's for version 2.QuoteOriginally posted by: Cuchulainn I think numerical analysis applications can live well without having to resize the matrix.outrun -- an excellent idea, and what Cuch notes is very valid; at the same time we also might want to keep in mind that there are trade-offs involved here and the fixed-sized objects are not always superior choice even assuming that we know N & M at compile time -- here's an example of what I mean and the choices made regarding the above-mentioned trade-offs in case of Eigen:Fixed vs. Dynamic sizehttp://eigen.tuxfamily.org/dox-devel/TutorialMatrixClass.html#TutorialMatrixFixedVsDynamic"When should one use fixed sizes (e.g. Matrix4f), and when should one prefer dynamic sizes (e.g. MatrixXf)? The simple answer is: use fixed sizes for very small sizes where you can, and use dynamic sizes for larger sizes or where you have to. For small sizes, especially for sizes smaller than (roughly) 16, using fixed sizes is hugely beneficial to performance, as it allows Eigen to avoid dynamic memory allocation and to unroll loops. Internally, a fixed-size Eigen matrix is just a plain static array [...]The limitation of using fixed sizes, of course, is that this is only possible when you know the sizes at compile time. Also, for large enough sizes, say for sizes greater than (roughly) 32, the performance benefit of using fixed sizes becomes negligible. Worse, trying to create a very large matrix using fixed sizes could result in a stack overflow, since Eigen will try to allocate the array as a static array, which by default goes on the stack. Finally, depending on circumstances, Eigen can also be more aggressive trying to vectorize (use SIMD instructions) when dynamic sizes are used, see Vectorization."Consequently, the support for "fixed-size vectorizable Eigen objects" doesn't extend beyond a certain size threshold for a reason:
http://eigen.tuxfamily.org/dox-devel/To ... mlThoughts?