Main MRPT website > C++ reference for MRPT 1.5.9
Functions
eigen_plugins.h File Reference

Go to the source code of this file.

Enumerations

MRPT plugin: Types
enum  { static_size = RowsAtCompileTime*ColsAtCompileTime }
 

Functions

template<class OtherDerived >
EIGEN_STRONG_INLINE void extractRow (size_t nRow, Eigen::EigenBase< OtherDerived > &v, size_t startingCol=0) const
 Extract one row from the matrix into a row vector. More...
 
template<typename T >
void extractRow (size_t nRow, std::vector< T > &v, size_t startingCol=0) const
 
template<class VECTOR >
EIGEN_STRONG_INLINE void extractRowAsCol (size_t nRow, VECTOR &v, size_t startingCol=0) const
 Extract one row from the matrix into a column vector. More...
 
template<class VECTOR >
EIGEN_STRONG_INLINE void extractCol (size_t nCol, VECTOR &v, size_t startingRow=0) const
 Extract one column from the matrix into a column vector. More...
 
template<typename T >
void extractCol (size_t nCol, std::vector< T > &v, size_t startingRow=0) const
 
template<class MATRIX >
EIGEN_STRONG_INLINE void extractMatrix (const size_t firstRow, const size_t firstCol, MATRIX &m) const
 
template<class MATRIX >
EIGEN_STRONG_INLINE void extractMatrix (const size_t firstRow, const size_t firstCol, const size_t nRows, const size_t nCols, MATRIX &m) const
 
template<class MATRIX >
EIGEN_STRONG_INLINE void extractSubmatrix (const size_t row_first, const size_t row_last, const size_t col_first, const size_t col_last, MATRIX &out) const
 Get a submatrix, given its bounds: first & last column and row (inclusive). More...
 
template<class MATRIX >
void extractSubmatrixSymmetricalBlocks (const size_t block_size, const std::vector< size_t > &block_indices, MATRIX &out) const
 Get a submatrix from a square matrix, by collecting the elements M(idxs,idxs), where idxs is a sequence {block_indices(i):block_indices(i)+block_size-1} for all "i" up to the size of block_indices. More...
 
template<class MATRIX >
void extractSubmatrixSymmetrical (const std::vector< size_t > &indices, MATRIX &out) const
 Get a submatrix from a square matrix, by collecting the elements M(idxs,idxs), where idxs is the sequence of indices passed as argument. More...
 
MRPT plugin: Set/get/load/save and other miscelaneous methods
EIGEN_STRONG_INLINE void fill (const Scalar v)
 
EIGEN_STRONG_INLINE void assign (const Scalar v)
 
EIGEN_STRONG_INLINE void assign (size_t N, const Scalar v)
 
EIGEN_STRONG_INLINE size_t getRowCount () const
 Get number of rows. More...
 
EIGEN_STRONG_INLINE size_t getColCount () const
 Get number of columns. More...
 
EIGEN_STRONG_INLINE void unit (const size_t nRows, const Scalar diag_vals)
 Make the matrix an identity matrix (the diagonal values can be 1.0 or any other value) More...
 
EIGEN_STRONG_INLINE void unit ()
 Make the matrix an identity matrix. More...
 
EIGEN_STRONG_INLINE void eye ()
 Make the matrix an identity matrix. More...
 
EIGEN_STRONG_INLINE void zeros ()
 Set all elements to zero. More...
 
EIGEN_STRONG_INLINE void zeros (const size_t row, const size_t col)
 Resize and set all elements to zero. More...
 
EIGEN_STRONG_INLINE void ones (const size_t row, const size_t col)
 Resize matrix and set all elements to one. More...
 
EIGEN_STRONG_INLINE void ones ()
 Set all elements to one. More...
 
EIGEN_STRONG_INLINE Scalarget_unsafe_row (size_t row)
 Fast but unsafe method to obtain a pointer to a given row of the matrix (Use only in time critical applications) VERY IMPORTANT WARNING: You must be aware of the memory layout, either Column or Row-major ordering. More...
 
EIGEN_STRONG_INLINE Scalar get_unsafe (const size_t row, const size_t col) const
 Read-only access to one element (Use with caution, bounds are not checked!) More...
 
EIGEN_STRONG_INLINE void set_unsafe (const size_t row, const size_t col, const Scalar val)
 Sets an element (Use with caution, bounds are not checked!) More...
 
EIGEN_STRONG_INLINE void push_back (Scalar val)
 Insert an element at the end of the container (for 1D vectors/arrays) More...
 
EIGEN_STRONG_INLINE bool isSquare () const
 
EIGEN_STRONG_INLINE bool isSingular (const Scalar absThreshold=0) const
 
bool fromMatlabStringFormat (const std::string &s, std::ostream *dump_errors_here=NULL)
 Read a matrix from a string in Matlab-like format, for example "[1 0 2; 0 4 -1]" The string must start with '[' and end with ']'. More...
 
std::string inMatlabFormat (const size_t decimal_digits=6) const
 Dump matrix in matlab format. More...
 
void saveToTextFile (const std::string &file, mrpt::math::TMatrixTextFileFormat fileFormat=mrpt::math::MATRIX_FORMAT_ENG, bool appendMRPTHeader=false, const std::string &userHeader=std::string()) const
 Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classes themselves). More...
 
void loadFromTextFile (const std::string &file)
 Load matrix from a text file, compatible with MATLAB text format. More...
 
void loadFromTextFile (std::istream &_input_text_stream)
 
EIGEN_STRONG_INLINE void multiplyColumnByScalar (size_t c, Scalar s)
 
EIGEN_STRONG_INLINE void multiplyRowByScalar (size_t r, Scalar s)
 
EIGEN_STRONG_INLINE void swapCols (size_t i1, size_t i2)
 
EIGEN_STRONG_INLINE void swapRows (size_t i1, size_t i2)
 
EIGEN_STRONG_INLINE size_t countNonZero () const
 
EIGEN_STRONG_INLINE Scalar maximum () const
 [VECTORS OR MATRICES] Finds the maximum value More...
 
EIGEN_STRONG_INLINE Scalar minimum () const
 [VECTORS OR MATRICES] Finds the minimum value More...
 
EIGEN_STRONG_INLINE void minimum_maximum (Scalar &out_min, Scalar &out_max) const
 [VECTORS OR MATRICES] Compute the minimum and maximum of a container at once More...
 
EIGEN_STRONG_INLINE Scalar maximum (size_t *maxIndex) const
 [VECTORS ONLY] Finds the maximum value (and the corresponding zero-based index) from a given container. More...
 
void find_index_max_value (size_t &u, size_t &v, Scalar &valMax) const
 [VECTORS OR MATRICES] Finds the maximum value (and the corresponding zero-based index) from a given container. More...
 
EIGEN_STRONG_INLINE Scalar minimum (size_t *minIndex) const
 [VECTORS ONLY] Finds the minimum value (and the corresponding zero-based index) from a given container. More...
 
EIGEN_STRONG_INLINE void minimum_maximum (Scalar &out_min, Scalar &out_max, size_t *minIndex, size_t *maxIndex) const
 [VECTORS ONLY] Compute the minimum and maximum of a container at once More...
 
