Re: [eigen] matrix_exp_compute LDBL_MANT_DIG > 112

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


Hi,

In the general case it basically computes the eigenvalue/vector decomposition, apply the scalar-wise exp function (stem_function_exp) to eigenvalues, and then recompose the matrix. In practice, this is performed using a Schur decomposition instead of a full eigenvalue/vector decomposition.

gael

On Mon, Oct 31, 2016 at 3:06 PM, Charles Margossian <charlesm@xxxxxxxxxxxx> wrote:
Hi,

I'm implementing a matrix exponential function in the language Stan (mc-stan.org), based on Eigen's implementation in Unsupported. I wanted to ask about the following C macro in this file (lines 345 - 353).

#if LDBL_MANT_DIG > 112 // rarely happens
  typedef typename traits<MatrixType>::Scalar Scalar;
  typedef typename NumTraits<Scalar>::Real RealScalar;
  typedef typename std::complex<RealScalar> ComplexScalar;
  if (sizeof(RealScalar) > 14) {
    result = arg.matrixFunction(internal::stem_function_exp<ComplexScalar>);
    return;
  }
#endif

I understand it is meant for the case where the machine bites is higher than 112, but I don't get what 

result = arg.matrixFunction(internal::stem_function_exp<ComplexScalar>; 

does. Looking at stem_function_exp, the function seems to only return std::exp.

Clarification would be very helpful. Thank you very much!

Best,
Charles



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