13#include <util/mpi/MpiStructBuilder.h>
24 #define UTIL_VECTOR_EPSILON 1.0E-8
29 if ( fabs(v1.elem_[i] - v2.elem_[i]) > UTIL_VECTOR_EPSILON) {
39 if ( fabs(v1.elem_[i] - v2[i]) > UTIL_VECTOR_EPSILON) {
46 #undef UTIL_VECTOR_EPSILON
49 {
return (v2 == v1); }
54 {
return !(v1 == v2); }
57 {
return !(v1 == v2); }
60 {
return !(v2 == v1); }
68 in >> vector.elem_[i];
79 out.setf(std::ios::scientific);
80 out.width(Vector::Width);
81 out.precision(Vector::Precision);
82 out << vector.elem_[i];
104 builder.
addMember(&vector[0], MPI::DOUBLE);
105 builder.
addMember(&vector[1], MPI::DOUBLE);
106 builder.
addMember(&vector[2], MPI::DOUBLE);
121 static int nCall = 0;
A MpiStructBuilder objects is used to create an MPI Struct datatype.
void addMember(void *memberAddress, MPI::Datatype type, int count=1)
Add a new member variable to the type map.
void setBase(void *objectAddress)
Set address of an class instance.
void commit(MPI::Datatype &newType)
Build and commit a user-defined MPI Struct datatype.
A Vector is a Cartesian vector.
static const Vector Zero
Zero Vector = {0.0, 0.0, 0.0}.
static void commitMpiType()
Commit MPI datatype MpiTraits<Vector>::type.
static void initStatic()
Initialize Zero Vector.
File containing preprocessor macros for error handling.
const int Dimension
Dimensionality of space.
Utility classes for scientific computation.
bool operator==(Polynomial< T > const &a, Polynomial< T > const &b)
Equality operator for polynomials.
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
bool operator!=(Polynomial< T > const &a, Polynomial< T > const &b)
Inequality operator for polynomials.