diff --git a/Makefile b/Makefile index 3bb09c6..bdee858 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ CXX = g++ -std=c++11 INCLUDES = -I. -I/opt/local/include # OPTFLAGS = -g -OPTFLAGS = -O2 -g +OPTFLAGS = -O2 -g -pg # OPTFLAGS = -O2 -g -DNDEBUG LDFLAGS = -L/opt/local/lib diff --git a/algebra/multivariate_laurentpoly.h b/algebra/multivariate_laurentpoly.h index 6c9d548..5fe65f6 100644 --- a/algebra/multivariate_laurentpoly.h +++ b/algebra/multivariate_laurentpoly.h @@ -548,6 +548,7 @@ multivariate_laurentpoly invert_variable(const multivariate_laurentpoly& p return result; } +<<<<<<< HEAD template multivariate_laurentpoly multivariate_laurentpoly::evaluate(T val, unsigned index) const { @@ -568,4 +569,6 @@ multivariate_laurentpoly::evaluate(T val, unsigned index) const { return res; } +======= +>>>>>>> 297e02dc05d79c4546d04aeb720680a9c231284e #endif // _KNOTKIT_ALGEBRA_MULTIVARIATE_LAURENPOLY_H diff --git a/kk.cpp b/kk.cpp index c867d9c..5e9c341 100644 --- a/kk.cpp +++ b/kk.cpp @@ -1,6 +1,10 @@ + #include +<<<<<<< HEAD #include #include +======= +>>>>>>> 297e02dc05d79c4546d04aeb720680a9c231284e #include #include @@ -399,53 +403,6 @@ void check_periodicity(std::string out_file) { } -// template -// void check_periodicity_criterion(knot_diagram kd, int prime = 5, Test_type t){ - // using monomial = multivariate_laurent_monomial; - // using polynomial = multivariate_laurentpoly; - // unsigned m = kd.num_components(); - // if(m != 1) { - // std::cerr << "Error: for now this only works for knots\n"; - // exit(EXIT_FAILURE); - // } - // polynomial khp, lee_p; - // // Adding braces so that the cube can be destroyed - // // when its not needed anymore - // { - // cube c(kd,0); - // ptr> C = c.khC; - // mod_map d = c.compute_d(1, 0, 0, 0, 0); - // for(unsigned i = 1; i <= kd.n_crossings; i++) - // d = d + c.H_i(i); - // assert (d.compose(d) == 0); - - // // computing Khovanov homology - // if(verbose) - // std::cout << "Computing Khovanov polynomial..." << "\n"; - // chain_complex_simplifier s(C, d, maybe(1), maybe(0)); - // C = s.new_C; - // d = s.new_d; - // khp = C->free_poincare_polynomial(); - - // // computing Lee homology - // if(verbose) - // std::cout << "Computing Lee polynomial..." << "\n"; - // chain_complex_simplifier s1(C, d, maybe(1), maybe(2)); - // C = s1.new_C; - // d = s1.new_d; - // assert(C->dim() == 2); - // lee_p = C->free_poincare_polynomial(); - // } - // if(verbose) { - // std::cout << "Khovanov polynomial = " - // << khp << "\n" - // << "Lee polynomial = " - // << lee_p << "\n"; - // } - // periodicity_checker pc(khp, lee_p, prime, t); - // pc(); -// } - template void compute_invariant () { @@ -887,6 +844,25 @@ main (int argc, char **argv) << ") of " << knot << " = " << std::endl << khp << std::endl; } + else if(!strcmp(invariant, "periodicity_congruence")) { + if(!strcmp(field, "Z2")) { + // first we check whether period is a prime + if(period == 2 || period == 3) { + std::cerr << "The criterion does not work for period = " << period << "\n"; + exit(EXIT_FAILURE); + } + auto result = find(primes.begin(), primes.end(), period); + if(result == primes.end()) { + std::cerr << "For now it is possible to check periodicity for primes up to 31" << "\n"; + exit(EXIT_FAILURE); + } + check_periodicity_criterion(kd,period); + } + else { + std::cerr << "error: for now this function is only defined for Z2 coefficients..." << "\n"; + exit(EXIT_FAILURE); + } + } else { if (!strcmp (field, "Z2"))