You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
#ifndef POLYNOMIAL_HPP
|
|
#define POLYNOMIAL_HPP
|
|
|
|
#include <cassert>
|
|
#include <iostream>
|
|
|
|
#include "../AttractorKernel.hpp"
|
|
|
|
class Polynomial : public AttractorKernel {
|
|
|
|
double * myParameters;
|
|
|
|
double * vectorNew;
|
|
double * vectorOld;
|
|
|
|
unsigned int dimension;
|
|
unsigned int orde;
|
|
unsigned int numberOfParameters;
|
|
|
|
void init();
|
|
void calculateNumberOfParameters();
|
|
void recur(unsigned int curr_dimension, unsigned int prev_i, unsigned int n, unsigned int& m, double prev_product=1.0);
|
|
|
|
public:
|
|
|
|
Polynomial();
|
|
Polynomial(const unsigned int dimensions, const unsigned int orde);
|
|
|
|
// parameters are stored in a array of doubles
|
|
// if you want to use other types, use the properties
|
|
virtual double& parameter(const unsigned int index);
|
|
virtual double*& parameters();
|
|
|
|
virtual unsigned int getNumberOfParameters();
|
|
|
|
// get properties of the attractor
|
|
// such as the dimension
|
|
// you should delete the void pointer if you used it
|
|
virtual void * getProperty(const string identifier);
|
|
virtual void setProperty(const string identifier, const void * value);
|
|
|
|
// iterate his formula
|
|
// vector pointers will be swapped! so new remains new and old remains old
|
|
virtual void iterate();
|
|
|
|
// getter functions for teh resulta
|
|
virtual double * & vector();
|
|
virtual double * & previousVector();
|
|
|
|
};
|
|
|
|
#endif // POLYNOMIAL_HPP
|
|
|
|
|