Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 200 additions & 0 deletions coxeter_group_orbits/ay4me/analysis.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
/* Copyright (c) 2015
Julian Pfeifle
julian.pfeifle@upc.edu
meike.hatzel@tu-berlin.de

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version: http://www.gnu.org/licenses/gpl.txt.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
--------------------------------------------------------------------------------
*/

#include "orbit.h"
#include <ctime>
#include <fstream>
#include <functional>

// int power(int n, int e)
// {
// int p = n;
// while (e>1)
// {
// p = p*n;
// e = e-1;
// }
// return p;
// }

int createOrbit(std::function<void (std::size_t,GeneratorList&)> generatingFunction,VectorType point)
{
Orbit generatedOrbit;
GeneratorList generators;
generatingFunction(point.size(),generators);
generatedOrbit = orbit(generators,point);
return generatedOrbit.size();
}

int createOrbit(std::function<void (GeneratorList&)> generatingFunction,VectorType point)
{
Orbit generatedOrbit;
GeneratorList generators;
generatingFunction(generators);
generatedOrbit = orbit(generators,point);
return generatedOrbit.size();
}

void analysis_out(std::ofstream& file, int coxeter_orbit, int coxeter_orbit_computed, std::string coxeter_name, double runtime)
{
file << coxeter_name;
file << "\n got: ";
file << coxeter_orbit_computed;
file << " wanted: ";
file << coxeter_orbit;
file << "\n";
file << "runtime: ";
file << runtime;
file << "\n\n";
file << std::flush;
}

int main()
{
clock_t start;
clock_t stop;
double runtime = 0.0;

std::ofstream file;
file.open ("analysis_output.txt");

//B3
assert((start = clock())!=-1);
int b3 = createOrbit(generateB, {1,2,3});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,3) * factorial(3), b3, "B3", runtime);

//D3
assert((start = clock())!=-1);
int d3 = createOrbit(generateD, {1,2,3});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,3-1) * factorial(3), d3, "D3", runtime);

//B4
assert((start = clock())!=-1);
int b4 = createOrbit(generateB, {1,2,3,4});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,4) * factorial(4), b4, "B4", runtime);

//D4
assert((start = clock())!=-1);
int d4 = createOrbit(generateD, {1,2,3,4});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,4-1) * factorial(4), d4, "D4", runtime);

//B5
assert((start = clock())!=-1);
int b5 = createOrbit(generateB, {1,2,3,4,5});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,5) * factorial(5), b5, "B5", runtime);

//D5
assert((start = clock())!=-1);
int d5 = createOrbit(generateD, {1,2,3,4,5});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,5-1) * factorial(5), d5, "D5", runtime);

//B6
assert((start = clock())!=-1);
int b6 = createOrbit(generateB, {1,2,3,4,5,6});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,6) * factorial(6), b6, "B6", runtime);

//D6
assert((start = clock())!=-1);
int d6 = createOrbit(generateD, {1,2,3,4,5,6});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,6-1) * factorial(6), d6, "D6", runtime);

//B7
assert((start = clock())!=-1);
int b7 = createOrbit(generateB, {1,2,3,4,5,6,7});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,7) * factorial(7), b7, "B7", runtime);

//D7
assert((start = clock())!=-1);
int d7 = createOrbit(generateD, {1,2,3,4,5,6,7});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,7-1) * factorial(7), d7, "D7", runtime);

//E6
assert((start = clock())!=-1);
int e6 = createOrbit(generateE6, {1,2,3,4,5,6});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, 51840, e6, "E6", runtime);

//F4
assert((start = clock())!=-1);
int f4 = createOrbit(generateF4, {1,-3,5,-4});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, 1152, f4, "F4", runtime);

//H3
assert((start = clock())!=-1);
int h3 = createOrbit(generateH3, {1,2,3});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, 120, h3, "H3", runtime);

//E7
assert((start = clock())!=-1);
int e7 = createOrbit(generateE7, {1,2,3,4,5,6,7});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, 2903040, e7, "E7", runtime);

//H4
assert((start = clock())!=-1);
int h4 = createOrbit(generateH4, {1,2,3,4});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, 14400, h4, "H4", runtime);

//B8
assert((start = clock())!=-1);
int b8 = createOrbit(generateB, {1,2,3,4,5,6,7,8});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,8) * factorial(8), b8, "B8", runtime);

//D8
assert((start = clock())!=-1);
int d8 = createOrbit(generateD, {1,2,3,4,5,6,7,8});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, power(2,8-1) * factorial(8), d8, "D8", runtime);

//E8
assert((start = clock())!=-1);
int e8 = createOrbit(generateE8, {1,2,3,4,5,6,7,8});
stop = clock();
runtime = (double) (stop - start) / CLOCKS_PER_SEC;
analysis_out(file, 696729600, e8, "E8", runtime);
}
23 changes: 23 additions & 0 deletions coxeter_group_orbits/ay4me/analysis_input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
B3

D3

B4

D4

B5

D5

B6

D6

B7

D7

B8

D8
52 changes: 52 additions & 0 deletions coxeter_group_orbits/ay4me/analysis_output_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
B3:
got: 48 wanted: 48
runtime: 0.00035

D3:
got: 24 wanted: 24
runtime: 0.00016

B4:
got: 384 wanted: 384
runtime: 0.004984

D4:
got: 192 wanted: 192
runtime: 0.002171

B5:
got: 3840 wanted: 3840
runtime: 0.044838

D5:
got: 1920 wanted: 1920
runtime: 0.02055

B6:
got: 46080 wanted: 46080
runtime: 0.81995

D6:
got: 23040 wanted: 23040
runtime: 0.391698

B7:
got: 645120 wanted: 645120
runtime: 17.2284

D7:
got: 322560 wanted: 322560
runtime: 8.28036

E6:
got: 74880 wanted: 51840
runtime: 1.5129

F4:
got: 1152 wanted: 1152
runtime: 0.008829

H3:
got: 120 wanted: 120
runtime: 0.000566

60 changes: 60 additions & 0 deletions coxeter_group_orbits/ay4me/analysis_output_15_07_08.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
B3
got: 48 wanted: 48
runtime: 0.000255

D3
got: 24 wanted: 24
runtime: 0.000101

B4
got: 384 wanted: 384
runtime: 0.002779

D4
got: 192 wanted: 192
runtime: 0.001229

B5
got: 3840 wanted: 3840
runtime: 0.046652

D5
got: 1920 wanted: 1920
runtime: 0.021272

B6
got: 46080 wanted: 46080
runtime: 0.896462

D6
got: 23040 wanted: 23040
runtime: 0.42163

B7
got: 645120 wanted: 645120
runtime: 19.8215

D7
got: 322560 wanted: 322560
runtime: 9.28447

E6
got: 51840 wanted: 51840
runtime: 1.09614

F4
got: 1152 wanted: 1152
runtime: 0.00896

H3
got: 120 wanted: 120
runtime: 0.000516

E7
got: 2903040 wanted: 2903040
runtime: 90.8309

H4
got: 14400 wanted: 14400
runtime: 0.254168

Loading