MRPT  2.0.4
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-2020, Individual contributors, see AUTHORS file |
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.
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
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object.
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object.
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 2.0.4 Git: 44b1e7295 Fri Jun 5 12:35:25 2020 +0200 at vie jun 5 12:45:10 CEST 2020