some stuff
This commit is contained in:
parent
3ff9821b4a
commit
f77daec80f
5 changed files with 43 additions and 41 deletions
|
@ -44,6 +44,9 @@
|
|||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="attractors/testAttractor.stf" />
|
||||
<Unit filename="attractors/testLorenz.stf" />
|
||||
<Unit filename="attractors/testPolynomial.stf" />
|
||||
<Unit filename="attractors/testUnravel.stf" />
|
||||
<Unit filename="kernels/Logistic.cpp" />
|
||||
<Unit filename="kernels/Logistic.hpp" />
|
||||
<Unit filename="kernels/Lorenz3D.cpp" />
|
||||
|
|
|
@ -118,7 +118,7 @@ void Canvas::output_file(const char * filename){
|
|||
if ( max_int[i] < int_array[j+i*width*height] ) {
|
||||
max_int[i] = int_array[j+i*width*height];
|
||||
}
|
||||
if ( int_array[j+i*width*height] ) {
|
||||
if ( int_array[j+i*width*height] > 5 ) {
|
||||
cumulative += int_array[j+i*width*height];
|
||||
n++;
|
||||
}
|
||||
|
@ -138,14 +138,14 @@ void Canvas::output_file(const char * filename){
|
|||
}
|
||||
}
|
||||
|
||||
const double vibrancy = v;
|
||||
const double vibrancy = 2.0;
|
||||
double averagePower = 0;
|
||||
for ( unsigned int i = 0; i < num_colors; i++ ) {
|
||||
averagePower += power[i];
|
||||
}
|
||||
averagePower /= num_colors;
|
||||
averagePower /= (double)num_colors;
|
||||
for ( unsigned int i = 0; i < num_colors; i++ ) {
|
||||
power[i] = vibrancy*power[i] + (1.0 - vibrancy*averagePower);
|
||||
power[i] = vibrancy*power[i] + (1.0 - vibrancy)*averagePower;
|
||||
}
|
||||
|
||||
pngwriter * pngFile = new pngwriter(width, height, 0.0, filename);
|
||||
|
|
|
@ -12,8 +12,8 @@ attractor: {
|
|||
|
||||
parameters: the variables of the attractortype
|
||||
{
|
||||
:"0.001"
|
||||
:"4.2"
|
||||
:"0.01"
|
||||
:"4.002"
|
||||
:"28"
|
||||
:"0.3"
|
||||
}
|
||||
|
|
|
@ -13,37 +13,36 @@ attractor: {
|
|||
|
||||
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"
|
||||
:"0.862"
|
||||
:"-1.147"
|
||||
:"0.01"
|
||||
:"0.241"
|
||||
:"-0.85"
|
||||
:"-0.174"
|
||||
:"1.193"
|
||||
:"-0.572"
|
||||
:"0.772"
|
||||
:"0.147"
|
||||
:"-0.049"
|
||||
:"0.427"
|
||||
:"-0.103"
|
||||
:"-0.402"
|
||||
:"1.13"
|
||||
:"0.859"
|
||||
:"-0.642"
|
||||
:"-0.649"
|
||||
:"-1.074"
|
||||
:"-0.636"
|
||||
:"-0.706"
|
||||
:"0.315"
|
||||
:"-0.125"
|
||||
:"1.193"
|
||||
:"0.533"
|
||||
:"-0.091"
|
||||
:"0.778"
|
||||
:"-1.199"
|
||||
:"-0.112"
|
||||
:"0.025"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
main.cpp
8
main.cpp
|
@ -11,7 +11,7 @@ int main(int argc, char *argv[]) {
|
|||
double totalTime, totalIterations;
|
||||
|
||||
// initialising stuff
|
||||
Attractor myAttractor("attractors/testLorenz.stf");
|
||||
Attractor myAttractor("attractors/testPolynomial.stf");
|
||||
|
||||
Projector projection;
|
||||
Canvas canvas(800, 800, 3);
|
||||
|
@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
|
|||
projection.output();
|
||||
|
||||
// iterating 4 evah
|
||||
unsigned int iterations = 200000; // twintig duizend
|
||||
unsigned int iterations = 2000; // tweeduizend
|
||||
start = clock();
|
||||
for ( unsigned int j = 1; j <= 100; j++ ) {
|
||||
for ( unsigned int i = 0; i <= iterations; i++ ) {
|
||||
|
@ -39,7 +39,7 @@ int main(int argc, char *argv[]) {
|
|||
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)) );
|
||||
printf("average iterations per second: %f\n\n", totalIterations/((double)(end-start)/(double)(CLOCKS_PER_SEC)) );
|
||||
|
||||
// saving output
|
||||
start = clock();
|
||||
|
@ -48,7 +48,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
totalTime = ((double)(end-start)/(double)(CLOCKS_PER_SEC));
|
||||
|
||||
printf("\ntotal clock time for writing png: %f\n", totalTime );
|
||||
printf("total clock time for writing png: %f\n", totalTime );
|
||||
|
||||
/*if ( argc <= 2 ) {
|
||||
cout << endl << "nothing to do..." << endl;
|
||||
|
|
Reference in a new issue