casacore
Loading...
Searching...
No Matches
LELAttribute.h
Go to the documentation of this file.
1// # LELAttribute.h: Ancillary information for the LEL letter classes
2// # Copyright (C) 1997,1998,1999,2000,2001,2003
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 LATTICES_LELATTRIBUTE_H
27#define LATTICES_LELATTRIBUTE_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Arrays/IPosition.h>
32#include <casacore/lattices/LEL/LELCoordinates.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Ancillary information for the LEL letter classes.
38// </summary>
39//
40// <use visibility=local>
41//
42// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
43// </reviewed>
44//
45// <prerequisite>
46// <li> <linkto class="Lattice"> Lattice</linkto>
47// <li> <linkto class="LatticeExpr"> LatticeExpr</linkto>
48// <li> <linkto class="LatticeExprNode"> LatticeExprNode</linkto>
49// <li> <linkto class="LELInterface"> LELInterface</linkto> and
50// derived classes
51// </prerequisite>
52//
53// <etymology>
54// Holds attribute information for the Lattice Expression
55// Language letter classes.
56// </etymology>
57
58// <synopsis>
59// The Lattice Expression Language letter classes provide
60// expression objects. There is ancilliary information or
61// attributes associated with these objects:
62// <ul>
63// <li> Scalar or lattice (i.e. array) or region.
64// <li> In case of an array, is it a reduced array. I.e. is it an array
65// that has to be calculated beforehand (e.g. partialMax).
66// A scalar is always reduced.
67// <li> Shape and tile shape of a lattice. This can be undefined.
68// <li> Is the lattice masked?
69// <li> Optionally coordinates of the lattice.
70// </ul>
71// Two attribute objects can be combined mirroring the combination of two
72// expressions (like the addition of two lattices).
73// Regions cannot be combined.
74// </synopsis>
75
77 public:
78 // Default constructor sets it as a scalar.
80
81 // Constructor sets it as lattice with given attributes.
82 // An empty shape indicates that the shape is not known.
85
86 // Constructor sets it as a region with given attributes.
87 explicit LELAttribute(uInt regionNdim);
88
89 // Copy constructor (copy semantics)
91
92 // Constructor that combines the two attributes given.
93 // An array can be combined with a scalar.
94 // If matchAxes is True and if two arrays are given, the shapes and
95 // coordinates have to match exactly, otherwise one can be a subset of
96 // the other (and LEL will auto-extend).
97 LELAttribute(const LELAttribute& attrLeft, const LELAttribute& attrRight, Bool matchAxes = True);
98
99 // Destructor
101
102 // Assignment (copy semantics)
104
105 // Is expression a scalar?
106 Bool isScalar() const { return isScalar_p; }
107
108 // Is expression a reduced array? A scalar is always reduced.
109 Bool isReduced() const { return isReduced_p; }
110
111 // Is expression a region?
112 Bool isRegion() const { return isRegion_p; }
113
114 // Is the expression result masked?
115 Bool isMasked() const { return isMasked_p; }
116
117 // What is the shape of the expression?
118 const IPosition& shape() const { return shape_p; }
119
120 // What is the tile shape of the expression?
121 const IPosition& tileShape() const { return tileShape_p; }
122
123 // What are the coordinates of the expression?
124 const LELCoordinates& coordinates() const { return coords_p; }
125
126 // Compare the coordinates and shapes to see if this is a subset of other.
127 Int compareCoord(const LELAttribute& other) const;
128
129 private:
137};
138
139} // namespace casacore
140
141#endif
Bool isRegion() const
Is expression a region?
LELAttribute(const LELAttribute &attrLeft, const LELAttribute &attrRight, Bool matchAxes=True)
Constructor that combines the two attributes given.
LELAttribute()
Default constructor sets it as a scalar.
~LELAttribute()
Destructor.
LELAttribute(Bool isMasked, const IPosition &shape, const IPosition &tileShape, const LELCoordinates &coordinates, Bool isReduced=False)
Constructor sets it as lattice with given attributes.
LELAttribute(const LELAttribute &attr)
Copy constructor (copy semantics).
LELAttribute & operator=(const LELAttribute &other)
Assignment (copy semantics).
Int compareCoord(const LELAttribute &other) const
Compare the coordinates and shapes to see if this is a subset of other.
LELAttribute(uInt regionNdim)
Constructor sets it as a region with given attributes.
const LELCoordinates & coordinates() const
What are the coordinates of the expression?
LELCoordinates coords_p
Bool isScalar() const
Is expression a scalar?
Bool isReduced() const
Is expression a reduced array?
const IPosition & shape() const
What is the shape of the expression?
const IPosition & tileShape() const
What is the tile shape of the expression?
Bool isMasked() const
Is the expression result masked?
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41