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 |
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 
DO_MATDYN_INSTANTIATION
#define DO_MATDYN_INSTANTIATION(T_)
Definition: CMatrixDynamic.cpp:47
math-precomp.h
mrpt::math::CMatrixDynamic::cast_double
CMatrixDynamic< double > cast_double() const
Definition: CMatrixDynamic.cpp:26
CVectorDynamic.h
mrpt::math::CMatrixDynamic::asEigen
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object
Definition: CMatrixDynamic.h:540
mrpt::math::CMatrixDynamic::cast_float
CMatrixDynamic< float > cast_float() const
Definition: CMatrixDynamic.cpp:19
CMatrixDynamic.h
mrpt::math::CMatrixDynamic::lu_solve
CVectorDynamic< Scalar > lu_solve(const CVectorDynamic< Scalar > &b) const
Solves the linear system Ax=b, returns x, with A this asymmetric matrix.
Definition: CMatrixDynamic.cpp:40
mrpt::math::CVectorDynamic
Template for column vectors of dynamic size, compatible with Eigen.
Definition: CVectorDynamic.h:31
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:11
mrpt::math::CVectorDynamic::asEigen
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object
Definition: CVectorDynamic.h:284
mrpt::math::CMatrixDynamic
This template class provides the basic functionality for a general 2D any-size, resizable container o...
Definition: CMatrixDynamic.h:39
mrpt::math::CMatrixDynamic::llt_solve
CVectorDynamic< Scalar > llt_solve(const CVectorDynamic< Scalar > &b) const
Solves the linear system Ax=b, returns x, with A this symmetric matrix.
Definition: CMatrixDynamic.cpp:34



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020