MathUtils.hpp
81 auto largestRelativeDifference(Eigen::ArrayBase<T> const& actual, Eigen::ArrayBase<U> const& expected) -> double
88 auto largestRelativeDifferenceLogScale(Eigen::ArrayBase<T> const& actual, Eigen::ArrayBase<U> const& expected) -> double
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
auto cleanRationalNumbers(double *vals, long size, long maxden=6) -> void
Clean an array that is known to have rational numbers from round-off errors.
auto largestRelativeDifference(Eigen::ArrayBase< T > const &actual, Eigen::ArrayBase< U > const &expected) -> double
Return the largest relative difference between two arrays actual and expected.
Definition: MathUtils.hpp:81
auto linearlyIndependentCols(MatrixXdConstRef A) -> Indices
Determine the set of linearly independent columns in a matrix using a column pivoting QR algorithm.
auto largestRelativeDifferenceLogScale(Eigen::ArrayBase< T > const &actual, Eigen::ArrayBase< U > const &expected) -> double
Return the largest relative difference between two arrays actual and expected in log scale.
Definition: MathUtils.hpp:88
auto rationalize(double x, unsigned maxden) -> std::tuple< long, long >
Calculates the rational number that approximates a given real number.
Eigen::Ref< const VectorXd > VectorXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:76
auto inverseShermanMorrison(MatrixXdConstRef invA, VectorXdConstRef D) -> MatrixXd
Calculate the inverse of A + D where inv(A) is already known and D is a diagonal matrix.
auto linearlyIndependentRows(MatrixXdConstRef A) -> Indices
Determine the set of linearly independent rows in a matrix.
auto residual3p(MatrixXdConstRef A, VectorXdConstRef x, VectorXdConstRef b) -> VectorXd
Return the residual of the equation A*x - b with triple-precision.
auto dot3p(VectorXdConstRef x, VectorXdConstRef y, double s) -> double
Return the dot product s + dot(x, y) of two vectors with triple-precision.
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
Eigen::Ref< const MatrixXd > MatrixXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:139
Eigen::Ref< MatrixXd > MatrixXdRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:138