MRPT  1.9.9
CMatrixDynamic.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2 | Mobile Robot Programming Toolkit (MRPT) |
3 | https://www.mrpt.org/ |
4 | |
5 | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6 | See: https://www.mrpt.org/Authors - All rights reserved. |
7 | Released under BSD License. See: https://www.mrpt.org/License |
8 +------------------------------------------------------------------------+ */
9 
10 #include "math-precomp.h" // Precompiled headers
11 
14 #include <Eigen/Dense>
15 
16 using namespace mrpt::math;
17 
18 template <typename T>
20 {
21  CMatrixDynamic<float> r(rows(), cols());
22  r.asEigen() = asEigen().template cast<float>();
23  return r;
24 }
25 template <typename T>
27 {
28  CMatrixDynamic<double> r(rows(), cols());
29  r.asEigen() = asEigen().template cast<double>();
30  return r;
31 }
32 
33 template <typename T>
35 {
36  auto ret = CVectorDynamic<T>(asEigen().llt().solve(b.asEigen()));
37  return ret;
38 }
39 template <typename T>
41 {
42  auto ret = CVectorDynamic<T>(asEigen().lu().solve(b.asEigen()));
43  return ret;
44 }
45 
46 // Template instantiation:
47 #define DO_MATDYN_INSTANTIATION(T_) \
48  template class mrpt::math::CMatrixDynamic<T_>;
49 
Template for column vectors of dynamic size, compatible with Eigen.
CMatrixDynamic< double > cast_double() const
CVectorDynamic< Scalar > lu_solve(const CVectorDynamic< Scalar > &b) const
Solves the linear system Ax=b, returns x, with A this asymmetric matrix.
This base provides a set of functions for maths stuff.
GLubyte GLubyte b
Definition: glext.h:6372
GLdouble GLdouble GLdouble r
Definition: glext.h:3711
CVectorDynamic< Scalar > llt_solve(const CVectorDynamic< Scalar > &b) const
Solves the linear system Ax=b, returns x, with A this symmetric matrix.
CMatrixDynamic< float > cast_float() const
This template class provides the basic functionality for a general 2D any-size, resizable container o...
#define DO_MATDYN_INSTANTIATION(T_)



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019