MRPT  2.0.0
List of all members | Public Member Functions
mrpt::math::MatrixVectorBase< Scalar, Derived > Class Template Reference

Detailed Description

template<typename Scalar, class Derived>
class mrpt::math::MatrixVectorBase< Scalar, Derived >

Base CRTP class for all MRPT vectors and matrices.

Template methods whose implementation is not in this header file are explicitly instantiated and exported for these derived types:

See also
CMatrixFixed

Definition at line 56 of file MatrixVectorBase.h.

#include <mrpt/math/MatrixVectorBase.h>

Inheritance diagram for mrpt::math::MatrixVectorBase< Scalar, Derived >:

Public Member Functions

Derived & mvbDerived ()
 
const Derived & mvbDerived () const
 
Operations that DO require `#include <Eigen/Dense>` in user code
template<int BLOCK_ROWS, int BLOCK_COLS>
auto block (int start_row, int start_col)
 non-const block(): Returns an Eigen::Block reference to the block More...
 
auto block (int start_row, int start_col, int BLOCK_ROWS, int BLOCK_COLS)
 
auto block (int start_row, int start_col, int BLOCK_ROWS, int BLOCK_COLS) const
 
auto transpose ()
 
auto transpose () const
 
auto array ()
 
auto array () const
 
auto operator- () const
 
template<typename S2 , class D2 >
auto operator+ (const MatrixVectorBase< S2, D2 > &m2) const
 
template<typename S2 , class D2 >
void operator+= (const MatrixVectorBase< S2, D2 > &m2)
 
template<typename S2 , class D2 >
auto operator- (const MatrixVectorBase< S2, D2 > &m2) const
 
template<typename S2 , class D2 >
void operator-= (const MatrixVectorBase< S2, D2 > &m2)
 
template<typename S2 , class D2 >
auto operator* (const MatrixVectorBase< S2, D2 > &m2) const
 
auto operator* (const Scalar s) const
 
template<int N>
CMatrixFixed< Scalar, N, 1 > tail () const
 
template<int N>
CMatrixFixed< Scalar, N, 1 > head () const
 

Initialization methods

void fill (const Scalar &val)
 
void setConstant (const Scalar value)
 
void setConstant (size_t nrows, size_t ncols, const Scalar value)
 
void setConstant (size_t nrows, const Scalar value)
 
void assign (const std::size_t N, const Scalar value)
 
void setZero ()
 
void setZero (size_t nrows, size_t ncols)
 
void setZero (size_t nrows)
 
static Derived Constant (const Scalar value)
 
static Derived Constant (size_t nrows, size_t ncols, const Scalar value)
 
static Derived Zero ()
 
static Derived Zero (size_t nrows, size_t ncols)
 

Standalone operations (do NOT require `#include <Eigen/Dense>`)

ScalarcoeffRef (int r, int c)
 
const Scalarcoeff (int r, int c) const
 
Scalar minCoeff () const
 Minimum value in the matrix/vector. More...
 
Scalar minCoeff (std::size_t &outIndexOfMin) const
 
Scalar minCoeff (std::size_t &rowIdx, std::size_t &colIdx) const
 
Scalar maxCoeff () const
 Maximum value in the matrix/vector. More...
 
Scalar maxCoeff (std::size_t &outIndexOfMax) const
 
Scalar maxCoeff (std::size_t &rowIdx, std::size_t &colIdx) const
 
bool isSquare () const
 returns true if matrix is NxN More...
 
bool empty () const
 returns true if matrix/vector has size=0 More...
 
Scalar norm_inf () const
 Compute the norm-infinite of a vector ($f[ ||{v}||_ $f]), ie the maximum absolute value of the elements. More...
 
Scalar norm () const
 Compute the L2 norm of a vector/array/matrix (the Euclidean distance to the origin, taking all the elements as a single vector). More...
 
void operator+= (Scalar s)
 
void operator-= (Scalar s)
 
void operator*= (Scalar s)
 
