File linearization.h#

namespace sym

Typedefs

template<typename Scalar>
using SparseLinearization = Linearization<Eigen::SparseMatrix<Scalar>>#
using SparseLinearizationd = SparseLinearization<double>#
using SparseLinearizationf = SparseLinearization<float>#
template<typename Scalar>
using DenseLinearization = Linearization<MatrixX<Scalar>>#
using DenseLinearizationd = DenseLinearization<double>#
using DenseLinearizationf = DenseLinearization<float>#

Functions

template<typename Scalar>
sparse_matrix_structure_t GetSparseStructure(const Eigen::SparseMatrix<Scalar> &matrix)#

Returns the sparse matrix structure of matrix.

template<typename Derived>
sparse_matrix_structure_t GetSparseStructure(const Eigen::EigenBase<Derived>&)#

Return a default initialized sparse structure because arg is dense.

template<typename Scalar>
Eigen::Map<const VectorX<Scalar>> JacobianValues(const Eigen::SparseMatrix<Scalar> &matrix)#

Returns coefficients of matrix. Overloads exist for both dense and sparse matrices to make writing generic code easier.

This version returns the non-zero values of an Eigen::SparseMatrix

Note: it returns a map, so be careful about mutating or disposing of matrix before you are finished with the output.

template<typename Scalar>
const MatrixX<Scalar> &JacobianValues(const MatrixX<Scalar> &matrix)#

Returns coefficients of matrix. Overloads exist for both dense and sparse matrices to make writing generic code easier.

Returns a const-ref to the argument.

template<typename MatrixType>
struct Linearization#
#include <linearization.h>

Class for storing a problem linearization evaluated at a Values (i.e. a residual, jacobian, hessian, and rhs)

MatrixType is expected to be an Eigen MatrixX or SparseMatrix.

Public Types

using Scalar = typename MatrixType::Scalar#
using Vector = VectorX<Scalar>#
using Matrix = MatrixType#

Public Functions

inline void Reset()#

Set to invalid

inline bool IsInitialized() const#

Returns whether the linearization is currently valid for the corresponding values. Accessing any of the members when this is false could result in unexpected behavior

inline void SetInitialized(const bool initialized = true)#
inline double Error() const#
inline double LinearError(const Vector &x_update) const#

Public Members

Vector residual#
Matrix hessian_lower#
Matrix jacobian#
Vector rhs#

Private Members

bool initialized_ = {false}#