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

Math utilities. More...

#include <Eigen/Core>
Include dependency graph for math.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  aligator::math_types< _Scalar >
 Typedefs for math (Eigen vectors, matrices) depending on scalar type. More...
 

Namespaces

namespace  aligator
 Main package namespace.
 
namespace  aligator::math
 Math utilities.
 

Macros

#define ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
 
#define ALIGATOR_DYNAMIC_TYPEDEFS_WITH_ROW_TYPES(Scalar)
 
#define ALIGATOR_EIGEN_ALLOW_MALLOC(allowed)
 
#define ALIGATOR_NOMALLOC_SCOPED
 
#define ALIGATOR_NOMALLOC_RESTORE
 
#define ALIGATOR_NOMALLOC_BEGIN   ALIGATOR_EIGEN_ALLOW_MALLOC(false)
 Entering performance-critical code.
 
#define ALIGATOR_NOMALLOC_END   ALIGATOR_EIGEN_ALLOW_MALLOC(true)
 Exiting performance-critical code.
 

Typedefs

template<typename T, typename T2 = void>
using aligator::enable_if_eigen_dense = std::enable_if_t<is_eigen_dense_type<T>, T2>
 

Functions

template<typename D>
auto aligator::eigenPrintWithPreamble (const Eigen::EigenBase< D > &mat, const std::string &text, Eigen::IOFormat ft=EIGEN_DEFAULT_IO_FORMAT)
 
template<typename MatType>
MatType::Scalar aligator::math::infty_norm (const Eigen::MatrixBase< MatType > &z)
 
template<typename MatType>
MatType::Scalar aligator::math::infty_norm (const std::vector< MatType > &z)
 
template<typename Scalar>
bool aligator::math::check_scalar (const Scalar value)
 Check that a scalar is neither inf, nor NaN.
 
template<typename T>
bool aligator::math::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 aligator::math::check_value (const T &x)
 
template<typename MatrixType>
bool aligator::math::check_value (const Eigen::MatrixBase< MatrixType > &x)
 
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.
 
template<typename T>
aligator::math::sign (const T &x)
 
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.
 
template<typename T>
void aligator::math::setZero (std::vector< T > &mats)
 
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.
 

Variables

template<typename T>
constexpr bool aligator::is_eigen_dense_type
 
template<typename T>
constexpr bool aligator::is_eigen_matrix_type
 

Detailed Description

Math utilities.

Definition in file math.hpp.

Macro Definition Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS

#define ALIGATOR_DYNAMIC_TYPEDEFS ( Scalar)
Value:
using VectorXs = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>; \
using MatrixXs = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>; \
using VectorOfVectors = std::vector<VectorXs>; \
using VectorRef = Eigen::Ref<VectorXs>; \
using MatrixRef = Eigen::Ref<MatrixXs>; \
using ConstVectorRef = Eigen::Ref<const VectorXs>; \
using ConstMatrixRef = Eigen::Ref<const MatrixXs>; \
using Vector3s = Eigen::Matrix<Scalar, 3, 1>; \
using Vector6s = Eigen::Matrix<Scalar, 6, 1>; \
using Matrix3Xs = Eigen::Matrix<Scalar, 3, Eigen::Dynamic>; \
using Matrix6Xs = Eigen::Matrix<Scalar, 6, Eigen::Dynamic>; \
using Matrix6s = Eigen::Matrix<Scalar, 6, 6>

Definition at line 8 of file math.hpp.

◆ ALIGATOR_DYNAMIC_TYPEDEFS_WITH_ROW_TYPES

#define ALIGATOR_DYNAMIC_TYPEDEFS_WITH_ROW_TYPES ( Scalar)
Value:
using RowMatrixXs = typename Eigen::Transpose<MatrixXs>::PlainObject; \
using RowMatrixRef = Eigen::Ref<RowMatrixXs>; \
using ConstRowMatrixRef = Eigen::Ref<const RowMatrixXs>
#define ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
Definition math.hpp:8

Definition at line 22 of file math.hpp.

◆ ALIGATOR_EIGEN_ALLOW_MALLOC

#define ALIGATOR_EIGEN_ALLOW_MALLOC ( allowed)

Definition at line 43 of file math.hpp.

◆ ALIGATOR_NOMALLOC_SCOPED

#define ALIGATOR_NOMALLOC_SCOPED

Definition at line 44 of file math.hpp.

◆ ALIGATOR_NOMALLOC_RESTORE

#define ALIGATOR_NOMALLOC_RESTORE

Definition at line 45 of file math.hpp.

◆ ALIGATOR_NOMALLOC_BEGIN

#define ALIGATOR_NOMALLOC_BEGIN   ALIGATOR_EIGEN_ALLOW_MALLOC(false)

Entering performance-critical code.

Definition at line 49 of file math.hpp.

◆ ALIGATOR_NOMALLOC_END

#define ALIGATOR_NOMALLOC_END   ALIGATOR_EIGEN_ALLOW_MALLOC(true)

Exiting performance-critical code.

Definition at line 51 of file math.hpp.