8 #include "OrthoRegion.h" 9 #include <util/space/Dimension.h> 10 #include <util/math/feq.h> 57 UTIL_THROW(
"lengths_[i] != maxima_[i] - minima_[i]");
60 UTIL_THROW(
"halfLengths_[i] != 0.5*lengths_[i]");
64 double diff =
volume_ - product;
66 std::stringstream buf;
68 buf <<
"volume_ != product of lengths_" << std::endl;
69 buf <<
"volume_ = " <<
volume_ << std::endl;
70 buf <<
"lengths_[0] = " << lengths_[0] << std::endl;
71 buf <<
"lengths_[1] = " << lengths_[1] << std::endl;
72 buf <<
"lengths_[2] = " << lengths_[2] << std::endl;
73 buf <<
"product = " << product;
74 buf <<
"diff = " << diff;
bool isValid()
Return true if valid, or throw Exception.
const int Dimension
Dimensionality of space.
void resetRegion()
Set lengths and volume to values consistent with minima and maxima.
float product(float a, float b)
Product for float Data.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
Vector minima_
Minimum coordinates: Require r[i] >= minima_[i].
Vector lengths_
OrthoRegion lengths: lengths_[i] = maxima_[i] - minima_[i].
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
OrthoRegion()
Constructor.
Utility classes for scientific computation.
Vector maxima_
Maximum coordinates: Require r[i] < maxima_[i].
double volume_
Volume: V = lengths_[0]*lengths_[1]*lengths_[2].
bool feq(double x, double y, double eps=1.0E-10)
Are two floating point numbers equal to within round-off error?
Vector halfLengths_
Half region lengths: halfLengths_[i] = 0.5*lengths_[i].