[eigen] Bug in pow function

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


I think I have identified a bug in the Eigen::pow function:

double del = 1.3;

Eigen::ArrayXi i(4); i << 1,2,3,4;

Eigen::ArrayXd d(4); d << 1.0,2.0,3.0,4.0;

    

std::cout << d << ": " << Eigen::pow(del, d) << std::endl;

std::cout << i << ": " << Eigen::pow(del, i) << std::endl;


yields


1

2

3

4:    1.3

  1.69

 2.197

2.8561

1

2

3

4: 1

1

1

1


where the pow(double, int) results are all 1, which is incorrect.



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