Re: [eigen] Deducing associated type in eigen3

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


Dear Brook,

you can do things like
  Eigen::MatrixXd::Scalar d;
or
  Eigen::MatrixXd M;
  decltype(M)::Scalar d;
Is this what you are looking for?

Alternatively, you can try Eigen::internal::traits<EigenType>::Scalar, which is supported by many Eigen type. You can see examples of use of Eigen::internal::traits in many places, e.g. SolverBase.h

Best regards,
Adrien

On Mon, May 25, 2020 at 3:31 AM Brook Milligan <brook@xxxxxxxx> wrote:
I am trying to discover if Eigen provides any meta functions for deducing types associated with the main Eigen types, e.g., arrays, matrices, etc.  For example, is there any way to determine what the scalar type associated with a matrix is?

I am not seeing any way to do this in the documentation, but perhaps I just have not found it yet.  It is certainly not highlighted.

Thanks for your help.

Cheers,
Brook





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