CMatrixDynamic< Scalaroperator* (const CMatrixDynamic< Scalar > &v)
 
Derived operator+ (const Derived &m2) const
 
void operator+= (const Derived &m2)
 
Derived operator- (const Derived &m2) const
 
void operator-= (const Derived &m2)
 
Derived operator* (const Derived &m2) const
 
Scalar dot (const CVectorDynamic< Scalar > &v) const
 dot product of this \cdot v More...
 
Scalar dot (const MatrixVectorBase< Scalar, Derived > &v) const
 
void matProductOf_Ab (const CMatrixDynamic< Scalar > &A, const CVectorDynamic< Scalar > &b)
 this = A * b , with A and b a dynamic matrix & vector More...
 
void matProductOf_Atb (const CMatrixDynamic< Scalar > &A, const CVectorDynamic< Scalar > &b)
 this = AT * b , with A and b a dynamic matrix & vector More...
 
Scalar sum () const
 Sum of all elements in matrix/vector. More...
 
Scalar sum_abs () const
 Sum of the absolute value of all elements in matrix/vector. More...
 
std::string asString () const
 Returns a string representation of the vector/matrix, using Eigen's default settings. More...
 
bool fromMatlabStringFormat (const std::string &s, mrpt::optional_ref< std::ostream > dump_errors_here=std::nullopt)
 Reads 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 std::size_t decimal_digits=6) const
 Exports the matrix as a string compatible with Matlab/Octave. 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
 Saves the vector/matrix to a file compatible with MATLAB/Octave text format. More...
 
void loadFromTextFile (std::istream &f)
 Loads a vector/matrix from a text file, compatible with MATLAB text format. More...
 
void loadFromTextFile (const std::string &file)
 
template<typename OTHERMATVEC >
bool operator== (const OTHERMATVEC &o) const
 
template<typename OTHERMATVEC >
bool operator!= (const OTHERMATVEC &o) const
 
Derived impl_op_add (const Derived &m2) const
 
void impl_op_selfadd (const Derived &m2)
 
Derived impl_op_subs (const Derived &m2) const
 
void impl_op_selfsubs (const Derived &m2)
 

Member Function Documentation

◆ array() [1/2]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::array ( )
inline

◆ array() [2/2]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::array ( ) const
inline

Definition at line 175 of file MatrixVectorBase.h.

◆ assign()

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::assign ( const std::size_t  N,
const Scalar  value 
)
inline

Definition at line 106 of file MatrixVectorBase.h.

Referenced by mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::obs::CActionRobotMovement2D::fastDrawSingleSample_modelGaussian(), mrpt::slam::CRangeBearingKFSLAM2D::reset(), and mrpt::slam::CRangeBearingKFSLAM::reset().

Here is the caller graph for this function:

◆ asString()

template<typename Scalar , class Derived >
std::string mrpt::math::MatrixVectorBase< Scalar, Derived >::asString ( ) const

Returns a string representation of the vector/matrix, using Eigen's default settings.

Definition at line 337 of file MatrixVectorBase_impl.h.

Referenced by mrpt::math::operator<<(), and quat_vs_YPR().

Here is the caller graph for this function:

◆ block() [1/3]

template<typename Scalar, class Derived>
template<int BLOCK_ROWS, int BLOCK_COLS>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::block ( int  start_row,
int  start_col 
)
inline

◆ block() [2/3]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::block ( int  start_row,
int  start_col,
int  BLOCK_ROWS,
int  BLOCK_COLS 
)
inline

Definition at line 145 of file MatrixVectorBase.h.

◆ block() [3/3]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::block ( int  start_row,
int  start_col,
int  BLOCK_ROWS,
int  BLOCK_COLS 
) const
inline

Definition at line 151 of file MatrixVectorBase.h.

◆ coeff()

template<typename Scalar, class Derived>
const Scalar& mrpt::math::MatrixVectorBase< Scalar, Derived >::coeff ( int  r,
int  c 
) const
inline

