aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
aligator::math Namespace Reference

Math utilities. More...

Functions

template<typename MatType>
MatType::Scalar infty_norm (const Eigen::MatrixBase< MatType > &z)
 
template<typename MatType>
MatType::Scalar infty_norm (const std::vector< MatType > &z)
 
template<typename Scalar>
bool check_scalar (const Scalar value)
 Check that a scalar is neither inf, nor NaN.
 
template<typename T>
bool check_value (const std::vector< T > &xs)
 Check if a std::vector of numerical objects has invalid values.
 
template<typename T, typename = std::enable_if_t<std::is_scalar<T>::value>>
bool check_value (const T &x)
 
template<typename MatrixType>
bool check_value (const Eigen::MatrixBase< MatrixType > &x)
 
template<typename Scalar>
bool scalar_close (const Scalar a, const Scalar b, const Scalar prec=std::numeric_limits< Scalar >::epsilon())
 Tests whether a and b are close, within absolute and relative precision prec.
 
template<typename T>
sign (const T &x)
 
template<typename Derived, unsigned int UpLo = Eigen::Lower>
void make_symmetric (const Eigen::MatrixBase< Derived > &matrix)
 Symmetrize a matrix using its lower triangular part.
 
template<typename T>
void setZero (std::vector< T > &mats)
 
template<typename A, typename B, typename OutType, typename Scalar>
void vectorMultiplyAdd (const std::vector< A > &a, const std::vector< B > &b, std::vector< OutType > &c, const Scalar alpha)
 Compute zi = xi + alpha * yi for all i.
 

Detailed Description

Math utilities.

Function Documentation

◆ infty_norm() [1/2]

template<typename MatType>
MatType::Scalar aligator::math::infty_norm ( const Eigen::MatrixBase< MatType > & z)

Definition at line 127 of file math.hpp.

◆ infty_norm() [2/2]

template<typename MatType>
MatType::Scalar aligator::math::infty_norm ( const std::vector< MatType > & z)

Definition at line 136 of file math.hpp.

◆ check_scalar()

template<typename Scalar>
bool aligator::math::check_scalar ( const Scalar value)
inline

Check that a scalar is neither inf, nor NaN.

Definition at line 146 of file math.hpp.

◆ check_value() [1/3]

template<typename T>
bool aligator::math::check_value ( const std::vector< T > & xs)

Check if a std::vector of numerical objects has invalid values.

Definition at line 151 of file math.hpp.

◆ check_value() [2/3]

template<typename T, typename = std::enable_if_t<std::is_scalar<T>::value>>
bool aligator::math::check_value ( const T & x)

Definition at line 161 of file math.hpp.

◆ check_value() [3/3]

template<typename MatrixType>
bool aligator::math::check_value ( const Eigen::MatrixBase< MatrixType > & x)

Definition at line 167 of file math.hpp.

◆ scalar_close()

template<typename Scalar>
bool aligator::math::scalar_close ( const Scalar a,
const Scalar b,
const Scalar prec = std::numeric_limits<Scalar>::epsilon() )

Tests whether a and b are close, within absolute and relative precision prec.

Definition at line 175 of file math.hpp.

◆ sign()

template<typename T>
T aligator::math::sign ( const T & x)

Definition at line 180 of file math.hpp.

◆ make_symmetric()

template<typename Derived, unsigned int UpLo = Eigen::Lower>
void aligator::math::make_symmetric ( const Eigen::MatrixBase< Derived > & matrix)

Symmetrize a matrix using its lower triangular part.

Definition at line 187 of file math.hpp.

◆ setZero()

template<typename T>
void aligator::math::setZero ( std::vector< T > & mats)

Definition at line 194 of file math.hpp.

◆ vectorMultiplyAdd()

template<typename A, typename B, typename OutType, typename Scalar>
void aligator::math::vectorMultiplyAdd ( const std::vector< A > & a,
const std::vector< B > & b,
std::vector< OutType > & c,
const Scalar alpha )

Compute zi = xi + alpha * yi for all i.

Definition at line 202 of file math.hpp.