30#include <casacore/casa/aips.h>
31#include <casacore/casa/BasicMath/Functors.h>
61 template<
typename CONTAINER>
65 if (left.size() != right.size()) {
66 throwContainerSizes (name, left.size(), right.size());
71 template<
typename CONTAINER>
74 size_t sz = in.size();
76 for (
size_t i=0; i<sz; ++i) {
84 std::vector<T>
operator+ (
const std::vector<T> &left,
85 const std::vector<T> &right)
87 checkContainerSizes(left, right,
"+");
88 std::vector<T> result(left.size());
89 std::transform (left.begin(), left.end(), right.begin(),
90 result.begin(), std::plus<T>());
96 std::vector<T>
operator/ (
const std::vector<T> &left,
const T &right)
98 std::vector<T> result(left.size());
99 std::transform (left.begin(), left.end(), result.begin(),
100 [right](T x) { return x / right; });
this file contains all the compiler specific defines
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
std::vector< T > operator/(const std::vector< T > &left, const T &right)
Divide a vector by a scalar.
void checkContainerSizes(const CONTAINER &left, const CONTAINER &right, const char *name)
Check if the sizes of both containers are the same.
void throwContainerSizes(const char *name, size_t l1, size_t l2)
Throw an exception that two container sizes mismatch.
CONTAINER reversedCasaContainer(const CONTAINER &in)
Reverse a Casacore container like IPosition, Block, or Vector.
std::vector< T > operator+(const std::vector< T > &left, const std::vector< T > &right)
Add two std::vector objects.