/usr/include/casacore/casa/Arrays/MaskArrLogi.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 | //# MaskArrLogi.h: Element by element logical operations on masked arrays.
//# Copyright (C) 1993,1994,1995,1999,2001
//# 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$
#ifndef CASA_MASKARRLOGI_H
#define CASA_MASKARRLOGI_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Arrays/Array.h>
#include <casacore/casa/Arrays/MaskedArray.h>
#include <casacore/casa/Arrays/MaskLogiArr.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// <summary>
// Logical operations for MaskedArrays, and between MaskedArrays and Arrays.
// </summary>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMaskArrLogi tMaskArrExcp">
//
// <prerequisite>
// <li> <linkto class=Array>Array</linkto>
// <li> <linkto group="LogiArray.h#LogicalArray">LogicalArray</linkto>
// <li> <linkto class=MaskedArray>MaskedArray</linkto>
// </prerequisite>
//
// <etymology>
// MaskArrLogi is short for MaskedArrayLogical, which is too long by the
// old AIPS++ file naming conventions. This file contains global functions
// which perform element by element logical operations on masked arrays.
// </etymology>
//
// <synopsis>
// These functions perform element by element logical operations on
// masked arrays. With two arrays, they must both conform, and the result
// is done element by element, for those locations where the mask of the
// MaskedArray is True. For two MaskedArrays, the "and" of the masks is used.
//
// There are two classes of functions. One class returns a MaskedLogicalArray.
// In these functions, the value of an element of the MaskedLogicalArray is
// the value of the logical operation applied to the corresponding elements
// of the input MaskedArrays. The other class of functions returns a single
// Bool. The return value is True if the logical operation returns True for
// all elements of the input masked arrays for the "all" functions
// (e.g. allLE()), and returns True if the logical operation returns True for
// any elements of the input masked arrays for the "any" functions
// (e.g. anyLE()). The functions which return a single Bool throw an exception
// if the AND of the masks of the input masked arrays has no True elements.
//
// For instance allLE (a, b) imples that every element of a is
// less than or equal to every element of b. Note that with this definition
// allLE (a, b) and allGE (a, b) can both be false (e.g. a = [1,0] b = [0,1]).
//
// NB comparison between two zero-sized arrays is not defined (should it
// throw an exception?).
// </synopsis>
//
// <example>
// <srcblock>
// Vector<Int> a(10);
// Vector<Int> b(10);
// LogicalVector l(10);
// . . .
// l = a(a>0) < b(b>0);
// </srcblock>
// This example sets those elements of l where ((a>0) && (b>0)) to (a<b).
// Elements of l where !((a>0) && (b>0)) are unchanged. The result of
// the comparison is a MaskedLogicalArray. The assignment from this
// MaskedLogicalArray to the LogicalArray l only assigns those elements
// where the mask is True.
// </example>
//
// <example>
// <srcblock>
// Vector<Int> a(10);
// Vector<Int> b(10);
// Bool result;
// . . .
// result = allLT (a(a>0), b(b>0));
// </srcblock>
// This example sets result to True if, for all elements where
// ((a>0) && (b>0)), a<b.
// </example>
//
// <motivation>
// One wants to be able to mask arrays and perform logical operations on
// those masked arrays. Since the masked arrays are only defined where
// the masks are True, the result must be a MaskedLogicalArray, or a single
// Bool.
// </motivation>
//
// <todo asof="$DATE:$>
// <li> Reconsider where the origin of the returned LogicalArray should
// be located.
// </todo>
//
// <linkfrom anchor="MaskedArray logical operations" classes="MaskedArray Array Vector Matrix Cube">
// <here>MaskedArray logical operations</here> -- Logical operations
// for MaskedArrays, and between MaskedArrays and Arrays.
// </linkfrom>
//
// <group name="MaskedArray logical operations">
//
// Element by element comparisons between the "l" and "r" arrays. The result
// is true only if the comparison is true for every element of the arrays
// for which the mask of the MaskedArray is True. For two MaskedArrays,
// the "and" of the masks is used.
//
// <thrown>
// <li> ArrayConformanceError
// <li> ArrayError
// </thrown>
//
// <group>
template<class T> Bool allLE (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool allLT (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool allGE (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool allGT (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool allEQ (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool allNE (const MaskedArray<T> &l, const Array<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T> Bool allAND (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool allOR (const MaskedArray<T> &l, const Array<T> &r);
// </group>
template<class T> Bool allLE (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool allLT (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool allGE (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool allGT (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool allEQ (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool allNE (const Array<T> &l, const MaskedArray<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T> Bool allAND (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool allOR (const Array<T> &l, const MaskedArray<T> &r);
// </group>
template<class T>
Bool allLE (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool allLT (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool allGE (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool allGT (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool allEQ (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool allNE (const MaskedArray<T> &l, const MaskedArray<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T>
Bool allAND (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool allOR (const MaskedArray<T> &l, const MaskedArray<T> &r);
// </group>
// </group>
//
// Element by element comparisons between the "l" and "r" arrays. The result
// is a MaskedLogicalArray.
//
// The arrays must conform or an exception is thrown.
//
// <thrown>
// <li> ArrayConformanceError
// </thrown>
//
// <group>
template<class T>
MaskedLogicalArray operator <= (const MaskedArray<T> &l, const Array<T> &r);
template<class T>
MaskedLogicalArray operator < (const MaskedArray<T> &l, const Array<T> &r);
template<class T>
MaskedLogicalArray operator >= (const MaskedArray<T> &l, const Array<T> &r);
template<class T>
MaskedLogicalArray operator > (const MaskedArray<T> &l, const Array<T> &r);
template<class T>
MaskedLogicalArray operator == (const MaskedArray<T> &l, const Array<T> &r);
template<class T>
MaskedLogicalArray operator != (const MaskedArray<T> &l, const Array<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T>
MaskedLogicalArray operator && (const MaskedArray<T> &l, const Array<T> &r);
template<class T>
MaskedLogicalArray operator || (const MaskedArray<T> &l, const Array<T> &r);
// </group>
template<class T>
MaskedLogicalArray operator <= (const Array<T> &l, const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator < (const Array<T> &l, const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator >= (const Array<T> &l, const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator > (const Array<T> &l, const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator == (const Array<T> &l, const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator != (const Array<T> &l, const MaskedArray<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T>
MaskedLogicalArray operator && (const Array<T> &l, const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator || (const Array<T> &l, const MaskedArray<T> &r);
// </group>
template<class T>
MaskedLogicalArray operator <= (const MaskedArray<T> &l,
const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator < (const MaskedArray<T> &l,
const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator >= (const MaskedArray<T> &l,
const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator > (const MaskedArray<T> &l,
const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator == (const MaskedArray<T> &l,
const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator != (const MaskedArray<T> &l,
const MaskedArray<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T>
MaskedLogicalArray operator && (const MaskedArray<T> &l,
const MaskedArray<T> &r);
template<class T>
MaskedLogicalArray operator || (const MaskedArray<T> &l,
const MaskedArray<T> &r);
// </group>
// </group>
//
// Logical negation of a MaskedArray. This only makes sense if the array
// element type is logical valued.
template<class T>
MaskedLogicalArray operator ! (const MaskedArray<T> &marray);
//
// Element by element comparisons between an array and a scalar, which
// behaves as if it were a conformant array filled with the value "val."
// The result is true only if the comparison is true for every element
// for which the mask of the MaskedArray is True.
// <thrown>
// <li> ArrayError
// </thrown>
//
// <group>
template<class T> Bool allLE (const MaskedArray<T> &array, const T &val);
template<class T> Bool allLE (const T &val, const MaskedArray<T> &array);
template<class T> Bool allLT (const MaskedArray<T> &array, const T &val);
template<class T> Bool allLT (const T &val, const MaskedArray<T> &array);
template<class T> Bool allGE (const MaskedArray<T> &array, const T &val);
template<class T> Bool allGE (const T &val, const MaskedArray<T> &array);
template<class T> Bool allGT (const MaskedArray<T> &array, const T &val);
template<class T> Bool allGT (const T &val, const MaskedArray<T> &array);
template<class T> Bool allEQ (const MaskedArray<T> &array, const T &val);
template<class T> Bool allEQ (const T &val, const MaskedArray<T> &array);
template<class T> Bool allNE (const MaskedArray<T> &array, const T &val);
template<class T> Bool allNE (const T &val, const MaskedArray<T> &array);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T> Bool allAND (const MaskedArray<T> &array, const T &val);
template<class T> Bool allAND (const T &val, const MaskedArray<T> &array);
template<class T> Bool allOR (const MaskedArray<T> &array, const T &val);
template<class T> Bool allOR (const T &val, const MaskedArray<T> &array);
// </group>
//
// </group>
//
// Element by element comparisons between an array and a scalar, which
// behaves as if it were a conformant array filled with the value "val."
// The result is an MaskedLogicalArray.
// <group>
//
template<class T>
MaskedLogicalArray operator <= (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator <= (const T &val, const MaskedArray<T> &array);
template<class T>
MaskedLogicalArray operator < (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator < (const T &val, const MaskedArray<T> &array);
template<class T>
MaskedLogicalArray operator >= (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator >= (const T &val, const MaskedArray<T> &array);
template<class T>
MaskedLogicalArray operator > (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator > (const T &val, const MaskedArray<T> &array);
template<class T>
MaskedLogicalArray operator == (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator == (const T &val, const MaskedArray<T> &array);
template<class T>
MaskedLogicalArray operator != (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator != (const T &val, const MaskedArray<T> &array);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T>
MaskedLogicalArray operator && (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator && (const T &val, const MaskedArray<T> &array);
template<class T>
MaskedLogicalArray operator || (const MaskedArray<T> &array, const T &val);
template<class T>
MaskedLogicalArray operator || (const T &val, const MaskedArray<T> &array);
// </group>
//
// </group>
//# With two arrays, they must both conform, and the result is done element
//# by element. For instance anyLE (a, b) imples that some element of a is
//# less than or equal to every element of b.
//# NB comparison between two zero-sized arrays is not defined (should it
//# throw an exception?).
//
// Element by element comparisons between the "l" and "r" arrays. The result
// is true only if the comparison is true for some element of the arrays
// for which the mask of the MaskedArray is True. For two MaskedArrays,
// the "and" of the masks is used.
//
// <thrown>
// <li> ArrayConformanceError
// <li> ArrayError
// </thrown>
//
// <group>
//
template<class T> Bool anyLE (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool anyLT (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool anyGE (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool anyGT (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool anyEQ (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool anyNE (const MaskedArray<T> &l, const Array<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T> Bool anyAND (const MaskedArray<T> &l, const Array<T> &r);
template<class T> Bool anyOR (const MaskedArray<T> &l, const Array<T> &r);
// </group>
template<class T> Bool anyLE (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool anyLT (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool anyGE (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool anyGT (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool anyEQ (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool anyNE (const Array<T> &l, const MaskedArray<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T> Bool anyAND (const Array<T> &l, const MaskedArray<T> &r);
template<class T> Bool anyOR (const Array<T> &l, const MaskedArray<T> &r);
// </group>
template<class T>
Bool anyLE (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool anyLT (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool anyGE (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool anyGT (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool anyEQ (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool anyNE (const MaskedArray<T> &l, const MaskedArray<T> &r);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T>
Bool anyAND (const MaskedArray<T> &l, const MaskedArray<T> &r);
template<class T>
Bool anyOR (const MaskedArray<T> &l, const MaskedArray<T> &r);
// </group>
// </group>
//
// Element by element comparisons between an array and a scalar, which
// behaves as if it were a conformant array filled with the value "val."
// The result is true only if the comparison is true for some element
// for which the mask of the MaskedArray is True.
//
// <thrown>
// <li> ArrayError
// </thrown>
//
// <group>
//
template<class T> Bool anyLE (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyLE (const T &val, const MaskedArray<T> &array);
template<class T> Bool anyLT (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyLT (const T &val, const MaskedArray<T> &array);
template<class T> Bool anyGE (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyGE (const T &val, const MaskedArray<T> &array);
template<class T> Bool anyGT (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyGT (const T &val, const MaskedArray<T> &array);
template<class T> Bool anyEQ (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyEQ (const T &val, const MaskedArray<T> &array);
template<class T> Bool anyNE (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyNE (const T &val, const MaskedArray<T> &array);
//
// This only makes sense if the array element type is logical valued.
// <group>
template<class T> Bool anyAND (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyAND (const T &val, const MaskedArray<T> &array);
template<class T> Bool anyOR (const MaskedArray<T> &array, const T &val);
template<class T> Bool anyOR (const T &val, const MaskedArray<T> &array);
// </group>
//
// </group>
// </group>
} //# NAMESPACE CASACORE - END
#ifndef CASACORE_NO_AUTO_TEMPLATES
#include <casacore/casa/Arrays/MaskArrLogi.tcc>
#endif //# CASACORE_NO_AUTO_TEMPLATES
#endif
|