Re: [eigen] matrix_exp_compute LDBL_MANT_DIG > 112
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] matrix_exp_compute LDBL_MANT_DIG > 112
• From: Charles Margossian <charlesm@xxxxxxxxxxxx>
• Date: Tue, 1 Nov 2016 09:28:14 -0400
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metrumrg-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ZqN/Zoj7JOxhVrszZk5Cs3JzHfRhihqlM4p3uNxDtRk=; b=ahKeNXikdMaM7+4rzjHe6W9Aghh3knDBw/LjjzdGe33sDMTMZI1v1EXkOwoFkyTMoP 2vCxYUqnpXxVX0V3yx0QUiPEsnN8GMHY4zMDtR/U+sohcEbtrIu/tsrMopRUGX+KNS7b nFEf/s+QqqX6OZQF5hLhyBvNivn+lkrTWiroo1mQr5TDqeDeADWjhk/q0dfEITlFJDUd NHpuTwjdOEF63ygYFn+b7LOoUIaOIx9zofWLD/ngXrI27GocDAKenBN0nSZoxQRoOsHK X2nJI5e5QR6Co+6zG1dDHVnI0W0noeOGSAvq9hKbIFcuCN6/Uh62jVBqa09je+IKne3p fGMA==

Dear Gael,

Thank you for your answer. Just to make sure I understand: If the machine bites is less than 112, the matrix exponential function uses a Padé approximation, coupled with scaling and squaring.

If the machine bites is higher than 112, the function invokes the C macro and computes the matrix exponential via a Schur decomposition. Right?

Best,
Charles

On Mon, Oct 31, 2016 at 6:18 PM, Gael Guennebaud wrote:
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 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/