Loading...
Searching...
No Matches
Functors.h
Go to the documentation of this file.
//# Functors.h: Define STL functors for basic math functions.
//# Copyright (C) 2008
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef CASA_FUNCTORS_H
#define CASA_FUNCTORS_H
#include <casacore/casa/aips.h>
#include <casacore/casa/BasicMath/Math.h>
#include <casacore/casa/BasicSL/Complex.h>
#include <casacore/casa/BasicSL/String.h>
#include <functional>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// Define a function to do a binary transform in place.
// It is functionally equivalent to std::transform where the first and result
// iterator are the same, but it is faster for non-trivial iterators.
template<typename InputIterator1, typename InputIterator2, typename BinaryOperator>
inline void transformInPlace (InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryOperator op)
{
for (; first1!=last1; ++first1, ++first2) {
*first1 = op(*first1, *first2);
}
}
// Define a function to do a unary transform in place.
// It is functionally equivalent to std::transform where the first and result
// iterator are the same, but it is faster for non-trivial iterators.
template<typename InputIterator1, typename UnaryOperator>
inline void transformInPlace (InputIterator1 first1, InputIterator1 last1,
UnaryOperator op)
{
for (; first1!=last1; ++first1) {
*first1 = op(*first1);
}
}
// Define a function (similar to std::accumulate) to do accumulation of
// elements for which the corresponding mask value is true.
// The default accumulation is addition.
template<typename InputIterator, typename MaskIterator, typename Accum, typename BinaryOperator>
inline Accum accumulateTrue (InputIterator first, InputIterator last,
MaskIterator mask, Accum acc,
BinaryOperator op = std::plus<Accum>())
{
for (; first!=last; ++first, ++mask) {
if (*mask) acc = op(acc, *first);
}
return acc;
}
// Define a function (similar to std::accumulate) to do accumulation of
// elements for which the corresponding mask value is false.
// The default accumulation is addition.
template<typename InputIterator, typename MaskIterator, typename Accum, typename BinaryOperator>
inline Accum accumulateFalse (InputIterator first, InputIterator last,
MaskIterator mask, Accum acc,
BinaryOperator op = std::plus<Accum>())
{
for (; first!=last; ++first, ++mask) {
if (!*mask) acc = op(acc, *first);
}
return acc;
}
// Define a function to compare all elements of two sequences.
// It returns true if all elements compare true.
// An example compare operator is <src>std::equal_to</src>.
// <group>
template<typename InputIterator1, typename InputIterator2, typename CompareOperator>
inline bool compareAll (InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, CompareOperator op)
{
for (; first1!=last1; ++first1, ++first2) {
if (!op(*first1, *first2)) return false;
}
return true;
}
// For use with a constant left value.
// This avoids use of bind1st or bind2nd which can fail for gcc-4.3.
// (see ArrayMath.h).
template<typename InputIterator1, typename T, typename CompareOperator>
inline bool compareAllLeft (InputIterator1 first1, InputIterator1 last1,
T left, CompareOperator op)
{
for (; first1!=last1; ++first1) {
if (!op(left, *first1)) return false;
}
return true;
}
// For use with a constant right value.
// This avoids use of bind1st or bind2nd which can fail for gcc-4.3.
// (see ArrayMath.h).
template<typename InputIterator1, typename T, typename CompareOperator>
inline bool compareAllRight (InputIterator1 first1, InputIterator1 last1,
T right, CompareOperator op)
{
for (; first1!=last1; ++first1) {
if (!op(*first1, right)) return false;
}
return true;
}
// </group>
// Define a function to compare all elements of two sequences.
// It returns true if any element compares true.
// An example compare operator is <src>std::equal_to</src>.
// <group>
template<typename InputIterator1, typename InputIterator2, typename CompareOperator>
inline bool compareAny (InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, CompareOperator op)
{
for (; first1!=last1; ++first1, ++first2) {
if (op(*first1, *first2)) return true;
}
return false;
}
// For use with a constant left value.
// This avoids use of bind1st or bind2nd which can fail for gcc-4.3.
// (see ArrayMath.h).
template<typename InputIterator1, typename T, typename CompareOperator>
inline bool compareAnyLeft (InputIterator1 first1, InputIterator1 last1,
T left, CompareOperator op)
{
for (; first1!=last1; ++first1) {
if (op(left, *first1)) return true;
}
return false;
}
// For use with a constant right value.
// This avoids use of bind1st or bind2nd which can fail for gcc-4.3.
// (see ArrayMath.h).
template<typename InputIterator1, typename T, typename CompareOperator>
inline bool compareAnyRight (InputIterator1 first1, InputIterator1 last1,
T right, CompareOperator op)
{
for (; first1!=last1; ++first1) {
if (op(*first1, right)) return true;
}
return false;
}
// </group>
// Functor to add variables of possibly different types.
// This is unlike std::plus which requires equal types.
template <typename L, typename R=L, typename RES=L>
struct Plus
{
RES operator() (const L& x, const R& y) const
{ return RES(x)+y; }
};
// Functor to subtract variables of possibly different types.
// This is unlike std::minus which requires equal types.
template <typename L, typename R=L, typename RES=L>
struct Minus
{
RES operator() (const L& x, const R& y) const
{ return RES(x)-y; }
};
// Functor to multiply variables of possibly different types.
// This is unlike std::multiplies which requires equal types.
template <typename L, typename R=L, typename RES=L>
struct Multiplies
{
RES operator() (const L& x, const R& y) const
{ return RES(x)*y; }
};
// Functor to divide variables of possibly different types.
// This is unlike std::divides which requires equal types.
template <typename L, typename R=L, typename RES=L>
struct Divides
{
RES operator() (const L& x, const R& y) const
{ return RES(x)/y; }
};
// Functor to take modulo of (integer) variables of possibly different types
// in the C way.
// This is unlike std::modulo which requires equal types.
template <typename L, typename R=L, typename RES=L>
struct Modulo
{
RES operator() (const L& x, const R& y) const
{ return RES(x)%y; }
};
// Functor to take modulo of variables of possibly different types
// using the floor modulo (% as used in Python).
template <typename L, typename R=L, typename RES=L>
struct FloorMod
{
RES operator() (const L& x, const R& y) const
{ return floormod (RES(x), RES(y)); }
};
// Functor for bitwise and of (integer) values.
template <typename T>
struct BitAnd
{
T operator() (const T& x, const T& y) const
{ return x&y; }
};
// Functor for bitwise or of (integer) values.
template <typename T>
struct BitOr
{
T operator() (const T& x, const T& y) const
{ return x|y; }
};
// Functor for bitwise xor of (integer) values.
template <typename T>
struct BitXor
{
T operator() (const T& x, const T& y) const
{ return x^y; }
};
// Functor for bitwise negate of (integer) values.
template <typename T>
struct BitNegate
{
T operator() (const T& x) const
{ return ~x; }
};
// Functor to test for NaN.
// It can be used in something like:
// <srcblock>
// std::transform (array.begin(), array.end(),
// result.begin(), IsNaN<T>());
// </srcblock>
template<typename T>
struct IsNaN
{
bool operator() (T value) const
{ return isNaN (value); }
};
// Functor to test for infinity.
template<typename T>
struct IsInf
{
bool operator() (T value) const
{ return isInf (value); }
};
// Functor to test for finiteness.
template<typename T>
struct IsFinite
{
bool operator() (T value) const
{ return isFinite (value); }
};
// Functor to test if two values are relatively near each other.
// It can be used in something like:
// <srcblock>
// std::transform (left.begin(), left.cend(), right.begin(),
// result.cbegin(), Near<T>(tolerance));
// </srcblock>
template<typename L, typename R=L>
struct Near
{
explicit Near (double tolerance=1e-5)
: itsTolerance (tolerance)
{}
bool operator() (L left, R right) const
{ return near (left, L(right), itsTolerance); }
private:
double itsTolerance;
};
// Functor to test for if two values are absolutely near each other.
template<typename L, typename R=L>
struct NearAbs
{
explicit NearAbs (double tolerance=1e-13)
: itsTolerance (tolerance)
{}
bool operator() (L left, R right) const
{ return nearAbs (left, L(right), itsTolerance); }
private:
double itsTolerance;
};
// Functor to apply sin.
template<typename T, typename RES=T>
struct Sin
{
RES operator() (T value) const
{ return RES(sin (value)); }
};
// Functor to apply sinh.
template<typename T, typename RES=T>
struct Sinh
{
RES operator() (T value) const
{ return RES(sinh (value)); }
};
// Functor to apply asin.
template<typename T, typename RES=T>
struct Asin
{
RES operator() (T value) const
{ return RES(asin (value)); }
};
// Functor to apply cos.
template<typename T, typename RES=T>
struct Cos
{
RES operator() (T value) const
{ return RES(cos (value)); }
};
// Functor to apply cosh.
template<typename T, typename RES=T>
struct Cosh
{
RES operator() (T value) const
{ return RES(cosh (value)); }
};
// Functor to apply acos.
template<typename T, typename RES=T>
struct Acos
{
RES operator() (T value) const
{ return RES(acos (value)); }
};
// Functor to apply tan.
template<typename T, typename RES=T>
struct Tan
{
RES operator() (T value) const
{ return RES(tan (value)); }
};
// Functor to apply tanh.
template<typename T, typename RES=T>
struct Tanh
{
RES operator() (T value) const
{ return RES(tanh (value)); }
};
// Functor to apply atan.
template<typename T, typename RES=T>
struct Atan
{
RES operator() (T value) const
{ return RES(atan (value)); }
};
// Functor to apply atan2.
template<typename L, typename R=L, typename RES=L>
struct Atan2
{
RES operator() (L left, R right) const
{ return RES(atan2 (left, L(right))); }
};
// Functor to apply sqr (power of 2).
template<typename T, typename RES=T>
struct Sqr
{
RES operator() (T value) const
{ return RES(value*value); }
};
// Functor to apply a power of 3.
template<typename T, typename RES=T>
struct Pow3
{
RES operator() (T value) const
{ return RES(value*value*value); }
};
// Functor to apply sqrt.
template<typename T, typename RES=T>
struct Sqrt
{
RES operator() (T value) const
{ return RES(sqrt (value)); }
};
// Functor to apply exp.
template<typename T, typename RES=T>
struct Exp
{
RES operator() (T value) const
{ return RES(exp (value)); }
};
// Functor to apply log.
template<typename T, typename RES=T>
struct Log
{
RES operator() (T value) const
{ return RES(log (value)); }
};
// Functor to apply log10.
template<typename T, typename RES=T>
struct Log10
{
RES operator() (T value) const
{ return RES(log10 (value)); }
};
// Functor to apply abs.
template<typename T, typename RES=T>
struct Abs
{
RES operator() (T value) const
{ return RES(abs (value)); }
};
// Functor to apply floor.
template<typename T, typename RES=T>
struct Floor
{
RES operator() (T value) const
{ return RES(floor (value)); }
};
// Functor to apply ceil.
template<typename T, typename RES=T>
struct Ceil
{
RES operator() (T value) const
{ return RES(ceil (value)); }
};
// Functor to apply round (e.g. -3.7 gets -4).
template<typename T, typename RES=T>
struct Round
{
RES operator() (T value) const
{ return RES(value<0 ? ceil(value-0.5) : floor(value+0.5)); }
};
// Functor to apply sign (result is -1, 0, or 1).
template<typename T, typename RES=T>
struct Sign
{
RES operator() (T value) const
{ return (value<0 ? -1 : (value>0 ? 1:0)); }
};
// Functor to form a complex number from the left and right value.
template<typename L, typename R, typename RES>
struct MakeComplex
{
RES operator() (L l, R r) const
{ return RES(l, r); }
};
// Functor to form a complex number from the real part of the
// left value and the right value.
template<typename L, typename R, typename RES>
struct MakeComplexReal
{
RES operator() (L l, R r) const
{ return RES(real(l), r); }
};
// Functor to form a complex number from the left value and the
// imaginary part of the right value.
template<typename L, typename R, typename RES>
struct MakeComplexImag
{
RES operator() (L l, R r) const
{ return RES(l, imag(r)); }
};
// Functor to form a complex number from the real part of the
// left value and the imaginary part of the right value.
template<typename L, typename R, typename RES>
struct MakeComplexRealImag
{
RES operator() (L l, R r) const
{ return RES(real(l), imag(r)); }
};
// Functor to apply complex function conj.
template<typename T, typename RES=T>
struct Conj
{
RES operator() (T value) const
{ return RES(conj (value)); }
};
// Functor to apply complex function real.
template<typename T, typename RES>
struct Real
{
RES operator() (T value) const
{ return RES(real (value)); }
};
// Functor to apply complex function imag.
template<typename T, typename RES>
struct Imag
{
RES operator() (T value) const
{ return RES(imag (value)); }
};
// Functor to apply complex function arg.
template<typename T, typename RES>
struct CArg
{
RES operator() (T value) const
{ return RES(arg (value)); }
};
// Functor to apply complex function fabs.
template<typename T, typename RES>
struct CAbs
{
RES operator() (T value) const
{ return RES(fabs (value)); }
};
// Functor to apply pow.
template<typename T, typename E=T, typename RES=T>
struct Pow
{
RES operator() (T left, E exponent) const
{ return RES(pow (left, exponent)); }
};
// Functor to apply fmod.
template<typename L, typename R=L, typename RES=L>
struct Fmod
{
RES operator() (R left, L right) const
{ return RES(fmod (left, L(right))); }
};
// Functor to get minimum of two values.
template<typename L, typename R=L, typename RES=L>
struct Min
{
RES operator() (L left, R right) const
{ return RES(left<right ? left : right); }
};
// Functor to get maximum of two values.
template<typename L, typename R=L, typename RES=L>
struct Max
{
RES operator() (L left, R right) const
{ return RES(left<right ? right : left); }
};
// Functor to add square of right to left.
template<typename T, typename Accum=T>
struct SumSqr
{
Accum operator() (Accum left, T right) const
{ return left + Accum(right)*Accum(right); }
};
// Functor to add squared diff of right and base value to left.
// It can be used to calculate the variance.
// Note: it is specialized for complex values to handle real and imag separately.
template<typename T, typename Accum=T>
struct SumSqrDiff
{
explicit SumSqrDiff(T base) : itsBase(base) {}
Accum operator() (Accum left, T right) const
{ return left + (right-itsBase)*(right-itsBase); }
private:
Accum itsBase; // store as Accum, so subtraction results in Accum
};
// Specialize for complex values.
// Variance has to be taken for the absolute value of a complex value. thus
// sum(abs((a[i] - mean)**2
// where the sqrt used in abs and the **2 cancel each other, thus can be left out.
// See also https://en.wikipedia.org/wiki/Complex_random_variable#Variance
// Note that although the sum is real, a complex value is used to have equal template types.
template<typename T>
struct SumSqrDiff<std::complex<T>>
{
explicit SumSqrDiff(std::complex<T> base) : itsBase(base) {}
std::complex<T> operator() (std::complex<T> left, std::complex<T> right) const
{ return left + ((right.real() - itsBase.real()) * (right.real() - itsBase.real()) +
(right.imag() - itsBase.imag()) * (right.imag() - itsBase.imag())); }
private:
std::complex<T> itsBase;
};
// Functor to add absolute diff of right and base value to left.
// It can be used to calculate the average deviation.
template<typename T, typename Accum=T>
struct SumAbsDiff
{
explicit SumAbsDiff(T base) : itsBase(base) {}
Accum operator() (Accum left, T right) const
{ return left + abs((right-itsBase)); }
private:
Accum itsBase; // store as Accum, so subtraction results in Accum
};
// Functor to downcase a std::string. The result is a casacore::String.
struct Downcase
{
String operator() (const std::string& value) const
{ return downcase(value); }
};
// Functor to upcase a std::string. The result is a casacore::String.
struct Upcase
{
String operator() (const std::string& value) const
{ return upcase(value); }
};
// Functor to capitalize a std::string. The result is a casacore::String.
struct Capitalize
{
String operator() (const std::string& value) const
{ return capitalize(value); }
};
// Functor to trim a std::string. The result is a casacore::String.
// Leading and trailing whitespace is removed.
struct Trim
{
String operator() (const std::string& value) const
{ return trim(value); }
};
} //# NAMESPACE CASACORE - END
#endif
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
first
struct Node * first
Definition malloc.h:328
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::compareAnyLeft
bool compareAnyLeft(InputIterator1 first1, InputIterator1 last1, T left, CompareOperator op)
For use with a constant left value.
Definition Functors.h:146
casacore::exp
LatticeExprNode exp(const LatticeExprNode &expr)
casacore::isNaN
LatticeExprNode isNaN(const LatticeExprNode &expr)
Test if a value is a NaN.
casacore::asin
LatticeExprNode asin(const LatticeExprNode &expr)
casacore::compareAny
bool compareAny(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, CompareOperator op)
Define a function to compare all elements of two sequences.
Definition Functors.h:134
casacore::fmod
LatticeExprNode fmod(const LatticeExprNode &left, const LatticeExprNode &right)
casacore::acos
LatticeExprNode acos(const LatticeExprNode &expr)
casacore::upcase
TableExprNode upcase(const TableExprNode &node)
Definition ExprNode.h:1472
casacore::compareAllLeft
bool compareAllLeft(InputIterator1 first1, InputIterator1 last1, T left, CompareOperator op)
For use with a constant left value.
Definition Functors.h:107
casacore::isFinite
TableExprNode isFinite(const TableExprNode &node)
Function to test if a scalar or array is finite.
Definition ExprNode.h:1634
casacore::cosh
LatticeExprNode cosh(const LatticeExprNode &expr)
casacore::atan
LatticeExprNode atan(const LatticeExprNode &expr)
casacore::tanh
LatticeExprNode tanh(const LatticeExprNode &expr)
casacore::arg
LatticeExprNode arg(const LatticeExprNode &expr)
casacore::compareAll
bool compareAll(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, CompareOperator op)
Define a function to compare all elements of two sequences.
Definition Functors.h:95
casacore::log10
LatticeExprNode log10(const LatticeExprNode &expr)
casacore::conj
LatticeExprNode conj(const LatticeExprNode &expr)
casacore::sinh
LatticeExprNode sinh(const LatticeExprNode &expr)
casacore::nearAbs
TableExprNode nearAbs(const TableExprNode &left, const TableExprNode &right)
Definition ExprNode.h:1254
casacore::isInf
TableExprNode isInf(const TableExprNode &node)
Definition ExprNode.h:1630
casacore::abs
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type.
casacore::tan
LatticeExprNode tan(const LatticeExprNode &expr)
casacore::mask
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
casacore::sin
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
casacore::compareAnyRight
bool compareAnyRight(InputIterator1 first1, InputIterator1 last1, T right, CompareOperator op)
For use with a constant right value.
Definition Functors.h:158
casacore::atan2
LatticeExprNode atan2(const LatticeExprNode &left, const LatticeExprNode &right)
Numerical 2-argument functions.
casacore::capitalize
TableExprNode capitalize(const TableExprNode &node)
Definition ExprNode.h:1482
casacore::downcase
TableExprNode downcase(const TableExprNode &node)
Definition ExprNode.h:1477
casacore::sqrt
LatticeExprNode sqrt(const LatticeExprNode &expr)
casacore::pow
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
casacore::log
LatticeExprNode log(const LatticeExprNode &expr)
casacore::accumulateFalse
Accum accumulateFalse(InputIterator first, InputIterator last, MaskIterator mask, Accum acc, BinaryOperator op=std::plus< Accum >())
Define a function (similar to std::accumulate) to do accumulation of elements for which the correspon...
Definition Functors.h:80
casacore::accumulateTrue
Accum accumulateTrue(InputIterator first, InputIterator last, MaskIterator mask, Accum acc, BinaryOperator op=std::plus< Accum >())
Define a function (similar to std::accumulate) to do accumulation of elements for which the correspon...
Definition Functors.h:66
casacore::trim
TableExprNode trim(const TableExprNode &node)
Definition ExprNode.h:1588
casacore::cos
LatticeExprNode cos(const LatticeExprNode &expr)
casacore::floor
LatticeExprNode floor(const LatticeExprNode &expr)
casacore::value
NewDelAllocator< T > NewDelAllocator< T >::value
Definition Allocator.h:369
casacore::transformInPlace
void transformInPlace(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryOperator op)
Define a function to do a binary transform in place.
Definition Functors.h:42
casacore::near
Bool near(const GaussianBeam &left, const GaussianBeam &other, const Double relWidthTol, const Quantity &absPaTol)
casacore::compareAllRight
bool compareAllRight(InputIterator1 first1, InputIterator1 last1, T right, CompareOperator op)
For use with a constant right value.
Definition Functors.h:119
casacore::ceil
LatticeExprNode ceil(const LatticeExprNode &expr)
casacore::real
LatticeExprNode real(const LatticeExprNode &expr)
casacore::imag
LatticeExprNode imag(const LatticeExprNode &expr)
std
Define real & complex conjugation for non-complex types and put comparisons into std namespace.
Definition Complex.h:350
casacore::Abs
Functor to apply abs.
Definition Functors.h:449
casacore::Abs::operator()
RES operator()(T value) const
Definition Functors.h:450
casacore::Acos
Functor to apply acos.
Definition Functors.h:361
casacore::Acos::operator()
RES operator()(T value) const
Definition Functors.h:362
casacore::Asin
Functor to apply asin.
Definition Functors.h:337
casacore::Asin::operator()
RES operator()(T value) const
Definition Functors.h:338
casacore::Atan2
Functor to apply atan2.
Definition Functors.h:393
casacore::Atan2::operator()
RES operator()(L left, R right) const
Definition Functors.h:394
casacore::Atan
Functor to apply atan.
Definition Functors.h:385
casacore::Atan::operator()
RES operator()(T value) const
Definition Functors.h:386
casacore::BitAnd
Functor for bitwise and of (integer) values.
Definition Functors.h:228
casacore::BitAnd::operator()
T operator()(const T &x, const T &y) const
Definition Functors.h:229
casacore::BitNegate
Functor for bitwise negate of (integer) values.
Definition Functors.h:252
casacore::BitNegate::operator()
T operator()(const T &x) const
Definition Functors.h:253
casacore::BitOr
Functor for bitwise or of (integer) values.
Definition Functors.h:236
casacore::BitOr::operator()
T operator()(const T &x, const T &y) const
Definition Functors.h:237
casacore::BitXor
Functor for bitwise xor of (integer) values.
Definition Functors.h:244
casacore::BitXor::operator()
T operator()(const T &x, const T &y) const
Definition Functors.h:245
casacore::CAbs
Functor to apply complex function fabs.
Definition Functors.h:556
casacore::CAbs::operator()
RES operator()(T value) const
Definition Functors.h:557
casacore::CArg
Functor to apply complex function arg.
Definition Functors.h:548
casacore::CArg::operator()
RES operator()(T value) const
Definition Functors.h:549
casacore::Capitalize
Functor to capitalize a std::string.
Definition Functors.h:658
casacore::Capitalize::operator()
String operator()(const std::string &value) const
Definition Functors.h:659
casacore::Ceil
Functor to apply ceil.
Definition Functors.h:465
casacore::Ceil::operator()
RES operator()(T value) const
Definition Functors.h:466
casacore::Conj
Functor to apply complex function conj.
Definition Functors.h:524
casacore::Conj::operator()
RES operator()(T value) const
Definition Functors.h:525
casacore::Cos
Functor to apply cos.
Definition Functors.h:345
casacore::Cos::operator()
RES operator()(T value) const
Definition Functors.h:346
casacore::Cosh
Functor to apply cosh.
Definition Functors.h:353
casacore::Cosh::operator()
RES operator()(T value) const
Definition Functors.h:354
casacore::Divides
Functor to divide variables of possibly different types.
Definition Functors.h:201
casacore::Divides::operator()
RES operator()(const L &x, const R &y) const
Definition Functors.h:202
casacore::Downcase
Functor to downcase a std::string.
Definition Functors.h:644
casacore::Downcase::operator()
String operator()(const std::string &value) const
Definition Functors.h:645
casacore::Exp
Functor to apply exp.
Definition Functors.h:425
casacore::Exp::operator()
RES operator()(T value) const
Definition Functors.h:426
casacore::FloorMod
Functor to take modulo of variables of possibly different types using the floor modulo (% as used in ...
Definition Functors.h:220
casacore::FloorMod::operator()
RES operator()(const L &x, const R &y) const
Definition Functors.h:221
casacore::Floor
Functor to apply floor.
Definition Functors.h:457
casacore::Floor::operator()
RES operator()(T value) const
Definition Functors.h:458
casacore::Fmod
Functor to apply fmod.
Definition Functors.h:572
casacore::Fmod::operator()
RES operator()(R left, L right) const
Definition Functors.h:573
casacore::Imag
Functor to apply complex function imag.
Definition Functors.h:540
casacore::Imag::operator()
RES operator()(T value) const
Definition Functors.h:541
casacore::IsFinite
Functor to test for finiteness.
Definition Functors.h:281
casacore::IsFinite::operator()
bool operator()(T value) const
Definition Functors.h:282
casacore::IsInf
Functor to test for infinity.
Definition Functors.h:273
casacore::IsInf::operator()
bool operator()(T value) const
Definition Functors.h:274
casacore::IsNaN
Functor to test for NaN.
Definition Functors.h:265
casacore::IsNaN::operator()
bool operator()(T value) const
Definition Functors.h:266
casacore::Log10
Functor to apply log10.
Definition Functors.h:441
casacore::Log10::operator()
RES operator()(T value) const
Definition Functors.h:442
casacore::Log
Functor to apply log.
Definition Functors.h:433
casacore::Log::operator()
RES operator()(T value) const
Definition Functors.h:434
casacore::MakeComplexImag
Functor to form a complex number from the left value and the imaginary part of the right value.
Definition Functors.h:507
casacore::MakeComplexImag::operator()
RES operator()(L l, R r) const
Definition Functors.h:508
casacore::MakeComplexRealImag
Functor to form a complex number from the real part of the left value and the imaginary part of the r...
Definition Functors.h:516
casacore::MakeComplexRealImag::operator()
RES operator()(L l, R r) const
Definition Functors.h:517
casacore::MakeComplexReal
Functor to form a complex number from the real part of the left value and the right value.
Definition Functors.h:498
casacore::MakeComplexReal::operator()
RES operator()(L l, R r) const
Definition Functors.h:499
casacore::MakeComplex
Functor to form a complex number from the left and right value.
Definition Functors.h:489
casacore::MakeComplex::operator()
RES operator()(L l, R r) const
Definition Functors.h:490
casacore::Max
Functor to get maximum of two values.
Definition Functors.h:588
casacore::Max::operator()
RES operator()(L left, R right) const
Definition Functors.h:589
casacore::Min
Functor to get minimum of two values.
Definition Functors.h:580
casacore::Min::operator()
RES operator()(L left, R right) const
Definition Functors.h:581
casacore::Minus
Functor to subtract variables of possibly different types.
Definition Functors.h:183
casacore::Minus::operator()
RES operator()(const L &x, const R &y) const
Definition Functors.h:184
casacore::Modulo
Functor to take modulo of (integer) variables of possibly different types in the C way.
Definition Functors.h:211
casacore::Modulo::operator()
RES operator()(const L &x, const R &y) const
Definition Functors.h:212
casacore::Multiplies
Functor to multiply variables of possibly different types.
Definition Functors.h:192
casacore::Multiplies::operator()
RES operator()(const L &x, const R &y) const
Definition Functors.h:193
casacore::NearAbs::itsTolerance
double itsTolerance
Definition Functors.h:314
casacore::NearAbs::NearAbs
NearAbs(double tolerance=1e-13)
Definition Functors.h:308
casacore::NearAbs::operator()
bool operator()(L left, R right) const
Definition Functors.h:311
casacore::Near::operator()
bool operator()(L left, R right) const
Definition Functors.h:298
casacore::Near::itsTolerance
double itsTolerance
Definition Functors.h:301
casacore::Near::Near
Near(double tolerance=1e-5)
Definition Functors.h:295
casacore::Plus
Functor to add variables of possibly different types.
Definition Functors.h:174
casacore::Plus::operator()
RES operator()(const L &x, const R &y) const
Definition Functors.h:175
casacore::Pow3
Functor to apply a power of 3.
Definition Functors.h:409
casacore::Pow3::operator()
RES operator()(T value) const
Definition Functors.h:410
casacore::Pow
Functor to apply pow.
Definition Functors.h:564
casacore::Pow::operator()
RES operator()(T left, E exponent) const
Definition Functors.h:565
casacore::Real
Functor to apply complex function real.
Definition Functors.h:532
casacore::Real::operator()
RES operator()(T value) const
Definition Functors.h:533
casacore::Round
Functor to apply round (e.g.
Definition Functors.h:473
casacore::Round::operator()
RES operator()(T value) const
Definition Functors.h:474
casacore::Sign
Functor to apply sign (result is -1, 0, or 1).
Definition Functors.h:481
casacore::Sign::operator()
RES operator()(T value) const
Definition Functors.h:482
casacore::Sin
Functor to apply sin.
Definition Functors.h:321
casacore::Sin::operator()
RES operator()(T value) const
Definition Functors.h:322
casacore::Sinh
Functor to apply sinh.
Definition Functors.h:329
casacore::Sinh::operator()
RES operator()(T value) const
Definition Functors.h:330
casacore::Sqr
Functor to apply sqr (power of 2).
Definition Functors.h:401
casacore::Sqr::operator()
RES operator()(T value) const
Definition Functors.h:402
casacore::Sqrt
Functor to apply sqrt.
Definition Functors.h:417
casacore::Sqrt::operator()
RES operator()(T value) const
Definition Functors.h:418
casacore::SumAbsDiff::operator()
Accum operator()(Accum left, T right) const
Definition Functors.h:636
casacore::SumAbsDiff::SumAbsDiff
SumAbsDiff(T base)
Definition Functors.h:635
casacore::SumAbsDiff::itsBase
Accum itsBase
Definition Functors.h:639
casacore::SumSqrDiff< std::complex< T > >::itsBase
std::complex< T > itsBase
Definition Functors.h:627
casacore::SumSqrDiff< std::complex< T > >::SumSqrDiff
SumSqrDiff(std::complex< T > base)
Definition Functors.h:622
casacore::SumSqrDiff::itsBase
Accum itsBase
Definition Functors.h:611
casacore::SumSqrDiff::SumSqrDiff
SumSqrDiff(T base)
Definition Functors.h:607
casacore::SumSqrDiff::operator()
Accum operator()(Accum left, T right) const
Definition Functors.h:608
casacore::SumSqr
Functor to add square of right to left.
Definition Functors.h:596
casacore::SumSqr::operator()
Accum operator()(Accum left, T right) const
Definition Functors.h:597
casacore::Tan
Functor to apply tan.
Definition Functors.h:369
casacore::Tan::operator()
RES operator()(T value) const
Definition Functors.h:370
casacore::Tanh
Functor to apply tanh.
Definition Functors.h:377
casacore::Tanh::operator()
RES operator()(T value) const
Definition Functors.h:378
casacore::Trim
Functor to trim a std::string.
Definition Functors.h:666
casacore::Trim::operator()
String operator()(const std::string &value) const
Definition Functors.h:667
casacore::Upcase
Functor to upcase a std::string.
Definition Functors.h:651
casacore::Upcase::operator()
String operator()(const std::string &value) const
Definition Functors.h:652