This file is indexed.

/usr/include/casacore/tables/TaQL/MArrayLogical.h is in casacore-dev 2.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
//# MArrayLogical.h: Logical operations on MArray objects
//# Copyright (C) 2012
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//#        Internet email: aips2-request@nrao.edu.
//#        Postal address: AIPS++ Project Office
//#                        National Radio Astronomy Observatory
//#                        520 Edgemont Road
//#                        Charlottesville, VA 22903-2475 USA
//#
//# $Id: MArrayLogical.h 21262 2012-09-07 12:38:36Z gervandiepen $

#ifndef CASA_MARRAYLOGICAL_H
#define CASA_MARRAYLOGICAL_H

//# Includes
#include <casacore/casa/aips.h>
#include <casacore/tables/TaQL/MArrayMathBase.h>
#include <casacore/casa/Arrays/ArrayLogical.h>
#include <casacore/casa/Arrays/ArrayPartMath.h>
#include <casacore/casa/BasicMath/Functors.h>

namespace casacore {

  // <summary>
  // Logical operations for MArray objects.
  // </summary>
  //
  // <reviewed reviewer="UNKNOWN" date="" tests="tMArrayMath">
  //
  // <prerequisite>
  //   <li> <linkto class=MArray>MArray</linkto>
  // </prerequisite>
  //
  // <synopsis>
  // These functions perform element by element logical operations on
  // optionally masked arrays and/or scalars.
  // If two arrays are used, the arrays must conform, except for allEQ which
  // returns False if the arrays do not conform.
  //
  // The functions in this file can be divided in 3 groups:
  // <ul>
  //  <li> Full array operations like ==, near, etc.
  //       They are defined for array-array and array-scalar operations. Arrays
  //       shapes have to be conformant. They operate on all elements
  //       (also the masked ones). The result is an MArray with the same
  //       shape as the input array(s). It will have a mask if one of the
  //       operands has a mask. If both operands have a mask, the resulting
  //       mask is the OR of both masks.
  //  <li> Full reduction functions like ntrue, all, allEQ, etc.
  //       They operate on the unmasked elements only. If there are no unmasked
  //       elements, the results is 0 or True.
  //  <li> Reduction functions working on unmasked elements in parts of the
  //       input array. The result is an MArray that has a mask if the input
  //       array has a mask. An output element is masked off if its input
  //       part has no unmasked elements.
  //       The functors defined at the beginning of this file are used to
  //       operate on each part.
  //       There are 3 flavours:
  //   <ul>
  //    <li> partialXXX reduces one or more axes. E.g. one can count the
  //         number of True elements for particular array axes.
  //         The result is an array with a lower dimensionality.
  //         They can be seen as a special versions of the boxedXXX functions.
  //    <li> slidingXXX operates in a sliding window over the array. So the
  //         result is an array with the same shape as the input, although
  //         the output array is smaller if the edge is not filled.
  //    <li> boxedXXX divides the input array in boxes with the given size
  //         and operates on each box. The result is an array with the same
  //         dimensionality, but with a smaller size.
  //         If the box size does not fit integrally, the edge box is smaller.
  //   </ul>
  // </ul>
  // </synopsis>
  //
  // <group name="MArray logical operations">


  // Define functors to perform a reduction function on an MArray object.
  // <group>
  template<typename T, typename RES=size_t>
  class MNTrueFunc : public MArrayFunctorBase<T,RES> {
  public:
    virtual ~MNTrueFunc() {}
    RES operator() (const MArray<T>& arr) const { return ntrue(arr); }
  };
  template<typename T, typename RES=size_t>
  class MNFalseFunc : public MArrayFunctorBase<T,RES> {
  public:
    virtual ~MNFalseFunc() {}
    RES operator() (const MArray<T>& arr) const { return nfalse(arr); }
  };
  template<typename T> class MAllFunc : public MArrayFunctorBase<T,Bool> {
  public:
    virtual ~MAllFunc() {}
    Bool operator() (const MArray<T>& arr) const { return allTrue(arr); }
  };
  template<typename T> class MAnyFunc : public MArrayFunctorBase<T,Bool> {
  public:
    virtual ~MAnyFunc() {}
    Bool operator() (const MArray<T>& arr) const { return anyTrue(arr); }
  };
  // </group>

