28#ifndef TABLES_TABVECMATH_H
29#define TABLES_TABVECMATH_H
35#include <casacore/casa/aips.h>
36#include <casacore/casa/BasicMath/Math.h>
37#include <casacore/tables/Tables/TableVector.h>
38#include <casacore/tables/Tables/TVecMath.h>
62template<
class T>
inline
65template<
class T>
inline
68template<
class T>
inline
71template<
class T>
inline
75template<
class T>
inline
78template<
class T>
inline
81template<
class T>
inline
84template<
class T>
inline
88template<
class T>
inline
91template<
class T>
inline
95template<
class T>
inline
99template<
class T>
inline
103template<
class T>
inline
107template<
class T>
inline
113template<
class T>
inline
117template<
class T>
inline
121template<
class T>
inline
125template<
class T>
inline
130template<
class T>
inline
134template<
class T>
inline
138template<
class T>
inline
142template<
class T>
inline
209 const double& exponent);
234template<
class T>
inline
239template<
class T>
inline
244template<
class T>
inline
249template<
class T>
inline
254template<
class T>
inline
259template<
class T>
inline
263template<
class T>
inline
270template<
class T>
inline T
293template<
class T>
inline
298template<
class T>
inline
302template<
class T>
inline
315#define TABVECMATHOPER(NAME,OP,OPA) \
316template<class T> inline \
317TableVector<T> aips_name2(operato,OP) (const TableVector<T>& tv, \
319 { return TableVector<T> (aips_name2(tabVecRepvalr,NAME) (tv.tabVec(), \
321template<class T> inline \
322TableVector<T> aips_name2(operato,OP) (const T& v, \
323 const TableVector<T>& tv) \
324 { return TableVector<T> (aips_name2(tabVecRepvall,NAME) (v, \
326template<class T> inline \
327TableVector<T> aips_name2(operato,OP) (const TableVector<T>& l, \
328 const TableVector<T>& r) \
329 { return TableVector<T> (aips_name2(tabVecReptv,NAME) (l.tabVec(), \
331template<class T> inline \
332void aips_name2(operato,OPA) (TableVector<T>& tv, const T& v) \
333 { aips_name2(tabVecRepvalass,NAME) (tv.tabVec(), v); } \
334template<class T> inline \
335void aips_name2(operato,OPA) (TableVector<T>& l, \
336 const TableVector<T>& r) \
337 { aips_name2(tabVecReptvass,NAME) (l.tabVec(), r.tabVec()); }
345#define TABVECMATHFUNC(NAME) \
346template<class T> inline \
347TableVector<T> NAME (const TableVector<T>& tv) \
348 { return TableVector<T> (aips_name2(tabVecRep,NAME) (tv.tabVec())); }
349#define TABVECMATHFUNC2(NAME) \
350template<class T> inline \
351TableVector<T> NAME (const TableVector<T>& l, \
352 const TableVector<T>& r) \
353 { return TableVector<T> (aips_name2(tabVecRep,NAME) (l.tabVec(), \
376template<
class T>
inline
381template<
class T>
inline
383 {
return tabVecRepsum (tv.
tabVec()); }
384template<
class T>
inline
386 {
return tabVecRepproduct (tv.
tabVec()); }
389template<
class T>
inline
392template<
class T>
inline
395template<
class T>
inline
399template<
class T>
inline
401 { tabVecRepindgen (tv.
tabVec(), start, inc); }
402template<
class T>
inline
404 { tabVecRepindgen (tv.
tabVec(), start, T(1)); }
405template<
class T>
inline
407 { tabVecRepindgen (tv.
tabVec(), T(0), T(1)); }
410template<
class T>
inline
412 {
return tabVecRepinnerproduct (l.
tabVec(), r.
tabVec()); }
413template<
class T>
inline
415 {
return tabVecRepnorm (tv.
tabVec()); }
416template<
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.