
Jens Seidel schrieb:
Hi,
a few days ago I started exactly as you described (except that I used old style for loops instead of STL stuff :-) a TinyDenseMatrix class to implement the Moore Penrose pseudo inverse for real tiny matrices (4 x n, n<20).
A very big disadvantage is using fixed dimensions. There is no need for memory allocation in this case but it restricts the usage dramatically!
Nearly always the dimensions are variables, there are only a few rare cases where you know these before. So how about making N and M variables and providing one or two good memory allocators?
T* data() { return &**m; }
Why not &m[0][0]?
Just a matter of taste, I guess. Actually I'm not even sure yet that it's wise to use a two dimensional array at all. T m[M*N] would work equally well and since there's no interface yet that relies on that structure, the latter might even be the simpler approach. The two-dimensional array just felt to be more 'natural' for a matrix. (whatever that means :-) ) But thanks for your support, Andreas
The advantage of this approach is its simplicity, in fact, it's
Right, I wrote such stuff already multiple times even if I care normally about sparse matrices with dimensions > 1 000 000.
Jens _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost