-minimise
primer
view-[1-9]*
interpolate-[1-9]*
+minimise-[1-9]*
*.d
*.tmp
*.new
-VIEWDIMS=33 64 125 246
-TARGETS= minimise primer lumpy.cfm sgtatham.cfm ring.cfm \
- interpolate-64 interpolate-125 interpolate-246 \
- $(addprefix view-, $(VIEWDIMS))
+ALLDIMS=33 64 125 246 487 968
+TARGETS= primer lumpy.cfm sgtatham.cfm ring.cfm \
+ minimise-33 minimise-64 \
+ $(addprefix interpolate-, $(ALLDIMS)) \
+ $(addprefix view-, $(ALLDIMS))
SGTATHAM=sgtatham
CWARNS= -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
all: $(TARGETS)
-compute: best.CFM
+compute: all
+ $(MAKE) best-33.CFM
+ $(MAKE) best-968.CFM
minimise: energy.o graph.o common.o mgraph.o minimise.o half.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBGSL)
ring.cfm: oldmoebius-converter prime.data /dev/null ../moebius/a.out
./$^ -o$@
-best.CFM:
- ./minimise sgtatham.cfm -iwip.cfm -o$@
+
+best-33.CFM:
+ ./minimise-33 sgtatham.cfm -iwip-33.cfm -o$@
+
+start-64.cfm: best-33.CFM
+ ./interpolate-64 -a4 $< -o$@
+
+best-64.CFM:
+ ./minimise-64 start-64.cfm -iwip-64.CFM -o$@
+
+define interpolate_aa
+best-$1.cfm: interpolate-$1 $2
+ ./$$< -aa $2 -o$$@
+endef
+
+$(eval $(call interpolate_aa,968, best-487.cfm))
+$(eval $(call interpolate_aa,487, best-246.cfm))
+$(eval $(call interpolate_aa,246, best-125.cfm))
+$(eval $(call interpolate_aa,125, best-64.CFM))
view-%: view+%.o mgraph+%.o common.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBGSL) -L/usr/X11R6/lib -lX11
minimise-%: energy+%.o graph+%.o mgraph+%.o minimise+%.o half+%.o common.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBGSL)
-define interpolate
-dense-$1.cfm: interpolate-$1 $2
- ./$$< <$2 $$o
-endef
-
-$(eval $(call interpolate,64, best.CFM))
-$(eval $(call interpolate,125, dense-64.cfm, dense-64.cfm))
-
# this ridiculous repetition is due to make being too lame
view+%.o: view.c
if (printing) printf("%15lld c>e |", evaluations);
-#if YBITS==3
- COST( 3e2, line_bending_cost(vs->a));
- COST( 1e3, edge_length_variation_cost(vs->a));
- COST( 0.2e3, rim_proximity_cost(vs->a));
- COST( 1e8, noncircular_rim_cost(vs->a));
-#else
- COST( 3e3, line_bending_cost(vs->a));
- COST( 1e4, edge_length_variation_cost(vs->a));
- COST( 0.2e3, rim_proximity_cost(vs->a));
- COST( 1e8, noncircular_rim_cost(vs->a));
-#endif
+ if (XBITS==3) {
+ COST( 3e2, line_bending_cost(vs->a));
+ COST( 1e3, edge_length_variation_cost(vs->a));
+ COST( 0.2e3, rim_proximity_cost(vs->a));
+ COST( 1e8, noncircular_rim_cost(vs->a));
+ stop_epsilon= 1e-6;
+ } else if (XBITS==4) {
+ COST( 3e2, line_bending_cost(vs->a));
+ COST( 3e3, edge_length_variation_cost(vs->a));
+ COST( 3.8e1, rim_proximity_cost(vs->a)); // 5e1 is too much
+ // 2.5e1 is too little
+ // 0.2e1 grows compared to previous ?
+ // 0.6e0 shrinks compared to previous ?
+ COST( 1e12, noncircular_rim_cost(vs->a));
+ stop_epsilon= 1e-5;
+ } else {
+ abort();
+ }
if (printing) printf("| total %# e |", energy);
const char *input_file, *best_file;
char *best_file_tmp;
long long evaluations;
+double stop_epsilon= 1e-20;
static void printing_init(void);
-static const double stop_epsilon= 1e-6;
static gsl_multimin_fminimizer *minimiser;
static const char *final_file;
static char *final_file_tmp;
extern const char *input_file, *best_file;
extern char *best_file_tmp;
extern long long evaluations;
+extern double stop_epsilon;
enum printing_instance { pr_cost, pr_size, pr__max };
int printing_check(enum printing_instance, int indent);