My old project for strange attractors
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

54 lines
1.2 KiB

#ifndef ATTRACTORKERNEL_HPP
#define ATTRACTORKERNEL_HPP
/*
15 years ago
ABC
*/
class AttractorKernel {
15 years ago
private:
void allocate();
void dealloc();
15 years ago
protected:
// biggest type first, this will reduce sizeof(AttractorKernel)
// size is now 40 (when the unsigned int are in front, it was 48)
15 years ago
double * parameters;
double * vectorNew;
double * vectorOld;
unsigned int numberOfParameters;
unsigned int dimension;
// stuff used by subclasses
AttractorKernel(const unsigned int dimension, const unsigned int numberOfParameters);
void reallocParameters(const unsigned int numberOfParameters);
15 years ago
public:
// parameters are stored in a array of doubles
15 years ago
double & operator[](const unsigned int index);
double const & operator[](const unsigned int index) const;
unsigned int getNumberOfParameters() const;
15 years ago
// iterate his formula, implemented by subclasses
virtual void operator()() = 0;
15 years ago
// getter functions for teh resulta (can't be used as setters)
double const * vector() const;
// double const * vector() const{
// return vectorNew;
// }
15 years ago
double const * previousVector() const;
unsigned int getDimension() const;
15 years ago
// dtor, should be virtual for subclasses to be deleted
virtual ~AttractorKernel();
};
#endif // ATTRACTORKERNEL_HPP