1 #ifndef __JMATH__JPOLYNOME__
2 #define __JMATH__JPOLYNOME__
19 namespace JPP {
using namespace JMATH; }
30 public JMath<JPolynome_t>,
48 const double eps = std::numeric_limits<double>::min())
const
50 if (this->size() == P.size()) {
52 for (const_iterator p = this->begin(), q = P.begin(); p != this->end(); ++p, ++q) {
53 if (fabs(*p - *q) > eps) {
75 while (this->size() < polynome.size()) {
79 for (
size_t i = 0; i != this->size(); ++i) {
80 (*this)[i] += polynome[i];
95 while (this->size() < polynome.size()) {
99 for (
size_t i = 0; i != this->size(); ++i) {
100 (*this)[i] -= polynome[i];
115 for (iterator i = begin(); i != end(); ++i) {
132 for (
double x; in >>
x; ) {
149 for (JPolynome_t::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
150 out <<
' ' <<
FIXED(9,3) << *i;
193 for (
T i = __begin; i != __end; ++i) {
204 template<
class ...Args>
216 template<
class ...Args>
238 for (const_iterator i = begin(); i != end(); ++i, z *=
x) {
261 for (const_iterator i = begin(); ++i != end(); ++
n, z *=
x) {
282 for (const_iterator i = begin(); i != end(); ++i, ++
n, z *=
x) {
312 }
else if (size() == 1
u) {
314 buffer.push_back(0.0);
320 for (const_iterator i = begin(); ++i != end(); ++
n) {
321 buffer.push_back(n * (*i));
340 for (const_iterator i = begin(); i != end(); ++i, ++
n) {
341 buffer.push_back((*i) / (
double) n);
360 for (const_iterator i = begin(); i != end(); ++i, z *=
x) {
374 template<
class ...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 values.
JPolynome()
Default constructor.
void __set__(const double x, const Args &...args)
Recursive method for setting values.
Auxiliary data structure for floating point format specification.
JPolynome_t()
Default constructor.
JPolynome_t & add(const JPolynome_t &polynome)
Add polynome.
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 values.
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.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
double getValue(const double x) const
Function value.
bool equals(const JPolynome_t &P, const double eps=std::numeric_limits< double >::min()) const
Equality.