Definition at line 244 of file MatrixVectorBase.h.

Referenced by mrpt::obs::detail::do_project_3d_pointcloud(), mrpt::obs::TRangeImageFilter::do_range_filter(), and mrpt::obs::CObservation3DRangeScan::rangeImageAsImage().

Here is the caller graph for this function:

◆ coeffRef()

template<typename Scalar, class Derived>
Scalar& mrpt::math::MatrixVectorBase< Scalar, Derived >::coeffRef ( int  r,
int  c 
)
inline

Definition at line 243 of file MatrixVectorBase.h.

Referenced by mrpt::obs::detail::do_project_3d_pointcloud(), mrpt::obs::detail::do_project_3d_pointcloud_SSE2(), mrpt::img::CImage::getAsMatrix(), mrpt::img::CImage::getAsRGBMatrices(), and mrpt::vision::CFeature::getFirstDescriptorAsMatrix().

Here is the caller graph for this function:

◆ Constant() [1/2]

template<typename Scalar, class Derived>
static Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::Constant ( const Scalar  value)
inlinestatic

Definition at line 89 of file MatrixVectorBase.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::Zero().

Here is the caller graph for this function:

◆ Constant() [2/2]

template<typename Scalar, class Derived>
static Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::Constant ( size_t  nrows,
size_t  ncols,
const Scalar  value 
)
inlinestatic

Definition at line 99 of file MatrixVectorBase.h.

◆ dot() [1/2]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::dot ( const CVectorDynamic< Scalar > &  v) const

dot product of this \cdot v

Definition at line 511 of file MatrixVectorBase_impl.h.

◆ dot() [2/2]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::dot ( const MatrixVectorBase< Scalar, Derived > &  v) const

Definition at line 524 of file MatrixVectorBase_impl.h.

◆ empty()

template<typename Scalar, class Derived>
bool mrpt::math::MatrixVectorBase< Scalar, Derived >::empty ( ) const
inline

returns true if matrix/vector has size=0

Definition at line 260 of file MatrixVectorBase.h.

◆ fill()

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::fill ( const Scalar val)
inline

◆ fromMatlabStringFormat()

template<typename Scalar , class Derived >
bool mrpt::math::MatrixVectorBase< Scalar, Derived >::fromMatlabStringFormat ( const std::string &  s,
mrpt::optional_ref< std::ostream >  dump_errors_here = std::nullopt 
)

Reads 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 ' ' or tabs ''. Commas ',' between elements are NOT allowed.

This format is also used for CConfigFile::read_matrix.

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

Definition at line 24 of file MatrixVectorBase_impl.h.

Referenced by mrpt::poses::CPoint< CPoint3D, 3 >::fromString(), mrpt::math::TTwist2D::fromString(), mrpt::math::TPose3DQuat::fromString(), mrpt::math::TPose2D::fromString(), mrpt::math::TTwist3D::fromString(), mrpt::math::TPose3D::fromString(), mrpt::poses::CPose3DQuat::fromString(), mrpt::poses::CPose2D::fromString(), mrpt::poses::CPose3D::fromString(), mrpt::nav::PlannerTPS_VirtualBase::internal_loadConfig_PTG(), quat_vs_YPR(), and TEST().

Here is the caller graph for this function:

◆ head()

template<typename Scalar, class Derived>
template<int N>
CMatrixFixed<Scalar, N, 1> mrpt::math::MatrixVectorBase< Scalar, Derived >::head ( ) const
inline

Definition at line 232 of file MatrixVectorBase.h.

◆ impl_op_add()

template<typename Scalar , class Derived >
Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::impl_op_add ( const Derived &  m2) const
private

Definition at line 446 of file MatrixVectorBase_impl.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator+().

Here is the caller graph for this function:

◆ impl_op_selfadd()

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::impl_op_selfadd ( const Derived &  m2)
private

Definition at line 453 of file MatrixVectorBase_impl.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator+=().

