Re: [eigen] Matrix power

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


> // compile with
> // g++ -Wall -O2 -g -I/usr/include/eigen3 -o testpow testpow.cc
> #include <Eigen/Dense>
> #include <unsupported/Eigen/MatrixFunctions>
>
> int main()
> {
>   Eigen::MatrixXd A(4, 4);
>   A <<  0, 0, 0, 0,
>         0, 0, 0, 0,
>         0, 0, 0.4115557167420392, -4.285896778479871,
>         0, 0, -4.285896778479871,  44.63286609452607;
>
>   Eigen::MatrixXd A_sqrt = A.pow(0.5);
> }

A simpler test case that works is:
Eigen::MatrixXd A(2, 2);
A <<  0, 0, 0, 1;

Yet a just barely more complicated case that does not work (i.e., it hangs) is:
  Eigen::MatrixXd A(3, 3);
  A <<  0, 0, 0,
        0, 0, 0,
        0, 0, 1;

Maybe this will help with tracking down the bug.

Luke



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