[eigen] Permutation times Sparse matrix

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


When I execute the program below I expect to get
L=
1 0
0 1
But I get
L =
0 0
0 0

# include <Eigen/SparseCore>
# include <iostream>
int main()
{   Eigen::SparseMatrix<double> L(2,2);
    L.insert(0,0) = 1.0;
    L.insert(1,1) = 1.0;
    Eigen::PermutationMatrix<2,2> P;
    P.setIdentity();
    L = P * L;
    std::cout << "L =\n" << Eigen::Matrix<double,2,2>(L) << "\n";
    return 0;
}




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/