|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-01-13 20:35:25
Hi Doug,
Thanks for the explanation.
How about the case when the matrix size is a run-time value, instead
of compile-time as in your example?
On Sat, 13 Jan 2001, Doug Gregor wrote:
gregod> The "literals" array for this type could be:
gregod>
gregod> template<typename T, int N>
gregod> Matrix<T, N, N> LiteralTable< Matrix<T, N, N> >::literals[] = {
gregod> Matrix<T, N, N>(Matrix<T, N, N>::zero),
gregod> Matrix<T, N, N>(Matrix<T, N, N>::identity)
gregod> };
gregod>
gregod> Which lets the ID(Matrix<T, N, N>, 0) <-> the NxN zero matrix and
gregod> ID(Matrix<T, N, N>, 1) <-> the NxN identity matrix.
gregod>
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk