0.4.1
Loading...
Searching...
No Matches
Math.hpp File Reference

Simple Math functions. More...

Go to the source code of this file.

Data Structures

struct  NAV::math::LerpSearchResult
 Lerp Search Result. More...
 

Namespaces

namespace  NAV
 
namespace  NAV::math
 

Functions

auto NAV::math::bilinearInterpolation (const auto &tx, const auto &ty, const auto &c00, const auto &c10, const auto &c01, const auto &c11)
 Bilinear interpolation.
 
double NAV::math::calcEllipticalIntegral (double phi, double m)
 Calculates the incomplete elliptical integral of the second kind.
 
template<std::floating_point T>
NAV::math::csc (const T &x)
 Calculates the cosecant of a value (csc(x) = sec(pi/2 - x) = 1 / sin(x))
 
template<typename Derived>
Derived::PlainObject NAV::math::expm (const Eigen::MatrixBase< Derived > &X, size_t order)
 Calculates the state transition matrix 𝚽 limited to specified order in 𝐅𝜏ₛ
 
uint64_t NAV::math::factorial (uint64_t n)
 Calculates the factorial of an unsigned integer.
 
template<std::integral Out, size_t Bits, std::integral In>
constexpr Out NAV::math::interpretAs (In in)
 Interprets the input integer with certain amount of Bits as Output type. Takes care of sign extension.
 
template<typename Derived>
Derived::PlainObject NAV::math::inverseSqrt (const Eigen::MatrixBase< Derived > &matrix)
 Returns the inverse square root of a matrix.
 
template<typename Derived>
Derived::PlainObject NAV::math::lerp (const Eigen::MatrixBase< Derived > &a, const Eigen::MatrixBase< Derived > &b, auto t)
 Linear interpolation between vectors.
 
LerpSearchResult NAV::math::lerpSearch (const auto &data, const auto &value)
 Searches the value in the data container.
 
template<typename Derived>
std::optional< std::pair< Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime >, Eigen::Vector< typename Derived::Scalar, Derived::RowsAtCompileTime > > > NAV::math::LtDLdecomp_choleskyFact (const Eigen::MatrixBase< Derived > &Q)
 Find (L^T D L)-decomposition of Q-matrix via a backward Cholesky factorization in a bordering method formulation.
 
template<typename Derived>
std::optional< std::pair< Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime >, Eigen::Vector< typename Derived::Scalar, Derived::RowsAtCompileTime > > > NAV::math::LtDLdecomp_outerProduct (const Eigen::MatrixBase< Derived > &Qmatrix)
 Find (L^T D L)-decomposition of Q-matrix via outer product method.
 
double NAV::math::normalCDF (double value)
 Calculates the cumulative distribution function (CDF) of the standard normal distribution.
 
template<std::floating_point T>
constexpr T NAV::math::round (const T &value, size_t digits)
 Round the number to the specified amount of digits.
 
template<std::floating_point T>
constexpr T NAV::math::roundSignificantDigits (T value, size_t digits)
 Round the number to the specified amount of significant digits.
 
template<std::floating_point T>
NAV::math::sec (const T &x)
 Calculates the secant of a value (sec(x) = csc(pi/2 - x) = 1 / cos(x))
 
template<typename T>
int NAV::math::sgn (const T &val)
 Returns the sign of the given value.
 
template<typename T>
NAV::math::sign (const T &x, const T &y)
 Change the sign of x according to the value of y.
 
template<typename Derived>
Eigen::Matrix< typename Derived::Scalar, 3, 3 > NAV::math::skewSymmetricMatrix (const Eigen::MatrixBase< Derived > &a)
 Calculates the skew symmetric matrix of the given vector. This is needed to perform the cross product with a scalar product operation.
 
template<typename Derived>
Eigen::Matrix< typename Derived::Scalar, 3, 3 > NAV::math::skewSymmetricMatrixSquared (const Eigen::MatrixBase< Derived > &a)
 Calculates the square of a skew symmetric matrix of the given vector.
 
template<typename DerivedA, typename DerivedQ>
DerivedA::Scalar NAV::math::squaredNormVectorMatrix (const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedQ > &Q)
 Calculates the squared norm of the vector and matrix.
 

Detailed Description

Simple Math functions.

Author
T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
N. Stahl (HiWi: Elliptical integral)
Date
2023-07-04

Definition in file Math.hpp.