EIGEN_STRONG_INLINE Scalar norm_inf () const
 Compute the norm-infinite of a vector ($f[ ||{v}||_ $f]), ie the maximum absolute value of the elements. More...
 
EIGEN_STRONG_INLINE Scalar squareNorm () const
 Compute the square norm of a vector/array/matrix (the Euclidean distance to the origin, taking all the elements as a single vector). More...
 
EIGEN_STRONG_INLINE Scalar sumAll () const
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE void laplacian (Eigen::MatrixBase< OtherDerived > &ret) const
 Computes the laplacian of this square graph weight matrix. More...
 
EIGEN_STRONG_INLINE void setSize (size_t row, size_t col)
 Changes the size of matrix, maintaining its previous content as possible and padding with zeros where applicable. More...
 
template<class OUTVECT >
void largestEigenvector (OUTVECT &x, Scalar resolution=Scalar(0.01), size_t maxIterations=6, int *out_Iterations=NULL, float *out_estimatedResolution=NULL) const
 Efficiently computes only the biggest eigenvector of the matrix using the Power Method, and returns it in the passed vector "x". More...
 
MatrixBase< Derived > & operator^= (const unsigned int pow)
 Combined matrix power and assignment operator. More...
 
EIGEN_STRONG_INLINE void scalarPow (const Scalar s)
 Scalar power of all elements to a given power, this is diferent of ^ operator. More...
 
EIGEN_STRONG_INLINE bool isDiagonal () const
 Checks for matrix type. More...
 
EIGEN_STRONG_INLINE Scalar maximumDiagonal () const
 Finds the maximum value in the diagonal of the matrix. More...
 
EIGEN_STRONG_INLINE double mean () const
 Computes the mean of the entire matrix. More...
 
template<class VEC >
void meanAndStd (VEC &outMeanVector, VEC &outStdVector, const bool unbiased_variance=true) const
 Computes a row with the mean values of each column in the matrix and the associated vector with the standard deviation of each column. More...
 
void meanAndStdAll (double &outMean, double &outStd, const bool unbiased_variance=true) const
 Computes the mean and standard deviation of all the elements in the matrix as a whole. More...
 
template<typename MAT >
EIGEN_STRONG_INLINE void insertMatrix (size_t r, size_t c, const MAT &m)
 Insert matrix "m" into this matrix at indices (r,c), that is, (*this)(r,c)=m(0,0) and so on. More...
 
template<typename MAT >
EIGEN_STRONG_INLINE void insertMatrixTranspose (size_t r, size_t c, const MAT &m)
 
template<typename MAT >
EIGEN_STRONG_INLINE void insertRow (size_t nRow, const MAT &aRow)
 
template<typename MAT >
EIGEN_STRONG_INLINE void insertCol (size_t nCol, const MAT &aCol)
 
template<typename R >
void insertRow (size_t nRow, const std::vector< R > &aRow)
 
template<typename R >
void insertCol (size_t nCol, const std::vector< R > &aCol)
 
EIGEN_STRONG_INLINE void removeColumns (const std::vector< size_t > &idxsToRemove)
 Remove columns of the matrix. More...
 
EIGEN_STRONG_INLINE void unsafeRemoveColumns (const std::vector< size_t > &idxs)
 Remove columns of the matrix. More...
 
EIGEN_STRONG_INLINE void removeRows (const std::vector< size_t > &idxsToRemove)
 Remove rows of the matrix. More...
 
EIGEN_STRONG_INLINE void unsafeRemoveRows (const std::vector< size_t > &idxs)
 Remove rows of the matrix. More...
 
EIGEN_STRONG_INLINE const AdjointReturnType t () const
 Transpose. More...
 
EIGEN_STRONG_INLINE PlainObject inv () const
 
template<class MATRIX >
EIGEN_STRONG_INLINE void inv (MATRIX &outMat) const
 
template<class MATRIX >
EIGEN_STRONG_INLINE void inv_fast (MATRIX &outMat) const
 
EIGEN_STRONG_INLINE Scalar det () const
 
MRPT plugin: Multiply and extra addition functions
EIGEN_STRONG_INLINE bool empty () const
 
template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void add_Ac (const OTHERMATRIX &m, const Scalar c)
 
template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_Ac (const OTHERMATRIX &m, const Scalar c)
 
template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_At (const OTHERMATRIX &m)
 
template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_An (const OTHERMATRIX &m, const size_t n)
 
template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void add_AAt (const OTHERMATRIX &A)
 
template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_AAt (const OTHERMATRIX &A)
 
template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE void multiply (const MATRIX1 &A, const MATRIX2 &B)
 
template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE void multiply_AB (const MATRIX1 &A, const MATRIX2 &B)
 
template<typename MATRIX1 , typename MATRIX2 >
EIGEN_STRONG_INLINE void multiply_AtB (const MATRIX1 &A, const MATRIX2 &B)
 
template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
EIGEN_STRONG_INLINE void multiply_Ab (const OTHERVECTOR1 &vIn, OTHERVECTOR2 &vOut, bool accumToOutput=false) const
 
template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
EIGEN_STRONG_INLINE void multiply_Atb (const OTHERVECTOR1 &vIn, OTHERVECTOR2 &vOut, bool accumToOutput=false) const
 
template<typename MAT_C , typename MAT_R >
EIGEN_STRONG_INLINE void multiply_HCHt (const MAT_C &C, MAT_R &R, bool accumResultInOutput=false) const
 
template<typename MAT_C , typename MAT_R >
EIGEN_STRONG_INLINE void multiply_HtCH (const MAT_C &C, MAT_R &R, bool accumResultInOutput=false) const
 
template<typename MAT_C >
EIGEN_STRONG_INLINE Scalar multiply_HCHt_scalar (const MAT_C &C) const
 
template<typename MAT_C >
EIGEN_STRONG_INLINE Scalar multiply_HtCH_scalar (const MAT_C &C) const
 
template<typename MAT_A >
EIGEN_STRONG_INLINE void multiply_AAt_scalar (const MAT_A &A, typename MAT_A::Scalar f)
 
template<typename MAT_A >
EIGEN_STRONG_INLINE void multiply_AtA_scalar (const MAT_A &A, typename MAT_A::Scalar f)
 
template<class MAT_A , class SKEW_3VECTOR >
void multiply_A_skew3 (const MAT_A &A, const SKEW_3VECTOR &v)
 
template<class SKEW_3VECTOR , class MAT_A >
void multiply_skew3_A (const SKEW_3VECTOR &v, const MAT_A &A)
 
template<class MAT_A , class MAT_OUT >
EIGEN_STRONG_INLINE void multiply_subMatrix (const MAT_A &A, MAT_OUT &outResult, const size_t A_cols_offset, const size_t A_rows_offset, const size_t A_col_count) const
 outResult = this * A More...
 
template<class MAT_A , class MAT_B , class MAT_C >
void multiply_ABC (const MAT_A &A, const MAT_B &B, const MAT_C &C)
 
template<class MAT_A , class MAT_B , class MAT_C >
void multiply_ABCt (const MAT_A &A, const MAT_B &B, const MAT_C &C)
 
