mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
General Mathematics

General mathematical utilities.

Classes

class  mx::math::histogramUniform< realT >
 A histogram with uniform bin spacing. More...

Topics

 Constants and units
 Geometry and Geodesy
 Special Functions
 Linear Algebra
 Integration
 Interpolation
 Data Fitting
 Plotting Data
 Random Numbers
 Vector Utilities
 Fourier Transforms
 Methods for calculating the Fourier Transform.
 NVIDIA Cuda Interface
 Mathematics Source Files

Functions

template<typename realT>
bool mx::math::isNan (realT value)
 Test whether a floating-point value is NaN, including under finite-math-only optimization.
template<typename realT>
bool mx::math::isFinite (realT value)
 Test whether a floating-point value is finite, including under finite-math-only optimization.
template<typename realT>
void mx::math::quarticRoots (std::vector< std::complex< realT > > &x, realT a, realT b, realT c, realT d, realT e)
 Find the roots of the general quartic equation.

Function Documentation

◆ isFinite()

template<typename realT>
bool mx::math::isFinite ( realT value)

◆ isNan()

template<typename realT>
bool mx::math::isNan ( realT value)

Test whether a floating-point value is NaN, including under finite-math-only optimization.

Returns
true if value is a quiet or signaling NaN, otherwise false.
Parameters
[in]valuefloating-point value to test

Definition at line 39 of file floatUtils.hpp.

References isNan().

Referenced by isNan(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and unitTest::math_eigenLapack_test::TEST_CASE().

◆ quarticRoots()

template<typename realT>
void mx::math::quarticRoots ( std::vector< std::complex< realT > > & x,
realT a,
realT b,
realT c,
realT d,
realT e )

Find the roots of the general quartic equation.

Finds the roots of

\[f(x) = a x^4 + b x^3 + c x^2 + d x + e \]

using the general formula for quartic roots. See https://en.wikipedia.org/wiki/Quartic_function.

Template Parameters
realTis the floating point type used for calculations.
Parameters
[out]xOn exit contains the 4 roots, is resized to length 4.
[in]athe coefficient of the \(x^4\) term.
[in]bthe coefficient of the \(x^3\) term.
[in]cthe coefficient of the \(x^2\) term.
[in]dthe coefficient of the \(x^1\) term.
[in]ethe coefficient of the \(x^0\) term.

Definition at line 126 of file roots.hpp.

Referenced by mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::optimumTauWFS().