int n = agnnodes(G);
if (Verbose) {
- fprintf(stderr, "calculating shortest paths:");
+ fprintf(stderr, "calculating shortest paths and setting up stress terms:");
start_timer();
}
// calculate how many terms will be needed as fixed nodes can be ignored
}
}
assert(offset == n_terms);
- free(graph);
+ free_adjacency(graph);
if (Verbose) {
fprintf(stderr, " %.2f sec\n", elapsed_sec());
}
start_timer();
}
int t;
- rk_seed(0, &rstate);
+ rk_seed(0, &rstate); // TODO: get seed from graph
for (t=0; t<MaxIter; t++) {
fisheryates_shuffle(terms, n_terms);
float eta = eta_max * exp(-lambda * t);
} else if (mode == MODE_SGD) {
Epsilon = .01;
getdouble(G, "epsilon", &Epsilon);
- GD_neato_nlist(G) = N_NEW(nV, node_t *);
+ GD_neato_nlist(G) = N_NEW(nV + 1, node_t *); // not sure why but sometimes needs the + 1
for (i = 0, np = agfstnode(G); np; np = agnxtnode(G, np)) {
GD_neato_nlist(G)[i] = np;
ND_id(np) = i++;