Drake
Drake C++ Documentation
matrix_util.h File Reference
#include <algorithm>
#include <cmath>
#include <functional>
#include <set>
#include <utility>
#include <vector>
#include <Eigen/Dense>
#include "drake/common/drake_assert.h"
#include "drake/common/drake_throw.h"
#include "drake/common/eigen_types.h"
Include dependency graph for matrix_util.h:
This graph shows which files directly or indirectly include this file:

Namespaces

 drake
 
 drake::math
 

Functions

template<typename Derived >
bool IsSymmetric (const Eigen::MatrixBase< Derived > &matrix)
 Determines if a matrix is symmetric. More...
 
template<typename Derived >
bool IsSymmetric (const Eigen::MatrixBase< Derived > &matrix, const typename Derived::Scalar &precision)
 Determines if a matrix is symmetric based on whether the difference between matrix(i, j) and matrix(j, i) is smaller than precision for all i, j. More...
 
template<typename Derived >
drake::MatrixX< typename Derived::Scalar > ToSymmetricMatrixFromLowerTriangularColumns (const Eigen::MatrixBase< Derived > &lower_triangular_columns)
 Given a column vector containing the stacked columns of the lower triangular part of a square matrix, returning a symmetric matrix whose lower triangular part is the same as the original matrix. More...
 
template<int rows, typename Derived >
Eigen::Matrix< typename Derived::Scalar, rows, rows > ToSymmetricMatrixFromLowerTriangularColumns (const Eigen::MatrixBase< Derived > &lower_triangular_columns)
 Given a column vector containing the stacked columns of the lower triangular part of a square matrix, returning a symmetric matrix whose lower triangular part is the same as the original matrix. More...
 
template<typename Derived >
drake::VectorX< typename Derived::Scalar > ToLowerTriangularColumnsFromMatrix (const Eigen::MatrixBase< Derived > &matrix)
 Given a square matrix, extract the lower triangular part as a stacked column vector. More...
 
template<typename Derived >
bool IsPositiveDefinite (const Eigen::MatrixBase< Derived > &matrix, double eigenvalue_tolerance=0.0, double symmetry_tolerance=0.0)
 Checks if a matrix is symmetric (with tolerance symmetry_tolerance – see IsSymmetric) and has all eigenvalues greater than eigenvalue_tolerance. More...
 
template<typename T >
std::vector< MatrixX< T > > EigenToStdVector (const Eigen::Ref< const MatrixX< T >> &mat)
 Converts a MatrixX<T> into a std::vector<MatrixX<T>>, taking each column of the m-by-n matrix mat into an m-by-1 element of the returned std::vector. More...
 
template<typename T >
MatrixX< T > StdVectorToEigen (const std::vector< MatrixX< T >> &vec)
 Converts a std::vector<MatrixX<T>> into a MatrixX<T>, composing each element of vec into a column of the returned matrix. More...
 
template<typename Derived >
MatrixX< typename Derived::Scalar > ExtractPrincipalSubmatrix (const Eigen::MatrixBase< Derived > &mat, const std::set< int > &indices)
 Extracts the principal submatrix from the ordered set of indices. More...