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.

47 lines
794 B

15 years ago
//
// $filename
// $projectname
//
// Created by Joshua moerman on $TODAY.
// Copyright 2010 Joshua Moerman. All rights reserved.
//
#include "Logistic.hpp"
#include <algorithm>
15 years ago
15 years ago
Logistic::Logistic():
KernelBasicParameter(3),
KernelBasicVector(3) {
15 years ago
init();
15 years ago
}
Logistic::Logistic(const unsigned int dimension):
KernelBasicParameter(dimension),
KernelBasicVector(dimension) {
15 years ago
init();
15 years ago
}
void Logistic::init() {
// setting some starting values
for ( unsigned int i = 0; i < myDimension; i++ ) {
15 years ago
vectorNew[i] = vectorOld[i] = 0.5;
}
15 years ago
}
void Logistic::operator()() {
std::swap(vectorNew, vectorOld);
15 years ago
for ( unsigned int i = 0; i < myDimension; i++ ) {
vectorNew[i] = parameters[i]*vectorOld[i]*(1.0 - vectorOld[i]);
15 years ago
}
}