9 #ifndef CMatrixFixedNumeric_H 10 #define CMatrixFixedNumeric_H 33 template <
typename T,
size_t NROWS,
size_t NCOLS>
41 ( (NCOLS==1 && NROWS!=1) ? Eigen::ColMajor : Eigen::RowMajor )
45 typedef Eigen::Matrix<T,NROWS,NCOLS, Eigen::AutoAlign | ( (NCOLS==1 && NROWS!=1) ? Eigen::ColMajor : Eigen::RowMajor ) >
Base;
62 template<
size_t N,
typename ReturnType>
inline ReturnType
getVicinity(
size_t c,
size_t r)
const {
73 template <
typename Derived>
74 inline bool operator ==(
const Eigen::MatrixBase<Derived>& m2)
const 76 return Base::cols()==m2.cols() &&
77 Base::rows()==m2.rows() &&
78 Base::cwiseEqual(m2).all();
81 template <
typename Derived>
82 inline bool operator !=(
const Eigen::MatrixBase<Derived>& m2)
const {
return !((*this)==m2); }
99 mat.get_unsafe(
r,
c)=
t;
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)...
A template to obtain the type of its argument as a string at compile time.
CMatrixFixedNumeric< T, NROWS, NCOLS > mrpt_autotype
Eigen::Matrix< T, NROWS, NCOLS, Eigen::AutoAlign|((NCOLS==1 &&NROWS!=1) ? Eigen::ColMajor :Eigen::RowMajor) > Base
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.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
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
This huge template encapsulates a function to get the vicinity of an element, with maximum genericity...