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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/IPosition.h>
33#include <casacore/lattices/LEL/LELCoordinates.h>
34
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38// <summary>
39// Ancillary information for the LEL letter classes.
40// </summary>
41//
42// <use visibility=local>
43//
44// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
45// </reviewed>
46//
47// <prerequisite>
48// <li> <linkto class="Lattice"> Lattice</linkto>
49// <li> <linkto class="LatticeExpr"> LatticeExpr</linkto>
50// <li> <linkto class="LatticeExprNode"> LatticeExprNode</linkto>
51// <li> <linkto class="LELInterface"> LELInterface</linkto> and
52// derived classes
53// </prerequisite>
54//
55// <etymology>
56// Holds attribute information for the Lattice Expression
57// Language letter classes.
58// </etymology>
59
60// <synopsis>
61// The Lattice Expression Language letter classes provide
62// expression objects. There is ancilliary information or
63// attributes associated with these objects:
64// <ul>
65// <li> Scalar or lattice (i.e. array) or region.
66// <li> In case of an array, is it a reduced array. I.e. is it an array
67// that has to be calculated beforehand (e.g. partialMax).
68// A scalar is always reduced.
69// <li> Shape and tile shape of a lattice. This can be undefined.
70// <li> Is the lattice masked?
71// <li> Optionally coordinates of the lattice.
72// </ul>
73// Two attribute objects can be combined mirroring the combination of two
74// expressions (like the addition of two lattices).
75// Regions cannot be combined.
76// </synopsis>
77
78
80{
81public:
82// Default constructor sets it as a scalar.
84
85// Constructor sets it as lattice with given attributes.
86// An empty shape indicates that the shape is not known.
88 const IPosition& shape,
89 const IPosition& tileShape,
92
93// Constructor sets it as a region with given attributes.
94 explicit LELAttribute(uInt regionNdim);
95
96// Copy constructor (copy semantics)
98
99// Constructor that combines the two attributes given.
100// An array can be combined with a scalar.
101// If matchAxes is True and if two arrays are given, the shapes and
102// coordinates have to match exactly, otherwise one can be a subset of
103// the other (and LEL will auto-extend).
104 LELAttribute(const LELAttribute& attrLeft,
105 const LELAttribute& attrRight,
106 Bool matchAxes = True);
107
108// Destructor
110
111// Assignment (copy semantics)
113
114// Is expression a scalar?
115 Bool isScalar() const { return isScalar_p; }
116
117// Is expression a reduced array? A scalar is always reduced.
118 Bool isReduced() const { return isReduced_p; }
119
120// Is expression a region?
121 Bool isRegion() const { return isRegion_p; }
122
123// Is the expression result masked?
124 Bool isMasked() const { return isMasked_p; }
125
126// What is the shape of the expression?
127 const IPosition& shape() const { return shape_p; }
128
129// What is the tile shape of the expression?
130 const IPosition& tileShape() const { return tileShape_p; }
131
132// What are the coordinates of the expression?
133 const LELCoordinates& coordinates() const { return coords_p; }
134
135// Compare the coordinates and shapes to see if this is a subset of other.
136 Int compareCoord (const LELAttribute& other) const;
137
138private:
146};
147
148
149
150} //# NAMESPACE CASACORE - END
151
152#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? A scalar is always reduced.
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?
this file contains all the compiler specific defines
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