#include "Lorenz3D.hpp" #include Lorenz3D::Lorenz3D(): AttractorKernel(3, 4){ init(); } void Lorenz3D::init() { // setting some starting values for ( unsigned int i = 0; i < dimension; i++ ) { vectorNew[i] = vectorOld[i] = 1.0; } } // the main function void Lorenz3D::operator()() { std::swap(vectorNew, vectorOld); vectorNew[0] = vectorOld[0] + parameters[0] * parameters[1] * (vectorOld[1] - vectorOld[0]); vectorNew[1] = vectorOld[1] + parameters[0] * (vectorOld[0] * (parameters[2] - vectorOld[2]) - vectorOld[1]); vectorNew[2] = vectorOld[2] + parameters[0] * (vectorOld[0] * vectorOld[1] - parameters[3] * vectorOld[2]); } /* 4D: new_point[0] = point[0] + param[0] * param[1] * (point[1] - point[0]); new_point[1] = point[1] + param[0] * (point[0] * (param[2] - point[2]) - point[1] + point[3]); new_point[2] = point[2] + param[0] * (point[0] * point[1] - param[3] * point[2]); new_point[3] = point[3] - param[0] * param[4] * point[0]; break; */