diff --git a/Makefile b/Makefile index d187912..a9388df 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ CXX = clang++ -fno-color-diagnostics --stdlib=libc++ --std=c++11 INCLUDES = -I/opt/local/include -I. -OPTFLAGS = -g -# OPTFLAGS = -O2 -g +# OPTFLAGS = -g +OPTFLAGS = -O2 -g # OPTFLAGS = -O2 -DNDEBUG LDFLAGS = -L/opt/local/lib diff --git a/main.cpp b/main.cpp index 3a8ca2d..e731b2e 100644 --- a/main.cpp +++ b/main.cpp @@ -294,6 +294,56 @@ load (map, mod_map > > &knot_kh_sq, + const char *file) +{ + char buf[1000]; + sprintf (buf, "knot_kh_sq/%s", file); + + printf ("loading %s...\n", buf); + + struct stat stat_buf; + if (stat (buf, &stat_buf) != 0) + { + if (errno == ENOENT) + { + printf ("%s does not exist.\n", buf); + return; + } + + stderror ("stat: %s", buf); + exit (EXIT_FAILURE); + } + + file_reader r (buf, 1); + map, mod_map > > m (r); + for (map, mod_map > >::const_iter i = m; i; i ++) + { +#if 0 + mod_map sq1 = i.val ().first; + ptr > H = sq1.domain (); + unsigned hwidth = homological_width (H); + // hwidth_knots[hwidth] ++; +#endif + +#if 0 + if (hwidth == 2) + continue; + if (i.key ().t == knot_desc::MT + && i.key ().diagram ().num_components () == 1) + continue; +#endif + + knot_kh_sq.push (i.key (), i.val ()); + } + + printf ("done.\n"); +} + static const int block_size = 100; void @@ -585,9 +635,70 @@ dump_sage () } } +void +convert_knot_sq () +{ + FILE *fp = open_file ("L14.files", "r"); + char buf[1000]; + + gzfile_writer w ("L14_sq.dat.gz"); + w.write_unsigned (76516); + + set keys; + while (fgets (buf, 1000, fp)) + { + char *p = strchr (buf, '\n'); + if (p) + { + assert (p[1] == 0); + *p = 0; + } + + map, mod_map > > knot_sq; + load (knot_sq, buf); + + for (map, mod_map > >::const_iter k = knot_sq; k; k ++) + { + write (w, k.key ()); + write (w, k.val ()); + } + } + + // write (w, knot_sq); +} + +void +test_knot_sq () +{ + const char *knot_sq_files[] = { + "knot_sq/rolfsen_sq.dat.gz", + "knot_sq/Ksmall_sq.dat.gz", + "knot_sq/K11_sq.dat.gz", + "knot_sq/K12_sq.dat.gz", + "knot_sq/Lsmall_sq.dat.gz", + "knot_sq/L11_sq.dat.gz", + "knot_sq/L12_sq.dat.gz", + 0, + }; + + for (unsigned i = 0; knot_sq_files[i] != 0; i ++) + { + gzfile_reader r (knot_sq_files[i]); + map, mod_map > > knot_sq (r); + printf ("|knot_sq| = %d\n", knot_sq.card ()); + } +} + int main () { + // convert_knot_sq (); + test_knot_sq (); + return 0; + // test_sage_show (); dump_sage (); diff --git a/todo.txt b/todo.txt index ea1c63b..bf0f287 100644 --- a/todo.txt +++ b/todo.txt @@ -41,6 +41,10 @@ general: semantics. - clean up/delete setcommon, mapcommon - incorporate sage dump into standard classes + - update use of tuples in steenrod square + + - test mutation invariance, other questions of Robert and Sucharit + - write paper c++11: - make vector wrap std::vector (probably faster) @@ -53,6 +57,11 @@ c++11: - initializer_list for container types - support for iterator + - compress Steenrod square data + - get mpimain running again, run 15 xing mutants + + - simplifications to run (5, 8) with symmetries. + notes: all rings (R): multivariate_laurentpoly