[eigen] matrix exponential with c++0x

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


I tried to compile the unit tests with c++0x and the matrix exponential stuff failed. I got actually two errors where the first one was trivial to fix though I am not sure anymore whether the fix is correct considering the second error.

First, M_LOG2_E suddenly was not defined anymore so I added

#if defined(log2) && !defined(M_LOG2_E)
  #define M_LOG2_E 0.693147180559945309417

Then, a second error popped up in

  void MatrixExponential<MatrixType>::computeUV(float)

where the compiler claimed that for this _expression_

 MatrixType A = *m_M / std::pow(Scalar(2), m_squarings);

no matching operator / exists. It would be great if you could check whether and how to fix this. Everybody else is of course invited to provide fixes as well. At the moment I just don't have much time to do so.

The last error is really strange. I tried to play a little bit with it and it seems that std::pow(std::complex<double>(2), int) is returning a std::complex<float>. At least I get the error message "conversion from 'std::complex<double>' to non-scalar type 'const std::complex<float>' requested" when I try the following code

  const Scalar tmp = std::pow(Scalar(2), m_squarings);
  MatrixType A = *m_M / tmp;

- Hauke

Attachment: matrix_exp.patch
Description: Binary data

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