benchmarking made possible
This commit is contained in:
parent
03db3ad5fa
commit
3ff9821b4a
5 changed files with 317 additions and 11 deletions
|
@ -4,21 +4,46 @@ output: "png"
|
||||||
|
|
||||||
attractor: {
|
attractor: {
|
||||||
type: lorenz/unravel/polynomial/polynomial a/logistic
|
type: lorenz/unravel/polynomial/polynomial a/logistic
|
||||||
=> "unravel"
|
=> "polynomial"
|
||||||
dimensions: most types only support 3D
|
dimensions: most types only support 3D
|
||||||
=> "3"
|
=> "3"
|
||||||
|
orde: "2"
|
||||||
|
|
||||||
iterations: "1000000"
|
iterations: "1000000"
|
||||||
|
|
||||||
parameters: the variables of the attractortype
|
parameters: the variables of the attractortype
|
||||||
{
|
{
|
||||||
:"-0.78"
|
:"0.148"
|
||||||
:"2.042"
|
:"0"
|
||||||
:"1.22"
|
:"0"
|
||||||
:"-1.267"
|
:"0"
|
||||||
:"1.37"
|
:"0"
|
||||||
:"2.3"
|
:"0"
|
||||||
:"-2.195"
|
:"0.119"
|
||||||
|
:"0.424"
|
||||||
|
:"1.100"
|
||||||
|
:"0"
|
||||||
|
:"0.125"
|
||||||
|
:"0.199"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"-0.643"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"-1.120"
|
||||||
|
:"-1.188"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"-0.864"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
77
attractors/testLorenz.stf
Normal file
77
attractors/testLorenz.stf
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
|
||||||
|
input: "attractor"
|
||||||
|
output: "png"
|
||||||
|
|
||||||
|
attractor: {
|
||||||
|
type: lorenz/unravel/polynomial/polynomial a/logistic
|
||||||
|
=> "Lorenz"
|
||||||
|
dimensions: most types only support 3D
|
||||||
|
=> "3"
|
||||||
|
|
||||||
|
iterations: "1000000"
|
||||||
|
|
||||||
|
parameters: the variables of the attractortype
|
||||||
|
{
|
||||||
|
:"0.001"
|
||||||
|
:"4.2"
|
||||||
|
:"28"
|
||||||
|
:"0.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
projector: {
|
||||||
|
type: auto center/lineair map/spherical/color projector
|
||||||
|
=> "lineair map"
|
||||||
|
|
||||||
|
domain: input of the projector, normally the attractor, but can also be a projector
|
||||||
|
=> "attractor"
|
||||||
|
domainDimension: redundant, because it knows from domain
|
||||||
|
=> "3"
|
||||||
|
|
||||||
|
codomain: output of the Projector, normally a canvas, but can also be another projector
|
||||||
|
=> "canvas"
|
||||||
|
codomainDimensions: redundant, because it knows from codomain
|
||||||
|
=> "2"
|
||||||
|
|
||||||
|
matrix: describing the lineair map
|
||||||
|
{
|
||||||
|
:{ :"1" :"0" :"0" }
|
||||||
|
:{ :"0" :"1" :"0" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas: {
|
||||||
|
type: 2D image/2D slices/3D volume/2D animation
|
||||||
|
=> "2D image"
|
||||||
|
output: canvas/png/jpg/zip/mpg
|
||||||
|
=> "png"
|
||||||
|
|
||||||
|
width: "6400"
|
||||||
|
height: "6400"
|
||||||
|
colors: "3"
|
||||||
|
|
||||||
|
imageConversion: description how to show the abstract canvas classe
|
||||||
|
{
|
||||||
|
colorMatrix: desciribing lineair map from canvas colors to RGB colorspace
|
||||||
|
{
|
||||||
|
:{ :"1" :"0" :"0" }
|
||||||
|
:{ :"0" :"1" :"0" }
|
||||||
|
:{ :"0" :"0" :"1" }
|
||||||
|
}
|
||||||
|
|
||||||
|
vibrancy: "0"
|
||||||
|
gamma: "-2.5"
|
||||||
|
brightness: "3"
|
||||||
|
}
|
||||||
|
|
||||||
|
pngFile: png options
|
||||||
|
{
|
||||||
|
fileName: leave empty to autogenerate filename
|
||||||
|
=> ""
|
||||||
|
|
||||||
|
compression: "9"
|
||||||
|
author: "Joshua Moerman"
|
||||||
|
title: "Unravel"
|
||||||
|
description: "A unravel-type attractor made with AwesomeAttractor"
|
||||||
|
}
|
||||||
|
}
|
105
attractors/testPolynomial.stf
Normal file
105
attractors/testPolynomial.stf
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
|
||||||
|
input: "attractor"
|
||||||
|
output: "png"
|
||||||
|
|
||||||
|
attractor: {
|
||||||
|
type: lorenz/unravel/polynomial/polynomial a/logistic
|
||||||
|
=> "polynomial"
|
||||||
|
dimensions: most types only support 3D
|
||||||
|
=> "3"
|
||||||
|
orde: "2"
|
||||||
|
|
||||||
|
iterations: "1000000"
|
||||||
|
|
||||||
|
parameters: the variables of the attractortype
|
||||||
|
{
|
||||||
|
:"0.148"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"-0.001"
|
||||||
|
:"0.119"
|
||||||
|
:"0.424"
|
||||||
|
:"1.100"
|
||||||
|
:"0"
|
||||||
|
:"0.125"
|
||||||
|
:"0.199"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"-0.643"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"-1.1201"
|
||||||
|
:"-1.1881"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0.001"
|
||||||
|
:"-0.8639"
|
||||||
|
:"-0.001"
|
||||||
|
:"0.001"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
:"0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
projector: {
|
||||||
|
type: auto center/lineair map/spherical/color projector
|
||||||
|
=> "lineair map"
|
||||||
|
|
||||||
|
domain: input of the projector, normally the attractor, but can also be a projector
|
||||||
|
=> "attractor"
|
||||||
|
domainDimension: redundant, because it knows from domain
|
||||||
|
=> "3"
|
||||||
|
|
||||||
|
codomain: output of the Projector, normally a canvas, but can also be another projector
|
||||||
|
=> "canvas"
|
||||||
|
codomainDimensions: redundant, because it knows from codomain
|
||||||
|
=> "2"
|
||||||
|
|
||||||
|
matrix: describing the lineair map
|
||||||
|
{
|
||||||
|
:{ :"1" :"0" :"0" }
|
||||||
|
:{ :"0" :"1" :"0" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas: {
|
||||||
|
type: 2D image/2D slices/3D volume/2D animation
|
||||||
|
=> "2D image"
|
||||||
|
output: canvas/png/jpg/zip/mpg
|
||||||
|
=> "png"
|
||||||
|
|
||||||
|
width: "6400"
|
||||||
|
height: "6400"
|
||||||
|
colors: "3"
|
||||||
|
|
||||||
|
imageConversion: description how to show the abstract canvas classe
|
||||||
|
{
|
||||||
|
colorMatrix: desciribing lineair map from canvas colors to RGB colorspace
|
||||||
|
{
|
||||||
|
:{ :"1" :"0" :"0" }
|
||||||
|
:{ :"0" :"1" :"0" }
|
||||||
|
:{ :"0" :"0" :"1" }
|
||||||
|
}
|
||||||
|
|
||||||
|
vibrancy: "0"
|
||||||
|
gamma: "-2.5"
|
||||||
|
brightness: "3"
|
||||||
|
}
|
||||||
|
|
||||||
|
pngFile: png options
|
||||||
|
{
|
||||||
|
fileName: leave empty to autogenerate filename
|
||||||
|
=> ""
|
||||||
|
|
||||||
|
compression: "9"
|
||||||
|
author: "Joshua Moerman"
|
||||||
|
title: "Unravel"
|
||||||
|
description: "A unravel-type attractor made with AwesomeAttractor"
|
||||||
|
}
|
||||||
|
}
|
80
attractors/testUnravel.stf
Normal file
80
attractors/testUnravel.stf
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
|
||||||
|
input: "attractor"
|
||||||
|
output: "png"
|
||||||
|
|
||||||
|
attractor: {
|
||||||
|
type: lorenz/unravel/polynomial/polynomial a/logistic
|
||||||
|
=> "unravel"
|
||||||
|
dimensions: most types only support 3D
|
||||||
|
=> "3"
|
||||||
|
|
||||||
|
iterations: "1000000"
|
||||||
|
|
||||||
|
parameters: the variables of the attractortype
|
||||||
|
{
|
||||||
|
:"-0.78"
|
||||||
|
:"2.042"
|
||||||
|
:"1.22"
|
||||||
|
:"-1.267"
|
||||||
|
:"1.37"
|
||||||
|
:"2.3"
|
||||||
|
:"-2.195"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
projector: {
|
||||||
|
type: auto center/lineair map/spherical/color projector
|
||||||
|
=> "lineair map"
|
||||||
|
|
||||||
|
domain: input of the projector, normally the attractor, but can also be a projector
|
||||||
|
=> "attractor"
|
||||||
|
domainDimension: redundant, because it knows from domain
|
||||||
|
=> "3"
|
||||||
|
|
||||||
|
codomain: output of the Projector, normally a canvas, but can also be another projector
|
||||||
|
=> "canvas"
|
||||||
|
codomainDimensions: redundant, because it knows from codomain
|
||||||
|
=> "2"
|
||||||
|
|
||||||
|
matrix: describing the lineair map
|
||||||
|
{
|
||||||
|
:{ :"1" :"0" :"0" }
|
||||||
|
:{ :"0" :"1" :"0" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas: {
|
||||||
|
type: 2D image/2D slices/3D volume/2D animation
|
||||||
|
=> "2D image"
|
||||||
|
output: canvas/png/jpg/zip/mpg
|
||||||
|
=> "png"
|
||||||
|
|
||||||
|
width: "6400"
|
||||||
|
height: "6400"
|
||||||
|
colors: "3"
|
||||||
|
|
||||||
|
imageConversion: description how to show the abstract canvas classe
|
||||||
|
{
|
||||||
|
colorMatrix: desciribing lineair map from canvas colors to RGB colorspace
|
||||||
|
{
|
||||||
|
:{ :"1" :"0" :"0" }
|
||||||
|
:{ :"0" :"1" :"0" }
|
||||||
|
:{ :"0" :"0" :"1" }
|
||||||
|
}
|
||||||
|
|
||||||
|
vibrancy: "0"
|
||||||
|
gamma: "-2.5"
|
||||||
|
brightness: "3"
|
||||||
|
}
|
||||||
|
|
||||||
|
pngFile: png options
|
||||||
|
{
|
||||||
|
fileName: leave empty to autogenerate filename
|
||||||
|
=> ""
|
||||||
|
|
||||||
|
compression: "9"
|
||||||
|
author: "Joshua Moerman"
|
||||||
|
title: "Unravel"
|
||||||
|
description: "A unravel-type attractor made with AwesomeAttractor"
|
||||||
|
}
|
||||||
|
}
|
25
main.cpp
25
main.cpp
|
@ -1,4 +1,5 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <ctime>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "Attractor.hpp"
|
#include "Attractor.hpp"
|
||||||
|
@ -6,11 +7,14 @@ using namespace std;
|
||||||
#include "Projector.hpp"
|
#include "Projector.hpp"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
clock_t start, end;
|
||||||
|
double totalTime, totalIterations;
|
||||||
|
|
||||||
Attractor myAttractor("attractors/testAttractor.stf");
|
// initialising stuff
|
||||||
|
Attractor myAttractor("attractors/testLorenz.stf");
|
||||||
|
|
||||||
Projector projection;
|
Projector projection;
|
||||||
Canvas canvas(6400, 6400, 3);
|
Canvas canvas(800, 800, 3);
|
||||||
projection.canvas = &canvas;
|
projection.canvas = &canvas;
|
||||||
|
|
||||||
myAttractor.projectors.push_back(&projection);
|
myAttractor.projectors.push_back(&projection);
|
||||||
|
@ -18,7 +22,9 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
projection.output();
|
projection.output();
|
||||||
|
|
||||||
unsigned int iterations = 2000000000; // twee miljard
|
// iterating 4 evah
|
||||||
|
unsigned int iterations = 200000; // twintig duizend
|
||||||
|
start = clock();
|
||||||
for ( unsigned int j = 1; j <= 100; j++ ) {
|
for ( unsigned int j = 1; j <= 100; j++ ) {
|
||||||
for ( unsigned int i = 0; i <= iterations; i++ ) {
|
for ( unsigned int i = 0; i <= iterations; i++ ) {
|
||||||
myAttractor.iterate();
|
myAttractor.iterate();
|
||||||
|
@ -28,8 +34,21 @@ int main(int argc, char *argv[]) {
|
||||||
myAttractor.output();
|
myAttractor.output();
|
||||||
cout << j << "% done" << endl;
|
cout << j << "% done" << endl;
|
||||||
}
|
}
|
||||||
|
end = clock();
|
||||||
|
|
||||||
|
totalIterations = 100.0*iterations;
|
||||||
|
totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC));
|
||||||
|
printf("\ntotal clock time: %f\n", totalTime );
|
||||||
|
printf("average iterations per second: %f\n", totalIterations/((double)(end-start)/(double)(CLOCKS_PER_SEC)) );
|
||||||
|
|
||||||
|
// saving output
|
||||||
|
start = clock();
|
||||||
canvas.output_file();
|
canvas.output_file();
|
||||||
|
end = clock();
|
||||||
|
|
||||||
|
totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC));
|
||||||
|
|
||||||
|
printf("\ntotal clock time for writing png: %f\n", totalTime );
|
||||||
|
|
||||||
/*if ( argc <= 2 ) {
|
/*if ( argc <= 2 ) {
|
||||||
cout << endl << "nothing to do..." << endl;
|
cout << endl << "nothing to do..." << endl;
|
||||||
|
|
Reference in a new issue