OGS
WeightedPoint.cpp
Go to the documentation of this file.
1
10#include "WeightedPoint.h"
11
12#include <ostream>
13
14namespace MathLib
15{
16// Used to output helpful information if the unit tests fail.
17std::ostream& operator<<(std::ostream& os, MathLib::WeightedPoint const& wp)
18{
19 auto const dim = wp.getDimension();
20 os << "WP[" << dim << "D]{{";
21 for (std::size_t comp = 0; comp < 3; ++comp)
22 {
23 if (comp != 0)
24 {
25 os << ", ";
26 }
27 os << wp[comp];
28 }
29 os << "}, weight=" << wp.getWeight() << '}';
30 return os;
31}
32} // namespace MathLib
std::size_t getDimension() const
The point dimension, i.e., the number of its coordinates.
double getWeight() const
std::ostream & operator<<(std::ostream &os, const Point3d &p)
Definition Point3d.h:91