MRPT
1.9.9
|
Base CRTP class for all MRPT matrices.
See MatrixVectorBase
Definition at line 23 of file MatrixBase.h.
#include <mrpt/math/MatrixBase.h>
Public Member Functions | |
Derived & | mbDerived () |
const Derived & | mbDerived () const |
void | setDiagonal (const std::size_t N, const Scalar value) |
Resize to NxN, set all entries to zero, except the main diagonal which is set to value More... | |
void | setDiagonal (const Scalar value) |
Set all entries to zero, except the main diagonal which is set to value More... | |
void | setDiagonal (const std::vector< Scalar > &diags) |
Resizes to NxN, with N the length of the input vector, set all entries to zero, except the main diagonal which is set to values in the vector. More... | |
void | setIdentity () |
void | setIdentity (const std::size_t N) |
void | matProductOf_AB (const Derived &A, const Derived &B) |
this = A*B, with A & B of the same type of this. More... | |
Derived & | mvbDerived () |
const Derived & | mvbDerived () const |
Operations that DO require `#include <Eigen/Dense>` in user code | |
auto | col (int colIdx) |
auto | col (int colIdx) const |
auto | row (int rowIdx) |
auto | row (int rowIdx) const |
template<typename VECTOR_LIKE > | |
void | extractRow (int rowIdx, VECTOR_LIKE &v) const |
template<typename VECTOR_LIKE > | |
VECTOR_LIKE | extractRow (int rowIdx) const |
template<typename VECTOR_LIKE > | |
void | extractColumn (int colIdx, VECTOR_LIKE &v) const |
template<typename VECTOR_LIKE > | |
VECTOR_LIKE | extractColumn (int colIdx) const |
Standalone operations (do NOT require `#include <Eigen/Dense>`) | |
Scalar | det () const |
Determinant of matrix. More... | |
Derived | inverse () const |
Returns the inverse of a general matrix using LU. More... | |
Derived | inverse_LLt () const |
Returns the inverse of a symmetric matrix using LLt. More... | |
int | rank (Scalar threshold=0) const |
Finds the rank of the matrix via LU decomposition. More... | |
bool | chol (Derived &U) const |
Cholesky M=UT * U decomposition for symmetric matrix (upper-half of the matrix is actually ignored. More... | |
bool | eig (Derived &eVecs, std::vector< Scalar > &eVals, bool sorted=true) const |
Computes the eigenvectors and eigenvalues for a square, general matrix. More... | |
bool | eig_symmetric (Derived &eVecs, std::vector< Scalar > &eVals, bool sorted=true) const |
Read: eig() More... | |
Scalar | maximumDiagonal () const |
Returns the maximum value in the diagonal. More... | |
Scalar | minimumDiagonal () const |
Returns the minimum value in the diagonal. More... | |
Scalar | trace () const |
Returns the trace of the matrix (not necessarily square). More... | |
void | unsafeRemoveColumns (const std::vector< std::size_t > &idxs) |
Removes columns of the matrix. More... | |
void | removeColumns (const std::vector< std::size_t > &idxsToRemove) |
Removes columns of the matrix. More... | |
void | unsafeRemoveRows (const std::vector< std::size_t > &idxs) |
Removes rows of the matrix. More... | |
void | removeRows (const std::vector< std::size_t > &idxsToRemove) |
Removes rows of the matrix. More... | |
template<typename OTHERMATVEC > | |
void | insertMatrix (const int row_start, const int col_start, const OTHERMATVEC &submat) |
Copies the given input submatrix/vector into this matrix/vector, starting at the given top-left coordinates. More... | |
template<typename OTHERMATVEC > | |
void | insertMatrixTransposed (const int row_start, const int col_start, const OTHERMATVEC &submat) |
Like insertMatrix(), but inserts ‘submat’` (transposed) More... | |
template<int BLOCK_ROWS, int BLOCK_COLS> | |
CMatrixFixed< Scalar, BLOCK_ROWS, BLOCK_COLS > | extractMatrix (const int start_row=0, const int start_col=0) const |
CMatrixDynamic< Scalar > | extractMatrix (const int BLOCK_ROWS, const int BLOCK_COLS, const int start_row, const int start_col) const |
template<typename MAT_A > | |
void | matProductOf_AAt (const MAT_A &A) |
this = A * AT More... | |
template<typename MAT_A > | |
void | matProductOf_AtA (const MAT_A &A) |
this = AT * A More... | |
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 > | |
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 > | |
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 |
Standalone operations (do NOT require `#include <Eigen/Dense>`) | |
Derived | operator- (const Derived &m2) const |
Derived | operator+ (const Derived &m2) const |
void | operator+= (Scalar s) |
void | operator+= (const Derived &m2) |
void | operator-= (Scalar s) |
void | operator-= (const Derived &m2) |
CMatrixDynamic< Scalar > | operator* (const CMatrixDynamic< Scalar > &v) |
Derived | operator* (const Derived &m2) const |
Scalar & | coeffRef (int r, int c) |
const Scalar & | coeff (int r, int c) const |
template<int BLOCK_ROWS, int BLOCK_COLS> | |
CMatrixFixed< Scalar, BLOCK_ROWS, BLOCK_COLS > | blockCopy (int start_row=0, int start_col=0) const |
const blockCopy(): Returns a copy of the given block More... | |
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) |
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 |
Static Public Member Functions | |
static Derived | Identity () |
static Derived | Identity (const std::size_t N) |
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) |
|
inlineinherited |
Definition at line 170 of file MatrixVectorBase.h.
Referenced by mrpt::vision::checkerBoardStereoCalibration(), mrpt::slam::CRangeBearingKFSLAM::computeOffDiagonalBlocksApproximationError(), mrpt::random::CRandomGenerator::drawGaussianMultivariate(), mrpt::obs::CActionRobotMovement2D::prepareFastDrawSingleSample_modelGaussian(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), and TEST().
|
inlineinherited |
Definition at line 175 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 106 of file MatrixVectorBase.h.
Referenced by mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::slam::CRangeBearingKFSLAM2D::reset(), and mrpt::slam::CRangeBearingKFSLAM::reset().
|
inherited |
Returns a string representation of the vector/matrix, using Eigen's default settings.
Definition at line 335 of file MatrixVectorBase_impl.h.
Referenced by mrpt::math::operator<<().
|
inlineinherited |
non-const block(): Returns an Eigen::Block reference to the block
Definition at line 138 of file MatrixVectorBase.h.
Referenced by mrpt::poses::CPosePDFSOG::changeCoordinatesReference(), mrpt::vision::checkerBoardCameraCalibration(), mrpt::poses::CPosePDFGaussian::copyFrom(), mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::getAsDense(), mrpt::math::TPose3D::getHomogeneousMatrix(), mrpt::poses::CPose3DQuatPDF::jacobiansPoseComposition(), mrpt::poses::CPointPDFGaussian::mahalanobisDistanceTo(), mrpt::poses::CPose3D::serializeFrom(), Pose3DTests::test_composePointJacob(), Pose3DQuatTests::test_invComposePointJacob(), Pose3DTests::test_invComposePointJacob(), Pose3DQuatTests::test_normalizeJacob(), Pose3DQuatTests::test_sphericalCoords(), Pose3DPDFGaussTests::testCompositionJacobian(), and Pose3DQuatPDFGaussTests::testCompositionJacobian().
|
inlineinherited |
Definition at line 145 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 151 of file MatrixVectorBase.h.
|
inlineinherited |
const blockCopy(): Returns a copy of the given block
Definition at line 248 of file MatrixVectorBase.h.
Referenced by mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::math::TPose3D::fromHomogeneousMatrix(), mrpt::slam::CRangeBearingKFSLAM2D::getAs3DObject(), mrpt::slam::CRangeBearingKFSLAM::getAs3DObject(), mrpt::slam::CRangeBearingKFSLAM2D::getCurrentRobotPose(), mrpt::slam::CRangeBearingKFSLAM::getCurrentRobotPose(), mrpt::slam::CRangeBearingKFSLAM2D::getCurrentState(), mrpt::slam::CRangeBearingKFSLAM::getCurrentState(), mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::getLandmarkCov(), and mrpt::poses::CPointPDFGaussian::productIntegralWith2D().
bool mrpt::math::MatrixBase< Scalar, Derived >::chol | ( | Derived & | U | ) | const |
Cholesky M=UT * U decomposition for symmetric matrix (upper-half of the matrix is actually ignored.
Definition at line 165 of file MatrixBase_impl.h.
Referenced by mrpt::vision::projectMatchedFeatures(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl(), and TEST().
|
inlineinherited |
Definition at line 244 of file MatrixVectorBase.h.
Referenced by mrpt::obs::CObservation3DRangeScan::convertTo2DScan(), mrpt::obs::detail::do_project_3d_pointcloud(), mrpt::obs::TRangeImageFilter::do_range_filter(), mrpt::obs::CObservation3DRangeScan::TPixelLabelInfo< BYTES_REQUIRED_ >::Print(), mrpt::obs::detail::range2XYZ(), and mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl().
|
inlineinherited |
Definition at line 243 of file MatrixVectorBase.h.
Referenced by mrpt::img::CImage::getAsMatrix(), mrpt::img::CImage::getAsRGBMatrices(), and mrpt::vision::CFeature::getFirstDescriptorAsMatrix().
|
inline |
Definition at line 89 of file MatrixBase.h.
Referenced by mrpt::nav::CHolonomicFullEval::evalSingleTarget(), mrpt::math::generateAxisBaseFromDirection(), mrpt::vision::projectMatchedFeatures(), ransacPlaneAlignment_fit(), and se3_l2_internal().
|
inline |
Definition at line 94 of file MatrixBase.h.
|
inlinestaticinherited |
Definition at line 89 of file MatrixVectorBase.h.
Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::Zero().
|
inlinestaticinherited |
Definition at line 99 of file MatrixVectorBase.h.
Scalar mrpt::math::MatrixBase< Scalar, Derived >::det | ( | ) | const |
Determinant of matrix.
Definition at line 76 of file MatrixBase_impl.h.
Referenced by mrpt::poses::CPointPDFSOG::bayesianFusion(), mrpt::poses::CPosePDFSOG::bayesianFusion(), mrpt::graphslam::TUncertaintyPath< GRAPH_T >::getAsString(), mrpt::graphslam::TUncertaintyPath< GRAPH_T >::getDeterminant(), mrpt::maps::CBeaconMap::internal_insertObservation(), mrpt::math::mahalanobisDistance2AndLogPDF(), mrpt::poses::CPosePDFSOG::mergeModes(), mrpt::math::normalPDF(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl(), and mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::updateCurrCovarianceVisualization().
|
inherited |
dot product of this \cdot v
Definition at line 509 of file MatrixVectorBase_impl.h.
Referenced by ransac3Dplane_distance().
|
inherited |
Definition at line 522 of file MatrixVectorBase_impl.h.
bool mrpt::math::MatrixBase< Scalar, Derived >::eig | ( | Derived & | eVecs, |
std::vector< Scalar > & | eVals, | ||
bool | sorted = true |
||
) | const |
Computes the eigenvectors and eigenvalues for a square, general matrix.
Use eig_symmetric() for symmetric matrices for better accuracy and performance. Eigenvectors are the columns of the returned matrix, and their order matches that of returned eigenvalues.
[in] | sorted | If true, eigenvalues (and eigenvectors) will be sorted in ascending order. |
[out] | eVecs | The container where eigenvectors will be stored. |
[out] | eVals | The container where eigenvalues will be stored. |
Definition at line 107 of file MatrixBase_impl.h.
Referenced by mrpt::detectors::CFaceDetection::checkIfFacePlaneCov(), mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::computeDominantEigenVector(), and TEST().
bool mrpt::math::MatrixBase< Scalar, Derived >::eig_symmetric | ( | Derived & | eVecs, |
std::vector< Scalar > & | eVals, | ||
bool | sorted = true |
||
) | const |
Read: eig()
Definition at line 131 of file MatrixBase_impl.h.
Referenced by mrpt::random::CRandomGenerator::drawGaussianMultivariate(), mrpt::random::CRandomGenerator::drawGaussianMultivariateMany(), mrpt::math::getRegressionLine(), mrpt::math::getRegressionPlane(), mrpt::obs::CActionRobotMovement2D::prepareFastDrawSingleSample_modelGaussian(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), se3_l2_internal(), mrpt::poses::CPoseRandomSampler::setPosePDF(), and TEST().
|
inlineinherited |
returns true if matrix/vector has size=0
Definition at line 269 of file MatrixVectorBase.h.
|
inline |
Definition at line 128 of file MatrixBase.h.
Referenced by mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::extractColumn().
|
inline |
Definition at line 136 of file MatrixBase.h.
|
inline |
Definition at line 232 of file MatrixBase.h.
Referenced by mrpt::slam::data_association_independent_predictions().
|
inline |
Definition at line 245 of file MatrixBase.h.
|
inline |
Definition at line 112 of file MatrixBase.h.
Referenced by mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::extractRow().
|
inline |
Definition at line 120 of file MatrixBase.h.
|
inlineinherited |
Fill all the elements with a given value (Note: named "fillAll" since "fill" will be used by child classes)
Definition at line 70 of file MatrixVectorBase.h.
Referenced by mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::assign(), mrpt::poses::CPose3DQuat::assign(), mrpt::maps::CRandomFieldGridMap2D::exist_relation_between2cells(), mrpt::vision::CFeatureExtraction::extractFeaturesFAST(), mrpt::vision::CFeatureExtraction::extractFeaturesFASTER_N(), mrpt::vision::CFeatureExtraction::extractFeaturesORB(), mrpt::vision::projectMatchedFeatures(), mrpt::obs::CObservation3DRangeScan::recoverCameraCalibrationParameters(), mrpt::obs::CObservationImage::serializeFrom(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::setConstant(), mrpt::math::MatrixVectorBase< T, CMatrixFixed< T, ROWS, COLS > >::setZero(), TestLevMarq(), and PosePDFGaussTests::testPoseInverse().
|
inherited |
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 ' ', tabs '' or commas ','.
This format is also used for 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::TPoint2D::fromString(), mrpt::math::TPose3D::fromString(), mrpt::poses::CPose3DQuat::fromString(), mrpt::poses::CPose2D::fromString(), mrpt::math::TPoint3D::fromString(), mrpt::poses::CPose3D::fromString(), mrpt::nav::PlannerTPS_VirtualBase::internal_loadConfig_PTG(), and TEST().
|
inlineinherited |
Definition at line 232 of file MatrixVectorBase.h.
|
inlinestatic |
Definition at line 64 of file MatrixBase.h.
|
inlinestatic |
Definition at line 74 of file MatrixBase.h.
|
inherited |
Exports the matrix as a string compatible with Matlab/Octave.
Definition at line 139 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().
|
inline |
Copies the given input submatrix/vector into this matrix/vector, starting at the given top-left coordinates.
Definition at line 210 of file MatrixBase.h.
Referenced by mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::slam::data_association_independent_predictions(), mrpt::obs::detail::project3DPointsFromDepthImageInto(), Pose3DQuatPDFGaussTests::testInverse(), Pose3DPDFGaussTests::testPoseComposition(), Pose3DQuatPDFGaussTests::testPoseComposition(), Pose3DPDFGaussTests::testPoseInverseComposition(), and Pose3DQuatPDFGaussTests::testPoseInverseComposition().
|
inline |
Like insertMatrix(), but inserts ‘submat’` (transposed)
Definition at line 221 of file MatrixBase.h.
Derived mrpt::math::MatrixBase< Scalar, Derived >::inverse | ( | ) | const |
Returns the inverse of a general matrix using LU.
Definition at line 183 of file MatrixBase_impl.h.
Referenced by mrpt::poses::CPosePDFGaussianInf::evaluatePDF(), mrpt::opengl::gl_utils::getCurrentRenderingInfo(), mrpt::math::mahalanobisDistance2(), and mrpt::math::normalPDF().
Derived mrpt::math::MatrixBase< Scalar, Derived >::inverse_LLt | ( | ) | const |
Returns the inverse of a symmetric matrix using LLt.
Definition at line 195 of file MatrixBase_impl.h.
Referenced by mrpt::poses::CPointPDFGaussian::bayesianFusion(), mrpt::poses::CPosePDFGaussian::bayesianFusion(), mrpt::poses::CPosePDFGaussianInf::bayesianFusion(), mrpt::poses::CPointPDFSOG::bayesianFusion(), mrpt::poses::CPosePDFSOG::bayesianFusion(), mrpt::poses::CPose3DQuatPDFGaussianInf::changeCoordinatesReference(), mrpt::maps::CLandmarksMap::compute3DMatchingRatio(), mrpt::maps::CLandmarksMap::computeLikelihood_SIFT_LandmarkMap(), mrpt::maps::CLandmarksMap::computeMatchingWith3DLandmarks(), mrpt::poses::CPose3DQuatPDFGaussianInf::copyFrom(), mrpt::poses::CPosePDFGaussianInf::copyFrom(), mrpt::poses::CPose3DPDFGaussianInf::copyFrom(), mrpt::poses::CPose3DQuatPDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DPDFGaussianInf::drawManySamples(), mrpt::poses::CPosePDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DQuatPDFGaussianInf::drawSingleSample(), mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPosePDFGaussianInf::drawSingleSample(), mrpt::poses::CPosePDFGaussianInf::evaluateNormalizedPDF(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), mrpt::poses::CPose3DQuatPDFGaussianInf::getCovarianceAndMean(), mrpt::poses::CPosePDFGaussianInf::getCovarianceAndMean(), mrpt::poses::CPose3DPDFGaussianInf::getCovarianceAndMean(), mrpt::math::CProbabilityDensityFunction< CPose2D, 3 >::getInformationMatrix(), mrpt::slam::CICP::ICP_Method_Classic(), mrpt::maps::CLandmarksMap::internal_computeObservationLikelihood(), mrpt::poses::CPose3DQuatPDFGaussianInf::inverse(), mrpt::poses::CPosePDFGaussianInf::inverseComposition(), mrpt::math::mahalanobisDistance2AndLogPDF(), mrpt::poses::CPointPDFGaussian::mahalanobisDistanceTo(), mrpt::poses::CPosePDFGaussian::mahalanobisDistanceTo(), mrpt::poses::CPosePDFGaussianInf::mahalanobisDistanceTo(), mrpt::poses::CPose3DPDFGaussianInf::mahalanobisDistanceTo(), mrpt::poses::CPose3DPDFGaussian::mahalanobisDistanceTo(), mrpt::math::normalPDF(), mrpt::poses::CPose3DQuatPDFGaussianInf::operator+=(), mrpt::poses::CPose3DPDFGaussianInf::operator+=(), mrpt::poses::CPosePDFGaussianInf::operator+=(), mrpt::poses::CPose3DPDFGaussianInf::operator-=(), mrpt::topography::path_from_rtk_gps(), mrpt::poses::CPointPDFGaussian::productIntegralWith(), mrpt::poses::CPointPDFGaussian::productIntegralWith2D(), and mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().
|
inlineinherited |
returns true if matrix is NxN
Definition at line 266 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().
|
inherited |
Loads a vector/matrix from a text file, compatible with MATLAB text format.
Lines starting with '' or '#' are interpreted as comments and ignored.
std::runtime_error | On format error. |
Definition at line 236 of file MatrixVectorBase_impl.h.
Referenced by mrpt::obs::CObservation3DRangeScan::load(), mrpt::poses::CPoseInterpolatorBase< 3 >::loadFromTextFile(), and TEST().
|
inherited |
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 324 of file MatrixVectorBase_impl.h.
|
inline |
Definition at line 261 of file MatrixBase.h.
Referenced by mrpt::random::CRandomGenerator::drawDefinitePositiveMatrix(), PosePDFGaussTests::generateRandomPose2DPDF(), Pose3DPDFGaussTests::generateRandomPose3DPDF(), Pose3DQuatPDFGaussTests::generateRandomPose3DPDF(), mrpt::poses::CPose3DPDFSOG::getCovarianceAndMean(), mrpt::poses::CPosePDFSOG::getCovarianceAndMean(), mrpt::slam::CICP::ICP_Method_Classic(), mrpt::slam::CICP::ICP_Method_LM(), and mrpt::poses::CPosePDFSOG::mergeModes().
void mrpt::math::MatrixBase< Scalar, Derived >::matProductOf_AB | ( | const Derived & | A, |
const Derived & | B | ||
) |
this = A*B, with A & B of the same type of this.
For products of different matrix types, use the regular * operator (which requires the <Eigen/Dense>
header)
Definition at line 175 of file MatrixBase_impl.h.
Referenced by mrpt::poses::CPoseRandomSampler::setPosePDF().
|
inherited |
this = A * b , with A
and b
a dynamic matrix & vector
Definition at line 483 of file MatrixVectorBase_impl.h.
|
inline |
Definition at line 280 of file MatrixBase.h.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().
|
inherited |
this = AT * b , with A
and b
a dynamic matrix & vector
Definition at line 490 of file MatrixVectorBase_impl.h.
|
inherited |
Maximum value in the matrix/vector.
Definition at line 361 of file MatrixVectorBase_impl.h.
Referenced by mrpt::opengl::CVectorField2D::adjustVectorFieldToGrid(), mrpt::slam::CGridMapAligner::AlignPDF_correlation(), do_matrix_op_test(), and mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal().
|
inherited |
Definition at line 382 of file MatrixVectorBase_impl.h.
|
inherited |
Definition at line 407 of file MatrixVectorBase_impl.h.
Scalar mrpt::math::MatrixBase< Scalar, Derived >::maximumDiagonal | ( | ) | const |
Returns the maximum value in the diagonal.
Definition at line 207 of file MatrixBase_impl.h.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().
|
inline |
Definition at line 26 of file MatrixBase.h.
Referenced by mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::col(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::extractColumn(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::extractMatrix(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::extractRow(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::insertMatrix(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::insertMatrixTransposed(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::matProductOf_AAt(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::matProductOf_AtA(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::row(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::setDiagonal(), and mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::setIdentity().
|
inline |
Definition at line 27 of file MatrixBase.h.
|
inherited |
Minimum value in the matrix/vector.
Definition at line 355 of file MatrixVectorBase_impl.h.
Referenced by mrpt::opengl::CVectorField2D::adjustVectorFieldToGrid(), and mrpt::vision::CFeature::internal_distanceBetweenPolarImages().
|
inherited |
Definition at line 367 of file MatrixVectorBase_impl.h.
|
inherited |
Definition at line 396 of file MatrixVectorBase_impl.h.
Scalar mrpt::math::MatrixBase< Scalar, Derived >::minimumDiagonal | ( | ) | const |
Returns the minimum value in the diagonal.
Definition at line 213 of file MatrixBase_impl.h.
|
inlineinherited |
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 > >::blockCopy(), 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 > >::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().
|
inlineinherited |
Definition at line 60 of file MatrixVectorBase.h.
|
inherited |
Compute the L2 norm of a vector/array/matrix (the Euclidean distance to the origin, taking all the elements as a single vector).
Definition at line 503 of file MatrixVectorBase_impl.h.
|
inherited |
Compute the norm-infinite of a vector ($f[ ||{v}||_ $f]), ie the maximum absolute value of the elements.
Definition at line 497 of file MatrixVectorBase_impl.h.
|
inlineinherited |
Definition at line 441 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 214 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 219 of file MatrixVectorBase.h.
|
inherited |
Definition at line 436 of file MatrixVectorBase_impl.h.
|
inherited |
Definition at line 468 of file MatrixVectorBase_impl.h.
|
inherited |
Definition at line 430 of file MatrixVectorBase_impl.h.
|
inlineinherited |
Definition at line 188 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 288 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 194 of file MatrixVectorBase.h.
|
inherited |
Definition at line 418 of file MatrixVectorBase_impl.h.
|
inlineinherited |
Definition at line 303 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 181 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 201 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 318 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 207 of file MatrixVectorBase.h.
|
inherited |
Definition at line 424 of file MatrixVectorBase_impl.h.
|
inlineinherited |
Definition at line 333 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 431 of file MatrixVectorBase.h.
int mrpt::math::MatrixBase< Scalar, Derived >::rank | ( | Scalar | threshold = 0 | ) | const |
Finds the rank of the matrix via LU decomposition.
Uses Eigen's default threshold unless threshold>0
.
Definition at line 156 of file MatrixBase_impl.h.
Referenced by mrpt::math::areAligned(), and mrpt::math::conformAPlane().
void mrpt::math::MatrixBase< Scalar, Derived >::removeColumns | ( | const std::vector< std::size_t > & | idxsToRemove | ) |
Removes columns of the matrix.
Indices may be unsorted and duplicated
Definition at line 38 of file MatrixBase_impl.h.
void mrpt::math::MatrixBase< Scalar, Derived >::removeRows | ( | const std::vector< std::size_t > & | idxsToRemove | ) |
Removes rows of the matrix.
Indices may be unsorted and duplicated
Definition at line 65 of file MatrixBase_impl.h.
|
inline |
Definition at line 100 of file MatrixBase.h.
Referenced by mrpt::vision::projectMatchedFeatures().
|
inline |
Definition at line 105 of file MatrixBase.h.
|
inherited |
Saves the vector/matrix to a file compatible with MATLAB/Octave text format.
file | The target filename. |
fileFormat | See TMatrixTextFileFormat. The format of the numbers in the text file. |
appendMRPTHeader | Insert this header to the file "% File generated by MRPT. Load with MATLAB with: VAR=load(FILENAME);" |
userHeader | Additional text to be written at the head of the file. Typically MALAB comments "% This file blah blah". Final end-of-line is not needed. |
Definition at line 157 of file MatrixVectorBase_impl.h.
Referenced by mrpt::vision::build_linear_system(), 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::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().
|
inlineinherited |
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().
|
inlineinherited |
Definition at line 76 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 81 of file MatrixVectorBase.h.
|
inline |
Resize to NxN, set all entries to zero, except the main diagonal which is set to value
Definition at line 34 of file MatrixBase.h.
Referenced by mrpt::obs::CActionRobotMovement2D::prepareFastDrawSingleSample_modelGaussian(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::setDiagonal(), mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::setIdentity(), mrpt::poses::CPoseRandomSampler::setPosePDF(), and TEST().
|
inline |
Set all entries to zero, except the main diagonal which is set to value
Definition at line 43 of file MatrixBase.h.
|
inline |
Resizes to NxN, with N the length of the input vector, set all entries to zero, except the main diagonal which is set to values in the vector.
Definition at line 51 of file MatrixBase.h.
|
inline |
Definition at line 57 of file MatrixBase.h.
Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::computeGloballyConsistentNodeCoordinates(), GraphSlamLevMarqTest< my_graph_t >::create_ring_path(), do_test_init_to_unit(), mrpt::poses::CPose2D::getHomogeneousMatrix(), mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::getMinUncertaintyPath(), mrpt::poses::CPosePDFSOG::getMostLikelyCovarianceAndMean(), mrpt::poses::CPosePDF::jacobiansPoseComposition(), mrpt::graphs::detail::graph_ops< graph_t >::load_graph_of_poses_from_text_stream(), and TEST().
|
inline |
Definition at line 62 of file MatrixBase.h.
|
inlineinherited |
Definition at line 112 of file MatrixVectorBase.h.
Referenced by mrpt::vision::build_linear_system(), mrpt::pbmap::SemanticClustering::buildCoVisibilityMatrix(), mrpt::pbmap::SemanticClustering::buildProximityMatrix(), mrpt::vision::checkerBoardCameraCalibration(), 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::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl(), mrpt::slam::CRangeBearingKFSLAM2D::reset(), mrpt::slam::CRangeBearingKFSLAM::reset(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), mrpt::vision::TStereoSystemParams::TStereoSystemParams(), and mrpt::graphs::ScalarFactorGraph::updateEstimation().
|
inlineinherited |
Definition at line 113 of file MatrixVectorBase.h.
|
inlineinherited |
Definition at line 117 of file MatrixVectorBase.h.
|
inherited |
Sum of all elements in matrix/vector.
Definition at line 343 of file MatrixVectorBase_impl.h.
Referenced by mrpt::vision::CFeature::internal_distanceBetweenPolarImages(), and TEST().
|
inherited |
Sum of the absolute value of all elements in matrix/vector.
Definition at line 349 of file MatrixVectorBase_impl.h.
|
inlineinherited |
Definition at line 226 of file MatrixVectorBase.h.
Scalar mrpt::math::MatrixBase< Scalar, Derived >::trace | ( | ) | const |
Returns the trace of the matrix (not necessarily square).
Definition at line 219 of file MatrixBase_impl.h.
Referenced by TEST().
|
inlineinherited |
Definition at line 159 of file MatrixVectorBase.h.
Referenced by mrpt::poses::CPointPDFGaussian::changeCoordinatesReference(), mrpt::poses::CPosePDFGaussian::composePoint(), mrpt::pbmap::getMultiDimMeanShift_color(), mrpt::maps::CBeaconMap::internal_insertObservation(), mrpt::poses::CPosePDFGaussian::inverse(), mrpt::poses::CPosePDFGaussianInf::inverse(), mrpt::maps::CLandmarksMap::saveToMATLABScript2D(), and TEST().
|
inlineinherited |
Definition at line 164 of file MatrixVectorBase.h.
void mrpt::math::MatrixBase< Scalar, Derived >::unsafeRemoveColumns | ( | const std::vector< std::size_t > & | idxs | ) |
Removes columns of the matrix.
This "unsafe" version assumes indices sorted in ascending order.
Definition at line 22 of file MatrixBase_impl.h.
void mrpt::math::MatrixBase< Scalar, Derived >::unsafeRemoveRows | ( | const std::vector< std::size_t > & | idxs | ) |
Removes rows of the matrix.
This "unsafe" version assumes indices sorted in ascending order.
Definition at line 49 of file MatrixBase_impl.h.
|
inlinestaticinherited |
Definition at line 125 of file MatrixVectorBase.h.
Referenced by mrpt::vision::build_linear_system(), and mrpt::obs::CObservation3DRangeScan::TPixelLabelInfo< BYTES_REQUIRED_ >::setSize().
|
inlinestaticinherited |
Definition at line 126 of file MatrixVectorBase.h.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019 |