casacore
Loading...
Searching...
No Matches
ArrayLogical.h
Go to the documentation of this file.
1// # ArrayLogical.h: Element by element logical operations on arrays.
2// # Copyright (C) 1993,1994,1995,1999,2001
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 CASA_ARRAYLOGICAL_2_H
27#define CASA_ARRAYLOGICAL_2_H
28
29// # Includes
30#include "ArrayFwd.h"
31#include "IPosition.h"
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Logical operations for Arrays.
37// </summary>
38// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tArrayLogical">
39//
40// <prerequisite>
41// <li> <linkto class=Array>Array</linkto>
42// </prerequisite>
43//
44// <etymology>
45// This file contains global functions which perform element by element logical
46// operations on arrays.
47// </etymology>
48//
49// <synopsis>
50// These functions perform element by element logical operations on
51// arrays. The two arrays must conform, except for allEQ which returns
52// false if the arrays do not conform.
53//
54// There are two classes of functions. One class returns a LogicalArray.
55// In these functions, the value of an element of the LogicalArray is
56// the value of the logical operation applied to the corresponding elements
57// of the input Arrays. The other class of functions returns a single
58// bool. The return value is true if the logical operation returns true for
59// all elements of the input arrays for the "all" functions
60// (e.g. allLE()), and returns true if the logical operation returns true for
61// any elements of the input arrays for the "any" functions
62// (e.g. anyLE()).
63//
64// For instance allLE (a, b) implies that every element of a is
65// less than or equal to every element of b. Note that with this definition
66// allLE (a, b) and allGE (a, b) can both be false (e.g. a = [1,0] b = [0,1]).
67//
68// <note role=caution> Comparison between two zero-sized arrays is not defined
69// (should it throw an exception?).
70// </note>
71//
72// </synopsis>
73//
74// <example>
75// <srcblock>
76// Vector<int> a(10);
77// Vector<int> b(10);
78// LogicalVector l(10);
79// . . .
80// l = a < b;
81// </srcblock>
82// This example sets the elements of l (a<b).
83// The result of the comparison is a LogicalArray.
84// </example>
85//
86// <example>
87// <srcblock>
88// Vector<int> a(10);
89// Vector<int> b(10);
90// bool result;
91// . . .
92// result = allLT (a, b);
93// </srcblock>
94// This example sets result to true if, for all elements, a<b.
95// </example>
96//
97// <motivation>
98// One wants to be able to perform logical operations on arrays.
99// </motivation>
100//
101// <todo asof="$DATE:$>
102// <li> Reconsider where the origin of the returned LogicalArray should
103// be located.
104// </todo>
105//
106// <linkfrom anchor="Array logical operations" classes="Array Vector Matrix Cube">
107// <here>Array logical operations</here> -- Logical operations for Arrays.
108// </linkfrom>
109//
110// <group name="Array logical operations">
112// Determine if the comparisons between corresponding array elements yield true.
113// <group>
114template <typename T, typename CompareOperator>
115bool arrayCompareAll(const Array<T> &left, const Array<T> &right, CompareOperator op);
116template <typename T, typename CompareOperator>
117bool arrayCompareAll(const Array<T> &left, T right, CompareOperator op);
118template <typename T, typename CompareOperator>
119bool arrayCompareAll(T left, const Array<T> &right, CompareOperator op);
120// </group>
121
122// Determine if the comparisons between corresponding array elements yield true.
123// <group>
124template <typename T, typename CompareOperator>
125bool arrayCompareAny(const Array<T> &left, const Array<T> &right, CompareOperator op);
126template <typename T, typename CompareOperator>
127bool arrayCompareAny(const Array<T> &left, T right, CompareOperator op);
128template <typename T, typename CompareOperator>
129bool arrayCompareAny(T left, const Array<T> &right, CompareOperator op);
130// </group>
131
132//
133// Element by element comparisons between the "l" and "r" arrays. The result
134// is true only if the comparison is true for every element of the arrays.
135//
136// The operator forms of array logical operations which return a single bool
137// have been replaced by these "all" functions.
138// The operator forms of array logical operations now return a LogicalArray.
139//
140// The arrays must conform except for allEQ, which will return false if the
141// arrays have different shapes.
142//
143// <thrown>
144// <li> ArrayConformanceError
145// </thrown>
146//
147// <group>
148template <class T>
149bool allLE(const Array<T> &l, const Array<T> &r);
150template <class T>
151bool allLT(const Array<T> &l, const Array<T> &r);
152template <class T>
153bool allGE(const Array<T> &l, const Array<T> &r);
154template <class T>
155bool allGT(const Array<T> &l, const Array<T> &r);
156template <class T>
157bool allEQ(const Array<T> &l, const Array<T> &r);
158template <class T>
159bool allNE(const Array<T> &l, const Array<T> &r);
160template <class T>
161bool allNear(const Array<T> &l, const Array<T> &r, double tol);
162template <class T>
163bool allNearAbs(const Array<T> &l, const Array<T> &r, double tol);
164//
165// This only makes sense if the array element type is logical valued.
166// <group>
167template <class T>
168bool allAND(const Array<T> &l, const Array<T> &r);
169template <class T>
170bool allOR(const Array<T> &l, const Array<T> &r);
171// </group>
172//
173// </group>
174
175//
176// Element by element comparisons between the "l" and "r" arrays. The result
177// is a LogicalArray.
178// The arrays must conform or an exception is thrown.
179//
180// The Vector, Matrix and Cube version are present to bypass the problems
181// due to the existence of automatic comparison inline templates in standard
182// algorithm library, producing a single bool value.
183//
184// <group>
185template <class T>
187template <class T>
189template <class T>
191template <class T>
193template <class T>
195template <class T>
197
198template <class T>
199LogicalArray near(const Array<T> &l, const Array<T> &r, double tol);
200template <class T>
201LogicalArray nearAbs(const Array<T> &l, const Array<T> &r, double tol);
202//
203// This only makes sense if the array element type is logical valued.
204// <group>
205template <class T>
207template <class T>
209// </group>
210//
211// </group>
212
213//
214// Logical negation of an array. This only makes sense if the array
215// element type is logical valued.
216template <class T>
218
219//
220// Element by element comparisons between an array and a scalar, which
221// behaves as if it were a conformant array filled with the value "val."
222// The result is true only if the comparison is true for every element
223// of the array.
224// <group>
225template <class T>
226bool allLE(const Array<T> &array, const T &val);
227template <class T>
228bool allLE(const T &val, const Array<T> &array);
229template <class T>
230bool allLT(const Array<T> &array, const T &val);
231template <class T>
232bool allLT(const T &val, const Array<T> &array);
233template <class T>
234bool allGE(const Array<T> &array, const T &val);
235template <class T>
236bool allGE(const T &val, const Array<T> &array);
237template <class T>
238bool allGT(const Array<T> &array, const T &val);
239template <class T>
240bool allGT(const T &val, const Array<T> &array);
241template <class T>
242bool allEQ(const Array<T> &array, const T &val);
243template <class T>
244bool allEQ(const T &val, const Array<T> &array);
245template <class T>
246bool allNE(const Array<T> &array, const T &val);
247template <class T>
248bool allNE(const T &val, const Array<T> &array);
249template <class T>
250bool allNear(const Array<T> &array, const T &val, double tol);
251template <class T>
252bool allNear(const T &val, const Array<T> &array, double tol);
253template <class T>
254bool allNearAbs(const Array<T> &array, const T &val, double tol);
255template <class T>
256bool allNearAbs(const T &val, const Array<T> &array, double tol);
257//
258// This only makes sense if the array element type is logical valued.
259// <group>
260template <class T>
261bool allAND(const Array<T> &array, const T &val);
262template <class T>
263bool allAND(const T &val, const Array<T> &array);
264template <class T>
265bool allOR(const Array<T> &array, const T &val);
266template <class T>
267bool allOR(const T &val, const Array<T> &array);
268// </group>
269//
270// </group>
271
272// Test if all elements in an array are the same.
273template <class T>
274bool allSame(const Array<T> &a) {
275 return a.size() <= 1 || allEQ(*a.data(), a);
276}
277
278// Element by element test for NaN or (In)finity.
279// <group>
280template <class T>
282template <class T>
284template <class T>
286// </group>
287
288//
289// Element by element comparisons between an array and a scalar, which
290// behaves as if it were a conformant array filled with the value "val."
291// The result is a LogicalArray.
292//
293// <thrown>
294// <li> ArrayConformanceError
295// </thrown>
296//
297// <group>
298template <class T>
299LogicalArray operator<=(const Array<T> &array, const T &val);
300template <class T>
301LogicalArray operator<=(const T &val, const Array<T> &array);
302template <class T>
303LogicalArray operator<(const Array<T> &array, const T &val);
304template <class T>
305LogicalArray operator<(const T &val, const Array<T> &array);
306template <class T>
307LogicalArray operator>=(const Array<T> &array, const T &val);
308template <class T>
309LogicalArray operator>=(const T &val, const Array<T> &array);
310template <class T>
311LogicalArray operator>(const Array<T> &array, const T &val);
312template <class T>
313LogicalArray operator>(const T &val, const Array<T> &array);
314template <class T>
315LogicalArray operator==(const Array<T> &array, const T &val);
316template <class T>
317LogicalArray operator==(const T &val, const Array<T> &array);
318template <class T>
319LogicalArray operator!=(const Array<T> &array, const T &val);
320template <class T>
321LogicalArray operator!=(const T &val, const Array<T> &array);
322template <class T>
323LogicalArray near(const Array<T> &array, const T &val, double tol);
324template <class T>
325LogicalArray near(const T &val, const Array<T> &array, double tol);
326template <class T>
327LogicalArray nearAbs(const Array<T> &array, const T &val, double tol);
328template <class T>
329LogicalArray nearAbs(const T &val, const Array<T> &array, double tol);
330//
331// This only makes sense if the array element type is logical valued.
332// <group>
333template <class T>
334LogicalArray operator&&(const Array<T> &array, const T &val);
335template <class T>
336LogicalArray operator&&(const T &val, const Array<T> &array);
337template <class T>
338LogicalArray operator||(const Array<T> &array, const T &val);
339template <class T>
340LogicalArray operator||(const T &val, const Array<T> &array);
341// </group>
342//
343// </group>
344
345// # With two arrays, they must both conform, and the result is done element
346// # by element. For instance anyLE (a, b) implies that some element of a is
347// # less than or equal to the corresponding element of b.
348// # NB comparison between two zero-sized arrays is not defined (should it
349// # throw an exception?).
350
351//
352// Element by element comparisons between the "l" and "r" arrays. The result
353// is true if the comparison is true for some element of the arrays.
354//
355// <thrown>
356// <li> ArrayConformanceError
357// </thrown>
358//
359// <group>
360
361template <class T>
362bool anyLE(const Array<T> &l, const Array<T> &r);
363template <class T>
364bool anyLT(const Array<T> &l, const Array<T> &r);
365template <class T>
366bool anyGE(const Array<T> &l, const Array<T> &r);
367template <class T>
368bool anyGT(const Array<T> &l, const Array<T> &r);
369template <class T>
370bool anyEQ(const Array<T> &l, const Array<T> &r);
371template <class T>
372bool anyNE(const Array<T> &l, const Array<T> &r);
373template <class T>
374bool anyNear(const Array<T> &l, const Array<T> &r, double tol);
375template <class T>
376bool anyNearAbs(const Array<T> &l, const Array<T> &r, double tol);
377//
378// This only makes sense if the array element type is logical valued.
379// <group>
380template <class T>
381bool anyAND(const Array<T> &l, const Array<T> &r);
382template <class T>
383bool anyOR(const Array<T> &l, const Array<T> &r);
384// </group>
385//
386// </group>
387
388//
389// Element by element comparisons between an array and a scalar, which
390// behaves as if it were a conformant array filled with the value "val."
391// The result is true if the comparison is true for some element of the array.
392// At some point operators will be available that return masks where the
393// comparison is true.
394// <group>
395
396template <class T>
397bool anyLE(const Array<T> &array, const T &val);
398template <class T>
399bool anyLE(const T &val, const Array<T> &array);
400template <class T>
401bool anyLT(const Array<T> &array, const T &val);
402template <class T>
403bool anyLT(const T &val, const Array<T> &array);
404template <class T>
405bool anyGE(const Array<T> &array, const T &val);
406template <class T>
407bool anyGE(const T &val, const Array<T> &array);
408template <class T>
409bool anyGT(const Array<T> &array, const T &val);
410template <class T>
411bool anyGT(const T &val, const Array<T> &array);
412template <class T>
413bool anyEQ(const Array<T> &array, const T &val);
414template <class T>
415bool anyEQ(const T &val, const Array<T> &array);
416template <class T>
417bool anyNE(const Array<T> &array, const T &val);
418template <class T>
419bool anyNE(const T &val, const Array<T> &array);
420template <class T>
421bool anyNear(const Array<T> &array, const T &val, double tol);
422template <class T>
423bool anyNear(const T &val, const Array<T> &array, double tol);
424template <class T>
425bool anyNearAbs(const Array<T> &array, const T &val, double tol);
426template <class T>
427bool anyNearAbs(const T &val, const Array<T> &array, double tol);
428//
429// This only makes sense if the array element type is logical valued.
430// <group>
431template <class T>
432bool anyAND(const Array<T> &array, const T &val);
433template <class T>
434bool anyAND(const T &val, const Array<T> &array);
435template <class T>
436bool anyOR(const Array<T> &array, const T &val);
437template <class T>
438bool anyOR(const T &val, const Array<T> &array);
439// </group>
440//
441// </group>
442
443// Are all elements true?
444inline bool allTrue(const Array<bool> &array) { return allEQ(array, true); }
445
446// Is any element true?
447inline bool anyTrue(const Array<bool> &array) { return anyEQ(array, true); }
448
449// The same functions as above, but for selected axes.
452
453// Determine the number of true or false elements.
454// Note: it is meant for bool arrays, but can also be used for
455// e.g. int arrays.
456// <group>
457
458// Determine it for the full array.
459// <group>
460template <class T>
461size_t nfalse(const Array<T> &array);
462template <class T>
463size_t ntrue(const Array<T> &array) {
464 return array.nelements() - nfalse(array);
465}
466// </group>
467
468// The same functions as above, but determine ntrue and nfalse for the
469// given axes only. The result is an array with a shape formed by the
470// remaining axes.
471// For example, for an array with shape [3,4,5], collapsing axis 0
472// results in an array with shape [4,5] containing ntrue or nfalse for
473// each X line.
474// Summing for axes 0 and 2 results in an array with shape [4] containing
475// ntrue or nfalse for each XZ plane.
476// <group>
477template <class T>
478Array<size_t> partialNTrue(const Array<T> &array, const IPosition &collapseAxes);
479template <class T>
481// </group>
482
483// </group>
484
485// </group>
486} // namespace casacore
487
488#include "ArrayMathBase.h"
489
490namespace casacore {
491
492// Logical functor to test if all elements are true
493template <typename T>
494class AllFunc final : public ArrayFunctorBase<T, bool> {
495 public:
496 virtual bool operator()(const Array<T> &arr) const override { return allTrue(arr); }
497};
498
499// Logical functor to test if any elements are true
500template <typename T>
501class AnyFunc final : public ArrayFunctorBase<T, bool> {
502 public:
503 virtual bool operator()(const Array<T> &arr) const override { return anyTrue(arr); }
504};
505
506// Logical functor to count the number of true elements
507template <typename T, typename RES = size_t>
508class NTrueFunc final : public ArrayFunctorBase<T, RES> {
509 public:
510 virtual RES operator()(const Array<T> &arr) const override { return ntrue(arr); }
511};
512
513// Logical functor to count the number of false elements
514template <typename T, typename RES = size_t>
515class NFalseFunc final : public ArrayFunctorBase<T, RES> {
516 public:
517 virtual RES operator()(const Array<T> &arr) const override { return nfalse(arr); }
518};
519
520} // namespace casacore
521
522#include "ArrayLogical.tcc"
523
524#endif
Logical functor to test if all elements are true.
virtual bool operator()(const Array< T > &arr) const override
Logical functor to test if any elements are true.
virtual bool operator()(const Array< T > &arr) const override
size_t size() const
Definition ArrayBase.h:99
T * data()
Get a pointer to the beginning of the array.
Definition Array.h:582
Logical functor to count the number of false elements.
virtual RES operator()(const Array< T > &arr) const override
Logical functor to count the number of true elements.
virtual RES operator()(const Array< T > &arr) const override
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
T * array
The actual storage.
Definition Block.h:689
Array< LogicalArrayElem > LogicalArray
Definition ArrayFwd.h:17
LatticeExprNode ntrue(const LatticeExprNode &expr)
Bool anyEQ(const TableVector< T > &l, const TableVector< T > &r)
LatticeExprNode nfalse(const LatticeExprNode &expr)
bool arrayCompareAny(const Array< T > &left, const Array< T > &right, CompareOperator op)
Determine if the comparisons between corresponding array elements yield true.
bool anyNearAbs(const Array< T > &l, const Array< T > &r, double tol)
bool allAND(const Array< T > &l, const Array< T > &r)
This only makes sense if the array element type is logical valued.
bool allNearAbs(const T &val, const Array< T > &array, double tol)
bool anyGE(const T &val, const Array< T > &array)
bool anyNE(const Array< T > &l, const Array< T > &r)
bool allGE(const Array< T > &array, const T &val)
bool allLT(const Array< T > &array, const T &val)
bool anyAND(const T &val, const Array< T > &array)
LogicalArray nearAbs(const Array< T > &array, const T &val, double tol)
bool anyNearAbs(const T &val, const Array< T > &array, double tol)
bool anyGE(const Array< T > &l, const Array< T > &r)
bool allOR(const Array< T > &array, const T &val)
LogicalArray operator>=(const Array< T > &array, const T &val)
LogicalArray near(const Array< T > &l, const Array< T > &r, double tol)
LogicalArray nearAbs(const T &val, const Array< T > &array, double tol)
bool allGE(const T &val, const Array< T > &array)
LogicalArray operator!=(const T &val, const Array< T > &array)
LogicalArray operator<=(const T &val, const Array< T > &array)
bool anyEQ(const T &val, const Array< T > &array)
bool arrayCompareAny(const Array< T > &left, T right, CompareOperator op)
size_t nfalse(const Array< T > &array)
Determine the number of true or false elements.
bool anyLE(const T &val, const Array< T > &array)
LogicalArray operator!=(const Array< T > &array, const T &val)
bool allGT(const T &val, const Array< T > &array)
bool anyNearAbs(const Array< T > &array, const T &val, double tol)
bool arrayCompareAll(const Array< T > &left, T right, CompareOperator op)
bool anyNear(const Array< T > &l, const Array< T > &r, double tol)
bool anyNE(const T &val, const Array< T > &array)
bool allLT(const T &val, const Array< T > &array)
LogicalArray operator>=(const T &val, const Array< T > &array)
bool anyLT(const Array< T > &array, const T &val)
bool arrayCompareAll(const Array< T > &left, const Array< T > &right, CompareOperator op)
Determine if the comparisons between corresponding array elements yield true.
LogicalArray operator&&(const Array< T > &array, const T &val)
This only makes sense if the array element type is logical valued.
bool allNE(const Array< T > &l, const Array< T > &r)
bool anyTrue(const Array< bool > &array)
Is any element true?
LogicalArray operator>(const Array< T > &l, const Array< T > &r)
bool anyLE(const Array< T > &l, const Array< T > &r)
Element by element comparisons between the "l" and "r" arrays.
bool allEQ(const Array< T > &array, const T &val)
bool anyNear(const T &val, const Array< T > &array, double tol)
bool allNE(const Array< T > &array, const T &val)
bool allAND(const T &val, const Array< T > &array)
bool allOR(const T &val, const Array< T > &array)
bool allSame(const Array< T > &a)
Test if all elements in an array are the same.
bool allGT(const Array< T > &array, const T &val)
bool anyEQ(const Array< T > &l, const Array< T > &r)
bool allGE(const Array< T > &l, const Array< T > &r)
bool anyOR(const T &val, const Array< T > &array)
Array< bool > partialAnyTrue(const Array< bool > &array, const IPosition &collapseAxes)
bool allNE(const T &val, const Array< T > &array)
Array< size_t > partialNTrue(const Array< T > &array, const IPosition &collapseAxes)
The same functions as above, but determine ntrue and nfalse for the given axes only.
bool allNear(const Array< T > &l, const Array< T > &r, double tol)
LogicalArray operator>=(const Array< T > &l, const Array< T > &r)
LogicalArray operator<=(const Array< T > &l, const Array< T > &r)
Element by element comparisons between the "l" and "r" arrays.
LogicalArray operator<(const Array< T > &l, const Array< T > &r)
LogicalArray operator==(const Array< T > &array, const T &val)
Array< size_t > partialNFalse(const Array< T > &array, const IPosition &collapseAxes)
bool allLE(const Array< T > &l, const Array< T > &r)
Element by element comparisons between the "l" and "r" arrays.
bool allLE(const T &val, const Array< T > &array)
LogicalArray nearAbs(const Array< T > &l, const Array< T > &r, double tol)
bool anyGT(const T &val, const Array< T > &array)
bool anyEQ(const Array< T > &array, const T &val)
bool anyLE(const Array< T > &array, const T &val)
Element by element comparisons between an array and a scalar, which behaves as if it were a conforman...
LogicalArray operator&&(const T &val, const Array< T > &array)
bool anyGT(const Array< T > &l, const Array< T > &r)
LogicalArray isNaN(const Array< T > &array)
Element by element test for NaN or (In)finity.
bool allEQ(const Array< T > &l, const Array< T > &r)
bool allGT(const Array< T > &l, const Array< T > &r)
bool allNear(const Array< T > &array, const T &val, double tol)
bool allAND(const Array< T > &array, const T &val)
This only makes sense if the array element type is logical valued.
Array< bool > partialAllTrue(const Array< bool > &array, const IPosition &collapseAxes)
The same functions as above, but for selected axes.
bool allLE(const Array< T > &array, const T &val)
Element by element comparisons between an array and a scalar, which behaves as if it were a conforman...
LogicalArray operator!=(const Array< T > &l, const Array< T > &r)
bool allNear(const T &val, const Array< T > &array, double tol)
bool arrayCompareAll(T left, const Array< T > &right, CompareOperator op)
LogicalArray operator==(const T &val, const Array< T > &array)
bool allEQ(const T &val, const Array< T > &array)
LogicalArray operator<=(const Array< T > &array, const T &val)
Element by element comparisons between an array and a scalar, which behaves as if it were a conforman...
bool allNearAbs(const Array< T > &l, const Array< T > &r, double tol)
bool anyOR(const Array< T > &array, const T &val)
bool anyNE(const Array< T > &array, const T &val)
bool anyLT(const T &val, const Array< T > &array)
LogicalArray operator==(const Array< T > &l, const Array< T > &r)
LogicalArray operator<(const T &val, const Array< T > &array)
LogicalArray operator>(const T &val, const Array< T > &array)
LogicalArray operator&&(const Array< T > &l, const Array< T > &r)
This only makes sense if the array element type is logical valued.
LogicalArray operator>(const Array< T > &array, const T &val)
bool anyAND(const Array< T > &l, const Array< T > &r)
This only makes sense if the array element type is logical valued.
bool allNearAbs(const Array< T > &array, const T &val, double tol)
LogicalArray near(const T &val, const Array< T > &array, double tol)
LogicalArray operator||(const Array< T > &array, const T &val)
LogicalArray operator!(const Array< T > &l)
Logical negation of an array.
bool anyGT(const Array< T > &array, const T &val)
bool anyOR(const Array< T > &l, const Array< T > &r)
LogicalArray operator<(const Array< T > &array, const T &val)
bool allLT(const Array< T > &l, const Array< T > &r)
bool anyAND(const Array< T > &array, const T &val)
This only makes sense if the array element type is logical valued.
bool anyLT(const Array< T > &l, const Array< T > &r)
bool allTrue(const Array< bool > &array)
Are all elements true?
LogicalArray operator||(const T &val, const Array< T > &array)
LogicalArray operator||(const Array< T > &l, const Array< T > &r)
bool anyNear(const Array< T > &array, const T &val, double tol)
bool allOR(const Array< T > &l, const Array< T > &r)
LogicalArray near(const Array< T > &array, const T &val, double tol)
bool arrayCompareAny(T left, const Array< T > &right, CompareOperator op)
bool anyGE(const Array< T > &array, const T &val)