Go to the documentation of this file.
9 #ifndef CMatrixTemplateNumeric_H
10 #define CMatrixTemplateNumeric_H
38 Eigen::AutoAlign | Eigen::RowMajor
42 typedef Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic,Eigen::AutoAlign|Eigen::RowMajor>
Base;
72 Base::coeffRef(i,j) = static_cast<T>(m.
get_unsafe(i,j));
77 template <
typename Derived>
78 inline CMatrixTemplateNumeric<T>& operator =(
const Eigen::MatrixBase<Derived>& m)
const
93 template <
typename V,
size_t N>
98 ::
memcpy(
Base::data(),&theArray[0],sizeof(T)*N);
106 template <
typename Derived>
107 inline bool operator ==(
const Eigen::MatrixBase<Derived>& m2)
const
109 return Base::cols()==m2.cols() &&
110 Base::rows()==m2.rows() &&
111 Base::cwiseEqual(m2).all();
114 template <
typename Derived>
115 inline bool operator !=(
const Eigen::MatrixBase<Derived>& m2)
const{
return !((*this)==m2); }
137 #ifdef HAVE_LONG_DOUBLE
162 mat.get_unsafe(r,c)=
t;
174 static std::string
get() {
return std::string(
"CMatrixTemplateNumeric<")+ std::string(
TTypeName<T>::get() )+std::string(
">"); }
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
CMatrixTemplateNumeric< float > CMatrixFloat
Declares a matrix of float numbers (non serializable).
#define ASSERT_EQUAL_(__A, __B)
size_t getColCount() const
Number of columns in the matrix.
const T & get_unsafe(size_t row, size_t col) const
Fast but unsafe method to read a value from the matrix.
CMatrixTemplateNumeric< unsigned int > CMatrixUInt
Declares a matrix of unsigned ints (non serializable).
This template class provides the basic functionality for a general 2D any-size, resizable container o...
void BASE_IMPEXP memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) MRPT_NO_THROWS
An OS and compiler independent version of "memcpy".
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CMatrixTemplateNumeric< double > CMatrixLongDouble
Declares a matrix of "long doubles" (non serializable), or of "doubles" if the compiler does not supp...
const EIGEN_STRONG_INLINE AdjointReturnType t() const
Transpose.
A matrix of dynamic size.
CMatrixTemplateNumeric(TConstructorFlags_Matrices)
Constructor that builds a 0x0 matrix (that is, uninitialized), for usage in places where efficiency i...
EIGEN_STRONG_INLINE size_t getColCount() const
Get number of columns.
The purpose of this class is to model traits for containers, so that they can be used as return value...
bool operator!=(const CArray< T, N > &x, const CArray< T, N > &y)
TConstructorFlags_Matrices
For usage in one of the constructors of CMatrixFixedNumeric or CMatrixTemplate (and derived classes),...
static void insertInContainer(CMatrixTemplateNumeric< T > &mat, size_t r, size_t c, const T &t)
static void initialize(CMatrixTemplateNumeric< T > &mat, size_t N)
CMatrixTemplateNumeric(size_t row, size_t col)
Constructor, creates a matrix of the given size, filled with zeros.
CMatrixTemplateNumeric()
Default constructor, builds a 1x1 matrix.
CMatrixTemplateNumeric< T > mrpt_autotype
#define MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(_CLASS_)
size_t getRowCount() const
Number of rows in the matrix.
#define MRPT_MATRIX_CONSTRUCTORS_FROM_POSES(_CLASS_)
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::AutoAlign|Eigen::RowMajor > Base
A template to obtain the type of its argument as a string at compile time.
EIGEN_STRONG_INLINE size_t getRowCount() const
Get number of rows.
Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 23:08:25 UTC 2019 | | |