Re: [eigen] matrix_exp_compute LDBL_MANT_DIG > 112
• To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
• Subject: Re: [eigen] matrix_exp_compute LDBL_MANT_DIG > 112
• From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
• Date: Wed, 2 Nov 2016 08:11:15 +0100
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ee98mx+mSrJyPD+0TfSlBhybBBA/MgjrkLoL9aWivfM=; b=FB1lryjM7f8XPtfP999IKh+WMcMgJFXuWJtuCpJMPlc4Jxb0lCiYD93+SALFld4M/+ mjpfymYviWAWaQm1do+05Xpht/7O2xmmcoruuvAn5n1TpZaECtFoSpWckeCvhZj/0Svu JRzkwZSJaYE882yAqoF6AJ1MyaGaMmTJLmrZXaw5XXOWC13MG58vuz1H8vaNpf/NDlhT FOCOZ35Q3bZlQHweEfUFGJX2UdzZqetphgXs4dEjpGD0uB/Dydn/Qk8fuMz4aGFubWqE O1jK92855pz2W7maFU3zSm7vNPqC+Bau8CeMZUGMfFCy9I76bidK1vhTCZUPVnyIVM88 0GqQ==

yes, exactly.

On Tue, Nov 1, 2016 at 2:28 PM, Charles Margossian wrote:
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/