casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrayMath.h
Go to the documentation of this file.
1 //# ArrayMath.h: ArrayMath: Simple mathematics done on an entire array.
2 //# Copyright (C) 1993,1994,1995,1996,1998,1999,2001,2003
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: aips2-request@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 //# $Id$
27 
28 #ifndef CASA_ARRAYMATH_H
29 #define CASA_ARRAYMATH_H
30 
31 #include <casacore/casa/aips.h>
35 //# Needed to get the proper Complex typedef's
39 #include <numeric>
40 #include <functional>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 template<class T> class Matrix;
45 
46 // <summary>
47 // Mathematical operations for Arrays.
48 // </summary>
49 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tArray">
50 //
51 // <prerequisite>
52 // <li> <linkto class=Array>Array</linkto>
53 // </prerequisite>
54 //
55 // <etymology>
56 // This file contains global functions which perform element by element
57 // mathematical operations on arrays.
58 // </etymology>
59 //
60 // <synopsis>
61 // These functions perform element by element mathematical operations on
62 // arrays. The two arrays must conform.
63 //
64 // Furthermore it defines functions a la std::transform to transform one or
65 // two arrays by means of a unary or binary operator. All math and logical
66 // operations on arrays can be expressed by means of these transform functions.
67 // <br>It also defines an in-place transform function because for non-trivial
68 // iterators it works faster than a transform where the result is an iterator
69 // on the same data object as the left operand.
70 // <br>The transform functions distinguish between contiguous and non-contiguous
71 // arrays because iterating through a contiguous array can be done in a faster
72 // way.
73 // <br> Similar to the standard transform function these functions do not check
74 // if the shapes match. The user is responsible for that.
75 // </synopsis>
76 //
77 // <example>
78 // <srcblock>
79 // Vector<Int> a(10);
80 // Vector<Int> b(10);
81 // Vector<Int> c(10);
82 // . . .
83 // c = a + b;
84 // </srcblock>
85 // This example sets the elements of c to (a+b). It checks if a and b have the
86 // same shape.
87 // The result of this operation is an Array.
88 // </example>
89 //
90 // <example>
91 // <srcblock>
92 // c = arrayTransformResult (a, b, std::plus<Double>());
93 // </srcblock>
94 // This example does the same as the previous example, but expressed using
95 // the transform function (which, in fact, is used by the + operator above).
96 // However, it is not checked if the shapes match.
97 // </example>
98 
99 // <example>
100 // <srcblock>
101 // arrayContTransform (a, b, c, std::plus<Double>());
102 // </srcblock>
103 // This example does the same as the previous example, but is faster because
104 // the result array already exists and does not need to be allocated.
105 // Note that the caller must be sure that c is contiguous.
106 // </example>
107 
108 // <example>
109 // <srcblock>
110 // Vector<Double> a(10);
111 // Vector<Double> b(10);
112 // Vector<Double> c(10);
113 // . . .
114 // c = atan2 (a, b);
115 // </srcblock>
116 // This example sets the elements of c to atan2 (a,b).
117 // The result of this operation is an Array.
118 // </example>
119 //
120 // <example>
121 // <srcblock>
122 // Vector<Int> a(10);
123 // Int result;
124 // . . .
125 // result = sum (a);
126 // </srcblock>
127 // This example sums a.
128 // </example>
129 //
130 // <motivation>
131 // One wants to be able to perform mathematical operations on arrays.
132 // </motivation>
133 //
134 // <linkfrom anchor="Array mathematical operations" classes="Array Vector Matrix Cube">
135 // <here>Array mathematical operations</here> -- Mathematical operations for
136 // Arrays.
137 // </linkfrom>
138 //
139 // <group name="Array mathematical operations">
141 
142  // The myxtransform functions are defined to avoid a bug in g++-4.3.
143  // That compiler generates incorrect code when only -g is used for
144  // a std::transform with a bind1st or bind2nd for a complex<float>.
145  // So, for example, the multiplication of a Complex array and Complex scalar
146  // would fail (see g++ bug 39678).
147  // <group>
148  // sequence = scalar OP sequence
149  template<typename _InputIterator1, typename T,
150  typename _OutputIterator, typename _BinaryOperation>
151  void
152  myltransform(_InputIterator1 __first1, _InputIterator1 __last1,
153  _OutputIterator __result, T left,
154  _BinaryOperation __binary_op)
155  {
156  for ( ; __first1 != __last1; ++__first1, ++__result)
157  *__result = __binary_op(left, *__first1);
158  }
159  // sequence = sequence OP scalar
160  template<typename _InputIterator1, typename T,
161  typename _OutputIterator, typename _BinaryOperation>
162  void
163  myrtransform(_InputIterator1 __first1, _InputIterator1 __last1,
164  _OutputIterator __result, T right,
165  _BinaryOperation __binary_op)
166  {
167  for ( ; __first1 != __last1; ++__first1, ++__result)
168  *__result = __binary_op(*__first1, right);
169  }
170  // sequence OP= scalar
171  template<typename _InputIterator1, typename T,
172  typename _BinaryOperation>
173  void
174  myiptransform(_InputIterator1 __first1, _InputIterator1 __last1,
175  T right,
176  _BinaryOperation __binary_op)
177  {
178  for ( ; __first1 != __last1; ++__first1)
179  *__first1 = __binary_op(*__first1, right);
180  }
181  // </group>
182 
183 
184 // Functions to apply a binary or unary operator to arrays.
185 // They are modeled after std::transform.
186 // They do not check if the shapes conform; as in std::transform the
187 // user must take care that the operands conform.
188 // <group>
189 // Transform left and right to a result using the binary operator.
190 // Result MUST be a contiguous array.
191 template<typename L, typename R, typename RES, typename BinaryOperator>
192 inline void arrayContTransform (const Array<L>& left, const Array<R>& right,
193  Array<RES>& result, BinaryOperator op)
194 {
196  if (left.contiguousStorage() && right.contiguousStorage()) {
197  std::transform (left.cbegin(), left.cend(), right.cbegin(),
198  result.cbegin(), op);
199  } else {
200  std::transform (left.begin(), left.end(), right.begin(),
201  result.cbegin(), op);
202  }
203 }
204 
205 // Transform left and right to a result using the binary operator.
206 // Result MUST be a contiguous array.
207 template<typename L, typename R, typename RES, typename BinaryOperator>
208 inline void arrayContTransform (const Array<L>& left, R right,
209  Array<RES>& result, BinaryOperator op)
210 {
212  if (left.contiguousStorage()) {
213  myrtransform (left.cbegin(), left.cend(),
214  result.cbegin(), right, op);
217  } else {
218  myrtransform (left.begin(), left.end(),
219  result.cbegin(), right, op);
222  }
223 }
224 
225 // Transform left and right to a result using the binary operator.
226 // Result MUST be a contiguous array.
227 template<typename L, typename R, typename RES, typename BinaryOperator>
228 inline void arrayContTransform (L left, const Array<R>& right,
229  Array<RES>& result, BinaryOperator op)
230 {
232  if (right.contiguousStorage()) {
233  myltransform (right.cbegin(), right.cend(),
234  result.cbegin(), left, op);
237  } else {
238  myltransform (right.begin(), right.end(),
239  result.cbegin(), left, op);
242  }
243 }
244 
245 // Transform array to a result using the unary operator.
246 // Result MUST be a contiguous array.
247 template<typename T, typename RES, typename UnaryOperator>
248 inline void arrayContTransform (const Array<T>& arr,
249  Array<RES>& result, UnaryOperator op)
250 {
252  if (arr.contiguousStorage()) {
253  std::transform (arr.cbegin(), arr.cend(), result.cbegin(), op);
254  } else {
255  std::transform (arr.begin(), arr.end(), result.cbegin(), op);
256  }
257 }
258 
259 // Transform left and right to a result using the binary operator.
260 // Result need not be a contiguous array.
261 template<typename L, typename R, typename RES, typename BinaryOperator>
262 void arrayTransform (const Array<L>& left, const Array<R>& right,
263  Array<RES>& result, BinaryOperator op);
264 
265 // Transform left and right to a result using the binary operator.
266 // Result need not be a contiguous array.
267 template<typename L, typename R, typename RES, typename BinaryOperator>
268 void arrayTransform (const Array<L>& left, R right,
269  Array<RES>& result, BinaryOperator op);
270 
271 // Transform left and right to a result using the binary operator.
272 // Result need not be a contiguous array.
273 template<typename L, typename R, typename RES, typename BinaryOperator>
274 void arrayTransform (L left, const Array<R>& right,
275  Array<RES>& result, BinaryOperator op);
276 
277 // Transform array to a result using the unary operator.
278 // Result need not be a contiguous array.
279 template<typename T, typename RES, typename UnaryOperator>
280 void arrayTransform (const Array<T>& arr,
281  Array<RES>& result, UnaryOperator op);
282 
283 // Transform left and right to a result using the binary operator.
284 // The created and returned result array is contiguous.
285 template<typename T, typename BinaryOperator>
286 Array<T> arrayTransformResult (const Array<T>& left, const Array<T>& right,
287  BinaryOperator op);
288 
289 // Transform left and right to a result using the binary operator.
290 // The created and returned result array is contiguous.
291 template<typename T, typename BinaryOperator>
292 Array<T> arrayTransformResult (const Array<T>& left, T right, BinaryOperator op);
293 
294 // Transform left and right to a result using the binary operator.
295 // The created and returned result array is contiguous.
296 template<typename T, typename BinaryOperator>
297 Array<T> arrayTransformResult (T left, const Array<T>& right, BinaryOperator op);
298 
299 // Transform array to a result using the unary operator.
300 // The created and returned result array is contiguous.
301 template<typename T, typename UnaryOperator>
302 Array<T> arrayTransformResult (const Array<T>& arr, UnaryOperator op);
303 
304 // Transform left and right in place using the binary operator.
305 // The result is stored in the left array (useful for e.g. the += operation).
306 template<typename L, typename R, typename BinaryOperator>
307 inline void arrayTransformInPlace (Array<L>& left, const Array<R>& right,
308  BinaryOperator op)
309 {
310  if (left.contiguousStorage() && right.contiguousStorage()) {
311  transformInPlace (left.cbegin(), left.cend(), right.cbegin(), op);
312  } else {
313  transformInPlace (left.begin(), left.end(), right.begin(), op);
314  }
315 }
316 
317 // Transform left and right in place using the binary operator.
318 // The result is stored in the left array (useful for e.g. the += operation).
319 template<typename L, typename R, typename BinaryOperator>
320 inline void arrayTransformInPlace (Array<L>& left, R right, BinaryOperator op)
321 {
322  if (left.contiguousStorage()) {
323  myiptransform (left.cbegin(), left.cend(), right, op);
325  } else {
326  myiptransform (left.begin(), left.end(), right, op);
328  }
329 }
330 
331 // Transform the array in place using the unary operator.
332 // E.g. doing <src>arrayTransformInPlace(array, Sin<T>())</src> is faster than
333 // <src>array=sin(array)</src> as it does not need to create a temporary array.
334 template<typename T, typename UnaryOperator>
335 inline void arrayTransformInPlace (Array<T>& arr, UnaryOperator op)
336 {
337  if (arr.contiguousStorage()) {
338  transformInPlace (arr.cbegin(), arr.cend(), op);
339  } else {
340  transformInPlace (arr.begin(), arr.end(), op);
341  }
342 }
343 // </group>
344 
345 //
346 // Element by element arithmetic modifying left in-place. left and other
347 // must be conformant.
348 // <group>
349 template<class T> void operator+= (Array<T> &left, const Array<T> &other);
350 template<class T> void operator-= (Array<T> &left, const Array<T> &other);
351 template<class T> void operator*= (Array<T> &left, const Array<T> &other);
352 template<class T> void operator/= (Array<T> &left, const Array<T> &other);
353 template<class T> void operator%= (Array<T> &left, const Array<T> &other);
354 template<class T> void operator&= (Array<T> &left, const Array<T> &other);
355 template<class T> void operator|= (Array<T> &left, const Array<T> &other);
356 template<class T> void operator^= (Array<T> &left, const Array<T> &other);
357 // </group>
358 
359 //
360 // Element by element arithmetic modifying left in-place. The scalar "other"
361 // behaves as if it were a conformant Array to left filled with constant values.
362 // <group>
363 template<class T> void operator+= (Array<T> &left, const T &other);
364 template<class T> void operator-= (Array<T> &left, const T &other);
365 template<class T> void operator*= (Array<T> &left, const T &other);
366 template<class T> void operator/= (Array<T> &left, const T &other);
367 template<class T> void operator%= (Array<T> &left, const T &other);
368 template<class T> void operator&= (Array<T> &left, const T &other);
369 template<class T> void operator|= (Array<T> &left, const T &other);
370 template<class T> void operator^= (Array<T> &left, const T &other);
371 // </group>
372 
373 // Unary arithmetic operation.
374 //
375 // <group>
376 template<class T> Array<T> operator+(const Array<T> &a);
377 template<class T> Array<T> operator-(const Array<T> &a);
378 template<class T> Array<T> operator~(const Array<T> &a);
379 // </group>
380 
381 //
382 // Element by element arithmetic on two arrays, returning an array.
383 // <group>
384 template<class T>
385  Array<T> operator+ (const Array<T> &left, const Array<T> &right);
386 template<class T>
387  Array<T> operator- (const Array<T> &left, const Array<T> &right);
388 template<class T>
389  Array<T> operator* (const Array<T> &left, const Array<T> &right);
390 template<class T>
391  Array<T> operator/ (const Array<T> &left, const Array<T> &right);
392 template<class T>
393  Array<T> operator% (const Array<T> &left, const Array<T> &right);
394 template<class T>
395  Array<T> operator| (const Array<T> &left, const Array<T> &right);
396 template<class T>
397  Array<T> operator& (const Array<T> &left, const Array<T> &right);
398 template<class T>
399  Array<T> operator^ (const Array<T> &left, const Array<T> &right);
400 // </group>
401 
402 //
403 // Element by element arithmetic between an array and a scalar, returning
404 // an array.
405 // <group>
406 template<class T>
407  Array<T> operator+ (const Array<T> &left, const T &right);
408 template<class T>
409  Array<T> operator- (const Array<T> &left, const T &right);
410 template<class T>
411  Array<T> operator* (const Array<T> &left, const T &right);
412 template<class T>
413  Array<T> operator/ (const Array<T> &left, const T &right);
414 template<class T>
415  Array<T> operator% (const Array<T> &left, const T &right);
416 template<class T>
417  Array<T> operator| (const Array<T> &left, const T &right);
418 template<class T>
419  Array<T> operator& (const Array<T> &left, const T &right);
420 template<class T>
421  Array<T> operator^ (const Array<T> &left, const T &right);
422 // </group>
423 
424 //
425 // Element by element arithmetic between a scalar and an array, returning
426 // an array.
427 // <group>
428 template<class T>
429  Array<T> operator+ (const T &left, const Array<T> &right);
430 template<class T>
431  Array<T> operator- (const T &left, const Array<T> &right);
432 template<class T>
433  Array<T> operator* (const T &left, const Array<T> &right);
434 template<class T>
435  Array<T> operator/ (const T &left, const Array<T> &right);
436 template<class T>
437  Array<T> operator% (const T &left, const Array<T> &right);
438 template<class T>
439  Array<T> operator| (const T &left, const Array<T> &right);
440 template<class T>
441  Array<T> operator& (const T &left, const Array<T> &right);
442 template<class T>
443  Array<T> operator^ (const T &left, const Array<T> &right);
444 // </group>
445 
446 //
447 // Transcendental function that can be applied to essentially all numeric
448 // types. Works on an element-by-element basis.
449 // <group>
450 template<class T> Array<T> cos(const Array<T> &a);
451 template<class T> Array<T> cosh(const Array<T> &a);
452 template<class T> Array<T> exp(const Array<T> &a);
453 template<class T> Array<T> log(const Array<T> &a);
454 template<class T> Array<T> log10(const Array<T> &a);
455 template<class T> Array<T> pow(const Array<T> &a, const Array<T> &b);
456 template<class T> Array<T> pow(const T &a, const Array<T> &b);
457 template<class T> Array<T> sin(const Array<T> &a);
458 template<class T> Array<T> sinh(const Array<T> &a);
459 template<class T> Array<T> sqrt(const Array<T> &a);
460 // </group>
461 
462 //
463 // Transcendental function applied to the array on an element-by-element
464 // basis. Although a template function, this does not make sense for all
465 // numeric types.
466 // <group>
467 template<class T> Array<T> acos(const Array<T> &a);
468 template<class T> Array<T> asin(const Array<T> &a);
469 template<class T> Array<T> atan(const Array<T> &a);
470 template<class T> Array<T> atan2(const Array<T> &y, const Array<T> &x);
471 template<class T> Array<T> atan2(const T &y, const Array<T> &x);
472 template<class T> Array<T> atan2(const Array<T> &y, const T &x);
473 template<class T> Array<T> ceil(const Array<T> &a);
474 template<class T> Array<T> fabs(const Array<T> &a);
475 template<class T> Array<T> abs(const Array<T> &a);
476 template<class T> Array<T> floor(const Array<T> &a);
477 template<class T> Array<T> round(const Array<T> &a);
478 template<class T> Array<T> sign(const Array<T> &a);
479 template<class T> Array<T> fmod(const Array<T> &a, const Array<T> &b);
480 template<class T> Array<T> fmod(const T &a, const Array<T> &b);
481 template<class T> Array<T> fmod(const Array<T> &a, const T &b);
482 template<class T> Array<T> floormod(const Array<T> &a, const Array<T> &b);
483 template<class T> Array<T> floormod(const T &a, const Array<T> &b);
484 template<class T> Array<T> floormod(const Array<T> &a, const T &b);
485 template<class T> Array<T> pow(const Array<T> &a, const Double &b);
486 template<class T> Array<T> tan(const Array<T> &a);
487 template<class T> Array<T> tanh(const Array<T> &a);
488 // N.B. fabs is deprecated. Use abs.
489 template<class T> Array<T> fabs(const Array<T> &a);
490 // </group>
491 
492 //
493 // <group>
494 // Find the minimum and maximum values of an array, including their locations.
495 template<class ScalarType>
496 void minMax(ScalarType &minVal, ScalarType &maxVal, IPosition &minPos,
497  IPosition &maxPos, const Array<ScalarType> &array);
498 // The array is searched at locations where the mask equals <src>valid</src>.
499 // (at least one such position must exist or an exception will be thrown).
500 // MaskType should be an Array of Bool.
501 template<class ScalarType>
502 void minMax(ScalarType &minVal, ScalarType &maxVal, IPosition &minPos,
503  IPosition &maxPos, const Array<ScalarType> &array,
504  const Array<Bool> &mask, Bool valid=True);
505 // The array * weight is searched
506 template<class ScalarType>
507 void minMaxMasked(ScalarType &minVal, ScalarType &maxVal, IPosition &minPos,
508  IPosition &maxPos, const Array<ScalarType> &array,
509  const Array<ScalarType> &weight);
510 // </group>
511 
512 //
513 // The "min" and "max" functions require that the type "T" have comparison
514 // operators.
515 // <group>
516 //
517 // This sets min and max to the minimum and maximum of the array to
518 // avoid having to do two passes with max() and min() separately.
519 template<class T> void minMax(T &min, T &max, const Array<T> &a);
520 //
521 // The minimum element of the array.
522 // Requires that the type "T" has comparison operators.
523 template<class T> T min(const Array<T> &a);
524 // The maximum element of the array.
525 // Requires that the type "T" has comparison operators.
526 template<class T> T max(const Array<T> &a);
527 
528 // "result" contains the maximum of "a" and "b" at each position. "result",
529 // "a", and "b" must be conformant.
530 template<class T> void max(Array<T> &result, const Array<T> &a,
531  const Array<T> &b);
532 // "result" contains the minimum of "a" and "b" at each position. "result",
533 // "a", and "b" must be conformant.
534 template<class T> void min(Array<T> &result, const Array<T> &a,
535  const Array<T> &b);
536 // Return an array that contains the maximum of "a" and "b" at each position.
537 // "a" and "b" must be conformant.
538 template<class T> Array<T> max(const Array<T> &a, const Array<T> &b);
539 template<class T> Array<T> max(const T &a, const Array<T> &b);
540 // Return an array that contains the minimum of "a" and "b" at each position.
541 // "a" and "b" must be conformant.
542 template<class T> Array<T> min(const Array<T> &a, const Array<T> &b);
543 
544 // "result" contains the maximum of "a" and "b" at each position. "result",
545 // and "a" must be conformant.
546 template<class T> void max(Array<T> &result, const Array<T> &a,
547  const T &b);
548 template<class T> inline void max(Array<T> &result, const T &a,
549  const Array<T> &b)
550  { max (result, b, a); }
551 // "result" contains the minimum of "a" and "b" at each position. "result",
552 // and "a" must be conformant.
553 template<class T> void min(Array<T> &result, const Array<T> &a,
554  const T &b);
555 template<class T> inline void min(Array<T> &result, const T &a,
556  const Array<T> &b)
557  { min (result, b, a); }
558 // Return an array that contains the maximum of "a" and "b" at each position.
559 template<class T> Array<T> max(const Array<T> &a, const T &b);
560 template<class T> inline Array<T> max(const T &a, const Array<T> &b)
561  { return max(b, a); }
562 // Return an array that contains the minimum of "a" and "b" at each position.
563 template<class T> Array<T> min(const Array<T> &a, const T &b);
564 template<class T> inline Array<T> min(const T &a, const Array<T> &b)
565  { return min(b, a); }
566 // </group>
567 
568 //
569 // Fills all elements of "array" with a sequence starting with "start"
570 // and incrementing by "inc" for each element. The first axis varies
571 // most rapidly.
572 template<class T> void indgen(Array<T> &a, T start, T inc);
573 //
574 // Fills all elements of "array" with a sequence starting with 0
575 // and ending with nelements() - 1. The first axis varies
576 // most rapidly.
577 template<class T> inline void indgen(Array<T> &a)
578  { indgen(a, T(0), T(1)); }
579 //
580 // Fills all elements of "array" with a sequence starting with start
581 // incremented by one for each position in the array. The first axis varies
582 // most rapidly.
583 template<class T> inline void indgen(Array<T> &a, T start)
584  { indgen(a, start, T(1)); }
585 
586 // Create a Vector of the given length and fill it with the start value
587 // incremented with <code>inc</code> for each element.
588 template<class T> inline Vector<T> indgen(uInt length, T start, T inc)
589 {
590  Vector<T> x(length);
591  indgen(x, start, inc);
592  return x;
593 }
594 
595 
596 // Sum of every element of the array.
597 template<class T> T sum(const Array<T> &a);
598 //
599 // Sum the square of every element of the array.
600 template<class T> T sumsqr(const Array<T> &a);
601 //
602 // Product of every element of the array. This could of course easily
603 // overflow.
604 template<class T> T product(const Array<T> &a);
605 
606 //
607 // The mean of "a" is the sum of all elements of "a" divided by the number
608 // of elements of "a".
609 template<class T> T mean(const Array<T> &a);
610 
611 // The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - ddof).
612 // Similar to numpy the argument ddof (delta degrees of freedom) tells if the
613 // population variance (ddof=0) or the sample variance (ddof=1) is taken.
614 // The variance functions proper use ddof=1.
615 // <br>Note that for a complex valued T the absolute values are used; in that way
616 // the variance is equal to the sum of the variances of the real and imaginary parts.
617 // Hence the imaginary part in the return value is 0.
618 template<class T> T variance(const Array<T> &a);
619 template<class T> T pvariance(const Array<T> &a, uInt ddof=0);
620 // Rather than using a computed mean, use the supplied value.
621 template<class T> T variance(const Array<T> &a, T mean);
622 template<class T> T pvariance(const Array<T> &a, T mean, uInt ddof=0);
623 
624 // The standard deviation of "a" is the square root of its variance.
625 template<class T> T stddev(const Array<T> &a);
626 template<class T> T pstddev(const Array<T> &a, uInt ddof=0);
627 template<class T> T stddev(const Array<T> &a, T mean);
628 template<class T> T pstddev(const Array<T> &a, T mean, uInt ddof=0);
629 
630 //
631 // The average deviation of "a" is the sum of abs(a(i) - mean(a))/N. (N.B.
632 // N, not N-1 in the denominator).
633 template<class T> T avdev(const Array<T> &a);
634 //
635 // The average deviation of "a" is the sum of abs(a(i) - mean(a))/N. (N.B.
636 // N, not N-1 in the denominator).
637 // Rather than using a computed mean, use the supplied value.
638 template<class T> T avdev(const Array<T> &a,T mean);
639 
640 //
641 // The root-mean-square of "a" is the sqrt of sum(a*a)/N.
642 template<class T> T rms(const Array<T> &a);
643 
644 
645 // The median of "a" is a(n/2).
646 // If a has an even number of elements and the switch takeEvenMean is set,
647 // the median is 0.5*(a(n/2) + a((n+1)/2)).
648 // According to Numerical Recipes (2nd edition) it makes little sense to take
649 // the mean if the array is large enough (> 100 elements). Therefore
650 // the default for takeEvenMean is False if the array has > 100 elements,
651 // otherwise it is True.
652 // <br>If "sorted"==True we assume the data is already sorted and we
653 // compute the median directly. Otherwise the function GenSort::kthLargest
654 // is used to find the median (kthLargest is about 6 times faster
655 // than a full quicksort).
656 // <br>Finding the median means that the array has to be (partially)
657 // sorted. By default a copy will be made, but if "inPlace" is in effect,
658 // the data themselves will be sorted. That should only be used if the
659 // data are used not thereafter.
660 // <note>The function kthLargest in class GenSortIndirect can be used to
661 // obtain the index of the median in an array. </note>
662 // <group>
663 template<class T> T median(const Array<T> &a, Block<T> &tmp, Bool sorted,
664  Bool takeEvenMean, Bool inPlace=False);
665 template<class T> T median(const Array<T> &a, Bool sorted, Bool takeEvenMean,
666  Bool inPlace=False)
667  { Block<T> tmp; return median (a, tmp, sorted, takeEvenMean, inPlace); }
668 template<class T> inline T median(const Array<T> &a, Bool sorted)
669  { return median (a, sorted, (a.nelements() <= 100), False); }
670 template<class T> inline T median(const Array<T> &a)
671  { return median (a, False, (a.nelements() <= 100), False); }
672 template<class T> inline T medianInPlace(const Array<T> &a, Bool sorted=False)
673  { return median (a, sorted, (a.nelements() <= 100), True); }
674 // </group>
675 
676 // The median absolute deviation from the median. Interface is as for
677 // the median functions
678 // <group>
679 template<class T> T madfm(const Array<T> &a, Block<T> &tmp, Bool sorted,
680  Bool takeEvenMean, Bool inPlace = False);
681 template<class T> T madfm(const Array<T> &a, Bool sorted, Bool takeEvenMean,
682  Bool inPlace=False)
683  { Block<T> tmp; return madfm(a, tmp, sorted, takeEvenMean, inPlace); }
684 template<class T> inline T madfm(const Array<T> &a, Bool sorted)
685  { return madfm(a, sorted, (a.nelements() <= 100), False); }
686 template<class T> inline T madfm(const Array<T> &a)
687  { return madfm(a, False, (a.nelements() <= 100), False); }
688 template<class T> inline T madfmInPlace(const Array<T> &a, Bool sorted=False)
689  { return madfm(a, sorted, (a.nelements() <= 100), True); }
690 // </group>
691 
692 // Return the fractile of an array.
693 // It returns the value at the given fraction of the array.
694 // A fraction of 0.5 is the same as the median, be it that no mean of
695 // the two middle elements is taken if the array has an even nr of elements.
696 // It uses kthLargest if the array is not sorted yet.
697 // <note>The function kthLargest in class GenSortIndirect can be used to
698 // obtain the index of the fractile in an array. </note>
699 template<class T> T fractile(const Array<T> &a, Block<T> &tmp, Float fraction,
700  Bool sorted=False, Bool inPlace=False);
701 template<class T> T fractile(const Array<T> &a, Float fraction,
702  Bool sorted=False, Bool inPlace=False)
703  { Block<T> tmp; return fractile (a, tmp, fraction, sorted, inPlace); }
704 
705 // Return the inter-fractile range of an array.
706 // This is the full range between the bottom and the top fraction.
707 // <group>
708 template<class T> T interFractileRange(const Array<T> &a, Block<T> &tmp,
709  Float fraction,
710  Bool sorted=False, Bool inPlace=False);
711 template<class T> T interFractileRange(const Array<T> &a, Float fraction,
712  Bool sorted=False, Bool inPlace=False)
713  { Block<T> tmp; return interFractileRange(a, tmp, fraction, sorted, inPlace); }
714 // </group>
715 
716 // Return the inter-hexile range of an array.
717 // This is the full range between the bottom sixth and the top sixth
718 // of ordered array values. "The semi-interhexile range is very nearly
719 // equal to the rms for a Gaussian distribution, but it is much less
720 // sensitive to the tails of extended distributions." (Condon et al
721 // 1998)
722 // <group>
723 template<class T> T interHexileRange(const Array<T> &a, Block<T> &tmp,
724  Bool sorted=False, Bool inPlace=False)
725  { return interFractileRange(a, tmp, 1./6., sorted, inPlace); }
726 template<class T> T interHexileRange(const Array<T> &a, Bool sorted=False,
727  Bool inPlace=False)
728  { return interFractileRange(a, 1./6., sorted, inPlace); }
729 // </group>
730 
731 // Return the inter-quartile range of an array.
732 // This is the full range between the bottom quarter and the top
733 // quarter of ordered array values.
734 // <group>
735 template<class T> T interQuartileRange(const Array<T> &a, Block<T> &tmp,
736  Bool sorted=False, Bool inPlace=False)
737  { return interFractileRange(a, tmp, 0.25, sorted, inPlace); }
738 template<class T> T interQuartileRange(const Array<T> &a, Bool sorted=False,
739  Bool inPlace=False)
740  { return interFractileRange(a, 0.25, sorted, inPlace); }
741 // </group>
742 
743 
744 // Methods for element-by-element scaling of complex and real.
745 // Note that Complex and DComplex are typedefs for std::complex.
746 //<group>
747 template<typename T>
748 void operator*= (Array<std::complex<T> > &left, const Array<T> &other);
749 template<typename T>
750 void operator*= (Array<std::complex<T> > &left, const T &other);
751 template<typename T>
752 void operator/= (Array<std::complex<T> > &left, const Array<T> &other);
753 template<typename T>
754 void operator/= (Array<std::complex<T> > &left, const T &other);
755 template<typename T>
756 Array<std::complex<T> > operator* (const Array<std::complex<T> > &left,
757  const Array<T> &right);
758 template<typename T>
759 Array<std::complex<T> > operator* (const Array<std::complex<T> > &left,
760  const T &right);
761 template<typename T>
762 Array<std::complex<T> > operator* (const std::complex<T> &left,
763  const Array<T> &right);
764 template<typename T>
765 Array<std::complex<T> > operator/ (const Array<std::complex<T> > &left,
766  const Array<T> &right);
767 template<typename T>
768 Array<std::complex<T> > operator/ (const Array<std::complex<T> > &left,
769  const T &right);
770 template<typename T>
771 Array<std::complex<T> > operator/ (const std::complex<T> &left,
772  const Array<T> &right);
773 // </group>
774 
775 // Returns the complex conjugate of a complex array.
776 //<group>
777 Array<Complex> conj(const Array<Complex> &carray);
778 Array<DComplex> conj(const Array<DComplex> &carray);
779 // Modifies rarray in place. rarray must be conformant.
780 void conj(Array<Complex> &rarray, const Array<Complex> &carray);
781 void conj(Array<DComplex> &rarray, const Array<DComplex> &carray);
782 //# The following are implemented to make the compiler find the right conversion
783 //# more often.
784 Matrix<Complex> conj(const Matrix<Complex> &carray);
785 Matrix<DComplex> conj(const Matrix<DComplex> &carray);
786 //</group>
787 
788 // Form an array of complex numbers from the given real arrays.
789 // Note that Complex and DComplex are simply typedefs for std::complex<float>
790 // and std::complex<double>, so the result is in fact one of these types.
791 // <group>
792 template<typename T>
793 Array<std::complex<T> > makeComplex(const Array<T> &real, const Array<T>& imag);
794 template<typename T>
795 Array<std::complex<T> > makeComplex(const T &real, const Array<T>& imag);
796 template<typename T>
797 Array<std::complex<T> > makeComplex(const Array<T> &real, const T& imag);
798 // </group>
799 
800 // Set the real part of the left complex array to the right real array.
801 template<typename L, typename R>
802 void setReal(Array<L> &carray, const Array<R> &rarray);
803 
804 // Set the imaginary part of the left complex array to right real array.
805 template<typename R, typename L>
806 void setImag(Array<R> &carray, const Array<L> &rarray);
807 
808 // Extracts the real part of a complex array into an array of floats.
809 // <group>
810 Array<Float> real(const Array<Complex> &carray);
811 Array<Double> real(const Array<DComplex> &carray);
812 // Modifies rarray in place. rarray must be conformant.
813 void real(Array<Float> &rarray, const Array<Complex> &carray);
814 void real(Array<Double> &rarray, const Array<DComplex> &carray);
815 // </group>
816 
817 //
818 // Extracts the imaginary part of a complex array into an array of floats.
819 // <group>
820 Array<Float> imag(const Array<Complex> &carray);
821 Array<Double> imag(const Array<DComplex> &carray);
822 // Modifies rarray in place. rarray must be conformant.
823 void imag(Array<Float> &rarray, const Array<Complex> &carray);
824 void imag(Array<Double> &rarray, const Array<DComplex> &carray);
825 // </group>
826 
827 //
828 // Extracts the amplitude (i.e. sqrt(re*re + im*im)) from an array
829 // of complex numbers. N.B. this is presently called "fabs" for a single
830 // complex number.
831 // <group>
832 Array<Float> amplitude(const Array<Complex> &carray);
834 // Modifies rarray in place. rarray must be conformant.
835 void amplitude(Array<Float> &rarray, const Array<Complex> &carray);
836 void amplitude(Array<Double> &rarray, const Array<DComplex> &carray);
837 // </group>
838 
839 //
840 // Extracts the phase (i.e. atan2(im, re)) from an array
841 // of complex numbers. N.B. this is presently called "arg"
842 // for a single complex number.
843 // <group>
844 Array<Float> phase(const Array<Complex> &carray);
845 Array<Double> phase(const Array<DComplex> &carray);
846 // Modifies rarray in place. rarray must be conformant.
847 void phase(Array<Float> &rarray, const Array<Complex> &carray);
848 void phase(Array<Double> &rarray, const Array<DComplex> &carray);
849 // </group>
850 
851 // Copy an array of complex into an array of real,imaginary pairs. The
852 // first axis of the real array becomes twice as long as the complex array.
853 // In the future versions which work by reference will be available; presently
854 // a copy is made.
855 Array<Float> ComplexToReal(const Array<Complex> &carray);
856 Array<Double> ComplexToReal(const Array<DComplex> &carray);
857 // Modify the array "rarray" in place. "rarray" must be the correct shape.
858 // <group>
859 void ComplexToReal(Array<Float> &rarray, const Array<Complex> &carray);
860 void ComplexToReal(Array<Double> &rarray, const Array<DComplex> &carray);
861 // </group>
862 
863 // Copy an array of real,imaginary pairs into a complex array. The first axis
864 // must have an even length.
865 // In the future versions which work by reference will be available; presently
866 // a copy is made.
867 Array<Complex> RealToComplex(const Array<Float> &rarray);
868 Array<DComplex> RealToComplex(const Array<Double> &rarray);
869 // Modify the array "carray" in place. "carray" must be the correct shape.
870 // <group>
871 void RealToComplex(Array<Complex> &carray, const Array<Float> &rarray);
872 void RealToComplex(Array<DComplex> &carray, const Array<Double> &rarray);
873 // </group>
874 
875 // Make a copy of an array of a different type; for example make an array
876 // of doubles from an array of floats. Arrays to and from must be conformant
877 // (same shape). Also, it must be possible to convert a scalar of type U
878 // to type T.
879 template<class T, class U> void convertArray(Array<T> &to,
880  const Array<U> &from);
881 
882 
883 // Returns an array where every element is squared.
884 template<class T> Array<T> square(const Array<T> &val);
885 
886 // Returns an array where every element is cubed.
887 template<class T> Array<T> cube(const Array<T> &val);
888 
889 // Expand the values of an array. The arrays can have different dimensionalities.
890 // Missing input axes have length 1; missing output axes are discarded.
891 // The length of each axis in the input array must be <= the length of the
892 // corresponding axis in the output array and divide evenly.
893 // For each axis <src>mult</src> is set to output/input.
894 // <br>The <src>alternate</src> argument determines how the values are expanded.
895 // If a row contains values '1 2 3', they can be expanded "linearly"
896 // as '1 1 2 2 3 3' or alternately as '1 2 3 1 2 3'
897 // This choice can be made for each axis; a value 0 means linearly,
898 // another value means alternately. If the length of alternate is less than
899 // the dimensionality of the output array, the missing ones default to 0.
900 template<class T> void expandArray (Array<T>& out, const Array<T>& in,
901  const IPosition& alternate=IPosition());
902 // Helper function for expandArray using recursion for each axis.
903 template<class T>
904 T* expandRecursive (int axis, const IPosition& shp, const IPosition& mult,
905  const IPosition& inSteps,
906  const T* in, T* out, const IPosition& alternate);
907 // Check array shapes for expandArray. It returns the alternate argument,
908 // where possibly missing values are appended (as 0).
909 // It fills in mult and inshp (with possibly missing axes of length 1).
910 // <br><code>inShape</code> defines the shape of the input array.
911 // <br><code>outShape</code> defines the shape of the output array.
912 // <br><code>alternate</code> tells per axis if value expansion uses alternation.
913 // <br><code>newInShape</code> is the input shape with new axes (of length 1) added as needed
914 // <br><code>mult</code> is the multiplication (expansion) factor per output axis
915 // Returned is the alternation per output axis; new axes have value 0 (linear expansion)
916 IPosition checkExpandArray (IPosition& mult, IPosition& newInShape,
917  const IPosition& inShape,
918  const IPosition& outShape,
919  const IPosition& alternate);
920 
921 
922 // </group>
923 
924 
925 } //# NAMESPACE CASACORE - END
926 
927 #ifndef CASACORE_NO_AUTO_TEMPLATES
928 #include <casacore/casa/Arrays/ArrayMath.tcc>
929 #endif //# CASACORE_NO_AUTO_TEMPLATES
930 #endif
Array< T > max(const T &a, const Array< T > &b)
Definition: ArrayMath.h:560
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
LatticeExprNode log10(const LatticeExprNode &expr)
A 1-D Specialization of the Array class.
T interHexileRange(const Array< T > &a, Bool sorted=False, Bool inPlace=False)
Definition: ArrayMath.h:726
LatticeExprNode log(const LatticeExprNode &expr)
T interHexileRange(const Array< T > &a, Block< T > &tmp, Bool sorted=False, Bool inPlace=False)
Return the inter-hexile range of an array.
Definition: ArrayMath.h:723
T median(const Array< T > &a, Bool sorted, Bool takeEvenMean, Bool inPlace=False)
Definition: ArrayMath.h:665
LatticeExprNode median(const LatticeExprNode &expr)
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
Definition: ArrayBase.h:99
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
LatticeExprNode imag(const LatticeExprNode &expr)
void myiptransform(_InputIterator1 __first1, _InputIterator1 __last1, T right, _BinaryOperation __binary_op)
sequence OP= scalar
Definition: ArrayMath.h:174
T medianInPlace(const Array< T > &a, Bool sorted=False)
Definition: ArrayMath.h:672
void myrtransform(_InputIterator1 __first1, _InputIterator1 __last1, _OutputIterator __result, T right, _BinaryOperation __binary_op)
sequence = sequence OP scalar
Definition: ArrayMath.h:163
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition: ExprNode.h:1886
LatticeExprNode sum(const LatticeExprNode &expr)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode operator%(const LatticeExprNode &left, const LatticeExprNode &right)
T fractile(const Array< T > &a, Float fraction, Bool sorted=False, Bool inPlace=False)
Definition: ArrayMath.h:701
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1405
Array< T > min(const T &a, const Array< T > &b)
Definition: ArrayMath.h:564
void max(Array< T > &result, const T &a, const Array< T > &b)
Definition: ArrayMath.h:548
void arrayTransformInPlace(Array< L > &left, const Array< R > &right, BinaryOperator op)
Transform left and right in place using the binary operator.
Definition: ArrayMath.h:307
LatticeExprNode fractile(const LatticeExprNode &expr, const LatticeExprNode &fraction)
Determine the value of the element at the part fraction from the beginning of the given lattice...
TableExprNode operator&(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1138
LatticeExprNode exp(const LatticeExprNode &expr)
iterator begin()
Get the begin iterator object for any array.
Definition: Array.h:856
Bool contiguousStorage() const
Are the array data contiguous? If they are not contiguous, getStorage (see below) needs to make a cop...
Definition: ArrayBase.h:112
LatticeExprNode floor(const LatticeExprNode &expr)
MVEarthMagnetic operator*(const RotMatrix &left, const MVEarthMagnetic &right)
Rotate a EarthMagnetic vector with rotation matrix and other multiplications.
LatticeExprNode cos(const LatticeExprNode &expr)
contiter cbegin()
Get the begin iterator object for a contiguous array.
Definition: Array.h:868
T interFractileRange(const Array< T > &a, Float fraction, Bool sorted=False, Bool inPlace=False)
Definition: ArrayMath.h:711
contiter cend()
Definition: Array.h:872
void arrayTransformInPlace(Array< L > &left, R right, BinaryOperator op)
Transform left and right in place using the binary operator.
Definition: ArrayMath.h:320
LatticeExprNode conj(const LatticeExprNode &expr)
void arrayContTransform(const Array< L > &left, R right, Array< RES > &result, BinaryOperator op)
Transform left and right to a result using the binary operator.
Definition: ArrayMath.h:208
LatticeExprNode tanh(const LatticeExprNode &expr)
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
void transformInPlace(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryOperator op)
Define a function to do a binary transform in place.
Definition: Functors.h:44
LatticeExprNode avdev(const LatticeExprNode &expr)
void arrayContTransform(L left, const Array< R > &right, Array< RES > &result, BinaryOperator op)
Transform left and right to a result using the binary operator.
Definition: ArrayMath.h:228
double Double
Definition: aipstype.h:55
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
T interQuartileRange(const Array< T > &a, Bool sorted=False, Bool inPlace=False)
Definition: ArrayMath.h:738
LatticeExprNode sign(const LatticeExprNode &expr)
LatticeExprNode sqrt(const LatticeExprNode &expr)
#define DebugAssert(expr, exception)
Definition: Assert.h:185
LatticeExprNode tan(const LatticeExprNode &expr)
void indgen(TableVector< T > &tv, Int start, Int inc)
Definition: TabVecMath.h:400
LatticeExprNode atan(const LatticeExprNode &expr)
void arrayContTransform(const Array< T > &arr, Array< RES > &result, UnaryOperator op)
Transform array to a result using the unary operator.
Definition: ArrayMath.h:248
TableExprNode product(const TableExprNode &array)
Definition: ExprNode.h:1607
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void minMax(T &min, T &max, const TableVector< T > &tv)
Definition: TabVecMath.h:390
void min(Array< T > &result, const T &a, const Array< T > &b)
Definition: ArrayMath.h:555
TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1308
LatticeExprNode stddev(const LatticeExprNode &expr)
LatticeExprNode round(const LatticeExprNode &expr)
float Float
Definition: aipstype.h:54
Vector< T > indgen(uInt length, T start, T inc)
Create a Vector of the given length and fill it with the start value incremented with inc for each el...
Definition: ArrayMath.h:588
const Bool False
Definition: aipstype.h:44
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1143
LatticeExprNode atan2(const LatticeExprNode &left, const LatticeExprNode &right)
Numerical 2-argument functions.
simple 1-D array
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
LatticeExprNode fmod(const LatticeExprNode &left, const LatticeExprNode &right)
iterator end()
Definition: Array.h:860
T madfmInPlace(const Array< T > &a, Bool sorted=False)
Definition: ArrayMath.h:688
Base class for all Casacore library errors.
Definition: Error.h:134
LatticeExprNode asin(const LatticeExprNode &expr)
LatticeExprNode mean(const LatticeExprNode &expr)
void arrayTransformInPlace(Array< T > &arr, UnaryOperator op)
Transform the array in place using the unary operator.
Definition: ArrayMath.h:335
void myltransform(_InputIterator1 __first1, _InputIterator1 __last1, _OutputIterator __result, T left, _BinaryOperation __binary_op)
The myxtransform functions are defined to avoid a bug in g++-4.3.
Definition: ArrayMath.h:152
TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1637
LatticeExprNode sinh(const LatticeExprNode &expr)
LatticeExprNode acos(const LatticeExprNode &expr)
TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1303
LatticeExprNode operator-(const LatticeExprNode &expr)
LatticeExprNode operator^(const LatticeExprNode &left, const LatticeExprNode &right)
void arrayContTransform(const Array< L > &left, const Array< R > &right, Array< RES > &result, BinaryOperator op)
Functions to apply a binary or unary operator to arrays.
Definition: ArrayMath.h:192
void indgen(Array< T > &a)
Fills all elements of &quot;array&quot; with a sequence starting with 0 and ending with nelements() - 1...
Definition: ArrayMath.h:577
LatticeExprNode variance(const LatticeExprNode &expr)
T madfm(const Array< T > &a, Bool sorted, Bool takeEvenMean, Bool inPlace=False)
Definition: ArrayMath.h:681
LatticeExprNode ceil(const LatticeExprNode &expr)
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
T interQuartileRange(const Array< T > &a, Block< T > &tmp, Bool sorted=False, Bool inPlace=False)
Return the inter-quartile range of an array.
Definition: ArrayMath.h:735
void indgen(Array< T > &a, T start)
Fills all elements of &quot;array&quot; with a sequence starting with start incremented by one for each positio...
Definition: ArrayMath.h:583
const Bool True
Definition: aipstype.h:43
LatticeExprNode cosh(const LatticeExprNode &expr)
LatticeExprNode real(const LatticeExprNode &expr)
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
unsigned int uInt
Definition: aipstype.h:51
transform(a.begin(), a.end(), std::ostream_iterator< int >(cout,"\n"), compose(unary(h), compose(unary(f), unary(f))))
Global Functions.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1397