1 #ifndef __JMATH__JPOLYNOME__
2 #define __JMATH__JPOLYNOME__
19 namespace JPP {
using namespace JMATH; }
28 public JMath<JPolynome_t>,
46 const double eps = std::numeric_limits<double>::min())
const
48 if (this->size() == P.size()) {
50 for (const_iterator p = this->begin(), q = P.begin(); p != this->end(); ++p, ++q) {
51 if (fabs(*p - *q) > eps) {
73 while (this->size() < polynome.size()) {
77 for (
size_t i = 0; i != this->size(); ++i) {
78 (*this)[i] += polynome[i];
93 while (this->size() < polynome.size()) {
97 for (
size_t i = 0; i != this->size(); ++i) {
98 (*this)[i] -= polynome[i];
113 for (iterator i = begin(); i != end(); ++i) {
130 for (
double x; in >> x; ) {
147 for (JPolynome_t::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
148 out <<
' ' <<
FIXED(9,3) << *i;
191 for (
T i = __begin; i != __end; ++i)
201 template<
class ...Args>
213 template<
class ...Args>
235 for (const_iterator i = begin(); i != end(); ++i, z *= x) {
258 for (const_iterator i = begin(); ++i != end(); ++
n, z *= x) {
279 for (const_iterator i = begin(); i != end(); ++i, ++
n, z *= x) {
309 }
else if (size() == 1
u) {
311 buffer.push_back(0.0);
317 for (const_iterator i = begin(); ++i != end(); ++
n) {
318 buffer.push_back(n * (*i));
337 for (const_iterator i = begin(); i != end(); ++i, ++
n) {
338 buffer.push_back((*i) / (
double) n);
357 for (const_iterator i = begin(); i != end(); ++i, z *= x) {
371 template<
class ...Args>
372 void __set__(
const double x,
const Args& ...args)
JPolynome_t & mul(const double factor)
Scale polynome.
Auxiliary base class for aritmetic operations of derived class types.
friend std::istream & operator>>(std::istream &in, JPolynome_t &object)
Read polynome from input.
JPolynome_t & sub(const JPolynome_t &polynome)
Subtract polynome.
JPolynome & set(const Args &...args)
Set array.
JPolynome()
Default constructor.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
void __set__(const double x, const Args &...args)
Recursive method for setting polynome.
Auxiliary data structure for floating point format specification.
JPolynome_t()
Default constructor.
JPolynome_t & add(const JPolynome_t &polynome)
Add polynome.
I/O formatting auxiliaries.
double getDerivative(const double x) const
Derivative value.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Template definition of auxiliary base class for comparison of data structures.
JPolynome(const Args &...args)
Initialise constructor.
friend std::ostream & operator<<(std::ostream &out, const JPolynome_t &object)
Write polynome to output.
double getIntegral(const double x) const
Integral value.
JPolynome_t getGradient(const double x) const
Get gradient.
void __set__() const
Termination method for setting polynome.
alias put_queue eval echo n
JPolynome getIntegral() const
get integral function.
Base class for data structures with artithmetic capabilities.
JPolynome(T __begin, T __end)
Constructor.
Polynome function object.
JPolynome getDerivative() const
Get derivative function.
JPolynome(const JPolynome_t &polynome)
Copy constructor.
double operator()(const double x) const
Function value.
double getValue(const double x) const
Function value.
bool equals(const JPolynome_t &P, const double eps=std::numeric_limits< double >::min()) const
Equality.