Registered Member
|
Given a band matrix B, I would like to extract its rows, one at a time.
The monster I've come up with is this:
which for a well-chosen value of k ought to return one of the rows. My questions are: 1. Is this the best way of doing this? 2. If so, how do I come up with k? It seems like a complicated function of 4 variables (rows, cols, supers, subs). 3. Do I need to start completely from scratch to set one of the rows? I can't seem to get reverse to return a mutable view. Thank you, krey |
Registered Member
|
For 2. I found this: http://www.netlib.org/lapack/lug/node124.html
|
Moderator
|
We currently don't have better to offer. Implementing a generic AntiDiagonal expression (similar to Diagonal) would help. Regarding the write issue, the problem is that there is no con-const reverse method in VectorwiseOp, easily fixable:
|
Moderator
|
Fixed in devel branch: https://bitbucket.org/eigen/eigen/commits/d4db25551a78/
|
Registered Member
|
Many thanks for taking care of this, Gael.
For the record, here is the correct code for getting the nth row
Please let me know if you can think of something more elegant/faster etc. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]