#include <PolynomialRoots.hh>
|
| Cubic () |
|
| Cubic (real_type a, real_type b, real_type c, real_type d) |
|
void | setup (real_type a, real_type b, real_type c, real_type d) |
|
integer | num_roots () const |
|
integer | numRoots () const |
| alias of num_roots
|
|
bool | complex_root () const |
|
bool | complexRoot () const |
| alias of complex_root
|
|
bool | double_root () const |
|
bool | doubleRoot () const |
| alias of double_root
|
|
bool | triple_root () const |
|
bool | tripleRoot () const |
| alias of triple_root
|
|
integer | get_real_roots (real_type r[]) const |
|
integer | getRealRoots (real_type r[]) const |
| alias of get_real_roots
|
|
integer | get_positive_roots (real_type r[]) const |
|
integer | getPositiveRoots (real_type r[]) const |
| alias of get_positive_roots
|
|
integer | get_negative_roots (real_type r[]) const |
|
integer | getNegativeRoots (real_type r[]) const |
| alias of get_negative_roots
|
|
integer | get_roots_in_range (real_type a, real_type b, real_type r[]) const |
|
integer | getRootsInRange (real_type a, real_type b, real_type r[]) const |
| alias of get_roots_in_range
|
|
integer | get_roots_in_open_range (real_type a, real_type b, real_type r[]) const |
|
integer | getRootsInOpenRange (real_type a, real_type b, real_type r[]) const |
| alias of get_roots_in_open_range
|
|
real_type | real_root0 () const |
|
real_type | real_root1 () const |
|
real_type | real_root2 () const |
|
complex_type | root0 () const |
|
complex_type | root1 () const |
|
complex_type | root2 () const |
|
void | get_root0 (real_type &re, real_type &im) const |
|
void | getRoot0 (real_type &re, real_type &im) const |
| alias of get_root0
|
|
void | get_root0 (complex_type &r) const |
|
void | getRoot0 (complex_type &r) const |
| alias of get_root0
|
|
void | get_root1 (real_type &re, real_type &im) const |
|
void | getRoot1 (real_type &re, real_type &im) const |
| alias of get_root1
|
|
void | get_root1 (complex_type &r) const |
|
void | getRoot1 (complex_type &r) const |
| alias of get_root1
|
|
void | get_root2 (real_type &re, real_type &im) const |
|
void | getRoot2 (real_type &re, real_type &im) const |
| alias of get_root2
|
|
void | get_root2 (complex_type &r) const |
|
void | getRoot2 (complex_type &r) const |
| alias of get_root2
|
|
real_type | eval (real_type x) const |
|
complex_type | eval (complex_type x) const |
|
void | eval (real_type x, real_type &p, real_type &dp) const |
|
void | info (ostream_type &s) const |
|
bool | check (ostream_type &s) const |
|
Cubic polynomial class
Constructor
double a = 1;
double b = 2;
double c = 3;
double d = 3;
Cubic()
Definition PolynomialRoots.hh:565
void setup(real_type a, real_type b, real_type c, real_type d)
Definition PolynomialRoots.hh:599
Get kind of solution
bool complex_root() const
Definition PolynomialRoots.hh:627
bool double_root() const
Definition PolynomialRoots.hh:635
integer num_roots() const
Definition PolynomialRoots.hh:619
bool triple_root() const
Definition PolynomialRoots.hh:643
Get real roots
double r_min = 0;
double r_max = 2;
double r[3];
int nroots;
integer getRootsInRange(real_type a, real_type b, real_type r[]) const
alias of get_roots_in_range
Definition PolynomialRoots.hh:699
integer getPositiveRoots(real_type r[]) const
alias of get_positive_roots
Definition PolynomialRoots.hh:671
integer getRealRoots(real_type r[]) const
alias of get_real_roots
Definition PolynomialRoots.hh:658
integer getRootsInOpenRange(real_type a, real_type b, real_type r[]) const
alias of get_roots_in_open_range
Definition PolynomialRoots.hh:714
integer getNegativeRoots(real_type r[]) const
alias of get_negative_roots
Definition PolynomialRoots.hh:684
Get roots
double re, im;
void getRoot1(real_type &re, real_type &im) const
alias of get_root1
Definition PolynomialRoots.hh:785
complex_type root0() const
Definition PolynomialRoots.hh:736
complex_type root2() const
Definition PolynomialRoots.hh:750
real_type real_root2() const
Definition PolynomialRoots.hh:730
real_type real_root0() const
Definition PolynomialRoots.hh:720
void getRoot2(real_type &re, real_type &im) const
alias of get_root2
Definition PolynomialRoots.hh:805
complex_type root1() const
Definition PolynomialRoots.hh:743
real_type real_root1() const
Definition PolynomialRoots.hh:725
void getRoot0(real_type &re, real_type &im) const
alias of get_root0
Definition PolynomialRoots.hh:763
std::complex< real_type > complex_type
complex type numbers
Definition PolynomialRoots-Utils.hh:50
Evaluate polynomial
{double or complex} v, x;
real_type eval(real_type x) const
Definition PolynomialRoots.hh:824
Information
bool ok = p.
check( cout );
void info(ostream_type &s) const
bool check(ostream_type &s) const
◆ Cubic() [1/2]
PolynomialRoots::Cubic::Cubic |
( |
| ) |
|
|
inline |
Build an empty instance of Cubic polynomial solver
◆ Cubic() [2/2]
Build the instance of the calss and compute the roots of cubic polynomial \( a x^3 + b x^2 + c x + d \)
- Parameters
-
[in] | a | coefficient of \( x^3 \) |
[in] | b | coefficient of \( x^2 \) |
[in] | c | coefficient of \( x \) |
[in] | d | coefficient of \( x^0 \) |
◆ check()
bool PolynomialRoots::Cubic::check |
( |
ostream_type & | s | ) |
const |
Check tolerenace and quality of the computed roots.
◆ complex_root()
bool PolynomialRoots::Cubic::complex_root |
( |
| ) |
const |
|
inline |
◆ complexRoot()
bool PolynomialRoots::Cubic::complexRoot |
( |
| ) |
const |
|
inline |
◆ double_root()
bool PolynomialRoots::Cubic::double_root |
( |
| ) |
const |
|
inline |
◆ doubleRoot()
bool PolynomialRoots::Cubic::doubleRoot |
( |
| ) |
const |
|
inline |
◆ eval() [1/3]
Evalute the cubic polynomial.
- Parameters
-
x | value where compute \( p(x) \), x complex |
- Returns
- the value \( p(x) \)
◆ eval() [2/3]
Evalute the cubic polynomial.
- Parameters
-
x | value where compute \( p(x) \) |
- Returns
- the value \( p(x) \)
◆ eval() [3/3]
Evalute the polynomial with its derivative.
- Parameters
-
x | value where compute \( p(x) \) |
p | value \( p(x) \) |
dp | value \( p'(x) \) |
◆ get_negative_roots()
Get negative real roots.
- Parameters
-
[out] | r | vector that will be filled with the real roots |
- Returns
- the total number of negative real roots, 0, 1, 2 or 3
◆ get_positive_roots()
Get positive real roots.
- Parameters
-
[out] | r | vector that will be filled with the real roots |
- Returns
- the total number of positive real roots, 0, 1, 2 or 3
◆ get_real_roots()
Get the real roots.
- Parameters
-
[out] | r | vector that will be filled with the real roots |
- Returns
- the total number of real roots, 0, 1, 2 or 3
◆ get_root0() [1/2]
void PolynomialRoots::Cubic::get_root0 |
( |
complex_type & | r | ) |
const |
|
inline |
First complex or real root.
◆ get_root0() [2/2]
First complex or real root.
◆ get_root1() [1/2]
void PolynomialRoots::Cubic::get_root1 |
( |
complex_type & | r | ) |
const |
|
inline |
Second complex or real root.
◆ get_root1() [2/2]
Second complex or real root.
◆ get_root2() [1/2]
void PolynomialRoots::Cubic::get_root2 |
( |
complex_type & | r | ) |
const |
|
inline |
Third complex or real root.
◆ get_root2() [2/2]
Third complex or real root.
◆ get_roots_in_open_range()
Get real roots in an open range.
- Parameters
-
[in] | a | left side of the range |
[in] | b | right side of the range |
[out] | r | vector that will be filled with the real roots |
- Returns
- the total number of real roots in the open range (a,b)
◆ get_roots_in_range()
Get real roots in a closed range.
- Parameters
-
[in] | a | left side of the range |
[in] | b | right side of the range |
[out] | r | vector that will be filled with the real roots |
- Returns
- the total number of real roots in the range [a,b]
◆ getNegativeRoots()
alias of get_negative_roots
◆ getPositiveRoots()
alias of get_positive_roots
◆ getRealRoots()
◆ getRoot0() [1/2]
void PolynomialRoots::Cubic::getRoot0 |
( |
complex_type & | r | ) |
const |
|
inline |
◆ getRoot0() [2/2]
◆ getRoot1() [1/2]
void PolynomialRoots::Cubic::getRoot1 |
( |
complex_type & | r | ) |
const |
|
inline |
◆ getRoot1() [2/2]
◆ getRoot2() [1/2]
void PolynomialRoots::Cubic::getRoot2 |
( |
complex_type & | r | ) |
const |
|
inline |
◆ getRoot2() [2/2]
◆ getRootsInOpenRange()
alias of get_roots_in_open_range
◆ getRootsInRange()
alias of get_roots_in_range
◆ info()
Print info of the roots of the polynomial.
◆ num_roots()
integer PolynomialRoots::Cubic::num_roots |
( |
| ) |
const |
|
inline |
◆ numRoots()
integer PolynomialRoots::Cubic::numRoots |
( |
| ) |
const |
|
inline |
◆ real_root0()
real_type PolynomialRoots::Cubic::real_root0 |
( |
| ) |
const |
|
inline |
◆ real_root1()
real_type PolynomialRoots::Cubic::real_root1 |
( |
| ) |
const |
|
inline |
◆ real_root2()
real_type PolynomialRoots::Cubic::real_root2 |
( |
| ) |
const |
|
inline |
◆ root0()
First complex or real root.
◆ root1()
Second complex or real root.
◆ root2()
Third complex or real root.
◆ setup()
Compute the roots of cubic polynomial \( a x^3 + b x^2 + c x + d \)
- Parameters
-
[in] | a | coefficient of \( x^3 \) |
[in] | b | coefficient of \( x^2 \) |
[in] | c | coefficient of \( x \) |
[in] | d | coefficient of \( x^0 \) |
◆ triple_root()
bool PolynomialRoots::Cubic::triple_root |
( |
| ) |
const |
|
inline |
◆ tripleRoot()
bool PolynomialRoots::Cubic::tripleRoot |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file:
- /Users/enricobertolazzi/Ricerca/PINS/PINS-submodules/quarticRootsFlocke/src/PolynomialRoots.hh