mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Overload operator<< for Position
This commit is contained in:
parent
73c4d97a37
commit
b2ad4d37dd
2 changed files with 10 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <array>
|
||||
#include <cmath> // for sqrt
|
||||
#include <iostream>
|
||||
#include <stdexcept> // for out_of_range
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -94,6 +95,8 @@ inline bool operator==(Position a, Position b)
|
|||
inline bool operator!=(Position a, Position b)
|
||||
{return a.x != b.x || a.y != b.y || a.z != b.z;}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, Position a);
|
||||
|
||||
//==============================================================================
|
||||
//! Type representing a vector direction in Cartesian coordinates
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -94,4 +94,11 @@ Position::rotate(const std::vector<double>& rotation) const
|
|||
};
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, Position r)
|
||||
{
|
||||
os << "(" << r.x << ", " << r.y << ", " << r.z << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue