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
113// Determine if the comparisons between corresponding array elements yield true.
114// <group>
115template<typename T, typename CompareOperator>
116bool arrayCompareAll (const Array<T>& left, const Array<T>& right,
117 CompareOperator op);
118template<typename T, typename CompareOperator>
119bool arrayCompareAll (const Array<T>& left, T right,
120 CompareOperator op);
121template<typename T, typename CompareOperator>
122bool arrayCompareAll (T left, const Array<T>& right,
123 CompareOperator op);
124// </group>
125
126// Determine if the comparisons between corresponding array elements yield true.
127// <group>
128template<typename T, typename CompareOperator>
129bool arrayCompareAny (const Array<T>& left, const Array<T>& right,
130 CompareOperator op);
131template<typename T, typename CompareOperator>
132bool arrayCompareAny (const Array<T>& left, T right,
133 CompareOperator op);
134template<typename T, typename CompareOperator>
135bool arrayCompareAny (T left, const Array<T>& right,
136 CompareOperator op);
137// </group>
138
139//
140// Element by element comparisons between the "l" and "r" arrays. The result
141// is true only if the comparison is true for every element of the arrays.
142//
143// The operator forms of array logical operations which return a single bool
144// have been replaced by these "all" functions.
145// The operator forms of array logical operations now return a LogicalArray.
146//
147// The arrays must conform except for allEQ, which will return false if the
148// arrays have different shapes.
149//
150// <thrown>
151// <li> ArrayConformanceError
152// </thrown>
153//
154// <group>
155template<class T> bool allLE (const Array<T> &l, const Array<T> &r);
156template<class T> bool allLT (const Array<T> &l, const Array<T> &r);
157template<class T> bool allGE (const Array<T> &l, const Array<T> &r);
158template<class T> bool allGT (const Array<T> &l, const Array<T> &r);
159template<class T> bool allEQ (const Array<T> &l, const Array<T> &r);
160template<class T> bool allNE (const Array<T> &l, const Array<T> &r);
161template<class T> bool allNear (const Array<T> &l, const Array<T> &r,
162 double tol);
163template<class T> bool allNearAbs (const Array<T> &l, const Array<T> &r,
164 double tol);
165//
166// This only makes sense if the array element type is logical valued.
167// <group>
168template<class T> bool allAND (const Array<T> &l, const Array<T> &r);
169template<class T> bool allOR (const Array<T> &l, const Array<T> &r);
170// </group>
171//
172// </group>
173
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> LogicalArray operator <= (const Array<T> &l,
186 const Array<T> &r);
187template<class T> LogicalArray operator < (const Array<T> &l,
188 const Array<T> &r);
189template<class T> LogicalArray operator >= (const Array<T> &l,
190 const Array<T> &r);
191template<class T> LogicalArray operator > (const Array<T> &l,
192 const Array<T> &r);
193template<class T> LogicalArray operator == (const Array<T> &l,
194 const Array<T> &r);
195template<class T> LogicalArray operator != (const Array<T> &l,
196 const Array<T> &r);
197
198template<class T> LogicalArray near(const Array<T> &l, const Array<T> &r,
199 double tol);
200template<class T> LogicalArray nearAbs(const Array<T> &l, const Array<T> &r,
201 double tol);
202//
203// This only makes sense if the array element type is logical valued.
204// <group>
205template<class T> LogicalArray operator && (const Array<T> &l, const Array<T> &r);
206template<class T> LogicalArray operator || (const Array<T> &l, const Array<T> &r);
207// </group>
208//
209// </group>
210
211
212//
213// Logical negation of an array. This only makes sense if the array
214// element type is logical valued.
215template<class T> LogicalArray operator ! (const Array<T> &l);
216
217
218//
219// Element by element comparisons between an array and a scalar, which
220// behaves as if it were a conformant array filled with the value "val."
221// The result is true only if the comparison is true for every element
222// of the array.
223// <group>
224template<class T> bool allLE (const Array<T> &array, const T &val);
225template<class T> bool allLE (const T &val, const Array<T> &array);
226template<class T> bool allLT (const Array<T> &array, const T &val);
227template<class T> bool allLT (const T &val, const Array<T> &array);
228template<class T> bool allGE (const Array<T> &array, const T &val);
229template<class T> bool allGE (const T &val, const Array<T> &array);
230template<class T> bool allGT (const Array<T> &array, const T &val);
231template<class T> bool allGT (const T &val, const Array<T> &array);
232template<class T> bool allEQ (const Array<T> &array, const T &val);
233template<class T> bool allEQ (const T &val, const Array<T> &array);
234template<class T> bool allNE (const Array<T> &array, const T &val);
235template<class T> bool allNE (const T &val, const Array<T> &array);
236template<class T> bool allNear (const Array<T> &array, const T &val, double tol);
237template<class T> bool allNear (const T &val, const Array<T> &array, double tol);
238template<class T> bool allNearAbs (const Array<T> &array, const T &val,
239 double tol);
240template<class T> bool allNearAbs (const T &val, const Array<T> &array,
241 double tol);
242//
243// This only makes sense if the array element type is logical valued.
244// <group>
245template<class T> bool allAND (const Array<T> &array, const T &val);
246template<class T> bool allAND (const T &val, const Array<T> &array);
247template<class T> bool allOR (const Array<T> &array, const T &val);
248template<class T> bool allOR (const T &val, const Array<T> &array);
249// </group>
250//
251// </group>
252
253
254// Test if all elements in an array are the same.
255template<class T> bool allSame (const Array<T> &a)
256 { return a.size() <= 1 || allEQ(*a.data(), a); }
257
258
259// Element by element test for NaN or (In)finity.
260// <group>
261template<class T> LogicalArray isNaN (const Array<T> &array);
262template<class T> LogicalArray isInf (const Array<T> &array);
263template<class T> LogicalArray isFinite (const Array<T> &array);
264// </group>
265
266//
267// Element by element comparisons between an array and a scalar, which
268// behaves as if it were a conformant array filled with the value "val."
269// The result is a LogicalArray.
270//
271// <thrown>
272// <li> ArrayConformanceError
273// </thrown>
274//
275// <group>
276template<class T> LogicalArray operator <= (const Array<T> &array, const T &val);
277template<class T> LogicalArray operator <= (const T &val, const Array<T> &array);
278template<class T> LogicalArray operator < (const Array<T> &array, const T &val);
279template<class T> LogicalArray operator < (const T &val, const Array<T> &array);
280template<class T> LogicalArray operator >= (const Array<T> &array, const T &val);
281template<class T> LogicalArray operator >= (const T &val, const Array<T> &array);
282template<class T> LogicalArray operator > (const Array<T> &array, const T &val);
283template<class T> LogicalArray operator > (const T &val, const Array<T> &array);
284template<class T> LogicalArray operator == (const Array<T> &array, const T &val);
285template<class T> LogicalArray operator == (const T &val, const Array<T> &array);
286template<class T> LogicalArray operator != (const Array<T> &array, const T &val);
287template<class T> LogicalArray operator != (const T &val, const Array<T> &array);
288template<class T> LogicalArray near (const Array<T> &array, const T &val,
289 double tol);
290template<class T> LogicalArray near (const T &val, const Array<T> &array,
291 double tol);
292template<class T> LogicalArray nearAbs (const Array<T> &array, const T &val,
293 double tol);
294template<class T> LogicalArray nearAbs (const T &val, const Array<T> &array,
295 double tol);
296//
297// This only makes sense if the array element type is logical valued.
298// <group>
299template<class T> LogicalArray operator && (const Array<T> &array, const T &val);
300template<class T> LogicalArray operator && (const T &val, const Array<T> &array);
301template<class T> LogicalArray operator || (const Array<T> &array, const T &val);
302template<class T> LogicalArray operator || (const T &val, const Array<T> &array);
303// </group>
304//
305// </group>
306
307
308//# With two arrays, they must both conform, and the result is done element
309//# by element. For instance anyLE (a, b) implies that some element of a is
310//# less than or equal to the corresponding element of b.
311//# NB comparison between two zero-sized arrays is not defined (should it
312//# throw an exception?).
313
314//
315// Element by element comparisons between the "l" and "r" arrays. The result
316// is true if the comparison is true for some element of the arrays.
317//
318// <thrown>
319// <li> ArrayConformanceError
320// </thrown>
321//
322// <group>
323
324template<class T> bool anyLE (const Array<T> &l, const Array<T> &r);
325template<class T> bool anyLT (const Array<T> &l, const Array<T> &r);
326template<class T> bool anyGE (const Array<T> &l, const Array<T> &r);
327template<class T> bool anyGT (const Array<T> &l, const Array<T> &r);
328template<class T> bool anyEQ (const Array<T> &l, const Array<T> &r);
329template<class T> bool anyNE (const Array<T> &l, const Array<T> &r);
330template<class T> bool anyNear (const Array<T> &l, const Array<T> &r,
331 double tol);
332template<class T> bool anyNearAbs (const Array<T> &l, const Array<T> &r,
333 double tol);
334//
335// This only makes sense if the array element type is logical valued.
336// <group>
337template<class T> bool anyAND (const Array<T> &l, const Array<T> &r);
338template<class T> bool anyOR (const Array<T> &l, const Array<T> &r);
339// </group>
340//
341// </group>
342
343//
344// Element by element comparisons between an array and a scalar, which
345// behaves as if it were a conformant array filled with the value "val."
346// The result is true if the comparison is true for some element of the array.
347// At some point operators will be available that return masks where the
348// comparison is true.
349// <group>
350
351template<class T> bool anyLE (const Array<T> &array, const T &val);
352template<class T> bool anyLE (const T &val, const Array<T> &array);
353template<class T> bool anyLT (const Array<T> &array, const T &val);
354template<class T> bool anyLT (const T &val, const Array<T> &array);
355template<class T> bool anyGE (const Array<T> &array, const T &val);
356template<class T> bool anyGE (const T &val, const Array<T> &array);
357template<class T> bool anyGT (const Array<T> &array, const T &val);
358template<class T> bool anyGT (const T &val, const Array<T> &array);
359template<class T> bool anyEQ (const Array<T> &array, const T &val);
360template<class T> bool anyEQ (const T &val, const Array<T> &array);
361template<class T> bool anyNE (const Array<T> &array, const T &val);
362template<class T> bool anyNE (const T &val, const Array<T> &array);
363template<class T> bool anyNear (const Array<T> &array, const T &val, double tol);
364template<class T> bool anyNear (const T &val, const Array<T> &array, double tol);
365template<class T> bool anyNearAbs (const Array<T> &array, const T &val,
366 double tol);
367template<class T> bool anyNearAbs (const T &val, const Array<T> &array,
368 double tol);
369//
370// This only makes sense if the array element type is logical valued.
371// <group>
372template<class T> bool anyAND (const Array<T> &array, const T &val);
373template<class T> bool anyAND (const T &val, const Array<T> &array);
374template<class T> bool anyOR (const Array<T> &array, const T &val);
375template<class T> bool anyOR (const T &val, const Array<T> &array);
376// </group>
377//
378// </group>
379
380
381// Are all elements true?
382inline bool allTrue (const Array<bool>& array)
383 { return allEQ (array, true); }
384
385// Is any element true?
386inline bool anyTrue (const Array<bool>& array)
387 { return anyEQ (array, true); }
388
389// The same functions as above, but for selected axes.
391 const IPosition& collapseAxes);
393 const IPosition& collapseAxes);
394
395// Determine the number of true or false elements.
396// Note: it is meant for bool arrays, but can also be used for
397// e.g. int arrays.
398// <group>
399
400// Determine it for the full array.
401// <group>
402template<class T> size_t nfalse (const Array<T> &array);
403template<class T> size_t ntrue (const Array<T> &array)
404 { return array.nelements() - nfalse(array); }
405// </group>
406
407// The same functions as above, but determine ntrue and nfalse for the
408// given axes only. The result is an array with a shape formed by the
409// remaining axes.
410// For example, for an array with shape [3,4,5], collapsing axis 0
411// results in an array with shape [4,5] containing ntrue or nfalse for
412// each X line.
413// Summing for axes 0 and 2 results in an array with shape [4] containing
414// ntrue or nfalse for each XZ plane.
415// <group>
416template<class T> Array<size_t> partialNTrue (const Array<T>& array,
417 const IPosition& collapseAxes);
418template<class T> Array<size_t> partialNFalse (const Array<T>& array,
419 const IPosition& collapseAxes);
420// </group>
421
422// </group>
423
424// </group>
425} //# end of casacore namespace
426
427#include "ArrayMathBase.h"
428
429namespace casacore {
430
431// Logical functor to test if all elements are true
432template<typename T> class AllFunc final : public ArrayFunctorBase<T,bool> {
433public:
434 virtual bool operator() (const Array<T>& arr) const override { return allTrue(arr); }
435};
436
437// Logical functor to test if any elements are true
438template<typename T> class AnyFunc final : public ArrayFunctorBase<T,bool> {
439public:
440 virtual bool operator() (const Array<T>& arr) const override { return anyTrue(arr); }
441};
442
443// Logical functor to count the number of true elements
444template<typename T, typename RES=size_t>
445class NTrueFunc final : public ArrayFunctorBase<T,RES> {
446public:
447 virtual RES operator() (const Array<T>& arr) const override { return ntrue(arr); }
448};
449
450// Logical functor to count the number of false elements
451template<typename T, typename RES=size_t>
452class NFalseFunc final : public ArrayFunctorBase<T,RES> {
453public:
454 virtual RES operator() (const Array<T>& arr) const override { return nfalse(arr); }
455};
456
457} //# NAMESPACE CASACORE - END
458
459#include "ArrayLogical.tcc"
460
461#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:103
T * data()
Get a pointer to the beginning of the array.
Definition Array.h:592
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
this file contains all the compiler specific defines
Definition mainpage.dox:28
LatticeExprNode operator&&(const LatticeExprNode &left, const LatticeExprNode &right)
Logical binary operators.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition ExprNode.h:1933
bool operator==(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition Allocator.h:127
bool operator!=(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition Allocator.h:133
LatticeExprNode ntrue(const LatticeExprNode &expr)
Bool anyEQ(const TableVector< T > &l, const TableVector< T > &r)
LatticeExprNode operator!(const LatticeExprNode &expr)
LatticeExprNode operator||(const LatticeExprNode &left, const LatticeExprNode &right)
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 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)
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)
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)
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.
bool allNE(const Array< T > &l, const Array< T > &r)
bool anyTrue(const Array< bool > &array)
Is any element true?
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)
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...
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)
bool allEQ(const T &val, const Array< T > &array)
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 Array< T > &l, const Array< T > &r)
This only makes sense if the array element type is logical valued.
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 > &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)
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 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)