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

General mathematical utilities.

Classes

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

Modules

 Constants and units
 
 Geometry and Geodesy
 
 Special Functions
 
 Templatized BLAS and Lapack
 
 Integration
 
 Interpolation
 
 Data Fitting
 
 Plotting Data
 
 Random Numbers
 
 Vector Utilities
 
 Fast Fourier Transforms
 
 NVIDIA Cuda Interface
 
 Gen. Math Files
 

Functions

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. More...
 

Function Documentation

◆ 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 129 of file roots.hpp.

References mx::astro::constants::c().

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