Loading...
Searching...
No Matches
Matrix.h File Reference

typedef and functions to augment Eigen's MatrixXd More...

Go to the source code of this file.

## Classes

struct | gtsam::Reshape< OutM, OutN, OutOptions, InM, InN, InOptions >
| Reshape functor. More...
struct | gtsam::Reshape< M, M, InOptions, M, M, InOptions >
| Reshape specialization that does nothing as shape stays the same (needed to not be ambiguous for square input equals square output). More...
struct | gtsam::Reshape< M, N, InOptions, M, N, InOptions >
| Reshape specialization that does nothing as shape stays the same. More...
struct | gtsam::Reshape< N, M, InOptions, M, N, InOptions >
| Reshape specialization that does transpose. More...
struct | gtsam::MultiplyWithInverse< N >
| Functor that implements multiplication of a vector b with the inverse of a matrix A. More...
struct | gtsam::MultiplyWithInverseFunction< T, N >
| Functor that implements multiplication with the inverse of a matrix, itself the result of a function f. More...

## Namespaces

namespace | gtsam
| Global functions in a separate testing namespace.

## Macros

#define | GTSAM_MAKE_MATRIX_DEFS(N)
#define | I_1x1 Matrix1::Identity()
#define | Z_1x1 Matrix1::Constant(0.0)
#define | I_2x2 Matrix2::Identity()
#define | Z_2x2 Matrix2::Constant(0.0)
#define | I_3x3 Matrix3::Identity()
#define | Z_3x3 Matrix3::Constant(0.0)
#define | I_4x4 Matrix4::Identity()
#define | Z_4x4 Matrix4::Constant(0.0)
#define | I_5x5 Matrix5::Identity()
#define | Z_5x5 Matrix5::Constant(0.0)
#define | I_6x6 Matrix6::Identity()
#define | Z_6x6 Matrix6::Constant(0.0)
#define | I_7x7 Matrix7::Identity()
#define | Z_7x7 Matrix7::Constant(0.0)
#define | I_8x8 Matrix8::Identity()
#define | Z_8x8 Matrix8::Constant(0.0)
#define | I_9x9 Matrix9::Identity()
#define | Z_9x9 Matrix9::Constant(0.0)

## Typedefs

typedef Eigen::MatrixXd | gtsam::Matrix
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | gtsam::MatrixRowMajor
typedef Eigen::Block< Matrix > | gtsam::SubMatrix
typedef Eigen::Block< const Matrix > | gtsam::ConstSubMatrix

## Functions

