ublas: identity_matrix and row()

It seems that identity_matrix does not work with row(); is this supposed to be the case? For example: ----------- code excerpt ----------- #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/vector.hpp> int main () { using namespace boost::numeric::ublas; //matrix<double> im(3,3); // this works identity_matrix<double> im(3); // this does not boost::numeric::ublas::vector<double> v = row(im,1); } ------------------------------------ Using matrix<> im, the code works fine, but using identity_matrix<> im, g++ blows up with four or five errors of the form included below, on lines 529, 61, 100, 104, and 84 of matrix_proxy.hpp. I've got quite a lot of questions on ublas, even after combing through the ublas and boost documentation, wiki, and mailing lists at great length. Is this an appropriate forum to pepper with questions, or is there some other manual I can RTFM first? Thanks, -Alex -------- errors excerpt compiling the above --------- /home/linux/phcomp/ph141w/ph141wam/libraries/boost_1_30_0/boost/numeric/ublas/matrix_proxy.hpp: In instantiation of `boost::numeric::ublas::matrix_row<boost::numeric::ublas::identity_matrix<double>
': rowtest.cpp:10: instantiated from here /home/linux/phcomp/ph141w/ph141wam/libraries/boost_1_30_0/boost/numeric/ublas/matrix_proxy.hpp:529: no type named `closure_type' in `class boost::numeric::ublas::identity_matrix<double>' /home/linux/phcomp/ph141w/ph141wam/libraries/boost_1_30_0/boost/numeric/ublas/matrix_proxy.hpp:529: template argument 3 is invalid

Hi Alex, you wrote:
It seems that identity_matrix does not work with row(); is this supposed to be the case? For example:
----------- code excerpt ----------- #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/vector.hpp> int main () { using namespace boost::numeric::ublas; //matrix<double> im(3,3); // this works identity_matrix<double> im(3); // this does not boost::numeric::ublas::vector<double> v = row(im,1); } ------------------------------------
Using matrix<> im, the code works fine, but using identity_matrix<> im, g++ blows up with four or five errors of the form included below, on lines 529, 61, 100, 104, and 84 of matrix_proxy.hpp.
Ouch! Another bug. I've added typedef matrix_reference<self_type> closure_type; to identity_matrix<> (and zero_matrix<> and something similar to unit_vector<> and zero_vector<>) in my local copy and your program compiles now with g++.
I've got quite a lot of questions on ublas, even after combing through the ublas and boost documentation, wiki, and mailing lists at great length. Is this an appropriate forum to pepper with questions, or is there some other manual I can RTFM first?
If all your questions are hidden bug reports, then please feel free to CC your questions to http://groups.yahoo.com/group/ublas-dev ;-) Thanks, Joerg
participants (2)
-
Alexander G Winbow
-
jhr.walter@t-online.de