示例#1
0
文件: mlogit.c 项目: patperry/iproc
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);
	}
}
示例#2
0
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]);
    }
}
示例#3
0
文件: main.cpp 项目: vadmium/tul
 virtual void dist_reset() {dist = 0; update_dist();};
示例#4
0
文件: main.cpp 项目: vadmium/tul
void MainWnd::dist_add(double x, double y) {
  x /= x_res;
  y /= y_res;
  dist += std::sqrt(x * x + y * y);
  update_dist();
}