26#ifndef TABLES_TABVECMATH_H
27#define TABLES_TABVECMATH_H
33#include <casacore/casa/aips.h>
34#include <casacore/casa/BasicMath/Math.h>
35#include <casacore/tables/Tables/TableVector.h>
36#include <casacore/tables/Tables/TVecMath.h>
60template<
class T>
inline
63template<
class T>
inline
66template<
class T>
inline
69template<
class T>
inline
73template<
class T>
inline
76template<
class T>
inline
79template<
class T>
inline
82template<
class T>
inline
86template<
class T>
inline
89template<
class T>
inline
93template<
class T>
inline
97template<
class T>
inline
101template<
class T>
inline
105template<
class T>
inline
111template<
class T>
inline
115template<
class T>
inline
119template<
class T>
inline
123template<
class T>
inline
128template<
class T>
inline
132template<
class T>
inline
136template<
class T>
inline
140template<
class T>
inline
207 const double& exponent);
232template<
class T>
inline
237template<
class T>
inline
242template<
class T>
inline
247template<
class T>
inline
252template<
class T>
inline
257template<
class T>
inline
261template<
class T>
inline
268template<
class T>
inline T
291template<
class T>
inline
296template<
class T>
inline
300template<
class T>
inline
313#define TABVECMATHOPER(NAME,OP,OPA) \
314template<class T> inline \
315TableVector<T> aips_name2(operato,OP) (const TableVector<T>& tv, \
317 { return TableVector<T> (aips_name2(tabVecRepvalr,NAME) (tv.tabVec(), \
319template<class T> inline \
320TableVector<T> aips_name2(operato,OP) (const T& v, \
321 const TableVector<T>& tv) \
322 { return TableVector<T> (aips_name2(tabVecRepvall,NAME) (v, \
324template<class T> inline \
325TableVector<T> aips_name2(operato,OP) (const TableVector<T>& l, \
326 const TableVector<T>& r) \
327 { return TableVector<T> (aips_name2(tabVecReptv,NAME) (l.tabVec(), \
329template<class T> inline \
330void aips_name2(operato,OPA) (TableVector<T>& tv, const T& v) \
331 { aips_name2(tabVecRepvalass,NAME) (tv.tabVec(), v); } \
332template<class T> inline \
333void aips_name2(operato,OPA) (TableVector<T>& l, \
334 const TableVector<T>& r) \
335 { aips_name2(tabVecReptvass,NAME) (l.tabVec(), r.tabVec()); }
343#define TABVECMATHFUNC(NAME) \
344template<class T> inline \
345TableVector<T> NAME (const TableVector<T>& tv) \
346 { return TableVector<T> (aips_name2(tabVecRep,NAME) (tv.tabVec())); }
347#define TABVECMATHFUNC2(NAME) \
348template<class T> inline \
349TableVector<T> NAME (const TableVector<T>& l, \
350 const TableVector<T>& r) \
351 { return TableVector<T> (aips_name2(tabVecRep,NAME) (l.tabVec(), \
374template<
class T>
inline
379template<
class T>
inline
381 {
return tabVecRepsum (tv.
tabVec()); }
382template<
class T>
inline
384 {
return tabVecRepproduct (tv.
tabVec()); }
387template<
class T>
inline
390template<
class T>
inline
393template<
class T>
inline
397template<
class T>
inline
399 { tabVecRepindgen (tv.
tabVec(), start, inc); }
400template<
class T>
inline
402 { tabVecRepindgen (tv.
tabVec(), start, T(1)); }
403template<
class T>
inline
405 { tabVecRepindgen (tv.
tabVec(), T(0), T(1)); }
408template<
class T>
inline
410 {
return tabVecRepinnerproduct (l.
tabVec(), r.
tabVec()); }
411template<
class T>
inline
413 {
return tabVecRepnorm (tv.
tabVec()); }
414template<
class T>
inline
#define TABVECMATHFUNC(NAME)
#define TABVECMATHOPER(NAME, OP, OPA)
#define TABVECMATHFUNC2(NAME)
TabVecRep< T > & tabVec()
Return the TabVecRep reference.
this file contains all the compiler specific defines
LatticeExprNode exp(const LatticeExprNode &expr)
LatticeExprNode asin(const LatticeExprNode &expr)
void minMax(T &min, T &max, const TableVector< T > &tv)
LatticeExprNode fmod(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode acos(const LatticeExprNode &expr)
T innerProduct(const TableVector< T > &l, const TableVector< T > &r)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
void indgen(TableVector< T > &tv, T start, T inc)
LatticeExprNode cosh(const LatticeExprNode &expr)
LatticeExprNode atan(const LatticeExprNode &expr)
LatticeExprNode tanh(const LatticeExprNode &expr)
LatticeExprNode log10(const LatticeExprNode &expr)
LatticeExprNode sinh(const LatticeExprNode &expr)
LatticeExprNode sum(const LatticeExprNode &expr)
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
MVBaseline operator*(const RotMatrix &left, const MVBaseline &right)
Rotate a Baseline vector with rotation matrix and other multiplications.
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
T norm(const TableVector< T > &tv)
LatticeExprNode operator-(const LatticeExprNode &expr)
LatticeExprNode tan(const LatticeExprNode &expr)
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode atan2(const LatticeExprNode &left, const LatticeExprNode &right)
Numerical 2-argument functions.
TableVector< T > crossProduct(const TableVector< T > &l, const TableVector< T > &r)
LatticeExprNode sqrt(const LatticeExprNode &expr)
T product(const TableVector< T > &tv)
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode log(const LatticeExprNode &expr)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
LatticeExprNode cos(const LatticeExprNode &expr)
LatticeExprNode floor(const LatticeExprNode &expr)
LatticeExprNode ceil(const LatticeExprNode &expr)
Functor to get maximum of two values.
Functor to get minimum of two values.
Further transcendental math for table vectors.
TableVector< T > asin(const TableVector< T > &)
TableVector< T > acos(const TableVector< T > &)
TableVector< T > ceil(const TableVector< T > &)
TableVector< T > fabs(const TableVector< T > &)
TableVector< T > pow(const TableVector< T > &value, const double &exponent)
TableVector< T > tan(const TableVector< T > &)
TableVector< T > atan2(const TableVector< T > &y, const TableVector< T > &x)
TableVector< T > floor(const TableVector< T > &)
TableVector< T > tanh(const TableVector< T > &)
TableVector< T > fmod(const TableVector< T > &value, const TableVector< T > &modulo)
TableVector< T > atan(const TableVector< T > &)
void operator/=(TableVector< T > &left, const TableVector< T > &right)
Divide 2 table vectors storing result in first one.
TableVector< T > operator*(const TableVector< T > &left, const TableVector< T > &right)
Multiple 2 table vectors storing result in a new one.
TableVector< T > operator/(const TableVector< T > &left, const TableVector< T > &right)
Divide 2 table vectors storing result in a new one.
void operator*=(TableVector< T > &left, const TableVector< T > &right)
Multiple 2 table vectors storing result in first one.
TableVector< T > operator-(const TableVector< T > &)
Unary minus.
void operator+=(TableVector< T > &left, const TableVector< T > &right)
Add 2 table vectors storing result in first one.
TableVector< T > operator+(const TableVector< T > &)
Unary plus.
void operator-=(TableVector< T > &left, const TableVector< T > &right)
Subtract 2 table vectors storing result in first one.
Transcendental math for table vectors.
TableVector< T > sin(const TableVector< T > &)
TableVector< T > cos(const TableVector< T > &)
TableVector< T > cosh(const TableVector< T > &)
TableVector< T > sinh(const TableVector< T > &)
TableVector< T > log(const TableVector< T > &)
TableVector< T > sqrt(const TableVector< T > &)
TableVector< T > log10(const TableVector< T > &)
TableVector< T > pow(const TableVector< T > &value, const TableVector< T > &exponent)
TableVector< T > exp(const TableVector< T > &)
Miscellaneous table vector operations.
T sum(const TableVector< T > &)
Sum of all the elements of a table vector.
void indgen(TableVector< T > &, T start)
Fills all elements of the table vector with a sequence starting with "start" incremented by one for e...
void indgen(TableVector< T > &, T start, T inc)
Fills all elements of the table vector with a sequence starting with "start" and incrementing by "inc...
T min(const TableVector< T > &)
The minimum element of the table vector.
void minMax(T &min, T &max, const TableVector< T > &)
This sets min and max to the min and max of the vector to avoid having to do two passes with max() an...
T max(const TableVector< T > &)
The maximum element of the table vector.
void indgen(TableVector< T > &)
Fills all elements of the table vector with a sequence starting with 0 and ending with nelements() - ...
T product(const TableVector< T > &)
Product of all the elements of a table vector.
Vector operations on a table vector.
T innerProduct(const TableVector< T > &left, const TableVector< T > &right)
The inner product of 2 table vectors.
T norm(const TableVector< T > &)
The norm of a table vector.
TableVector< T > crossProduct(const TableVector< T > &left, const TableVector< T > &right)
The cross product of 2 table vectors containing 3 elements.