void update(struct mlogit *m) { if (uintset_count(&m->ind)) { update_dx(m); update_dist(m); update_mean(m); update_cov(m); uintset_clear(&m->ind); } }
static void compute_dist(HashTablePtr table) { int i; HashBucketPtr bucket; printf("Entries = %ld, hits = %ld, partials = %ld, misses = %ld\n", table->entries, table->hits, table->partials, table->misses); clear_dist(); for (i = 0; i < HASH_SIZE; i++) { bucket = table->buckets[i]; update_dist(count_entries(bucket)); } for (i = 0; i < DIST_LIMIT; i++) { if (i != DIST_LIMIT-1) printf("%5d %10d\n", i, dist[i]); else printf("other %10d\n", dist[i]); } }
virtual void dist_reset() {dist = 0; update_dist();};
void MainWnd::dist_add(double x, double y) { x /= x_res; y /= y_res; dist += std::sqrt(x * x + y * y); update_dist(); }