44 static int last_read_i = 0;
45 static int last_written_i = 0;
48 static const double epsilon = 0.001;
52 static int notUsed = 0;
56 if (fabs(
cache_[i].posX - posX) < epsilon &&
57 fabs(
cache_[i].posY - posY) < epsilon &&
58 fabs(
cache_[i].posZ - posZ) < epsilon) {
64 debugOut<<
"used the cache! " <<
double(used)/(used + notUsed) <<
"\n";
69 }
while (i != last_read_i);
71 last_read_i = last_written_i = (last_written_i + 1) %
n_buckets_;
84 debugOut<<
"did NOT use the cache! \n";
90 return field_->
get(posX, posY, posZ, Bx, By, Bz);