OGS
WeightedPoint.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "WeightedPoint.h"
5
6#include <ostream>
7
8namespace MathLib
9{
10// Used to output helpful information if the unit tests fail.
11std::ostream& operator<<(std::ostream& os, MathLib::WeightedPoint const& wp)
12{
13 auto const dim = wp.getDimension();
14 os << "WP[" << dim << "D]{{";
15 for (std::size_t comp = 0; comp < 3; ++comp)
16 {
17 if (comp != 0)
18 {
19 os << ", ";
20 }
21 os << wp[comp];
22 }
23 os << "}, weight=" << wp.getWeight() << '}';
24 return os;
25}
26} // namespace MathLib
constexpr double getWeight() const
constexpr std::size_t getDimension() const
The point dimension, i.e., the number of its coordinates.
std::ostream & operator<<(std::ostream &os, const Point3d &p)
Definition Point3d.h:83