MatrixBase_eval.cpp
Go to the documentation of this file.
00001 Matrix2f M = Matrix2f::Random();
00002 Matrix2f m;
00003 m = M;
00004 cout << "Here is the matrix m:" << endl << m << endl;
00005 cout << "Now we want to copy a column into a row." << endl;
00006 cout << "If we do m.col(1) = m.row(0), then m becomes:" << endl;
00007 m.col(1) = m.row(0);
00008 cout << m << endl << "which is wrong!" << endl;
00009 cout << "Now let us instead do m.col(1) = m.row(0).eval(). Then m becomes" << endl;
00010 m = M;
00011 m.col(1) = m.row(0).eval();
00012 cout << m << endl << "which is right." << endl;


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:31:56