multiplying a matrix with 0 makes it become a scalar 0
21 Sep
2008
21 Sep
'08
4:35 p.m.
Hi! symbol a("a"), b("b"), c("c"); matrix blah(3,1); blah = a,b,c; cout << "blah: " << blah << endl; //output: // blah: [[a],[b],[c]] cout << "3*blah: " << 3*blah << endl; //output: // 3*blah: 3*[[a],[b],[c]] cout << "(3*blah).evalm(): " << (3*blah).evalm() << endl; // output: // [[3*a], [3*b], [3*c]] cout << "0*blah: " << 0*blah << endl; // output: // 0 cout << "(0*blah).evalm(): " << (0*blah).evalm() << endl; // output: // 0 I don't like this behaviour. Is it supposed to be that way or is this a bug? Is there a nice way to prevent a matrix from losing its row and column information? Regards Al Capone
6125
Age (days ago)
6125
Last active (days ago)
0 comments
1 participants
participants (1)
-
dummy-address@web.de