Exemple #1
0
void print_point(const KMPoint &p, std::ostream &out) {
  out << "[ ";
  for (unsigned int i = 0; i < p.size(); i++) {
    out << std::setw(8) << p[i] << " ";
  }
  out << " ]";
}
Exemple #2
0
IMPSTATISTICS_BEGIN_INTERNAL_NAMESPACE
double km_distance2(const KMPoint &p, const KMPoint &q) {
  double dist = 0;
  // IMP_INTERNAL_CHECK(); - TODO L add check for high checks level
  for (unsigned int i = 0; i < p.size(); i++) {
    dist += (p[i] - q[i]) * (p[i] - q[i]);
  }
  return dist;
}
Exemple #3
0
bool KMRectangle::is_inside(const KMPoint &p) {
  for (unsigned int i = 0; i < p.size(); i++) {
    if ((p[i] < lo_[i]) || (p[i] > hi_[i])) return false;
  }
  return true;
}
Exemple #4
0
bool km_is_equal(const KMPoint &p, const KMPoint &q) {
  for (unsigned int i = 0; i < p.size(); i++) {
    if (p[i] != q[i]) return false;
  }
  return true;
}