Registered Member
|
I am new to eigen. Could you tell me why the following piece of code gives an error?
Here is the error I got [bug] error: invalid operands to binary expression ('MatrixXd' (aka 'Matrix<double, Dynamic, Dynamic>') and 'const DiagonalWrapper<const Eigen::Matrix<double, -1, 1, 0, -1, 1> >') cout<< B + ss.asDiagonal() ; ~ ^ ~~~~~~~~~~~~~~~[/bug] However when I replace the
by
it works. |
Moderator
|
This is a non supported operation. You can only combine dense and diagonal matrices trough products or compound assignments:
B += bb.asDiagonal(); B -= bb.asDiagonal(); |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]