casacore
Loading...
Searching...
No Matches
SparseDiffMath.h
Go to the documentation of this file.
1// # SparseDiffMath.h: Implements all mathematical functions for SparseDiff.
2// # Copyright (C) 2007
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef SCIMATH_SPARSEDIFFMATH_H
27#define SCIMATH_SPARSEDIFFMATH_H
28
29// # Includes
30
31#include <casacore/casa/aips.h>
32#include <casacore/casa/BasicMath/Math.h>
33#include <casacore/scimath/Mathematics/SparseDiff.h>
34
35namespace casacore { // # NAMESPACE CASACORE - BEGIN
36
37// <summary>
38// Implements all mathematical operators and functions for SparseDiff.
39// </summary>
40//
41// <reviewed reviewer="UNKNOWN" date="" tests="tSparseDiff" demos="">
42// </reviewed>
43//
44// <prerequisite>
45// <li> <linkto class=SparseDiff>SparseDiff</linkto> class
46// </prerequisite>
47//
48// <etymology>
49// Implements all mathematical operators and functions for SparseDiff.
50// </etymology>
51//
52// <todo asof="20001/08/12">
53// <li> nothing I know of
54// </todo>
55
56// <group name="SparseDiff mathematical operations">
58// Unary arithmetic operators.
59// <group>
60template <class T>
62template <class T>
64// </group>
65
66// Arithmetic on two SparseDiff objects, returning a SparseDiff object
67// <group>
68template <class T>
70template <class T>
72template <class T>
74template <class T>
76// </group>
77
78// Arithmetic on a SparseDiff and a scalar, returning a SparseDiff
79// <group>
80template <class T>
81SparseDiff<T> operator+(const SparseDiff<T> &left, const T &right);
82template <class T>
83SparseDiff<T> operator-(const SparseDiff<T> &left, const T &right);
84template <class T>
85SparseDiff<T> operator*(const SparseDiff<T> &left, const T &right);
86template <class T>
87SparseDiff<T> operator/(const SparseDiff<T> &left, const T &right);
88// </group>
89
90// Arithmetic between a scalar and a SparseDiff returning a SparseDiff
91// <group>
92template <class T>
93SparseDiff<T> operator+(const T &left, const SparseDiff<T> &right);
94template <class T>
95SparseDiff<T> operator-(const T &left, const SparseDiff<T> &right);
96template <class T>
97SparseDiff<T> operator*(const T &left, const SparseDiff<T> &right);
98template <class T>
99SparseDiff<T> operator/(const T &left, const SparseDiff<T> &right);
100// </group>
101
102// Transcendental functions
103// <group>
104template <class T>
106template <class T>
108template <class T>
110template <class T>
112template <class T>
114template <class T>
116template <class T>
118template <class T>
120template <class T>
122template <class T>
124template <class T>
126template <class T>
128template <class T>
129SparseDiff<T> pow(const SparseDiff<T> &a, const T &b);
130template <class T>
132template <class T>
134template <class T>
136template <class T>
138template <class T>
140template <class T>
142template <class T>
144template <class T>
146// </group>
147// Floating-point remainder of x/c, with the same sign as x, where c is
148// a constant.
149// <group>
150template <class T>
151SparseDiff<T> fmod(const SparseDiff<T> &x, const T &c);
152template <class T>
154// </group>
155// Floor and ceil of values
156// <group>
157template <class T>
159template <class T>
161// </group>
162
163// Comparison operators. Only the values are compared: in the actual
164// functions, comparisons are used to decide on algorithms. To check
165// if two SparseDiff values are equal, use comparison for both
166// value and derivatives.
167// <note role=tip> To check if two SparseDiff values are equal, use the
168// member method <src>equals()</src> (e.g. for debugging and testing).
169// </note>
170// <group>
171// Compare two SparseDiff's
172template <class T>
173Bool operator>(const SparseDiff<T> &left, const SparseDiff<T> &right);
174template <class T>
175Bool operator<(const SparseDiff<T> &left, const SparseDiff<T> &right);
176template <class T>
177Bool operator>=(const SparseDiff<T> &left, const SparseDiff<T> &right);
178template <class T>
179Bool operator<=(const SparseDiff<T> &left, const SparseDiff<T> &right);
180template <class T>
181Bool operator==(const SparseDiff<T> &left, const SparseDiff<T> &right);
182template <class T>
183Bool operator!=(const SparseDiff<T> &left, const SparseDiff<T> &right);
184template <class T>
185Bool near(const SparseDiff<T> &left, const SparseDiff<T> &right);
186template <class T>
187Bool near(const SparseDiff<T> &left, const SparseDiff<T> &right, const Double tol);
188template <class T>
189Bool allnear(const SparseDiff<T> &left, const SparseDiff<T> &right, const Double tol);
190template <class T>
191Bool nearAbs(const SparseDiff<T> &left, const SparseDiff<T> &right, const Double tol);
192template <class T>
193Bool allnearAbs(const SparseDiff<T> &left, const SparseDiff<T> &right, const Double tol);
194// </group>
195// Compare a SparseDiff and a constant
196// <group>
197template <class T>
198Bool operator>(const SparseDiff<T> &left, const T &right);
199template <class T>
200Bool operator<(const SparseDiff<T> &left, const T &right);
201template <class T>
202Bool operator>=(const SparseDiff<T> &left, const T &right);
203template <class T>
204Bool operator<=(const SparseDiff<T> &left, const T &right);
205template <class T>
206Bool operator==(const SparseDiff<T> &left, const T &right);
207template <class T>
208Bool operator!=(const SparseDiff<T> &left, const T &right);
209template <class T>
210Bool near(const SparseDiff<T> &left, const T &right);
211template <class T>
212Bool near(const SparseDiff<T> &left, const T &right, const Double tol);
213template <class T>
214Bool allnear(const SparseDiff<T> &left, const T &right, const Double tol);
215template <class T>
216Bool nearAbs(const SparseDiff<T> &left, const T &right, const Double tol);
217template <class T>
218Bool allnearAbs(const SparseDiff<T> &left, const T &right, const Double tol);
219// </group>
220// Compare a constant and a SparseDiff
221// <group>
222template <class T>
223Bool operator>(const T &left, const SparseDiff<T> &right);
224template <class T>
225Bool operator<(const T &left, const SparseDiff<T> &right);
226template <class T>
227Bool operator>=(const T &left, const SparseDiff<T> &right);
228template <class T>
229Bool operator<=(const T &left, const SparseDiff<T> &right);
230template <class T>
231Bool operator==(const T &left, const SparseDiff<T> &right);
232template <class T>
233Bool operator!=(const T &left, const SparseDiff<T> &right);
234template <class T>
235Bool near(const T &left, const SparseDiff<T> &right, const Double tol);
236template <class T>
237Bool allnear(const T &left, const SparseDiff<T> &right, const Double tol);
238template <class T>
239Bool nearAbs(const T &left, const SparseDiff<T> &right, const Double tol);
240template <class T>
241Bool allnearAbs(const T &left, const SparseDiff<T> &right, const Double tol);
242// </group>
243// Test special values
244// <group>
245template <class T>
247template <class T>
249// </group>
250// Minimum/maximum
251// <group>
252template <class T>
253SparseDiff<T> min(const SparseDiff<T> &left, const SparseDiff<T> &right);
254template <class T>
255SparseDiff<T> max(const SparseDiff<T> &left, const SparseDiff<T> &right);
256// </group>
257
258// </group>
259
260} // namespace casacore
261
262#ifndef CASACORE_NO_AUTO_TEMPLATES
263#include <casacore/scimath/Mathematics/SparseDiffMath.tcc>
264#endif // # CASACORE_NO_AUTO_TEMPLATES
265#endif
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53
Bool operator<(const SparseDiff< T > &left, const T &right)
Bool near(const T &left, const SparseDiff< T > &right, const Double tol)
SparseDiff< T > operator-(const T &left, const SparseDiff< T > &right)
SparseDiff< T > operator+(const T &left, const SparseDiff< T > &right)
Arithmetic between a scalar and a SparseDiff returning a SparseDiff.
SparseDiff< T > pow(const SparseDiff< T > &a, const SparseDiff< T > &b)
Bool operator!=(const SparseDiff< T > &left, const SparseDiff< T > &right)
SparseDiff< T > acos(const SparseDiff< T > &ad)
Transcendental functions.
SparseDiff< T > operator+(const SparseDiff< T > &other)
Unary arithmetic operators.
SparseDiff< T > min(const SparseDiff< T > &left, const SparseDiff< T > &right)
Minimum/maximum.
SparseDiff< T > operator*(const SparseDiff< T > &left, const T &right)
SparseDiff< T > operator/(const T &left, const SparseDiff< T > &right)
SparseDiff< T > operator-(const SparseDiff< T > &left, const SparseDiff< T > &right)
SparseDiff< T > operator*(const SparseDiff< T > &left, const SparseDiff< T > &right)
Bool allnearAbs(const SparseDiff< T > &left, const T &right, const Double tol)
Bool near(const SparseDiff< T > &left, const SparseDiff< T > &right, const Double tol)
Bool operator>=(const SparseDiff< T > &left, const T &right)
Bool operator==(const T &left, const SparseDiff< T > &right)
SparseDiff< T > operator+(const SparseDiff< T > &left, const SparseDiff< T > &right)
Arithmetic on two SparseDiff objects, returning a SparseDiff object.
Bool operator<(const SparseDiff< T > &left, const SparseDiff< T > &right)
Bool operator<=(const SparseDiff< T > &left, const SparseDiff< T > &right)
SparseDiff< T > operator+(const SparseDiff< T > &left, const T &right)
Arithmetic on a SparseDiff and a scalar, returning a SparseDiff.
Bool allnear(const SparseDiff< T > &left, const SparseDiff< T > &right, const Double tol)
SparseDiff< T > atan2(const SparseDiff< T > &y, const SparseDiff< T > &x)
Bool operator==(const SparseDiff< T > &left, const SparseDiff< T > &right)
SparseDiff< T > max(const SparseDiff< T > &left, const SparseDiff< T > &right)
Bool operator<(const T &left, const SparseDiff< T > &right)
Bool near(const SparseDiff< T > &left, const T &right, const Double tol)
SparseDiff< T > operator/(const SparseDiff< T > &left, const SparseDiff< T > &right)
Bool operator<=(const T &left, const SparseDiff< T > &right)
Bool allnearAbs(const T &left, const SparseDiff< T > &right, const Double tol)
Bool operator>(const T &left, const SparseDiff< T > &right)
Compare a constant and a SparseDiff.
Bool operator>=(const SparseDiff< T > &left, const SparseDiff< T > &right)
Bool near(const SparseDiff< T > &left, const SparseDiff< T > &right)
Bool allnear(const T &left, const SparseDiff< T > &right, const Double tol)
Bool operator!=(const SparseDiff< T > &left, const T &right)
Bool operator>=(const T &left, const SparseDiff< T > &right)
SparseDiff< T > operator*(const T &left, const SparseDiff< T > &right)
Bool operator>(const SparseDiff< T > &left, const SparseDiff< T > &right)
Comparison operators.
Bool nearAbs(const SparseDiff< T > &left, const SparseDiff< T > &right, const Double tol)
SparseDiff< T > fmod(const SparseDiff< T > &x, const T &c)
Floating-point remainder of x/c, with the same sign as x, where c is a constant.
Bool allnear(const SparseDiff< T > &left, const T &right, const Double tol)
Bool operator==(const SparseDiff< T > &left, const T &right)
SparseDiff< T > fmod(const SparseDiff< T > &x, const SparseDiff< T > &c)
SparseDiff< T > pow(const SparseDiff< T > &a, const T &b)
Bool nearAbs(const T &left, const SparseDiff< T > &right, const Double tol)
Bool allnearAbs(const SparseDiff< T > &left, const SparseDiff< T > &right, const Double tol)
SparseDiff< T > floor(const SparseDiff< T > &ad)
Floor and ceil of values.
SparseDiff< T > operator-(const SparseDiff< T > &left, const T &right)
Bool operator>(const SparseDiff< T > &left, const T &right)
Compare a SparseDiff and a constant.
Bool nearAbs(const SparseDiff< T > &left, const T &right, const Double tol)
Bool operator<=(const SparseDiff< T > &left, const T &right)
SparseDiff< T > operator/(const SparseDiff< T > &left, const T &right)
Bool operator!=(const T &left, const SparseDiff< T > &right)
Bool isNaN(const SparseDiff< T > &val)
Test special values.