My Project
|
Provides free functions to invert polynomials of degree 1, 2 and 3. More...
Go to the source code of this file.
Functions | |
template<class Scalar , class SolContainer > | |
unsigned | Opm::invertLinearPolynomial (SolContainer &sol, Scalar a, Scalar b) |
Invert a linear polynomial analytically. More... | |
template<class Scalar , class SolContainer > | |
unsigned | Opm::invertQuadraticPolynomial (SolContainer &sol, Scalar a, Scalar b, Scalar c) |
Invert a quadratic polynomial analytically. More... | |
template<class Scalar , class SolContainer > | |
unsigned | Opm::invertCubicPolynomial (SolContainer *sol, Scalar a, Scalar b, Scalar c, Scalar d) |
Invert a cubic polynomial analytically. More... | |
template<class Scalar , class SolContainer > | |
unsigned | Opm::cubicRoots (SolContainer *sol, Scalar a, Scalar b, Scalar c, Scalar d) |
Invert a cubic polynomial analytically. More... | |
Provides free functions to invert polynomials of degree 1, 2 and 3.
unsigned Opm::cubicRoots | ( | SolContainer * | sol, |
Scalar | a, | ||
Scalar | b, | ||
Scalar | c, | ||
Scalar | d | ||
) |
Invert a cubic polynomial analytically.
The polynomial is defined as
This method returns the number of solutions which are in the real numbers. The "sol" argument contains the real roots of the cubic polynomial in order with the smallest root first.
sol | Container into which the solutions are written |
a | The coefficient for the cubic term |
b | The coefficient for the quadratic term |
c | The coefficient for the linear term |
d | The coefficient for the constant term |
unsigned Opm::invertCubicPolynomial | ( | SolContainer * | sol, |
Scalar | a, | ||
Scalar | b, | ||
Scalar | c, | ||
Scalar | d | ||
) |
Invert a cubic polynomial analytically.
The polynomial is defined as
This method teturns the number of solutions which are in the real numbers. The "sol" argument contains the real roots of the cubic polynomial in order with the smallest root first.
sol | Container into which the solutions are written |
a | The coefficient for the cubic term |
b | The coefficient for the quadratic term |
c | The coefficient for the linear term |
d | The coefficient for the constant term |
unsigned Opm::invertLinearPolynomial | ( | SolContainer & | sol, |
Scalar | a, | ||
Scalar | b | ||
) |
Invert a linear polynomial analytically.
The polynomial is defined as
This method Returns the number of solutions which are in the real numbers, i.e. 1 except if the slope of the line is 0.
sol | Container into which the solutions are written |
a | The coefficient for the linear term |
b | The coefficient for the constant term |
unsigned Opm::invertQuadraticPolynomial | ( | SolContainer & | sol, |
Scalar | a, | ||
Scalar | b, | ||
Scalar | c | ||
) |
Invert a quadratic polynomial analytically.
The polynomial is defined as
This method teturns the number of solutions which are in the real numbers. The "sol" argument contains the real roots of the parabola in order with the smallest root first.
sol | Container into which the solutions are written |
a | The coefficient for the quadratic term |
b | The coefficient for the linear term |
c | The coefficient for the constant term |