9 #ifndef CMatrixFixedNumeric_H 10 #define CMatrixFixedNumeric_H 38 template <
typename T,
size_t NROWS,
size_t NCOLS>
40 :
public Eigen::Matrix<
45 ((NCOLS == 1 && NROWS != 1) ? Eigen::ColMajor : Eigen::RowMajor)>
48 typedef Eigen::Matrix<T, NROWS, NCOLS,
50 ((NCOLS == 1 && NROWS != 1) ? Eigen::ColMajor
69 template <
size_t N,
typename ReturnType>
73 ReturnType, N>::get(
c,
r, *
this);
85 template <
typename Derived>
86 inline bool operator==(
const Eigen::MatrixBase<Derived>& m2)
const 88 return Base::cols() == m2.cols() && Base::rows() == m2.rows() &&
89 Base::cwiseEqual(m2).all();
94 template <
typename Derived>
95 inline bool operator!=(
const Eigen::MatrixBase<Derived>& m2)
const 97 return !((*this) == m2);
107 template <
typename T,
size_t D>
119 mat.get_unsafe(
r,
c) =
t;
129 template <
typename T,
size_t N,
size_t M>
136 (
unsigned int)N, (
unsigned int)M);
Eigen::Matrix< T, NROWS, NCOLS, Eigen::AutoAlign|((NCOLS==1 &&NROWS !=1) ? Eigen::ColMajor :Eigen::RowMajor)> Base
static void initialize(CMatrixFixedNumeric< T, D, D > &mat, size_t N)
TConstructorFlags_Matrices
For usage in one of the constructors of CMatrixFixedNumeric or CMatrixTemplate (and derived classes)...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
A template to obtain the type of its argument as a string at compile time.
bool operator==(const Eigen::MatrixBase< Derived > &m2) const
== comparison of two matrices; it differs from default Eigen operator in that returns false if matric...
bool operator!=(const Eigen::MatrixBase< Derived > &m2) const
!= comparison of two matrices; it differs from default Eigen operator in that returns true if matrice...
MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(CMatrixFixedNumeric) inline CMatrixFixedNumeric()
Default constructor, initializes all elements to zero.
CMatrixFixedNumeric(TConstructorFlags_Matrices)
Constructor which leaves the matrix uninitialized.
A numeric matrix of compile-time fixed size.
The purpose of this class is to model traits for containers, so that they can be used as return value...
static void insertInContainer(CMatrixFixedNumeric< T, D, D > &mat, size_t r, size_t c, const T &t)
#define MRPT_MATRIX_CONSTRUCTORS_FROM_POSES(_CLASS_)
CMatrixFixedNumeric(const T *vals)
Constructor from an array in row major.
GLsizei const GLchar ** string
void loadFromArray(const T *vals)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLdouble GLdouble GLdouble r
ReturnType getVicinity(size_t c, size_t r) const
CMatrixFixedNumeric< T, NROWS, NCOLS > mrpt_autotype
This huge template encapsulates a function to get the vicinity of an element, with maximum genericity...