Here is the caller graph for this function:

◆ impl_op_selfsubs()

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::impl_op_selfsubs ( const Derived &  m2)
private

Definition at line 465 of file MatrixVectorBase_impl.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator-=().

Here is the caller graph for this function:

◆ impl_op_subs()

template<typename Scalar , class Derived >
Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::impl_op_subs ( const Derived &  m2) const
private

Definition at line 458 of file MatrixVectorBase_impl.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator-().

Here is the caller graph for this function:

◆ inMatlabFormat()

template<typename Scalar , class Derived >
std::string mrpt::math::MatrixVectorBase< Scalar, Derived >::inMatlabFormat ( const std::size_t  decimal_digits = 6) const

Exports the matrix as a string compatible with Matlab/Octave.

See also
fromMatlabStringFormat()

Definition at line 141 of file MatrixVectorBase_impl.h.

Referenced by mrpt::obs::gnss::Message_TOPCON_PZS::dumpToStream(), mrpt::obs::CObservation6DFeatures::getDescriptionAsText(), mrpt::obs::CObservationStereoImagesFeatures::getDescriptionAsText(), and mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA().

Here is the caller graph for this function:

◆ isSquare()

template<typename Scalar, class Derived>
bool mrpt::math::MatrixVectorBase< Scalar, Derived >::isSquare ( ) const
inline

returns true if matrix is NxN

Definition at line 257 of file MatrixVectorBase.h.

Referenced by mrpt::slam::data_association_full_covariance(), mrpt::math::mahalanobisDistance2(), mrpt::math::mahalanobisDistance2AndLogPDF(), mrpt::math::normalPDF(), and op_dense_multiply_AB().

Here is the caller graph for this function:

◆ loadFromTextFile() [1/2]

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::loadFromTextFile ( std::istream &  f)

Loads a vector/matrix from a text file, compatible with MATLAB text format.

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

Exceptions
std::runtime_errorOn format error.
See also
saveToTextFile, fromMatlabStringFormat

Definition at line 238 of file MatrixVectorBase_impl.h.

Referenced by mrpt::apps::MonteCarloLocalization_Base::do_pf_localization(), mrpt::obs::CObservation3DRangeScan::load(), mrpt::poses::CPoseInterpolatorBase< 3 >::loadFromTextFile(), mrpt::apps::KFSLAMApp::Run_KF_SLAM(), and TEST().

Here is the caller graph for this function:

◆ loadFromTextFile() [2/2]

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::loadFromTextFile ( const std::string &  file)

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 326 of file MatrixVectorBase_impl.h.

◆ matProductOf_Ab()

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::matProductOf_Ab ( const CMatrixDynamic< Scalar > &  A,
const CVectorDynamic< Scalar > &  b 
)

this = A * b , with A and b a dynamic matrix & vector

Definition at line 485 of file MatrixVectorBase_impl.h.

◆ matProductOf_Atb()

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::matProductOf_Atb ( const CMatrixDynamic< Scalar > &  A,
const CVectorDynamic< Scalar > &  b 
)

this = AT * b , with A and b a dynamic matrix & vector

Definition at line 492 of file MatrixVectorBase_impl.h.

◆ maxCoeff() [1/3]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::maxCoeff ( ) const

Maximum value in the matrix/vector.

Definition at line 363 of file MatrixVectorBase_impl.h.

Referenced by mrpt::slam::CGridMapAligner::AlignPDF_correlation(), do_matrix_op_test(), and mrpt::obs::CObservation3DRangeScan::rangeImageAsImage().

Here is the caller graph for this function:

◆ maxCoeff() [2/3]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::maxCoeff ( std::size_t &  outIndexOfMax) const

Definition at line 384 of file MatrixVectorBase_impl.h.

◆ maxCoeff() [3/3]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::maxCoeff ( std::size_t &  rowIdx,
std::size_t &  colIdx 
) const

