Re: [eigen] Convert 1x1 matrix to internal type?

[ Thread Index | Date Index | More Archives ]

lfrfly@xxxxxxxxxxx wrote:
> Indeed, a Cholesky decomposition is a better option. However, the below
> does not appear to be correct. I'm going to keep working the problem,
> but in the meantime does anyone know how the Eigen expression to compute
> Mahalanobis distance from the origin using a Cholesky decomposition?

Have you tried (compiles but not tested for correctness):
double d = covariance.llt().matrixL().solveTriangular(data).squaredNorm();

(don't forget to #include <Eigen/Cholesky>)

hth Christoph

Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: (+49) 421-218-64252

Mail converted by MHonArc 2.6.19+