template<class MAT_A , class MAT_B , class MAT_C >
void multiply_AtBC (const MAT_A &A, const MAT_B &B, const MAT_C &C)
 
template<class MAT_A , class MAT_B >
EIGEN_STRONG_INLINE void multiply_ABt (const MAT_A &A, const MAT_B &B)
 
template<class MAT_A >
EIGEN_STRONG_INLINE void multiply_AAt (const MAT_A &A)
 
template<class MAT_A >
EIGEN_STRONG_INLINE void multiply_AtA (const MAT_A &A)
 
template<class MAT_A , class MAT_B >
EIGEN_STRONG_INLINE void multiply_result_is_symmetric (const MAT_A &A, const MAT_B &B)
 
MRPT plugin: Eigenvalue / Eigenvectors
template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE bool eigenVectors (MATRIX1 &eVecs, MATRIX2 &eVals) const
 [For square matrices only] Compute the eigenvectors and eigenvalues (sorted), both returned as matrices: eigenvectors are the columns in "eVecs", and eigenvalues in ascending order as the diagonal of "eVals". More...
 
template<class MATRIX1 , class VECTOR1 >
EIGEN_STRONG_INLINE bool eigenVectorsVec (MATRIX1 &eVecs, VECTOR1 &eVals) const
 [For square matrices only] Compute the eigenvectors and eigenvalues (sorted), eigenvectors are the columns in "eVecs", and eigenvalues are returned in in ascending order in the vector "eVals". More...
 
template<class VECTOR >
EIGEN_STRONG_INLINE void eigenValues (VECTOR &eVals) const
 [For square matrices only] Compute the eigenvectors and eigenvalues (sorted), and return only the eigenvalues in the vector "eVals". More...
 
template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE void eigenVectorsSymmetric (MATRIX1 &eVecs, MATRIX2 &eVals) const
 [For symmetric matrices only] Compute the eigenvectors and eigenvalues (in no particular order), both returned as matrices: eigenvectors are the columns, and eigenvalues More...
 
template<class MATRIX1 , class VECTOR1 >
EIGEN_STRONG_INLINE void eigenVectorsSymmetricVec (MATRIX1 &eVecs, VECTOR1 &eVals) const
 [For symmetric matrices only] Compute the eigenvectors and eigenvalues (in no particular order), both returned as matrices: eigenvectors are the columns, and eigenvalues More...
 
MRPT plugin: Linear algebra & decomposition-based methods
template<class MATRIX >
EIGEN_STRONG_INLINE bool chol (MATRIX &U) const
 Cholesky M=UT * U decomposition for simetric matrix (upper-half of the matrix will be actually ignored) More...
 
EIGEN_STRONG_INLINE size_t rank (double threshold=0) const
 Gets the rank of the matrix via the Eigen::ColPivHouseholderQR method. More...
 
MRPT plugin: Scalar and element-wise extra operators
void normalize (Scalar valMin, Scalar valMax)
 Scales all elements such as the minimum & maximum values are shifted to the given values. More...
 
void adjustRange (Scalar valMin, Scalar valMax)
 

MRPT plugin: Basic iterators. These iterators are intended for 1D matrices only, i.e. column or row vectors.

typedef Scalariterator
 
typedef const Scalarconst_iterator
 
EIGEN_STRONG_INLINE iterator begin ()
 
EIGEN_STRONG_INLINE iterator end ()
 

Typedef Documentation

◆ const_iterator

typedef const Scalar* const_iterator

Definition at line 24 of file eigen_plugins.h.

◆ iterator

typedef Scalar* iterator

Definition at line 23 of file eigen_plugins.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 17 of file eigen_plugins.h.

Function Documentation

◆ add_AAt()

template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void add_AAt ( const OTHERMATRIX &  A)

this += A + AT

Definition at line 499 of file eigen_plugins.h.

◆ add_Ac()

template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void add_Ac ( const OTHERMATRIX &  m,
const Scalar  c 
)

Add c (scalar) times A to this matrix: this += A * c

Definition at line 488 of file eigen_plugins.h.

◆ adjustRange()

