
This is probably so all the matrix classes have the same interface. This would allow functions on matrices to work generically for rect_matrix and identity_matrix. template<typename MatrixType> size_t num_elements(MatrixType m) { return m.size1()*m.size2(); } identity_matrix i; rectangular_matrix r; std::cout << num_elements(i) << std::endl; std::cout << num_elements(r) << std::endl; Chris On 10/13/06, YYW <yyw1_25@sohu.com> wrote:
Hi all, I'm a newcomer to uBlas. Please consider the following code:
identity_matrix<double> matI(3); int row = matI.size1(); int col = matI.size2();
now that matI has the same number of rows and columns, why the identity_matrix template class has two "size" member functions: size1() and size2()? And has two "size" member variables: size1_ and size2_? Why not use just size() and size_?
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users