const Eigen::IOFormat & | gtsam::matlabFormat ()
template<class MATRIX>
bool | gtsam::equal_with_abs_tol (const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
| equals with a tolerance
bool | gtsam::operator== (const Matrix &A, const Matrix &B)
| equality is just equal_with_abs_tol 1e-9
bool | gtsam::operator!= (const Matrix &A, const Matrix &B)
| inequality
bool | gtsam::assert_equal (const Matrix &A, const Matrix &B, double tol=1e-9)
| equals with an tolerance, prints out message if unequal
bool | gtsam::assert_inequal (const Matrix &A, const Matrix &B, double tol=1e-9)
| inequals with an tolerance, prints out message if within tolerance
bool | gtsam::assert_equal (const std::list< Matrix > &As, const std::list< Matrix > &Bs, double tol=1e-9)
| equals with an tolerance, prints out message if unequal
bool | gtsam::linear_independent (const Matrix &A, const Matrix &B, double tol=1e-9)
| check whether the rows of two matrices are linear independent
bool | gtsam::linear_dependent (const Matrix &A, const Matrix &B, double tol=1e-9)
| check whether the rows of two matrices are linear dependent
Vector | gtsam::operator^ (const Matrix &A, const Vector &v)
| overload ^ for trans(A)*v We transpose the vectors for speed.
template<class MATRIX>
MATRIX | gtsam::prod (const MATRIX &A, const MATRIX &B)
| products using old-style format to improve compatibility
void | gtsam::print (const Matrix &A, const std::string &s, std::ostream &stream)
| print without optional string, must specify cout yourself
void | gtsam::print (const Matrix &A, const std::string &s="")
| print with optional string to cout
void | gtsam::save (const Matrix &A, const std::string &s, const std::string &filename)
| save a matrix to file, which can be loaded by matlab
istream & | gtsam::operator>> (std::istream &inputStream, Matrix &destinationMatrix)
| Read a matrix from an input stream, such as a file.
template<class MATRIX>
Eigen::Block< const MATRIX > | gtsam::sub (const MATRIX &A, size_t i1, size_t i2, size_t j1, size_t j2)
| extract submatrix, slice semantics, i.e.
template<typename Derived1, typename Derived2>
void | gtsam::insertSub (Eigen::MatrixBase< Derived1 > &fullMatrix, const Eigen::MatrixBase< Derived2 > &subMatrix, size_t i, size_t j)
| insert a submatrix IN PLACE at a specified location in a larger matrix NOTE: there is no size checking
Matrix | gtsam::diag (const std::vector< Matrix > &Hs)
| Create a matrix with submatrices along its diagonal.
template<class MATRIX>
const MATRIX::ConstColXpr | gtsam::column (const MATRIX &A, size_t j)
| Extracts a column view from a matrix that avoids a copy.
template<class MATRIX>
const MATRIX::ConstRowXpr | gtsam::row (const MATRIX &A, size_t j)
| Extracts a row view from a matrix that avoids a copy.
template<class MATRIX>
void | gtsam::zeroBelowDiagonal (MATRIX &A, size_t cols=0)
| Zeros all of the elements below the diagonal of a matrix, in place.
Matrix | gtsam::trans (const Matrix &A)
| static transpose function, just calls Eigen transpose member function
template<int OutM, int OutN, int OutOptions, int InM, int InN, int InOptions>
Reshape< OutM, OutN, OutOptions, InM, InN, InOptions >::ReshapedType | gtsam::reshape (const Eigen::Matrix< double, InM, InN, InOptions > &m)
pair< Matrix, Matrix > | gtsam::qr (const Matrix &A)
| Householder QR factorization, Golub & Van Loan p 224, explicit version.
void | gtsam::inplace_QR (Matrix &A)
| QR factorization using Eigen's internal block QR algorithm.
list< boost::tuple< Vector, double, double > > | gtsam::weighted_eliminate (Matrix &A, Vector &b, const Vector &sigmas)
| Imperative algorithm for in-place full elimination with weights and constraint handling.
void | gtsam::householder_ (Matrix &A, size_t k, bool copy_vectors)
| Imperative version of Householder QR factorization, Golub & Van Loan p 224 version with Householder vectors below diagonal, as in GVL.
void | gtsam::householder (Matrix &A, size_t k)
| Householder tranformation, zeros below diagonal.
Vector | gtsam::backSubstituteUpper (const Matrix &U, const Vector &b, bool unit=false)
| backSubstitute U*x=b
Vector | gtsam::backSubstituteUpper (const Vector &b, const Matrix &U, bool unit=false)
| backSubstitute x'*U=b'
Vector | gtsam::backSubstituteLower (const Matrix &L, const Vector &b, bool unit=false)
| backSubstitute L*x=b
Matrix | gtsam::stack (size_t nrMatrices,...)
| create a matrix by stacking other matrices Given a set of matrices: A1, A2, A3...
Matrix | gtsam::stack (const std::vector< Matrix > &blocks)
Matrix | gtsam::collect (const std::vector< const Matrix * > &matrices, size_t m=0, size_t n=0)
| create a matrix by concatenating Given a set of matrices: A1, A2, A3... If all matrices have the same size, specifying single matrix dimensions will avoid the lookup of dimensions
Matrix | gtsam::collect (size_t nrMatrices,...)
void | gtsam::vector_scale_inplace (const Vector &v, Matrix &A, bool inf_mask=false)
| scales a matrix row or column by the values in a vector Arguments (Matrix, Vector) scales the columns, (Vector, Matrix) scales the rows
Matrix | gtsam::vector_scale (const Vector &v, const Matrix &A, bool inf_mask)
Matrix | gtsam::vector_scale (const Matrix &A, const Vector &v, bool inf_mask)
Matrix3 | gtsam::skewSymmetric (double wx, double wy, double wz)
| skew symmetric matrix returns this: 0 -wz wy wz 0 -wx -wy wx 0
template<class Derived>
Matrix3 | gtsam::skewSymmetric (const Eigen::MatrixBase< Derived > &w)
Matrix | gtsam::inverse_square_root (const Matrix &A)
| Use Cholesky to calculate inverse square root of a matrix.
Matrix | gtsam::cholesky_inverse (const Matrix &A)
| Return the inverse of a S.P.D.
void | gtsam::svd (const Matrix &A, Matrix &U, Vector &S, Matrix &V)
| SVD computes economy SVD A=U*S*V'.
boost::tuple< int, double, Vector > | gtsam::DLT (const Matrix &A, double rank_tol=1e-9)
| Direct linear transform algorithm that calls svd to find a vector v that minimizes the algebraic error A*v.
Matrix | gtsam::expm (const Matrix &A, size_t K=7)
| Numerical exponential map, naive approach, not industrial strength !
std::string | gtsam::formatMatrixIndented (const std::string &label, const Matrix &matrix, bool makeVectorHorizontal)
Matrix | gtsam::LLt (const Matrix &A)
Matrix | gtsam::RtR (const Matrix &A)
Vector | gtsam::columnNormSquare (const Matrix &A)

## Detailed Description

typedef and functions to augment Eigen's MatrixXd

Author
  Christian Potthast
  Kai Ni
  Frank Dellaert
  Alex Cunningham
  Alex Hagiopol
  Varun Agrawal

## Macro Definition Documentation

## GTSAM_MAKE_MATRIX_DEFS

#define GTSAM_MAKE_MATRIX_DEFS | ( |  | N | ) |

Value:
using Matrix##N = Eigen::Matrix<double, N, N>; \
using Matrix1##N = Eigen::Matrix<double, 1, N>; \
using Matrix2##N = Eigen::Matrix<double, 2, N>; \
using Matrix3##N = Eigen::Matrix<double, 3, N>; \
using Matrix4##N = Eigen::Matrix<double, 4, N>; \
using Matrix5##N = Eigen::Matrix<double, 5, N>; \
using Matrix6##N = Eigen::Matrix<double, 6, N>; \
using Matrix7##N = Eigen::Matrix<double, 7, N>; \
using Matrix8##N = Eigen::Matrix<double, 8, N>; \
using Matrix9##N = Eigen::Matrix<double, 9, N>;