void adjustRange ( Scalar  valMin,
Scalar  valMax 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 713 of file eigen_plugins.h.

References normalize().

◆ assign() [1/2]

EIGEN_STRONG_INLINE void assign ( const Scalar  v)

Fill all the elements with a given value

Definition at line 41 of file eigen_plugins.h.

◆ assign() [2/2]

EIGEN_STRONG_INLINE void assign ( size_t  N,
const Scalar  v 
)

Resize to N and set all the elements to a given value

Definition at line 43 of file eigen_plugins.h.

◆ begin()

EIGEN_STRONG_INLINE const_iterator begin ( )

Definition at line 26 of file eigen_plugins.h.

Referenced by mrpt::opengl::CSetOfLines::appendLines(), mrpt::opengl::CPolyhedron::cantellate(), mrpt::vision::TSequenceFeatureObservations::compressIDs(), mrpt::hmtslam::CRobotPosesGraph::convertIntoSimplemap(), mrpt::vision::CFeatureList::copyListFrom(), mrpt::hmtslam::TArcList::debugDump(), mrpt::vision::TSequenceFeatureObservations::decimateCameraFrames(), mrpt::vision::CFeatureExtraction::detectFeatures(), mrpt::utils::list_searchable< CHMHMapNode::TNodeID >::find(), mrpt::utils::list_searchable< CHMHMapNode::TNodeID >::find_ptr_to(), mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::findCurrentNumberOfRows(), mrpt::vision::findMultipleChessboardsCorners(), mrpt::vision::CFeatureList::get_type(), mrpt::vision::CMatchedFeatureList::get_type(), mrpt::obs::CActionCollection::getActionByClass(), mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::getAsDense(), mrpt::utils::TParameters< double >::getAsString(), mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::getBinaryBlocksRepresentation(), mrpt::vision::CMatchedFeatureList::getBothFeatureLists(), mrpt::vision::CFeatureList::getByID(), mrpt::vision::CMatchedFeatureList::getByID(), mrpt::math::TPolygon2D::getCenter(), mrpt::math::TPolygon3D::getCenter(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::getLargestDistanceFromOrigin(), mrpt::maps::CMultiMetricMap::getMapByClass(), mrpt::vision::CFeatureList::getMaxID(), mrpt::opengl::CGeneralizedCylinder::getMeshIterators(), mrpt::poses::CPosePDFSOG::getMostLikelyCovarianceAndMean(), mrpt::obs::CSensoryFrame::getObservationByClass(), mrpt::opengl::CSetOfObjects::insert(), mrpt::opengl::COpenGLScene::insert(), mrpt::hmtslam::CRobotPosesGraph::insertIntoMetricMap(), mrpt::opengl::CSetOfTriangles::insertTriangles(), mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA(), mrpt::graphslam::optimize_graph_spa_levmarq(), mrpt::vision::TSequenceFeatureObservations::removeFewObservedFeatures(), mrpt::poses::CPose3DQuat::rend(), mrpt::opengl::CGeneralizedCylinder::render_dl(), mrpt::vision::TSequenceFeatureObservations::saveToTextFile(), mrpt::vision::CFeatureList::saveToTextFile(), mrpt::vision::CMatchedFeatureList::saveToTextFile(), searchForEdge(), mrpt::vision::CMatchedFeatureList::updateMaxID(), mrpt::hmtslam::TArcList::write(), mrpt::hmtslam::CRobotPosesGraph::writeToStream(), mrpt::maps::CBeaconMap::writeToStream(), and mrpt::hmtslam::THypothesisIDSet::writeToStream().

◆ chol()

template<class MATRIX >
EIGEN_STRONG_INLINE bool chol ( MATRIX &  U) const

Cholesky M=UT * U decomposition for simetric matrix (upper-half of the matrix will be actually ignored)

Definition at line 675 of file eigen_plugins.h.

◆ countNonZero()

EIGEN_STRONG_INLINE size_t countNonZero ( ) const

Definition at line 171 of file eigen_plugins.h.

◆ det()

EIGEN_STRONG_INLINE Scalar det ( ) const

◆ eigenValues()

template<class VECTOR >
EIGEN_STRONG_INLINE void eigenValues ( VECTOR &  eVals) const

[For square matrices only] Compute the eigenvectors and eigenvalues (sorted), and return only the eigenvalues in the vector "eVals".

Note
Warning: Only the real part of complex eigenvectors and eigenvalues are returned.
See also
eigenVectorsSymmetric, eigenVectorsVec

Definition at line 647 of file eigen_plugins.h.

References eigenVectorsVec().

Referenced by mrpt::graphs::CGraphPartitioner< GRAPH_MATRIX, num_t >::SpectralBisection().

◆ eigenVectors()

template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE bool eigenVectors ( MATRIX1 &  eVecs,
MATRIX2 &  eVals 
) const

[For square matrices only] Compute the eigenvectors and eigenvalues (sorted), both returned as matrices: eigenvectors are the columns in "eVecs", and eigenvalues in ascending order as the diagonal of "eVals".

Note
Warning: Only the real part of complex eigenvectors and eigenvalues are returned.
See also
eigenVectorsSymmetric, eigenVectorsVec
Returns
false on error

Referenced by mrpt::graphs::CGraphPartitioner< GRAPH_MATRIX, num_t >::SpectralBisection().

◆ eigenVectorsSymmetric()

template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE void eigenVectorsSymmetric ( MATRIX1 &  eVecs,
MATRIX2 &  eVals 
) const

[For symmetric matrices only] Compute the eigenvectors and eigenvalues (in no particular order), both returned as matrices: eigenvectors are the columns, and eigenvalues

See also
eigenVectors

◆ eigenVectorsSymmetricVec()

template<class MATRIX1 , class VECTOR1 >
EIGEN_STRONG_INLINE void eigenVectorsSymmetricVec ( MATRIX1 &  eVecs,
VECTOR1 &  eVals 
) const

[For symmetric matrices only] Compute the eigenvectors and eigenvalues (in no particular order), both returned as matrices: eigenvectors are the columns, and eigenvalues

See also
eigenVectorsVec

◆ eigenVectorsVec()

template<class MATRIX1 , class VECTOR1 >
EIGEN_STRONG_INLINE bool eigenVectorsVec ( MATRIX1 &  eVecs,
VECTOR1 &  eVals 
) const

[For square matrices only] Compute the eigenvectors and eigenvalues (sorted), eigenvectors are the columns in "eVecs", and eigenvalues are returned in in ascending order in the vector "eVals".

Note
Warning: Only the real part of complex eigenvectors and eigenvalues are returned.
See also
eigenVectorsSymmetric, eigenVectorsVec
Returns
false on error

Referenced by eigenValues().

◆ empty()

EIGEN_STRONG_INLINE bool empty ( ) const

◆ end()

EIGEN_STRONG_INLINE iterator end ( )

Definition at line 27 of file eigen_plugins.h.

◆ extractCol() [1/2]

template<class VECTOR >
EIGEN_STRONG_INLINE void extractCol ( size_t  nCol,
VECTOR &  v,
size_t  startingRow = 0 
) const

Extract one column from the matrix into a column vector.

Definition at line 736 of file eigen_plugins.h.

◆ extractCol() [2/2]

template<typename T >
void extractCol ( size_t  nCol,
std::vector< T > &  v,
size_t  startingRow = 0 
) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 740 of file eigen_plugins.h.

◆ extractMatrix() [1/2]

template<class MATRIX >
EIGEN_STRONG_INLINE void extractMatrix ( const size_t  firstRow,
const size_t  firstCol,
MATRIX &  m 
) const

Definition at line 746 of file eigen_plugins.h.

◆ extractMatrix() [2/2]

template<class MATRIX >
EIGEN_STRONG_INLINE void extractMatrix ( const size_t  firstRow,
const size_t  firstCol,
const size_t  nRows,
const size_t  nCols,
MATRIX &  m 
) const

Definition at line 750 of file eigen_plugins.h.

◆ extractRow() [1/2]

template<class OtherDerived >
EIGEN_STRONG_INLINE void extractRow ( size_t  nRow,
Eigen::EigenBase< OtherDerived > &  v,
size_t  startingCol = 0 
) const

Extract one row from the matrix into a row vector.

Definition at line 719 of file eigen_plugins.h.

◆ extractRow() [2/2]

template<typename T >
void extractRow ( size_t  nRow,
std::vector< T > &  v,
size_t  startingCol = 0 
) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 723 of file eigen_plugins.h.

◆ extractRowAsCol()

template<class VECTOR >
EIGEN_STRONG_INLINE void extractRowAsCol ( size_t  nRow,
VECTOR &  v,
size_t  startingCol = 0 
) const

Extract one row from the matrix into a column vector.

Definition at line 729 of file eigen_plugins.h.

◆ extractSubmatrix()

template<class MATRIX >
EIGEN_STRONG_INLINE void extractSubmatrix ( const size_t  row_first,
const size_t  row_last,
const size_t  col_first,
const size_t  col_last,
MATRIX &  out 
) const

Get a submatrix, given its bounds: first & last column and row (inclusive).

Definition at line 758 of file eigen_plugins.h.

◆ extractSubmatrixSymmetrical()

template<class MATRIX >
void extractSubmatrixSymmetrical ( const std::vector< size_t > &  indices,
MATRIX &  out 
) const

Get a submatrix from a square matrix, by collecting the elements M(idxs,idxs), where idxs is the sequence of indices passed as argument.

A perfect application of this method is in extracting covariance matrices of a subset of variables from the full covariance matrix.

See also
extractSubmatrix, extractSubmatrixSymmetricalBlocks

Definition at line 801 of file eigen_plugins.h.

◆ extractSubmatrixSymmetricalBlocks()

template<class MATRIX >
void extractSubmatrixSymmetricalBlocks ( const size_t  block_size,
const std::vector< size_t > &  block_indices,
MATRIX &  out 
) const

Get a submatrix from a square matrix, by collecting the elements M(idxs,idxs), where idxs is a sequence {block_indices(i):block_indices(i)+block_size-1} for all "i" up to the size of block_indices.

A perfect application of this method is in extracting covariance matrices of a subset of variables from the full covariance matrix.

See also
extractSubmatrix, extractSubmatrixSymmetrical

Definition at line 769 of file eigen_plugins.h.

◆ eye()

EIGEN_STRONG_INLINE void eye ( )

Make the matrix an identity matrix.

Definition at line 63 of file eigen_plugins.h.

◆ fill()

EIGEN_STRONG_INLINE void fill ( const Scalar  v)

◆ find_index_max_value()

void find_index_max_value ( size_t &  u,
size_t &  v,
Scalar valMax 
) const

[VECTORS OR MATRICES] Finds the maximum value (and the corresponding zero-based index) from a given container.

Exceptions
std::exceptionOn an empty input vector

Definition at line 218 of file eigen_plugins.h.

◆ fromMatlabStringFormat()

bool fromMatlabStringFormat ( const std::string s,
std::ostream *  dump_errors_here = NULL 
)

Read a matrix from a string in Matlab-like format, for example "[1 0 2; 0 4 -1]" The string must start with '[' and end with ']'.

Rows are separated by semicolons ';' and columns in each row by one or more whitespaces ' ', commas ',' or tabs ''.

This format is also used for CConfigFile::read_matrix.

This template method can be instantiated for matrices of the types: int, long, unsinged int, unsigned long, float, double, long double

Returns
true on success. false if the string is malformed, and then the matrix will be resized to 0x0.
See also
inMatlabFormat, CConfigFile::read_matrix

◆ get_unsafe()

EIGEN_STRONG_INLINE Scalar & get_unsafe ( const size_t  row,
const size_t  col 
) const

Read-only access to one element (Use with caution, bounds are not checked!)

Reference access to one element (Use with caution, bounds are not checked!)

Definition at line 82 of file eigen_plugins.h.

Referenced by mrpt::utils::CImage::setFromMatrix(), and mrpt::utils::CImage::setFromRGBMatrices().

◆ get_unsafe_row()

EIGEN_STRONG_INLINE const Scalar * get_unsafe_row ( size_t  row)

Fast but unsafe method to obtain a pointer to a given row of the matrix (Use only in time critical applications) VERY IMPORTANT WARNING: You must be aware of the memory layout, either Column or Row-major ordering.

Definition at line 78 of file eigen_plugins.h.

◆ getColCount()

EIGEN_STRONG_INLINE size_t getColCount ( ) const

◆ getRowCount()

EIGEN_STRONG_INLINE size_t getRowCount ( ) const

◆ inMatlabFormat()

std::string inMatlabFormat ( const size_t  decimal_digits = 6) const

Dump matrix in matlab format.

This template method can be instantiated for matrices of the types: int, long, unsinged int, unsigned long, float, double, long double

See also
fromMatlabStringFormat

◆ insertCol() [1/2]

template<typename MAT >
EIGEN_STRONG_INLINE void insertCol ( size_t  nCol,
const MAT &  aCol 
)

Definition at line 408 of file eigen_plugins.h.

◆ insertCol() [2/2]

template<typename R >
void insertCol ( size_t  nCol,
const std::vector< R > &  aCol 
)

Definition at line 416 of file eigen_plugins.h.

◆ insertMatrix()

template<typename MAT >
EIGEN_STRONG_INLINE void insertMatrix ( size_t  r,
size_t  c,
const MAT &  m 
)

Insert matrix "m" into this matrix at indices (r,c), that is, (*this)(r,c)=m(0,0) and so on.

Definition at line 402 of file eigen_plugins.h.

◆ insertMatrixTranspose()

template<typename MAT >
EIGEN_STRONG_INLINE void insertMatrixTranspose ( size_t  r,
size_t  c,
const MAT &  m 
)

Definition at line 405 of file eigen_plugins.h.

◆ insertRow() [1/2]

template<typename MAT >
EIGEN_STRONG_INLINE void insertRow ( size_t  nRow,
const MAT &  aRow 
)

Definition at line 407 of file eigen_plugins.h.

◆ insertRow() [2/2]

template<typename R >
void insertRow ( size_t  nRow,
const std::vector< R > &  aRow 
)

Definition at line 410 of file eigen_plugins.h.

◆ inv() [1/2]

EIGEN_STRONG_INLINE PlainObject inv ( ) const

◆ inv() [2/2]

template<class MATRIX >
EIGEN_STRONG_INLINE void inv ( MATRIX &  outMat) const

Definition at line 475 of file eigen_plugins.h.

◆ inv_fast()

template<class MATRIX >
EIGEN_STRONG_INLINE void inv_fast ( MATRIX &  outMat) const

Definition at line 476 of file eigen_plugins.h.

◆ isDiagonal()

EIGEN_STRONG_INLINE bool isDiagonal ( ) const

Checks for matrix type.

Definition at line 341 of file eigen_plugins.h.

◆ isSingular()

EIGEN_STRONG_INLINE bool isSingular ( const Scalar  absThreshold = 0) const

Definition at line 115 of file eigen_plugins.h.

◆ isSquare()

EIGEN_STRONG_INLINE bool isSquare ( ) const

Definition at line 114 of file eigen_plugins.h.

◆ laplacian()

template<typename OtherDerived >
EIGEN_STRONG_INLINE void laplacian ( Eigen::MatrixBase< OtherDerived > &  ret) const

Computes the laplacian of this square graph weight matrix.

The laplacian matrix is L = D - W, with D a diagonal matrix with the degree of each node, W the

Definition at line 265 of file eigen_plugins.h.

◆ largestEigenvector()

template<class OUTVECT >
void largestEigenvector ( OUTVECT &  x,
Scalar  resolution = Scalar(0.01),
size_t  maxIterations = 6,
int *  out_Iterations = NULL,
float *  out_estimatedResolution = NULL 
) const

Efficiently computes only the biggest eigenvector of the matrix using the Power Method, and returns it in the passed vector "x".

Definition at line 301 of file eigen_plugins.h.

◆ loadFromTextFile() [1/2]

void loadFromTextFile ( const std::string file)

Load matrix from a text file, compatible with MATLAB text format.

Lines starting with '' or '#' are interpreted as comments and ignored.

See also
saveToTextFile, fromMatlabStringFormat

Referenced by mrpt::obs::CObservation3DRangeScan::load().

◆ loadFromTextFile() [2/2]

void loadFromTextFile ( std::istream &  _input_text_stream)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ maximum() [1/2]

EIGEN_STRONG_INLINE Scalar maximum ( ) const

[VECTORS OR MATRICES] Finds the maximum value

Exceptions
std::exceptionOn an empty input container

Definition at line 176 of file eigen_plugins.h.

Referenced by minimum_maximum().

◆ maximum() [2/2]

EIGEN_STRONG_INLINE Scalar maximum ( size_t *  maxIndex) const

[VECTORS ONLY] Finds the maximum value (and the corresponding zero-based index) from a given container.

Exceptions
std::exceptionOn an empty input vector

Definition at line 206 of file eigen_plugins.h.

◆ maximumDiagonal()

EIGEN_STRONG_INLINE Scalar maximumDiagonal ( ) const

Finds the maximum value in the diagonal of the matrix.

Definition at line 351 of file eigen_plugins.h.

◆ mean()

EIGEN_STRONG_INLINE double mean ( ) const

Computes the mean of the entire matrix.

See also
meanAndStdAll

Definition at line 355 of file eigen_plugins.h.

Referenced by mrpt::opengl::detail::aux_add3DpointWithEigenVectors(), mrpt::poses::CPosePDFSOG::bayesianFusion(), mrpt::vision::pnp::rpnp::calcampose(), mrpt::poses::CPosePDFSOG::changeCoordinatesReference(), mrpt::poses::CPosePDFSOG::copyFrom(), mrpt::random::CRandomGenerator::drawGaussian1D(), mrpt::random::CRandomGenerator::drawGaussian1DMatrix(), mrpt::random::CRandomGenerator::drawGaussian1DVector(), mrpt::random::CRandomGenerator::drawGaussianMultivariate(), mrpt::random::CRandomGenerator::drawGaussianMultivariateMany(), mrpt::poses::CPosePDFSOG::evaluateNormalizedPDF(), mrpt::poses::CPosePDFSOG::evaluatePDF(), mrpt::opengl::detail::generalizedEllipsoidPoints< 2 >(), mrpt::opengl::detail::generalizedEllipsoidPoints< 3 >(), mrpt::poses::CPoint2DPDFGaussian::getCovarianceAndMean(), mrpt::poses::CPose3DPDFParticles::getCovarianceAndMean(), mrpt::poses::CPose3DQuatPDFGaussianInf::getCovarianceAndMean(), mrpt::poses::CPointPDFParticles::getCovarianceAndMean(), mrpt::poses::CPosePDFGaussian::getCovarianceAndMean(), mrpt::poses::CPosePDFGaussianInf::getCovarianceAndMean(), mrpt::poses::CPose3DPDFGaussianInf::getCovarianceAndMean(), mrpt::poses::CPose3DPDFSOG::getCovarianceAndMean(), mrpt::poses::CPose3DPDFGaussian::getCovarianceAndMean(), mrpt::poses::CPosePDFParticles::getCovarianceAndMean(), mrpt::poses::CPosePDFSOG::getCovarianceAndMean(), mrpt::vision::getDispersion(), mrpt::poses::CPoint2DPDFGaussian::getMean(), mrpt::poses::CPose3DQuatPDFGaussianInf::getMean(), mrpt::poses::CPosePDFGaussian::getMean(), mrpt::poses::CPosePDFGaussianInf::getMean(), mrpt::poses::CPose3DPDFGaussianInf::getMean(), mrpt::poses::CPose3DPDFGaussian::getMean(), mrpt::poses::CPosePDFSOG::getMean(), mrpt::poses::CPosePDFGaussian::getPoseMean(), mrpt::poses::CPosePDFGaussianInf::getPoseMean(), mrpt::poses::CPose3DPDFGaussianInf::getPoseMean(), mrpt::poses::CPose3DQuatPDFGaussianInf::getPoseMean(), mrpt::poses::CPose3DQuatPDFGaussian::getPoseMean(), mrpt::poses::CPose3DPDFGaussian::getPoseMean(), mrpt::graphslam::TSlidingWindow::getStdDev(), mrpt::opengl::COctreePointRenderer< CPointCloudColoured >::internal_recursive_split(), mrpt::poses::CPosePDFSOG::inverse(), mrpt::math::MATLAB_plotCovariance2D(), mrpt::random::matrixRandomNormal(), mrpt::poses::CPosePDFSOG::mergeModes(), mrpt::poses::CPosePDFSOG::operator+=(), mrpt::opengl::CSetOfObjects::posePDF2opengl(), mrpt::random::RandomNormal(), mrpt::maps::CGasConcentrationGridMap2D::readFromStream(), mrpt::maps::CWirelessPowerGridMap2D::readFromStream(), mrpt::poses::CPosePDFSOG::readFromStream(), mrpt::slam::CRangeBearingKFSLAM2D::saveMapAndPath2DRepresentationAsMATLABFile(), mrpt::slam::CRangeBearingKFSLAM::saveMapAndPath2DRepresentationAsMATLABFile(), mrpt::poses::CPosePDFSOG::saveToTextFile(), mrpt::graphs::CGraphPartitioner< GRAPH_MATRIX, num_t >::SpectralBisection(), TEST_F(), mrpt::random::vectorRandomNormal(), and mrpt::poses::CPosePDFSOG::writeToStream().

◆ meanAndStd()

template<class VEC >
void meanAndStd ( VEC &  outMeanVector,
VEC &  outStdVector,
const bool  unbiased_variance = true 
) const

Computes a row with the mean values of each column in the matrix and the associated vector with the standard deviation of each column.

See also
mean,meanAndStdAll
Exceptions
std::exceptionIf the matrix/vector is empty.
Parameters
unbiased_varianceStandard deviation is sum(vals-mean)/K, with K=N-1 or N for unbiased_variance=true or false, respectively.

Definition at line 366 of file eigen_plugins.h.

References mrpt::math::square(), and mrpt::math::sum().

Referenced by mrpt::detectors::CFaceDetection::experimental_showMeasurements().

◆ meanAndStdAll()

void meanAndStdAll ( double &  outMean,
double &  outStd,
const bool  unbiased_variance = true 
) const

Computes the mean and standard deviation of all the elements in the matrix as a whole.

See also
mean,meanAndStd
Exceptions
std::exceptionIf the matrix/vector is empty.
Parameters
unbiased_varianceStandard deviation is sum(vals-mean)/K, with K=N-1 or N for unbiased_variance=true or false, respectively.

Definition at line 388 of file eigen_plugins.h.

References mrpt::math::square(), and mrpt::math::sum().

◆ minimum() [1/2]

EIGEN_STRONG_INLINE Scalar minimum ( ) const

[VECTORS OR MATRICES] Finds the minimum value

See also
maximum, minimum_maximum
Exceptions
std::exceptionOn an empty input container

Definition at line 185 of file eigen_plugins.h.

Referenced by minimum_maximum().

◆ minimum() [2/2]

EIGEN_STRONG_INLINE Scalar minimum ( size_t *  minIndex) const

[VECTORS ONLY] Finds the minimum value (and the corresponding zero-based index) from a given container.

See also
maximum, minimum_maximum
Exceptions
std::exceptionOn an empty input vector

Definition at line 230 of file eigen_plugins.h.

◆ minimum_maximum() [1/2]

EIGEN_STRONG_INLINE void minimum_maximum ( Scalar out_min,
Scalar out_max 
) const

[VECTORS OR MATRICES] Compute the minimum and maximum of a container at once

See also
maximum, minimum
Exceptions
std::exceptionOn an empty input container

Definition at line 194 of file eigen_plugins.h.

References maximum(), and minimum().

Referenced by normalize().

◆ minimum_maximum() [2/2]

EIGEN_STRONG_INLINE void minimum_maximum ( Scalar out_min,
Scalar out_max,
size_t *  minIndex,
size_t *  maxIndex 
) const

[VECTORS ONLY] Compute the minimum and maximum of a container at once

See also
maximum, minimum
Exceptions
std::exceptionOn an empty input vector

Definition at line 242 of file eigen_plugins.h.

References maximum(), and minimum().

◆ multiply()

template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE void multiply ( const MATRIX1 &  A,
const MATRIX2 &  B 
)
Parameters
Bthis = A * B

Definition at line 505 of file eigen_plugins.h.

◆ multiply_A_skew3()

template<class MAT_A , class SKEW_3VECTOR >
void multiply_A_skew3 ( const MAT_A &  A,
const SKEW_3VECTOR &  v 
)

this = A * skew(v), with v being a 3-vector (or 3-array) and skew(v) the skew symmetric matrix of v (see mrpt::math::skew_symmetric3)

Definition at line 569 of file eigen_plugins.h.

References mrpt::math::multiply_A_skew3().

◆ multiply_AAt()

template<class MAT_A >
EIGEN_STRONG_INLINE void multiply_AAt ( const MAT_A &  A)
Parameters
Athis = A * AT

Definition at line 604 of file eigen_plugins.h.

◆ multiply_AAt_scalar()

template<typename MAT_A >
EIGEN_STRONG_INLINE void multiply_AAt_scalar ( const MAT_A &  A,
typename MAT_A::Scalar  f 
)

this = C * CT * f (with a matrix C and a scalar f).

Definition at line 559 of file eigen_plugins.h.

◆ multiply_AB()

template<class MATRIX1 , class MATRIX2 >
EIGEN_STRONG_INLINE void multiply_AB ( const MATRIX1 &  A,
const MATRIX2 &  B 
)
Parameters
Bthis = A * B

Definition at line 508 of file eigen_plugins.h.

Referenced by mrpt::math::CSparseMatrix::operator*=().

◆ multiply_Ab()

template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
EIGEN_STRONG_INLINE void multiply_Ab ( const OTHERVECTOR1 &  vIn,
OTHERVECTOR2 &  vOut,
bool  accumToOutput = false 
) const

Computes the vector vOut = this * vIn, where "vIn" is a column vector of the appropriate length.

Definition at line 519 of file eigen_plugins.h.

Referenced by mrpt::math::CSparseMatrix::operator*().

◆ multiply_ABC()

template<class MAT_A , class MAT_B , class MAT_C >
void multiply_ABC ( const MAT_A &  A,
const MAT_B &  B,
const MAT_C &  C 
)
Parameters
Cthis = A*B*C

Definition at line 584 of file eigen_plugins.h.

◆ multiply_ABCt()

template<class MAT_A , class MAT_B , class MAT_C >
void multiply_ABCt ( const MAT_A &  A,
const MAT_B &  B,
const MAT_C &  C 
)
Parameters
Cthis = A*B*(CT)

Definition at line 589 of file eigen_plugins.h.

◆ multiply_ABt()

template<class MAT_A , class MAT_B >
EIGEN_STRONG_INLINE void multiply_ABt ( const MAT_A &  A,
const MAT_B &  B 
)
Parameters
Bthis = A * BT

Definition at line 599 of file eigen_plugins.h.

◆ multiply_AtA()

template<class MAT_A >
EIGEN_STRONG_INLINE void multiply_AtA ( const MAT_A &  A)
Parameters
Athis = AT * A

Definition at line 609 of file eigen_plugins.h.

◆ multiply_AtA_scalar()

template<typename MAT_A >
EIGEN_STRONG_INLINE void multiply_AtA_scalar ( const MAT_A &  A,
typename MAT_A::Scalar  f 
)

this = CT * C * f (with a matrix C and a scalar f).

Definition at line 564 of file eigen_plugins.h.

◆ multiply_AtB()

template<typename MATRIX1 , typename MATRIX2 >
EIGEN_STRONG_INLINE void multiply_AtB ( const MATRIX1 &  A,
const MATRIX2 &  B 
)
Parameters
Bthis=A^t * B

Definition at line 513 of file eigen_plugins.h.

◆ multiply_Atb()

template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
EIGEN_STRONG_INLINE void multiply_Atb ( const OTHERVECTOR1 &  vIn,
OTHERVECTOR2 &  vOut,
bool  accumToOutput = false 
) const

Computes the vector vOut = thisT * vIn, where "vIn" is a column vector of the appropriate length.

Definition at line 526 of file eigen_plugins.h.

◆ multiply_AtBC()

template<class MAT_A , class MAT_B , class MAT_C >
void multiply_AtBC ( const MAT_A &  A,
const MAT_B &  B,
const MAT_C &  C 
)
Parameters
Cthis = A(T)*B*C

Definition at line 594 of file eigen_plugins.h.

◆ multiply_HCHt()

template<typename MAT_C , typename MAT_R >
EIGEN_STRONG_INLINE void multiply_HCHt ( const MAT_C &  C,
MAT_R &  R,
bool  accumResultInOutput = false 
) const

< R = this * C * thisT

Definition at line 532 of file eigen_plugins.h.

References R.

◆ multiply_HCHt_scalar()

template<typename MAT_C >
EIGEN_STRONG_INLINE Scalar multiply_HCHt_scalar ( const MAT_C &  C) const

R = H * C * HT (with a vector H and a symmetric matrix C) In fact when H is a vector, multiply_HCHt_scalar and multiply_HtCH_scalar are exactly equivalent

Definition at line 547 of file eigen_plugins.h.

◆ multiply_HtCH()

template<typename MAT_C , typename MAT_R >
EIGEN_STRONG_INLINE void multiply_HtCH ( const MAT_C &  C,
MAT_R &  R,
bool  accumResultInOutput = false 
) const

< R = thisT * C * this

Definition at line 539 of file eigen_plugins.h.

References R.

◆ multiply_HtCH_scalar()

template<typename MAT_C >
EIGEN_STRONG_INLINE Scalar multiply_HtCH_scalar ( const MAT_C &  C) const

R = HT * C * H (with a vector H and a symmetric matrix C) In fact when H is a vector, multiply_HCHt_scalar and multiply_HtCH_scalar are exactly equivalent

Definition at line 553 of file eigen_plugins.h.

◆ multiply_result_is_symmetric()

template<class MAT_A , class MAT_B >
EIGEN_STRONG_INLINE void multiply_result_is_symmetric ( const MAT_A &  A,
const MAT_B &  B 
)
Parameters
Bthis = A * B (result is symmetric)

Definition at line 614 of file eigen_plugins.h.

◆ multiply_skew3_A()

template<class SKEW_3VECTOR , class MAT_A >
void multiply_skew3_A ( const SKEW_3VECTOR &  v,
const MAT_A &  A 
)

this = skew(v)*A, with v being a 3-vector (or 3-array) and skew(v) the skew symmetric matrix of v (see mrpt::math::skew_symmetric3)

Definition at line 573 of file eigen_plugins.h.

References mrpt::math::multiply_skew3_A().

◆ multiply_subMatrix()

template<class MAT_A , class MAT_OUT >
EIGEN_STRONG_INLINE void multiply_subMatrix ( const MAT_A &  A,
MAT_OUT &  outResult,
const size_t  A_cols_offset,
const size_t  A_rows_offset,
const size_t  A_col_count 
) const

outResult = this * A

Definition at line 579 of file eigen_plugins.h.

◆ multiplyColumnByScalar()

EIGEN_STRONG_INLINE void multiplyColumnByScalar ( size_t  c,
Scalar  s 
)

Definition at line 165 of file eigen_plugins.h.

◆ multiplyRowByScalar()

EIGEN_STRONG_INLINE void multiplyRowByScalar ( size_t  r,
Scalar  s 
)

Definition at line 166 of file eigen_plugins.h.

◆ norm_inf()

EIGEN_STRONG_INLINE Scalar norm_inf ( ) const

Compute the norm-infinite of a vector ($f[ ||{v}||_ $f]), ie the maximum absolute value of the elements.

Definition at line 253 of file eigen_plugins.h.

Referenced by mrpt::vision::bundle_adj_full().

◆ normalize()

void normalize ( Scalar  valMin,
Scalar  valMax 
)

Scales all elements such as the minimum & maximum values are shifted to the given values.

Definition at line 702 of file eigen_plugins.h.

References minimum_maximum().

Referenced by adjustRange(), and mrpt::topography::ENUToGeocentric().

◆ ones() [1/2]

EIGEN_STRONG_INLINE void ones ( const size_t  row,
const size_t  col 
)

Resize matrix and set all elements to one.

Definition at line 71 of file eigen_plugins.h.

Referenced by mrpt::vision::CFeatureExtraction::extractFeaturesFAST().

◆ ones() [2/2]

EIGEN_STRONG_INLINE void ones ( )

Set all elements to one.

Definition at line 73 of file eigen_plugins.h.

◆ operator^=()

MatrixBase<Derived>& operator^= ( const unsigned int  pow)

Combined matrix power and assignment operator.

Definition at line 327 of file eigen_plugins.h.

◆ push_back()

EIGEN_STRONG_INLINE void push_back ( Scalar  val)

◆ rank()

EIGEN_STRONG_INLINE size_t rank ( double  threshold = 0) const

Gets the rank of the matrix via the Eigen::ColPivHouseholderQR method.

Parameters
thresholdIf set to >0, it's used as threshold instead of Eigen's default one.

Definition at line 687 of file eigen_plugins.h.

◆ removeColumns()

EIGEN_STRONG_INLINE void removeColumns ( const std::vector< size_t > &  idxsToRemove)

Remove columns of the matrix.

Definition at line 424 of file eigen_plugins.h.

References unsafeRemoveColumns().

◆ removeRows()

EIGEN_STRONG_INLINE void removeRows ( const std::vector< size_t > &  idxsToRemove)

Remove rows of the matrix.

Definition at line 448 of file eigen_plugins.h.

References unsafeRemoveRows().

◆ saveToTextFile()

void saveToTextFile ( const std::string file,
mrpt::math::TMatrixTextFileFormat  fileFormat = mrpt::math::MATRIX_FORMAT_ENG,
bool  appendMRPTHeader = false,
const std::string userHeader = std::string() 
) const

Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classes themselves).

Parameters
theMatrixIt can be a CMatrixTemplate or a CMatrixFixedNumeric.
fileThe target filename.
fileFormatSee TMatrixTextFileFormat. The format of the numbers in the text file.
appendMRPTHeaderInsert this header to the file "% File generated by MRPT. Load with MATLAB with: VAR=load(FILENAME);"
userHeaderAdditional text to be written at the head of the file. Typically MALAB comments "% This file blah blah". Final end-of-line is not needed.
See also
loadFromTextFile, CMatrixTemplate::inMatlabFormat, SAVE_MATRIX

◆ scalarPow()

EIGEN_STRONG_INLINE void scalarPow ( const Scalar  s)

Scalar power of all elements to a given power, this is diferent of ^ operator.

Definition at line 338 of file eigen_plugins.h.

◆ set_unsafe()

EIGEN_STRONG_INLINE void set_unsafe ( const size_t  row,
const size_t  col,
const Scalar  val 
)

Sets an element (Use with caution, bounds are not checked!)

Definition at line 98 of file eigen_plugins.h.

References val.

◆ setSize()

EIGEN_STRONG_INLINE void setSize ( size_t  row,
size_t  col 
)

◆ squareNorm()

EIGEN_STRONG_INLINE Scalar squareNorm ( ) const

Compute the square norm of a vector/array/matrix (the Euclidean distance to the origin, taking all the elements as a single vector).

See also
norm

Definition at line 256 of file eigen_plugins.h.

◆ substract_AAt()

template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_AAt ( const OTHERMATRIX &  A)

this -= A + AT

Definition at line 502 of file eigen_plugins.h.

◆ substract_Ac()

template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_Ac ( const OTHERMATRIX &  m,
const Scalar  c 
)

Substract c (scalar) times A to this matrix: this -= A * c

Definition at line 490 of file eigen_plugins.h.

◆ substract_An()

template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_An ( const OTHERMATRIX &  m,
const size_t  n 
)

Substract n (integer) times A to this matrix: this -= A * n

Definition at line 496 of file eigen_plugins.h.

◆ substract_At()

template<typename OTHERMATRIX >
EIGEN_STRONG_INLINE void substract_At ( const OTHERMATRIX &  m)

Substract A transposed to this matrix: this -= A.adjoint()

Definition at line 493 of file eigen_plugins.h.

◆ sumAll()

EIGEN_STRONG_INLINE Scalar sumAll ( ) const

Sum all the elements, returning a value of the same type than the container

Definition at line 259 of file eigen_plugins.h.

◆ swapCols()

EIGEN_STRONG_INLINE void swapCols ( size_t  i1,
size_t  i2 
)

Definition at line 168 of file eigen_plugins.h.

◆ swapRows()

EIGEN_STRONG_INLINE void swapRows ( size_t  i1,
size_t  i2 
)

Definition at line 169 of file eigen_plugins.h.

◆ t()

EIGEN_STRONG_INLINE const AdjointReturnType t ( ) const

Transpose.

Definition at line 472 of file eigen_plugins.h.

◆ unit() [1/2]

EIGEN_STRONG_INLINE void unit ( const size_t  nRows,
const Scalar  diag_vals 
)

Make the matrix an identity matrix (the diagonal values can be 1.0 or any other value)

Definition at line 51 of file eigen_plugins.h.

◆ unit() [2/2]

EIGEN_STRONG_INLINE void unit ( )

Make the matrix an identity matrix.

Definition at line 61 of file eigen_plugins.h.

◆ unsafeRemoveColumns()

EIGEN_STRONG_INLINE void unsafeRemoveColumns ( const std::vector< size_t > &  idxs)

Remove columns of the matrix.

The unsafe version assumes that, the indices are sorted in ascending order.

Definition at line 435 of file eigen_plugins.h.

Referenced by removeColumns().

◆ unsafeRemoveRows()

EIGEN_STRONG_INLINE void unsafeRemoveRows ( const std::vector< size_t > &  idxs)

Remove rows of the matrix.

The unsafe version assumes that, the indices are sorted in ascending order.

Definition at line 459 of file eigen_plugins.h.

Referenced by removeRows().

◆ zeros() [1/2]

EIGEN_STRONG_INLINE void zeros ( )

Set all elements to zero.

Definition at line 66 of file eigen_plugins.h.

◆ zeros() [2/2]

EIGEN_STRONG_INLINE void zeros ( const size_t  row,
const size_t  col 
)

Resize and set all elements to zero.

Definition at line 68 of file eigen_plugins.h.




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020