  // Define comparison functions between 2 MArray objects and
  // between MArray object and scalar.
  // <group>
  template<typename T>
  MArray<Bool> operator== (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() == right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator<= (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() <= right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator< (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() < right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator>= (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() >= right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator> (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() > right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator!= (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() != right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator|| (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() || right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator&& (const MArray<T>& left, const MArray<T>& right)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (left.array() && right.array(),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> operator== (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() == right, left); }

  template<typename T>
  MArray<Bool> operator<= (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() <= right, left); }

  template<typename T>
  MArray<Bool> operator< (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() < right, left); }

  template<typename T>
  MArray<Bool> operator>= (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() >= right, left); }

  template<typename T>
  MArray<Bool> operator> (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() > right, left); }

  template<typename T>
  MArray<Bool> operator!= (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() != right, left); }

  template<typename T>
  MArray<Bool> operator|| (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() || right, left); }

  template<typename T>
  MArray<Bool> operator&& (const MArray<T>& left, const T& right)
    { return MArray<Bool> (left.array() && right, left); }

  template<typename T>
  MArray<Bool> operator== (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left == right.array(), right); }

  template<typename T>
  MArray<Bool> operator<= (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left <= right.array(), right); }

  template<typename T>
  MArray<Bool> operator< (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left < right.array(), right); }

  template<typename T>
  MArray<Bool> operator>= (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left >= right.array(), right); }

  template<typename T>
  MArray<Bool> operator> (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left > right.array(), right); }

  template<typename T>
  MArray<Bool> operator!= (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left != right.array(), right); }
  // </group>

  // The logical OR of 2 MArray objects (normally Bool type)
  template<typename T>
  MArray<Bool> operator|| (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left || right.array(), right); }

  // The logical AND of 2 MArray objects (normally Bool type).
  template<typename T>
  MArray<Bool> operator&& (const T& left, const MArray<T>& right)
    { return MArray<Bool> (left && right.array(), right); }

  // The logical NOT of an MArray object (normally Bool type).
  template<typename T>
  MArray<Bool> operator! (const MArray<T>& a)
    { return MArray<Bool> (!a.array(), a); }


  // Compare with a given relative or absolute tolerance.
  // <group>
  template<typename T>
  MArray<Bool> near (const MArray<T>& left, const MArray<T>& right,
                     Double tol)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (near(left.array(), right.array(), tol),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> nearAbs (const MArray<T>& left, const MArray<T>& right,
                        Double tol)
    { return (left.isNull() || right.isNull()  ?  MArray<Bool>() :
              MArray<Bool> (nearAbs(left.array(), right.array(), tol),
                            left.combineMask(right))); }

  template<typename T>
  MArray<Bool> near (const MArray<T>& left, const T& right,
                     Double tol)
    { return MArray<Bool> (near(left.array(), right, tol), left); }

  template<typename T>
  MArray<Bool> nearAbs (const MArray<T>& left, const T& right,
                     Double tol)
    { return MArray<Bool> (nearAbs(left.array(), right, tol), left); }

  template<typename T>
  MArray<Bool> near (const T& left, const MArray<T>& right,
                     Double tol)
    { return MArray<Bool> (near(left, right.array(), tol), right); }

  template<typename T>
  MArray<Bool> nearAbs (const T& left, const MArray<T>& right,
                        Double tol)
    { return MArray<Bool> (nearAbs(left, right.array(), tol), right); }
  // </group>


  // Test which elements are NaN.
  template<typename T>
  MArray<Bool> isNaN (const MArray<T>& arr)
    { return MArray<Bool> (isNaN(arr.array()), arr); }

  // Test which elements are infinite.
  template<typename T>
  MArray<Bool> isInf (const MArray<T>& arr)
    { return MArray<Bool> (isInf(arr.array()), arr); }

  // Test which elements have a finite value.
  template<typename T>
  MArray<Bool> isFinite (const MArray<T>& arr)
    { return MArray<Bool> (isFinite(arr.array()), arr); }


  // Are all unmasked elements equal?
  // The result is True if there are no unmasked elements.
  // <group>
  template <typename T>
  Bool allEQ (const MArray<T>& left, const MArray<T>& right)
    { if (left.isNull() || right.isNull()) {
        return False;
      } else if (left.hasMask()) {
        if (right.hasMask()) {
          return compareAllMasked (left.array().begin(), left.array().end(),
                                   right.array.begin(), left.mask().begin(),
                                   right.mask().begin(), std::equal_to<T>());
        } else {
          return compareAllMasked (left.array().begin(), left.array().end(),
                                   right.array.begin(), left.mask().begin(),
                                   std::equal_to<T>());
        }
      } else if (right.hasMask()) {
        return compareAllMasked (left.array().begin(), left.array().end(),
                                 right.array.begin(), right.mask().begin(),
                                 std::equal_to<T>());
      }
      return allEQ (left.array(), right.array());
    }
  template <typename T>
  Bool allEQ (const MArray<T>& array, const T& value)
    { return array.isNull()  ?  False :
        array.hasMask() ?
        compareAllRightMasked (array.array().begin(), array.array().end(),
                               value, array.mask().begin(), std::equal_to<T>())
        : allEQ (array.array(), value);
    }
  template <typename T>
  inline Bool allEQ (const T& value, const MArray<T>& array)
    { return allEQ (array, value); }
  // </group>

  // Is any unmasked element equal?
  // The result is False if there are no unmasked elements.
  // <group>
  template <typename T>
  Bool anyEQ (const MArray<T>& left, const MArray<T>& right)
    { if (left.isNull() || right.isNull()) {
        return False;
      } else if (left.hasMask()) {
        if (right.hasMask()) {
          return compareAnyMasked (left.array().begin(), left.array().end(),
                                   right.array.begin(), left.mask().begin(),
                                   right.mask().begin(), std::equal_to<T>());
        } else {
          return compareAnyMasked (left.array().begin(), left.array().end(),
                                   right.array.begin(), left.mask().begin(),
                                   std::equal_to<T>());
        }
      } else if (right.hasMask()) {
        return compareAnyMasked (left.array().begin(), left.array().end(),
                                 right.array.begin(), right.mask().begin(),
                                 std::equal_to<T>());
      }
      return anyEQ (left.array(), right.array());
    }
  template <typename T>
  Bool anyEQ (const MArray<T>& array, const T& value)
    { return array.isNull()  ?  False :
        array.hasMask() ?
        compareAnyRightMasked (array.array().begin(), array.array().end(),
                               value, array.mask().begin(), std::equal_to<T>())
        : anyEQ (array.array(), value);
  }
  template <typename T>
  inline Bool anyEQ (const T& value, const MArray<T>& array)
    { return anyEQ (array, value); }
  // </group>

  // Are all unmasked elements true?
  inline Bool allTrue (const MArray<Bool>& array)
    { return allEQ (array, True); }

  // Is any unmasked element true?
  inline Bool anyTrue (const MArray<Bool>& array)
    { return anyEQ (array, True); }

  // Count the number of unmasked elements that are True.
  template<typename T>
  size_t ntrue(const MArray<T>& a)
  {
    if (a.hasMask()) {
      return a.array().contiguousStorage() && a.mask().contiguousStorage() ?
        countNEMasked<T>(a.array().cbegin(), a.array().cend(),
                         a.mask().cbegin(), T())  :
        countNEMasked<T>(a.array().begin(),  a.array().end(),
                         a.mask().begin(),  T());
    }
    return ntrue(a.array());
  }

  // Count the number of unmasked elements that are False.
  template<typename T>
  size_t nfalse(const MArray<T>& a)
  {
    if (a.hasMask()) {
      return a.array().contiguousStorage() && a.mask().contiguousStorage() ?
        countMasked<T>(a.array().cbegin(), a.array().cend(),
                       a.mask().cbegin(), T())  :
        countMasked<T>(a.array().begin(),  a.array().end(),
                       a.mask().begin(),  T());
    }
    return nfalse(a.array());
  }


  // Get partial ntrues.
  template<typename T>
  MArray<uInt> partialNTrue (const MArray<T>& a,
                             const IPosition& collapseAxes)
  {
    if (a.isNull()) {
      return MArray<uInt>();
    } else if (! a.hasMask()) {
      return MArray<uInt>(partialNTrue (a.array(), collapseAxes));
    }
    MArray<uInt> res;
    partialArrayMath (res, a, collapseAxes, MNTrueFunc<T,uInt>());
    return res;
  }
  // Get partial nfalses.
  template<typename T>
  MArray<uInt> partialNFalse (const MArray<T>& a,
                              const IPosition& collapseAxes)
  {
    if (a.isNull()) {
      return MArray<uInt>();
    } else if (! a.hasMask()) {
      return MArray<uInt>(partialNFalse (a.array(), collapseAxes));
    }
    MArray<uInt> res;
    partialArrayMath (res, a, collapseAxes, MNFalseFunc<T,uInt>());
    return res;
  }
  // Get partial all.
  template<typename T>
  MArray<Bool> partialAlls (const MArray<T>& a,
                            const IPosition& collapseAxes)
  {
    if (a.isNull()) {
      return MArray<Bool>();
    } else if (! a.hasMask()) {
      Array<Bool> res;
      partialArrayMath (res, a.array(), collapseAxes, AllFunc<T>());
      return MArray<Bool>(res);
    }
    MArray<Bool> res;
    partialArrayMath (res, a, collapseAxes, MAllFunc<T>());
    return res;
  }
  // Get partial any.
  template<typename T>
  MArray<Bool> partialAnys (const MArray<T>& a,
                            const IPosition& collapseAxes)
  {
    if (a.isNull()) {
      return MArray<Bool>();
    } else if (! a.hasMask()) {
      Array<Bool> res;
      partialArrayMath (res, a.array(), collapseAxes, AnyFunc<T>());
      return MArray<Bool>(res);
    }
    MArray<Bool> res;
    partialArrayMath (res, a, collapseAxes, MAnyFunc<T>());
    return res;
  }

  // Get sliding ntrues.
  template<typename T>
  MArray<uInt> slidingNTrue (const MArray<T>& a,
                             const IPosition& halfBoxSize, Bool fillEdge=True)
  {
    if (a.isNull()) {
      return MArray<uInt>();
    } else if (! a.hasMask()) {
      return MArray<uInt>(slidingNTrue (a.array(), halfBoxSize, fillEdge));
    }
    MArray<uInt> res;
    slidingArrayMath (res, a, halfBoxSize, MNTrueFunc<T,uInt>(), fillEdge);
    return res;
  }
  // Get sliding nfalses.
  template<typename T>
  MArray<uInt> slidingNFalse (const MArray<T>& a,
                              const IPosition& halfBoxSize, Bool fillEdge=True)
  {
    if (a.isNull()) {
      return MArray<uInt>();
    } else if (! a.hasMask()) {
      return MArray<uInt>(slidingNFalse (a.array(), halfBoxSize, fillEdge));
    }
    MArray<uInt> res;
    slidingArrayMath (res, a, halfBoxSize, MNFalseFunc<T,uInt>(), fillEdge);
    return res;
  }
  // Get sliding all.
  template<typename T>
  MArray<Bool> slidingAlls (const MArray<T>& a,
                            const IPosition& halfBoxSize, Bool fillEdge=True)
  {
    if (a.isNull()) {
      return MArray<Bool>();
    } else if (! a.hasMask()) {
      Array<Bool> res;
      slidingArrayMath (res, a.array(), halfBoxSize, AllFunc<T>(), fillEdge);
      return MArray<Bool>(res);
    }
    MArray<Bool> res;
    slidingArrayMath (res, a, halfBoxSize, MAllFunc<T>(), fillEdge);
    return res;
  }
  // Get sliding any.
  template<typename T>
  MArray<Bool> slidingAnys (const MArray<T>& a,
                            const IPosition& halfBoxSize, Bool fillEdge=True)
  {
    if (a.isNull()) {
      return MArray<Bool>();
    } else if (! a.hasMask()) {
      Array<Bool> res;
      slidingArrayMath (res, a.array(), halfBoxSize, AnyFunc<T>(), fillEdge);
      return MArray<Bool>(res);
    }
    MArray<Bool> res;
    slidingArrayMath (res, a, halfBoxSize, MAnyFunc<T>(), fillEdge);
    return res;
  }

  // Get boxed ntrues.
  template<typename T>
  MArray<uInt> boxedNTrue (const MArray<T>& a,
                           const IPosition& boxSize)
  {
    if (a.isNull()) {
      return MArray<uInt>();
    } else if (! a.hasMask()) {
      return MArray<uInt>(boxedNTrue (a.array(), boxSize));
    }
    MArray<uInt> res;
    boxedArrayMath (res, a, boxSize, MNTrueFunc<T,uInt>());
    return res;
  }
  // Get boxed nfalses.
  template<typename T>
  MArray<uInt> boxedNFalse (const MArray<T>& a,
                            const IPosition& boxSize)
  {
    if (a.isNull()) {
      return MArray<uInt>();
    } else if (! a.hasMask()) {
      return MArray<uInt>(boxedNFalse (a.array(), boxSize));
    }
    MArray<uInt> res;
    boxedArrayMath (res, a, boxSize, MNFalseFunc<T,uInt>());
    return res;
  }
  // Get boxed all.
  template<typename T>
  MArray<Bool> boxedAlls (const MArray<T>& a,
                          const IPosition& boxSize)
  {
    if (a.isNull()) {
      return MArray<Bool>();
    } else if (! a.hasMask()) {
      Array<Bool> res;
      boxedArrayMath (res, a.array(), boxSize, AllFunc<T>());
      return MArray<Bool>(res);
    }
    MArray<Bool> res;
    boxedArrayMath (res, a, boxSize, MAllFunc<T>());
    return res;
  }
  // Get boxed any.
  template<typename T>
  MArray<Bool> boxedAnys (const MArray<T>& a,
                          const IPosition& boxSize)
  {
    if (a.isNull()) {
      return MArray<Bool>();
    } else if (! a.hasMask()) {
      Array<Bool> res;
      boxedArrayMath (res, a.array(), boxSize, AnyFunc<T>());
      return MArray<Bool>(res);
    }
    MArray<Bool> res;
    boxedArrayMath (res, a, boxSize, MAnyFunc<T>());
    return res;
  }

  // </group>

} //# end namespace

#endif