Definition at line 409 of file MatrixVectorBase_impl.h.

◆ minCoeff() [1/3]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::minCoeff ( ) const

Minimum value in the matrix/vector.

Definition at line 357 of file MatrixVectorBase_impl.h.

Referenced by mrpt::vision::CFeature::internal_distanceBetweenPolarImages().

Here is the caller graph for this function:

◆ minCoeff() [2/3]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::minCoeff ( std::size_t &  outIndexOfMin) const

Definition at line 369 of file MatrixVectorBase_impl.h.

◆ minCoeff() [3/3]

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::minCoeff ( std::size_t &  rowIdx,
std::size_t &  colIdx 
) const

Definition at line 398 of file MatrixVectorBase_impl.h.

◆ mvbDerived() [1/2]

template<typename Scalar, class Derived>
Derived& mrpt::math::MatrixVectorBase< Scalar, Derived >::mvbDerived ( )
inline

Definition at line 59 of file MatrixVectorBase.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::array(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::assign(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::block(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::coeff(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::coeffRef(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::dot(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::empty(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::fill(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::head(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::isSquare(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator*(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator+(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator+=(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator-(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator-=(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::operator==(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::setConstant(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::tail(), and mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::transpose().

Here is the caller graph for this function:

◆ mvbDerived() [2/2]

template<typename Scalar, class Derived>
const Derived& mrpt::math::MatrixVectorBase< Scalar, Derived >::mvbDerived ( ) const
inline

Definition at line 60 of file MatrixVectorBase.h.

◆ norm()

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::norm ( ) const

Compute the L2 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 505 of file MatrixVectorBase_impl.h.

◆ norm_inf()

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::norm_inf ( ) const

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

Definition at line 499 of file MatrixVectorBase_impl.h.

◆ operator!=()

template<typename Scalar, class Derived>
template<typename OTHERMATVEC >
bool mrpt::math::MatrixVectorBase< Scalar, Derived >::operator!= ( const OTHERMATVEC &  o) const
inline

Definition at line 432 of file MatrixVectorBase.h.

◆ operator*() [1/4]

template<typename Scalar, class Derived>
template<typename S2 , class D2 >
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::operator* ( const MatrixVectorBase< S2, D2 > &  m2) const
inline

Definition at line 214 of file MatrixVectorBase.h.

◆ operator*() [2/4]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::operator* ( const Scalar  s) const
inline

Definition at line 219 of file MatrixVectorBase.h.

◆ operator*() [3/4]

template<typename Scalar , class Derived >
CMatrixDynamic< Scalar > mrpt::math::MatrixVectorBase< Scalar, Derived >::operator* ( const CMatrixDynamic< Scalar > &  v)

Definition at line 438 of file MatrixVectorBase_impl.h.

◆ operator*() [4/4]

template<typename Scalar , class Derived >
Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::operator* ( const Derived &  m2) const

Definition at line 470 of file MatrixVectorBase_impl.h.

◆ operator*=()

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator*= ( Scalar  s)

Definition at line 432 of file MatrixVectorBase_impl.h.

◆ operator+() [1/2]

template<typename Scalar, class Derived>
template<typename S2 , class D2 >
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::operator+ ( const MatrixVectorBase< S2, D2 > &  m2) const
inline

Definition at line 188 of file MatrixVectorBase.h.

◆ operator+() [2/2]

template<typename Scalar, class Derived>
Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::operator+ ( const Derived &  m2) const
inline

Definition at line 279 of file MatrixVectorBase.h.

◆ operator+=() [1/3]

template<typename Scalar, class Derived>
template<typename S2 , class D2 >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator+= ( const MatrixVectorBase< S2, D2 > &  m2)
inline

Definition at line 194 of file MatrixVectorBase.h.

◆ operator+=() [2/3]

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator+= ( Scalar  s)

Definition at line 420 of file MatrixVectorBase_impl.h.

◆ operator+=() [3/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator+= ( const Derived &  m2)
inline

Definition at line 294 of file MatrixVectorBase.h.

◆ operator-() [1/3]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::operator- ( ) const
inline

Definition at line 181 of file MatrixVectorBase.h.

◆ operator-() [2/3]

template<typename Scalar, class Derived>
template<typename S2 , class D2 >
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::operator- ( const MatrixVectorBase< S2, D2 > &  m2) const
inline

Definition at line 201 of file MatrixVectorBase.h.

◆ operator-() [3/3]

template<typename Scalar, class Derived>
Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::operator- ( const Derived &  m2) const
inline

Definition at line 309 of file MatrixVectorBase.h.

◆ operator-=() [1/3]

template<typename Scalar, class Derived>
template<typename S2 , class D2 >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator-= ( const MatrixVectorBase< S2, D2 > &  m2)
inline

Definition at line 207 of file MatrixVectorBase.h.

◆ operator-=() [2/3]

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator-= ( Scalar  s)

Definition at line 426 of file MatrixVectorBase_impl.h.

◆ operator-=() [3/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::operator-= ( const Derived &  m2)
inline

Definition at line 324 of file MatrixVectorBase.h.

◆ operator==()

template<typename Scalar, class Derived>
template<typename OTHERMATVEC >
bool mrpt::math::MatrixVectorBase< Scalar, Derived >::operator== ( const OTHERMATVEC &  o) const
inline

Definition at line 422 of file MatrixVectorBase.h.

◆ saveToTextFile()

template<typename Scalar , class Derived >
void mrpt::math::MatrixVectorBase< Scalar, Derived >::saveToTextFile ( const std::string &  file,
mrpt::math::TMatrixTextFileFormat  fileFormat = mrpt::math::MATRIX_FORMAT_ENG,
bool  appendMRPTHeader = false,
const std::string &  userHeader = std::string() 
) const

Saves the vector/matrix to a file compatible with MATLAB/Octave text format.

Parameters
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, CMatrixDynamic::inMatlabFormat, SAVE_MATRIX

Definition at line 159 of file MatrixVectorBase_impl.h.

Referenced by mrpt::vision::build_linear_system(), mrpt::apps::MonteCarloLocalization_Base::do_pf_localization(), kfslam_traits< CRangeBearingKFSLAM >::doPartitioningExperiment(), mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPosePDFGaussian::drawSingleSample(), mrpt::poses::CPose3DPDFGaussian::drawSingleSample(), mrpt::poses::CPosePDFGaussianInf::drawSingleSample(), mrpt::obs::CObservation3DRangeScan::points3D_convertToExternalStorage(), mrpt::obs::CObservation3DRangeScan::rangeImage_convertToExternalStorage(), mrpt::apps::CGridMapAlignerApp::run(), mrpt::apps::KFSLAMApp::Run_KF_SLAM(), mrpt::maps::CRandomFieldGridMap2D::saveMetricMapRepresentationToFile(), mrpt::maps::COccupancyGridMap2D::saveMetricMapRepresentationToFile(), mrpt::math::CSparseMatrix::saveToTextFile_dense(), mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::saveToTextFileAsDense(), and TestLevMarq().

Here is the caller graph for this function:

◆ setConstant() [1/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::setConstant ( const Scalar  value)
inline

Definition at line 75 of file MatrixVectorBase.h.

Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::setConstant(), and mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::setZero().

Here is the caller graph for this function:

◆ setConstant() [2/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::setConstant ( size_t  nrows,
size_t  ncols,
const Scalar  value 
)
inline

Definition at line 76 of file MatrixVectorBase.h.

◆ setConstant() [3/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::setConstant ( size_t  nrows,
const Scalar  value 
)
inline

Definition at line 81 of file MatrixVectorBase.h.

◆ setZero() [1/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::setZero ( )
inline

Definition at line 112 of file MatrixVectorBase.h.

Referenced by mrpt::vision::build_linear_system(), mrpt::opengl::TRenderMatrices::computeProjectionMatrix(), mrpt::poses::CPose3DPDFGaussianInf::copyFrom(), mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::poses::CPointPDFGaussian::CPointPDFGaussian(), mrpt::poses::CPosePDFGaussian::CPosePDFGaussian(), mrpt::math::CSparseMatrix::cs2dense(), mrpt::poses::CPoseRandomSampler::do_sample_2D(), mrpt::poses::CPoseRandomSampler::do_sample_3D(), fillSampleObs(), mrpt::math::generateAxisBaseFromDirectionAndAxis(), mrpt::poses::CPointPDFParticles::getCovarianceAndMean(), mrpt::poses::CPose3DPDFParticles::getCovarianceAndMean(), mrpt::poses::CPosePDFParticles::getCovarianceAndMean(), mrpt::poses::CPointPDFSOG::getCovarianceAndMean(), mrpt::poses::CPosePDFSOG::getCovarianceAndMean(), mrpt::vision::CFeatureExtraction::internal_computeSpinImageDescriptors(), mrpt::poses::CPose3DQuatPDF::jacobiansPoseComposition(), mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA(), mrpt::hwdrivers::TCaptureOptions_DUO3D::m_camera_int_params_from_yml(), mrpt::graphslam::optimize_graph_spa_levmarq(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::renderUpdateBuffers(), mrpt::slam::CRangeBearingKFSLAM2D::reset(), mrpt::slam::CRangeBearingKFSLAM::reset(), mrpt::apps::RBPF_SLAM_App_Base::run(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), mrpt::img::TCamera::setIntrinsicParamsFromValues(), and mrpt::graphs::ScalarFactorGraph::updateEstimation().

Here is the caller graph for this function:

◆ setZero() [2/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::setZero ( size_t  nrows,
size_t  ncols 
)
inline

Definition at line 113 of file MatrixVectorBase.h.

◆ setZero() [3/3]

template<typename Scalar, class Derived>
void mrpt::math::MatrixVectorBase< Scalar, Derived >::setZero ( size_t  nrows)
inline

Definition at line 117 of file MatrixVectorBase.h.

◆ sum()

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::sum ( ) const

Sum of all elements in matrix/vector.

Definition at line 345 of file MatrixVectorBase_impl.h.

Referenced by mrpt::vision::CFeature::internal_distanceBetweenPolarImages(), and TEST().

Here is the caller graph for this function:

◆ sum_abs()

template<typename Scalar , class Derived >
Scalar mrpt::math::MatrixVectorBase< Scalar, Derived >::sum_abs ( ) const

Sum of the absolute value of all elements in matrix/vector.

Definition at line 351 of file MatrixVectorBase_impl.h.

◆ tail()

template<typename Scalar, class Derived>
template<int N>
CMatrixFixed<Scalar, N, 1> mrpt::math::MatrixVectorBase< Scalar, Derived >::tail ( ) const
inline

Definition at line 226 of file MatrixVectorBase.h.

◆ transpose() [1/2]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::transpose ( )
inline

◆ transpose() [2/2]

template<typename Scalar, class Derived>
auto mrpt::math::MatrixVectorBase< Scalar, Derived >::transpose ( ) const
inline

Definition at line 164 of file MatrixVectorBase.h.

◆ Zero() [1/2]

template<typename Scalar, class Derived>
static Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::Zero ( )
inlinestatic

Definition at line 125 of file MatrixVectorBase.h.

Referenced by mrpt::vision::build_linear_system(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::setCovMatrix(), and mrpt::obs::TPixelLabelInfo< BYTES_REQUIRED_ >::setSize().

Here is the caller graph for this function:

◆ Zero() [2/2]

template<typename Scalar, class Derived>
static Derived mrpt::math::MatrixVectorBase< Scalar, Derived >::Zero ( size_t  nrows,
size_t  ncols 
)
inlinestatic

Definition at line 126 of file MatrixVectorBase.h.




Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020