Registered Member
|
Hello everyone,
I am implementing an algorithm that requires vectors and row-vectors matrix multiplications. The vectors are extracted from a given matrix. If try the following
everything works fine. On the other hand, the following
gives me an exception saying that Program: ... File: <path>/XprHelper.h Line: 53 Expression: v == T(Value) I wonder if it is somehow related to the sparse matrix internal storage order. Shouldn't I be trying to access rows/columns of a sparse matrix using the the col() and row() methods? If that is the case, how should I access the matrix rows/columns to be later used in a matvec operation? Thanks in advance! |
Moderator
|
This should be very slow (1), but this should work... Which Eigen version are you using???
(1) the complexity to access to the row elements of a column major sparse matrix is O(n) .... In case you need to access to several rows, better to copy it to a row-major matrix first, or rethink your problem to avoid the need to access to the rows.... |
Registered Member
|
I am using version 3.2.4.
I might consider to rethink my problem. However, because I am solving a transposed system with the unknown vector left-multiplied instead of the more standard presentation which uses right-multiplication, and because Eigen has this nice feature of not transposing the matrix in place by only changing the way it is accessed, I should be able to use the pre-shipped Eigen solvers to solve my system of equations. But I really want to construct my linear system without having to change the matvec operations required to build it (because of encapsulation), hence some row-vector times matrix operations will be necessary and the functionality to access a row of a matrix is very appealing. Thanks for warning me about the element-accessing issue. I will definitely consider that after the problem with the row() method is sorted out. |
Moderator
|
I cannot reproduce your issue. Do you have a self-contained example that trigger the assertion?
|
Registered Member
|
If I simply try the code snippet I provided in my first post I already have the exception.
Here is the "unit test" I run in order to observe the exception:
Perhaps something related with my development environment? The OS is Windows 7. I am developing my application using VS2010. The unit test above runs using the VS Unit Testing framework. I am using Eigen by basically including the header files (no CMAKE). |
Moderator
|
And what about the latest 3.2 branch which contains a few MSVC fixes: https://bitbucket.org/eigen/eigen/get/3.2.zip
|
Registered Member
|
Ok, it works now! Thanks a lot!
Out of curiosity, what type of fixes are needed to compile Eigen using msvc? |
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar