diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5be2eb9 Binary files /dev/null and b/.DS_Store differ diff --git a/.project b/.project new file mode 100644 index 0000000..15c30f6 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + 2015-algorithms + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject index 9a31ca6..40e9f40 100644 --- a/.pydevproject +++ b/.pydevproject @@ -1,5 +1,5 @@ - - -Default -python 2.7 - + + +Default +python 2.7 + diff --git a/.pydevproject.bak b/.pydevproject.bak new file mode 100644 index 0000000..e72eb2a --- /dev/null +++ b/.pydevproject.bak @@ -0,0 +1,16 @@ +<<<<<<< HEAD + + + +/${PROJECT_DIR_NAME} + +python 2.7 +Default + +======= + + +Default +python 2.7 + +>>>>>>> upstream/master diff --git a/coxeter_group_orbits/.DS_Store b/coxeter_group_orbits/.DS_Store new file mode 100644 index 0000000..201a43d Binary files /dev/null and b/coxeter_group_orbits/.DS_Store differ diff --git a/coxeter_group_orbits/RobertRaoul/.DS_Store b/coxeter_group_orbits/RobertRaoul/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/coxeter_group_orbits/RobertRaoul/.DS_Store differ diff --git a/coxeter_group_orbits/RobertRaoul/Makefile.template b/coxeter_group_orbits/RobertRaoul/Makefile.template new file mode 100644 index 0000000..8437f04 --- /dev/null +++ b/coxeter_group_orbits/RobertRaoul/Makefile.template @@ -0,0 +1,18 @@ +SHELL = /bin/sh + +.SUFFIXES: +.SUFFIXES: .cc .o + +BOOSTDIR = /the/path/to/your/boost # was: /home/julian/software/boost_1_57_0 + +INCLUDEDIR = -I. -I$(BOOSTDIR) +LIBDIR = -L$(BOOSTDIR)/lib +LIBS = -lboost_unit_test_framework +CFLAGS = -Wall -Wextra -Wpedantic -std=c++1y -O3 -g +CC = g++ + +test_orbits: test_orbits.o + $(CC) $(LIBDIR) $(CFLAGS) $< $(LIBS) -o $@ + +test_orbits.o: test_orbits.cc orbit.h + $(CC) $(INCLUDEDIR) $(CFLAGS) -c $< -o $@ diff --git a/coxeter_group_orbits/RobertRaoul/generators.h b/coxeter_group_orbits/RobertRaoul/generators.h new file mode 100644 index 0000000..b45947f --- /dev/null +++ b/coxeter_group_orbits/RobertRaoul/generators.h @@ -0,0 +1,378 @@ +/* Copyright (c) 2015 + Julian Pfeifle + julian.pfeifle@upc.edu + + 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. + -------------------------------------------------------------------------------- + */ + +#ifndef __GENERATORS_H_ +#define __GENERATORS_H_ + +#include +#include +#include +#include "types.h" + +GeneratorList simple_roots_type_A (const int n) +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 ... 0 0 + 0 1 -1 0 ... 0 0 + ... + 0 0 0 0 ... 1 -1 + In particular, they lie in the plane (sum of coordinates = 0) + */ + GeneratorList R(n, n+1); + for (int i=0; i n-1, + */ + VectorType v(n); + v[n-1] = 1; + GeneratorList G = simple_roots_type_A(n-1); + G.push_back(v); + return G; +} + +GeneratorList simple_roots_type_C (const int n) +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 ... 0 0 + 0 1 -1 0 ... 0 0 + ... + 0 0 0 0 ... 1 -1 + 0 0 0 0 ... 0 2 + + The Dynkin diagram is: + + 0 ---- 1 ---- ... ---- n-2 <--(4)-- n-1, + */ + VectorType v(n); + v[n-1] = 2; + GeneratorList G = simple_roots_type_A(n-1); + G.push_back(v); + return G; +} + +GeneratorList simple_roots_type_D (const int n) +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 ... 0 0 + 0 1 -1 0 ... 0 0 + ... + 0 0 0 0 ... 1 -1 + 0 0 0 0 ... 1 1 + The indexing of the Dynkin diagram is + + n-2 + / + 0 - 1 - 2 - ... - n-3 + \ + n-1 + + */ + VectorType v(n); + v[n-2] = v[n-1] = 1; + GeneratorList G = simple_roots_type_A(n-1); + G.push_back(v); + return G; +} + +GeneratorList simple_roots_type_E6() +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 0 0 + 0 1 -1 0 0 0 + 0 0 1 -1 0 0 + 0 0 0 1 -1 0 + 0 0 0 1 1 0 + -1/2(1 1 1 1 1 -sqrt(3)) + + The indexing of the Dynkin diagram is + + + 3 + | + | + 0 ---- 1 ---- 2 ---- 4 ---- 5 + + */ + VectorType v(6); + for (int i=0; i<5; ++i) + v[i] = -0.5; + v[5] = 0.5 * sqrt(3); + GeneratorList G = simple_roots_type_D(5); + for (int i=0; i<5; ++i) + G[i].push_back(0); + G.push_back(v); + return G; +} + +GeneratorList simple_roots_type_E7() +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 0 0 0 + 0 1 -1 0 0 0 0 + 0 0 1 -1 0 0 0 + 0 0 0 1 -1 0 0 + 0 0 0 0 1 -1 0 + 0 0 0 0 1 1 0 + -1/2(1 1 1 1 1 1 -sqrt(2)) + + The indexing of the Dynkin diagram is + + + 4 + | + | + 0 ---- 1 ---- 2 ---- 3 ---- 5 ---- 6 + + */ + VectorType v(7); + for (int i=0; i<6; ++i) + v[i] = -0.5; + v[6] = 0.5 * sqrt(2); + GeneratorList G = simple_roots_type_D(6); + for (int i=0; i<6; ++i) + G[i].push_back(0); + G.push_back(v); + return G; +} + +GeneratorList simple_roots_type_E8() +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 0 0 0 0 + 0 1 -1 0 0 0 0 0 + ... + 0 0 0 0 0 1 -1 0 + 0 0 0 0 0 1 1 0 + -1/2(1 1 1 1 1 1 1 1) + + These are the coordinates in the even coordinate system. + The indexing of the Dynkin diagram is + + + 5 + | + | + 0 ---- 1 ---- 2 ---- 3 ---- 4 ---- 6 ---- 7 + + */ + VectorType v(8); + for (int i=0; i<8; ++i) + v[i] = -0.5; + GeneratorList G = simple_roots_type_D(7); + for (int i=0; i<7; ++i) + G[i].push_back(0); + G.push_back(v); + return G; +} + +GeneratorList simple_roots_type_F4() +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 0 + 0 1 -1 0 + 0 0 1 0 + -1/2 -1/2 -1/2 -1/2 + + The Dynkin diagram is: + + 0 ---- 1 --(4)--> 2 ---- 3 + */ + GeneratorList R(4,4); + R(0,0) = R(1,1) = R(2,2) = 1; + R(0,1) = R(1,2) = -1; + R(3,0) = R(3,1) = R(3,2) = R(3,3) = -0.5; + return R; +} + +GeneratorList simple_roots_type_G2() +{ + /* + Read rowwise, these simple root vectors are + 1 -1 0 + -1 2 -1 + + Notice that each row sums to zero. + + The Dynkin diagram is: + + 0 <--(6)-- 1 + */ + GeneratorList R(2,3); + R(0,0) = 1; + R(0,1) = R(1,0) = R(1,2) = -1; + R(1,1) = 2; + return R; +} + +GeneratorList simple_roots_type_H3() +{ + const NumberType tau(0.5 + 0.5 * sqrt(5)); // golden ratio + + /* + For H_3, the Dynkin diagram is + + 0 --(5)-- 1 ---- 2, + + and the simple root vectors are, + + 2 0 0 + a b -1 + 0 0 2 + + with a=-tau and b=1/tau. Notice they all have length 2. + + */ + + GeneratorList R(3,3); + R(0,0) = R(2,2) = 2; + R(1,0) = -tau; R(1,1) = tau - 1; R(1,2) = -1; + return R; +} + +GeneratorList simple_roots_type_H4() +{ + const NumberType tau(0.5 + 0.5 * sqrt(5)); // golden ratio + + /* + For H_4, the Dynkin diagram is + + 0 --(5)-- 1 ---- 2 ---- 3, + + and the simple root vectors are, according to + [John H. Stembridge, A construction of H_4 without miracles, + Discrete Comput. Geom. 22, No.3, 425-427 (1999)], + + a b b b + -1 1 0 0 + 0 -1 1 0 + 0 0 -1 1 + + with a=(1+tau)/2 and b=(1-tau)/2, so that the length of each root is sqrt{2}. + + */ + GeneratorList R(4, 4); + + R(0,0) = (1+tau) * 0.5; + R(0,1) = R(0,2) = R(0,3) = (1-tau) * 0.5; + + for (int i=0; i<3; ++i) { + R(i+1, i) = -1; + R(i+1, i+1) = 1; + } + return R; +} + + + +GeneratorList simple_roots(char type, int dim) +{ + switch(type) { + case 'a': + case 'A': + return simple_roots_type_A(dim); + + case 'b': + case 'B': + return simple_roots_type_B(dim); + + case 'c': + case 'C': + return simple_roots_type_C(dim); + + case 'd': + case 'D': + return simple_roots_type_D(dim); + + case 'e': + case 'E': + switch(dim) { + case 6: + return simple_roots_type_E6(); + case 7: + return simple_roots_type_E7(); + case 8: + return simple_roots_type_E8(); + default: + throw InvalidGroupException(); + } + + case 'f': + case 'F': + switch(dim) { + case 4: + return simple_roots_type_F4(); + default: + throw InvalidGroupException(); + } + + case 'g': + case 'G': + switch(dim) { + case 2: + return simple_roots_type_G2(); + default: + throw InvalidGroupException(); + } + + case 'h': + case 'H': + switch(dim) { + case 3: + return simple_roots_type_H3(); + case 4: + return simple_roots_type_H4(); + default: + throw InvalidGroupException(); + } + + default: + throw NotImplementedException(); + } +} + +#endif // __GENERATORS_H_ + +// Local Variables: +// mode:C++ +// c-basic-offset:3 +// indent-tabs-mode:nil +// End: diff --git a/coxeter_group_orbits/RobertRaoul/main.cpp b/coxeter_group_orbits/RobertRaoul/main.cpp new file mode 100644 index 0000000..76d9b8c --- /dev/null +++ b/coxeter_group_orbits/RobertRaoul/main.cpp @@ -0,0 +1,66 @@ +// +// main.cpp +// orbit_h +// +// Created by Robert Loewe on 07.06.15. +// Copyright (c) 2015 Robert Loewe. All rights reserved. +// + + +#include +#include +#include +#include "orbit.h" + +using namespace std; + +string printVector(VectorType v){ + std::string output; + for(int i = 0; i < v.size(); i++){ + std::ostringstream os; + os << v[i]; + std::string str = os.str(); + output.append(str); + output.append(" "); + } + return output; +} + +int main(){ + + + + VectorType v = {/*0.3, -0.123, 17.9, 42.3,*/0., 0., 0., 0.}; + + GeneratorList B2 = createMatrixH4(); + for (int i = 0; i < B2.size(); i++){ + cout << printVector(B2[i]) << endl; + } + cout << B2.size() << endl; + + timestamp_t t0 = get_timestamp(); + + Orbit solution = orbit(B2, v); + + timestamp_t t1 = get_timestamp(); + + cout << "size: " << solution.size() << endl; + cout << "time: " << (t1 - t0) / 1000000.0L << "secs" << endl; + cout << "time: " << (t1 - t0) / 60000000.0L << "mins" << endl; + + // for(auto s : solution){ + // cout << printVector(s) << endl; + // } + + /* + VectorType normal = { 16, -1, -0.5}; + VectorType v = {1, 2, 3}; + VectorType vector = reflection(normal, v); + cout << printVector(vector) << endl; + cout << printVector(reflection(normal, vector)) << endl; + + */ + return 0; +} + + diff --git a/coxeter_group_orbits/RobertRaoul/orbit.h b/coxeter_group_orbits/RobertRaoul/orbit.h new file mode 100644 index 0000000..d69793d --- /dev/null +++ b/coxeter_group_orbits/RobertRaoul/orbit.h @@ -0,0 +1,345 @@ +// +// orbit.h +// Coxeter_Orbit +// +// Created by Robert Loewe on 07.06.15. +// Copyright (c) 2015 Robert Loewe. All rights reserved. +// +/* Copyright (c) 2015 + Julian Pfeifle + julian.pfeifle@upc.edu + + 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. + -------------------------------------------------------------------------------- + */ + + +#ifndef Coxeter_Orbit_orbit_h +#define Coxeter_Orbit_orbit_h + + +#include +#include +#include +#include + +typedef unsigned long long timestamp_t; +static timestamp_t +get_timestamp (){ + struct timeval now; + gettimeofday (&now, NULL); + return now.tv_usec + (timestamp_t)now.tv_sec * 1000000; +} + + + + +class NotImplementedException : public std::exception {}; + + +typedef double E; + +const static E epsilon = 0.0001; + +class coxeterVector : public std::vector{ + +public: + + coxeterVector(){} + + explicit coxeterVector(int dim): std::vector(dim){} + + template + coxeterVector(std::initializer_list init) + : std::vector(init) {} + + + + bool operator==(const coxeterVector& rhs) const + { + coxeterVector a(*this); + for ( int i = 0; i < rhs.size() ; i++) { + if ( a[i] < rhs[i] - epsilon || a[i] > rhs[i] + epsilon ) + return false; + } + return true; + } + + bool operator < (const coxeterVector& rhs) const + { + for ( int i = 0; i < rhs.size() ; i++) { + if ( this->at(i) < rhs[i] - epsilon ) { + return true; + } else { + if ( this->at(i) > rhs[i] + epsilon ) + return false; + } + } + return false; + } + + friend std::ostream& operator << (std::ostream& os, const coxeterVector& v) + { + for (const auto& x : v) + os << x << " "; + return os; + } + + + +}; + + +typedef double NumberType; +typedef coxeterVector VectorType; +typedef std::vector GeneratorList; +typedef std::set Orbit; + + +std::set orbitSet; + + +VectorType vectorAddition(VectorType v1, VectorType v2){ + VectorType v = VectorType(v1.size()); + for(int i = 0; i < v1.size(); i++){ + v[i] = v1[i] + v2[i]; + } + return v; +} + +VectorType scalarMultiplication(double a, VectorType v1){ + VectorType v = VectorType(v1.size()); + for(int i = 0; i < v1.size(); i++){ + v[i] = a*v1[i]; + } + return v; +} + +double scalarProduct(VectorType v1, VectorType v2){ + double sum = 0; + for(int i = 0; i < v1.size(); i++){ + sum += v1[i]*v2[i]; + } + return sum; +} + +VectorType reflection(VectorType normal, VectorType vector){ + VectorType reflected = VectorType(vector.size()); + double rs = (-2)*scalarProduct(vector, normal)/scalarProduct(normal, normal); + reflected = vectorAddition(vector, scalarMultiplication(rs,normal)); + return reflected; +} + +GeneratorList createMatrixB(int dim){ + GeneratorList Matrix; + for (int i = 0; i < dim-1; i++){ + VectorType normal (dim); + normal[i] = 1.; + normal[i+1]= -1.; + Matrix.push_back(normal); + } + VectorType normal (dim); + normal[dim-1] = 1.; + Matrix.push_back(normal); + return Matrix; +} + +GeneratorList createMatrixA(int dim){ + GeneratorList Matrix; + for (int i = 0; i < dim; i++){ + VectorType normal (dim+1); + normal[i] = 1.; + normal[i+1]= -1.; + Matrix.push_back(normal); + } + return Matrix; +} + +GeneratorList createMatrixE(int dim) +{ + GeneratorList Matrix; + for ( int i = 0 ; i < dim-2 ; i++ ) { + VectorType vec(dim); + vec[i]=1; + vec[i+1]=-1; + Matrix.push_back(vec); + } + if (dim == 6) + Matrix.push_back({-0.5,-0.5,-0.5,-0.5,-0.5,sqrt(3)/2.}); + if (dim == 7) + Matrix.push_back({-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,sqrt(2)/2.}); + if (dim == 8) + Matrix.push_back({-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5}); + VectorType vec1 (dim); vec1[dim-3] = 1; vec1[dim-2] = 1; + Matrix.push_back(vec1); + return Matrix; +} + + +GeneratorList createMatrixF(){ + GeneratorList Matrix={ {0.5,-0.5,-0.5,-0.5} , + {0.,1.,-1.,0.}, + {0.,0.,1.,-1.}, + {0.,0.,0.,1.} + }; + return Matrix; +} + +GeneratorList createMatrixG(){ + GeneratorList Matrix= { {0.,1.,-1.}, + {1.,-2.,1.} }; + return Matrix; +} + +GeneratorList createMatrixI(int dim) +{ + GeneratorList Matrix {{1., 0.},{0.,1.}}; + double cosine = cos(M_PI/dim); + Matrix[1][0]= cosine/sqrt(1.0-pow(cosine, 2)); + return Matrix; +} + +GeneratorList createMatrixD(int dim) + { + VectorType v(dim); + v[dim - 2] = v[dim - 1] = 1; + GeneratorList list = createMatrixA(dim - 1); + std::cout << list.back() << '\n'; + list.push_back(v); + return list; + } + + +GeneratorList createMatrixH3() +{ + const NumberType tau(0.5 + 0.5 * sqrt(5)); + GeneratorList Matrix = {{2., 0., 0.}, + {-tau, 1./tau , -1.}, + {0., 0., 2.}}; + return Matrix; +} + + + +GeneratorList createMatrixH4() +{ + const NumberType tau(0.5 + 0.5 * sqrt(5)); + std::cout << "bl2" << std::endl; + GeneratorList Matrix = {{tau, 1./tau, 1./tau, 1./tau}, + {-1., 1., 0., 0.}, + {0., -1., 1., 0.}, + {0., 0., -1., 1.}}; + return Matrix; + +} + + + + +GeneratorList simple_roots(char type, int dim) +{ + switch(type) { + case 'A': + if (dim > 0) + return createMatrixA(dim); + else throw new NotImplementedException(); + case 'B': + if (dim > 0) + return createMatrixB(dim); + else throw new NotImplementedException(); + case 'C': + if (dim > 0) + return createMatrixB(dim); + else throw new NotImplementedException(); + case 'D': + if (dim > 4) throw new NotImplementedException(); + else throw new NotImplementedException(); + case 'E': + if (dim == 6) + return createMatrixE(dim); + else if (dim == 7) + return createMatrixE(dim); + else if (dim == 8) + return createMatrixE(dim); + else throw new NotImplementedException(); + case 'F': + if (dim == 4) return createMatrixF(); + throw new NotImplementedException(); + case 'G': + if (dim == 2) return createMatrixG(); + throw new NotImplementedException(); + case 'H': + if (dim == 2) throw new NotImplementedException(); + if (dim == 3) throw new NotImplementedException(); + if (dim == 4) throw new NotImplementedException(); + else throw new NotImplementedException(); + case 'I': + if (dim < 1) throw new NotImplementedException(); + else return createMatrixI(dim); + default: + throw new NotImplementedException(); + } +} + + +Orbit orbit(const GeneratorList& generators, const VectorType& v ) +{ + Orbit orb; + Orbit tmpPoints {v}; + while (tmpPoints.empty() == false ){ + Orbit::iterator it = tmpPoints.begin(); + VectorType vec = *it; + tmpPoints.erase(it); + if ( std::get<1>(orb.insert(vec)) ){ + //std::cout << vec << '\n'; + for (int i = 0 ; i < generators.size() ; i++) + tmpPoints.insert(reflection(generators[i], vec)); + } // endif + } // endwhile + return orb; +} + + + +/*void recursion(const GeneratorList& generators, VectorType v, int counter){ + for(int i = 0; i < generators.size(); i++){ + //std:: cout << i << std::endl; + if (orbitSet.find(reflection(generators[i], v)) == orbitSet.end()) { //orbitSet contains reflection(generators[i], v) + orbitSet.insert(reflection(generators[i], v)); + + counter += 1; + //std::cout << "counter " << counter << std::endl; + recursion(generators, reflection(generators[i], v), counter); + } + } +} + +Orbit orbit(const GeneratorList& generators, const VectorType& v) +{ + orbitSet.clear(); + orbitSet.insert(v); + recursion(generators,v,0); + return orbitSet; +}*/ + + +#endif // __ORBIT_H_ + +// Local Variables: +// mode:C++ +// c-basic-offset:3 +// indent-tabs-mode:nil +// End: + + + + + diff --git a/coxeter_group_orbits/RobertRaoul/stl_wrappers.h b/coxeter_group_orbits/RobertRaoul/stl_wrappers.h new file mode 100644 index 0000000..ad29de5 --- /dev/null +++ b/coxeter_group_orbits/RobertRaoul/stl_wrappers.h @@ -0,0 +1,83 @@ +/* Copyright (c) 2015 + Julian Pfeifle + julian.pfeifle@upc.edu + + 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. + -------------------------------------------------------------------------------- + */ + +//#ifndef __STL_WRAPPERS_H__ +//#define __STL_WRAPPERS_H__ + +#include +#include +#include +#include + + +template +inline std::ostream& +operator<<(std::ostream& wrapped, const std::array& item) +{ + wrapped << '{'; + bool first = true; + for (auto const& element : item) { + wrapped << (!first ? "," : "") << element; + first = false; + } + return wrapped << '}'; +} + + +// teach Boost.Test how to print std::vector +template +inline std::ostream& +operator<<(std::ostream& wrapped, std::vector const& item) +{ + wrapped << '{'; + bool first = true; + for (auto const& element : item) { + wrapped << (!first ? "," : "") << element; + first = false; + } + return wrapped << '}'; +} + +template +inline std::ostream& +operator<<(std::ostream& wrapped, std::pair const& item) +{ + return wrapped << '<' << item.first << ',' << item.second << '>'; +} + +template +inline std::ostream& +operator<<(std::ostream& wrapped, std::map const& item) +{ + wrapped << '{'; + bool first = true; + for (auto const& element : item) { + wrapped << (!first ? "," : "") << element; + first = false; + } + return wrapped << '}'; +} + + +//#endif // __STL_WRAPPERS_H__ + + +// Local Variables: +// mode:C++ +// c-basic-offset:3 +// indent-tabs-mode:nil +// End: + diff --git a/coxeter_group_orbits/RobertRaoul/types.h b/coxeter_group_orbits/RobertRaoul/types.h new file mode 100644 index 0000000..0b56f98 --- /dev/null +++ b/coxeter_group_orbits/RobertRaoul/types.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2015 + Julian Pfeifle + julian.pfeifle@upc.edu + + 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. + -------------------------------------------------------------------------------- + */ + +#ifndef __TYPES_H_ +#define __TYPES_H_ + +#include +#include + +class NotImplementedException : public std::exception {}; +class InvalidGroupException : public std::exception {}; + +typedef long double NumberType; // this might work +typedef std::vector VectorType; +typedef std::set Orbit; + +class GeneratorList : public std::vector { +public: + GeneratorList(int r, int c) + : std::vector(r) + { + for (int i=0; i