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