Registered Member
|
Hello,
I have problems with partitioning a MatrixXd into submatrices and using them for manipulation. All i get is copy of submatrices. When i change elements of submatrix, we got only local copy changes(no changes in container matrixXd). This means i am not able to get sub matrices with referance. Sample code below,
the output is:
any suggestions? |
Registered Member
|
By itself, m.topLeftCorner(2,2) is an expression of type Eigen::Block<yamMatrix> and is a reference to the block in the top left corner of m. However, you assign it to a variable of type yamMatrix and the implicit type cast makes a copy. If you want a reference to the block, you should declare mtr to be of type Eigen::Block<yamMatrix> .
|
Registered Member
|
This solved problem thank you,
And another question, is there anyway to protect same row and columun index of reference block after resizing matrix, i want to automatically decrease sub blocks indices after i delete some block that's row count is same as "m" and columun count is less than "m" ? this will make possible to delete some objects that containts reference blocks to m. thank you. |
Registered Member
|
I do not understand what you want, but I suspect it is not possible.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]