Polynome function object.
More...
#include <JPolynome.hh>
Polynome function object.
Evaluates function, derivative and integral values.
Definition at line 26 of file JPolynome.hh.
◆ JPolynome() [1/3]
JMATH::JPolynome::JPolynome |
( |
| ) |
|
|
inline |
◆ JPolynome() [2/3]
JMATH::JPolynome::JPolynome |
( |
int |
n, |
|
|
|
... |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
n | degree of polynome (followed by comma separated argument list) |
Definition at line 42 of file JPolynome.hh.
48 for (
double x;
n != 0; --
n) {
50 x = va_arg(ap,
double);
◆ JPolynome() [3/3]
template<class T >
JMATH::JPolynome::JPolynome |
( |
T |
__begin, |
|
|
T |
__end |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
__begin | begin of data |
__end | end of data |
Definition at line 66 of file JPolynome.hh.
69 for (T i = __begin; i != __end; ++i)
◆ getValue()
double JMATH::JPolynome::getValue |
( |
const double |
x | ) |
const |
|
inline |
Function value.
- Parameters
-
- Returns
- function value
Definition at line 80 of file JPolynome.hh.
85 for (const_iterator i = begin(); i != end(); ++i, z *= x) {
◆ getDerivative() [1/2]
double JMATH::JPolynome::getDerivative |
( |
const double |
x | ) |
const |
|
inline |
Derivative value.
- Parameters
-
- Returns
- derivative value
Definition at line 99 of file JPolynome.hh.
108 for (const_iterator i = begin(); ++i != end(); ++
n, z *= x) {
◆ getIntegral() [1/2]
double JMATH::JPolynome::getIntegral |
( |
const double |
x | ) |
const |
|
inline |
Integral value.
- Parameters
-
- Returns
- integral value
Definition at line 123 of file JPolynome.hh.
129 for (const_iterator i = begin(); i != end(); ++i, ++
n, z *= x) {
◆ operator()()
double JMATH::JPolynome::operator() |
( |
const double |
x | ) |
const |
|
inline |
Function value.
- Parameters
-
- Returns
- function value
Definition at line 143 of file JPolynome.hh.
◆ getDerivative() [2/2]
JPolynome JMATH::JPolynome::getDerivative |
( |
| ) |
const |
|
inline |
Derivative function.
- Returns
- derivative function
Definition at line 154 of file JPolynome.hh.
160 for (const_iterator i = begin(); ++i != end(); ++
n) {
161 buffer.push_back(
n * (*i));
◆ getIntegral() [2/2]
JPolynome JMATH::JPolynome::getIntegral |
( |
| ) |
const |
|
inline |
Integral function.
- Returns
- integral function
Definition at line 173 of file JPolynome.hh.
179 for (const_iterator i = begin(); i != end(); ++i, ++
n) {
180 buffer.push_back((*i) / (
double)
n);
◆ equals()
bool JMATH::JPolynome::equals |
( |
const JPolynome & |
P, |
|
|
const double |
eps = std::numeric_limits<double>::min() |
|
) |
| const |
|
inline |
Equality.
- Parameters
-
P | polynome |
eps | numerical precision |
- Returns
- true if polynomes identical; else false
Definition at line 194 of file JPolynome.hh.
197 if (this->size() == P.size()) {
199 for (const_iterator p = this->begin(), q = P.begin(); p != this->end(); ++p, ++q) {
200 if (fabs(*p - *q) > eps) {
◆ operator>>
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
JPolynome & |
object |
|
) |
| |
|
friend |
Read polynome from input.
- Parameters
-
in | input stream |
object | polynome |
- Returns
- input stream
Definition at line 221 of file JPolynome.hh.
223 for (
double x; in >> x; ) {
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JPolynome & |
object |
|
) |
| |
|
friend |
Write polynome to output.
- Parameters
-
out | output stream |
object | polynome |
- Returns
- output stream
Definition at line 238 of file JPolynome.hh.
240 for (JPolynome::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
The documentation for this class was generated from the following file: