casacore
LatticeIterator.h
Go to the documentation of this file.
1 //# LatticeIterator.h: Iterators for Lattices: readonly or read/write
2 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,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: 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 LATTICES_LATTICEITERATOR_H
29 #define LATTICES_LATTICEITERATOR_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/lattices/Lattices/Lattice.h>
34 #include <casacore/lattices/Lattices/LatticeIterInterface.h>
35 #include <casacore/casa/Utilities/CountedPtr.h>
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 //# Forward Declarations
40 class IPosition;
41 class LatticeNavigator;
42 template <class T> class Array;
43 template <class T> class Cube;
44 template <class T> class Matrix;
45 template <class T> class Vector;
46 
47 
48 // <summary>
49 // A readonly iterator for Lattices
50 // </summary>
51 
52 // <use visibility=export>
53 
54 // <reviewed reviewer="Peter Barnes" date="1999/10/30" tests="tLatticeIterator.cc">
55 // </reviewed>
56 
57 // <prerequisite>
58 // <li> <linkto class="Lattice">Lattice</linkto>
59 // <li> <linkto class="LatticeNavigator">LatticeNavigator</linkto>
60 // <li> <linkto class="Array">Array</linkto>
61 // </prerequisite>
62 
63 // <etymology>
64 // The leading "RO" is shorthand for "readonly", which indicates that an
65 // RO_LatticeIterator is used for traversing a Lattice, examining and
66 // possibly extracting its contents, but not for modifying it.
67 // </etymology>
68 
69 // <synopsis>
70 // This class provides a convenient way to traverse any class derived from
71 // Lattice. You can iterate through the Lattice's data from "start" to "end"
72 // by calling <src>operator++</src>, and reverse direction by calling
73 // <src>operator--</src>. You can return immediately to the beginning by
74 // calling the <src>reset</src> function. The RO_LatticeIterator gives the
75 // user the opportunity to methodically walk through the data, in an
76 // efficient way.
77 // <p>
78 // The supplied <linkto class=LatticeNavigator>LatticeNavigator</linkto>
79 // determines how to step through the Lattice. It can, for instance,
80 // be line by line, but it can also be in a more complicated way.
81 // When no navigator is supplied, a default navigator will be used
82 // which steps in the optimum way.
83 // <p>
84 // A cursor (which is an <linkto class=Array>Array</linkto> object) is
85 // used to return the data for each step in the iteration process.
86 // Depending on the navigator used the cursor can have a different shape
87 // for each step of the iteration. This is especially true when the
88 // end of an axis is reached for a non-integrally fitting cursor shape.
89 // <br> The cursor() function returns an Array which has the same
90 // dimensionality as the Lattice. It is, however, also possible to get
91 // an Array with a lower dimensionality by using the correct function
92 // in the group <src>vectorCursor()</src>, <src>matrixCursor()</src>, and
93 // <src>cubeCursor()</src>. Those functions remove (some) degenerated axes
94 // resulting in a vector, matrix or cube.
95 // When, for example, a LatticeStepper with shape [64,1,1] is used, the
96 // <src>vectorCursor()</src> can be used. It will remove the degenerated
97 // axes (length 1) and return the cursor as a Vector object. Note that
98 // <src>matrixCursor()</src> cannot be used, because removing the degenerated
99 // axes results in a 1D array.
100 // <p>
101 // Generally iterators should not be long-lived objects - create new ones
102 // when needed rather than keeping one around for a long time to be
103 // reused. This is because the cache memory used by the cursor will be
104 // released when the iterator is destroyed.
105 // <p>
106 // The purpose of this class is to hide the possibly complicated
107 // implementation and structure of the Lattice classes, and allow you to
108 // iterate through a Lattice with the same ease as one iterates through a
109 // Fortran or C vector. For example, and assuming that initialization has
110 // been done properly, here's a typical 'for' loop:
111 // <srcblock>
112 // // code omitted which associates Lattice object and the iterator
113 // for (iterator.reset(); !iterator.atEnd(); iterator++) {
114 // meanValue = mean(iterator.cursor());
115 // }
116 // </srcblock>
117 // The iterator's <src>cursor()</src> member function returns a reference to
118 // that part of the Lattice data which is presently "seen" by the
119 // LatticeIterator.
120 // <p>
121 // Before explaining the initialization of an iterator, the LatticeNavigator
122 // class must be further introduced. This is an abstract base class, from which
123 // concrete navigators are derived. After one of these is created, you
124 // attach it to the LatticeIterator, and it provides a specific technique
125 // for navigating through the Lattice. Different navigators deliver
126 // different traversal schemes. The most basic is
127 // <linkto class=LatticeStepper>LatticeStepper</linkto>, which
128 // moves a specified shape sequentially through the Lattice -- for example,
129 // by moving one plane at a time, front to back, through a cube. Another
130 // (future) navigator might be designed to move a small, 2-dimensional plane
131 // through a cube, centering each iteration on the brightest pixel of the
132 // cube's plane, and ignoring the darker regions of the cube.
133 // <p>
134 // The performance and memory usage of an iteration through a lattice
135 // (in particular through a <linkto class=PagedArray>PagedArray</linkto>)
136 // depends very heavily on the navigator used. Currently there are three
137 // navigators available:
138 // <ol>
139 // <li> <linkto class=LatticeStepper>LatticeStepper</linkto> steps
140 // sequentially through a lattice with the given cursor shape.
141 // This can use a lot of memory for the PagedArray cache.
142 // <li> <linkto class=TiledLineStepper>TiledLineStepper</linkto>
143 // steps line by line through a lattice. However, it is doing that
144 // in such a way that as few tiles as possible need to kept in the
145 // PagedArray cache. This reduces memory usage considerably.
146 // <li> <linkto class=TileStepper>TileStepper</linkto> steps tile
147 // by tile through a lattice. This navigator requires a PagedArray cache
148 // of 1 tile only. However, it can only be used for application in which
149 // the iteration order is not important (e.g. addition, determining max).
150 // </ol>
151 // The class <linkto class=LatticeApply>LatticeApply</linkto> is very useful
152 // to iterate through a Lattice while applying an algorithm. It makes it
153 // possible for the user to concentrate on the algorithm.
154 // <p>
155 // Here's a typical iterator declaration:
156 // <srcblock>
157 // RO_LatticeIterator<Float> iterator(pagedArray, stepper);
158 // </srcblock>
159 // The template identifier <src>Float</src> defines the data type of
160 // Array object that will be the iterator's cursor.
161 //<br>
162 // The <src>pagedArray</src> constructor argument names a PagedArray object,
163 // which is what the iterator will traverse. The <src>stepper</src>
164 // argument is a LatticeStepper which defines the method of iteration.
165 
166 // <example>
167 // When passed the name of a previously created PagedArray stored on disk,
168 // this function will traverse the whole array, and report the average value
169 // of all of the elements. Imagine that the filename contains a PagedArray
170 // with dimension 64 x 64 x 8.
171 // <srcblock>
172 // void demonstrateIterator (const String& filename)
173 // {
174 // PagedArray<Float> pagedArray(filename);
175 // IPosition latticeShape = pagedArray.shape();
176 // cout << "paged array has shape: " << latticeShape << endl;
177 //
178 // // Construct the iterator. since we only want to read the PagedArray,
179 // // use the read-only class, which disallows writing back to the cursor.
180 // // No navigator is given, so the default TileStepper is used
181 // // which ensures optimum performance.
182 // RO_LatticeIterator<Float> iterator(pagedArray);
183 //
184 // // Add for each iteration step the sum of the cursor elements to the sum.
185 // // Note that the cursor is an Array object and that the function sum
186 // // is defined in ArrayMath.h.
187 // Float runningSum = 0.0;
188 // for (iterator.reset(); !iterator.atEnd(); iterator++) {
189 // runningSum += sum(iterator.cursor());
190 // }
191 // cout << "average value, from demonstrateIterator: "
192 // << runningSum / latticeShape.product() << endl;
193 // }
194 // </srcblock>
195 // </example>
196 
197 // <motivation>
198 // Iterator classes are a standard feature in C++ libraries -- they
199 // provide convenience and allow the implementation of the "iteratee"
200 // to be kept hidden.
201 // </motivation>
202 
203 //# <todo asof="1995/09/12">
204 //# <li>
205 //# </todo>
206 
207 
208 template <class T> class RO_LatticeIterator
209 {
210 public:
211 
212  // The default constructor creates an empty object which is practically
213  // unusable.
214  // It can only be used as the source or target of an assignment. It can
215  // also be used as the source for the copy constructor and the copy function.
216  // Other functions do not check if the object is empty and will usually
217  // give a segmentation fault.
218  // The function isNull() can be used to test if the object is empty.
220 
221  // Construct the Iterator with the supplied data.
222  // It uses a TileStepper as the default iteration strategy.
223  // useRef=True means that if possible the cursor arrays returned
224  // reference the data in the underlying lattice. This is only possible
225  // for ArrayLattice objects (or e.g. a SubLattice using it).
226  explicit RO_LatticeIterator (const Lattice<T>& data, Bool useRef=True);
227 
228  // Construct the Iterator with the supplied data, and iteration strategy
229  RO_LatticeIterator (const Lattice<T>& data, const LatticeNavigator& method,
230  Bool useRef=True);
231 
232  // Construct the Iterator with the supplied data.
233  // It uses a LatticeStepper with the supplied cursor shape as the
234  // iteration strategy.
235  RO_LatticeIterator (const Lattice<T>& data, const IPosition& cursorShape,
236  Bool useRef=True);
237 
238  // The copy constructor uses reference semantics (ie. NO real copy is made).
239  // The function <src>copy</src> can be used to make a true copy.
241 
242  // Destructor (cleans up dangling references and releases memory)
244 
245  // Assignment uses reference semantics (ie. NO real copy is made).
246  // The function <src>copy</src> can be used to make a true copy.
248 
249  // Make a copy of the iterator object.
250  // This means that an independent navigator object is created to
251  // be able to iterate independently through the same Lattice.
252  // The position in the copied navigator is the same as the original.
253  // The reset function has to be used to start at the beginning.
254  // <br>Note that if the Lattice uses a cache (e.g. PagedArray), the
255  // cache is shared by the iterators.
256  RO_LatticeIterator<T> copy() const;
257 
258  // Is the iterator object empty?
259  Bool isNull() const
260  { return itsIterPtr.null(); }
261 
262  // Return the underlying lattice.
264  { return itsIterPtr->lattice(); }
265 
266  // Increment operator - increment the cursor to the next position. These
267  // functions are forwarded to the current LatticeNavigator and both
268  // postfix and prefix versions will do the same thing.
269  // <br>They return True if the cursor moved (which should always be the
270  // case if the iterator is not at the end).
271  // <group>
272  Bool operator++();
273  Bool operator++(int);
274  // </group>
275 
276  // Decrement operator - decrement the cursor to the previous
277  // position. These functions are forwarded to the current LatticeNavigator
278  // and both postfix and prefix versions will do the same thing.
279  // <br>They return True if the cursor moved (which should always be the
280  // case if the iterator is not at the start).
281  // <group>
282  Bool operator--();
283  Bool operator--(int);
284  // </group>
285 
286  // Function which resets the cursor to the beginning of the Lattice and
287  // resets the number of steps taken to zero.
288  void reset();
289 
290  // Function which returns a value of "True" if the cursor is at the
291  // beginning of the Lattice, otherwise, returns "False".
292  Bool atStart() const;
293 
294  // Function which returns a value of "True" if an attempt has been made
295  // to move the cursor beyond the end of the Lattice.
296  Bool atEnd() const;
297 
298  // Function to return the number of steps (increments or decrements) taken
299  // since construction (or since last reset). This is a running count of
300  // all cursor movement, thus doing N increments followed by N decrements
301  // results in 2N steps.
302  uInt nsteps() const;
303 
304  // Function which returns the current position of the beginning of the
305  // cursor within the Lattice. The returned IPosition will have the same
306  // number of axes as the underlying Lattice.
307  IPosition position() const;
308 
309  // Function which returns the current position of the end of the
310  // cursor. The returned IPosition will have the same number of axes as the
311  // underlying Lattice.
312  IPosition endPosition() const;
313 
314  // Function which returns the shape of the Lattice being iterated through.
315  // The returned IPosition will always have the same number of axes as the
316  // underlying Lattice.
317  IPosition latticeShape() const;
318 
319  // Function which returns the shape of the cursor which is iterating
320  // through the Lattice. The returned IPosition will have the same number
321  // of axes as the underlying Lattice.
322  IPosition cursorShape() const;
323 
324  // Functions which returns a window to the data in the Lattice. These are
325  // used to read the data within the Lattice. Use the function that is
326  // appropriate to the current cursor dimension, AFTER REMOVING DEGENERATE
327  // AXES, or use the <src>cursor</src> function which works with any number
328  // of dimensions in the cursor. A call of the function whose return value
329  // is inappropriate with respect to the current cursor dimension will
330  // throw an exception (AipsError).
331  // <group>
332  const Vector<T>& vectorCursor() const;
333  const Matrix<T>& matrixCursor() const;
334  const Cube<T>& cubeCursor() const;
335  const Array<T>& cursor() const;
336  // </group>
337 
338  // Function which checks the internals of the class for consistency.
339  // Returns True if everything is fine otherwise returns False.
340  Bool ok() const;
341 
342 protected:
343  // The pointer to the Iterator
345 };
346 
347 
348 
349 // <summary>
350 // A read/write lattice iterator
351 // </summary>
352 
353 // <use visibility=export>
354 
355 // <reviewed reviewer="Peter Barnes" date="1999/10/30" tests="tLatticeIterator.cc">
356 // </reviewed>
357 
358 // <prerequisite>
359 // <li> <linkto class="RO_LatticeIterator">RO_LatticeIterator</linkto>
360 // <li> <linkto class="Lattice">Lattice</linkto>
361 // <li> <linkto class="LatticeNavigator">LatticeNavigator</linkto>
362 // <li> <linkto class="Array">Array</linkto>
363 // </prerequisite>
364 
365 // <synopsis>
366 // LatticeIterator differs from the RO_LatticeIterator class in that
367 // the window into the Lattice data which moves with each iterative step may
368 // be used to alter the Lattice data itself. The moving "cursor" gives the
369 // user the door to reach in and change the basic Lattice before moving to
370 // another section of the Lattice.
371 // <p>
372 // LatticeIterator can be used in 3 ways:
373 // <br> - For readonly purposes using the cursor() functions. Note that if
374 // the entire iteration is readonly, it is better to use an
375 // <linkto class=RO_LatticeIterator>RO_LatticeIterator</linkto> object.
376 // <br> - To update (part of)the contents of the lattice (e.g. clip the value
377 // of some pixels). For this purpose the <src>rwCursor</src> functions
378 // should be used. They read the data (if not read yet) and mark the
379 // cursor for write.
380 // <br> - To fill the lattice. For this purpose the <src>woCursor</src>
381 // functions should be used. They do not read the data, but only mark the
382 // cursor for write.
383 // <p>
384 // When needed, writing the cursor data is done automatically when the
385 // cursor position changes or when the iterator is destructed.
386 // </synopsis>
387 
388 // <example>
389 // Here's an iterator that runs through a cube, assigning every element
390 // of each plane of the cube a value equal to the number of the plane.
391 // See <linkto class=LatticeStepper>LatticeStepper</linkto> for an
392 // explanation of the navigator used here.
393 // <srcblock>
394 // PagedArray<Float> pa("someName");
395 // IPosition windowShape(2,pa.shape(0), pa.shape(1));
396 // LatticeStepper stepper(pa.shape(), windowShape);
397 // LatticeIterator<Float> iterator(pa, stepper);
398 // Int planeNumber = 0;
399 // for (iterator.reset(); !iterator.atEnd(); iterator++) {
400 // iterator.woCursor() = planeNumber++;
401 // }
402 // </srcblock>
403 //
404 // Here's an iterator that runs through a cube, subtracting the mean from
405 // each line of the cube with a mean < 0.
406 // See <linkto class=TiledLineStepper>TiledLineStepper</linkto> for an
407 // explanation of the navigator used here.
408 // <srcblock>
409 // PagedArray<Float> pa("someName");
410 // TiledLineStepper stepper(pa.shape(), pa.niceCursorShape(), 0);
411 // LatticeIterator<Float> iterator(pa, stepper);
412 // Int planeNumber = 0;
413 // for (iterator.reset(); !iterator.atEnd(); iterator++) {
414 // Float meanLine = mean(iterator.cursor());
415 // if (meanLine < 0) {
416 // iterator.rwCursor() -= meanLine;
417 // }
418 // }
419 // </srcblock>
420 // Note that in this last example no more vectors than required are written.
421 // This is achieved by using the readonly function <src>cursor</src> in
422 // the test and using <src>rwCursor</src> only when data needs to be changed.
423 // <br>Note that <src>rwCursor</src> does not read the data again. They are
424 // still readily available.
425 // </example>
426 
427 
428 template <class T> class LatticeIterator : public RO_LatticeIterator<T>
429 {
430 public:
431 
432  // The default constructor creates an empty object which is practically
433  // unusable.
434  // It can only be used as the source or target of an assignment. It can
435  // also be used as the source for the copy constructor and the copy function.
436  // Other functions do not check if the object is empty and will usually
437  // give a segmentation fault.
438  // The function isNull() can be used to test if the object is empty.
439  LatticeIterator();
440 
441  // Construct the Iterator with the supplied data.
442  // It uses a TileStepper as the default iteration strategy.
443  // useRef=True means that if possible the cursor arrays returned
444  // reference the data in the underlying lattice. This is only possible
445  // for ArrayLattice objects (or e.g. a SubLattice using it).
446  explicit LatticeIterator (Lattice<T>& data, Bool useRef=True);
447 
448  // Construct the Iterator with the supplied data, and iteration strategy
449  LatticeIterator (Lattice<T>& data, const LatticeNavigator& method,
450  Bool useRef=True);
451 
452  // Iterate through the data with a LatticeStepper that has uses the
453  // supplied cursorShape.
454  LatticeIterator (Lattice<T>& data, const IPosition& cursorShape,
455  Bool useRef=True);
456 
457  // The copy constructor uses reference semantics (ie. NO real copy is made).
458  // The function <src>copy</src> can be used to make a true copy.
459  LatticeIterator (const LatticeIterator<T>& other);
460 
461  // destructor (cleans up dangling references and releases memory)
463 
464  // Assignment uses reference semantics (ie. NO real copy is made).
465  // The function <src>copy</src> can be used to make a true copy.
467 
468  // Make a copy of the iterator object.
469  // This means that an independent navigator object is created to
470  // be able to iterate independently through the same Lattice.
471  // The position in the copied navigator is the same as the original.
472  // The reset function has to be used to start at the beginning.
473  // <br>Note that if the Lattice uses a cache (e.g. PagedArray), the
474  // cache is shared by the iterators.
475  LatticeIterator<T> copy() const;
476 
477  // Functions to return a window to the data in the Lattice. Use the function
478  // that is appropriate to the current cursor dimension, AFTER REMOVING
479  // DEGENERATE AXES, or use the <src>cursor</src> function which works with
480  // any number of dimensions in the cursor. A call of the function whose
481  // return value is inappropriate with respect to the current cursor
482  // dimension will throw an exception (AipsError) (e.g. VectorCursor
483  // cannot be used when the cursor is 2D).
484  // <br>
485  // When the iterator state changes (e.g. by moving, destruction) the
486  // data are automatically rewritten before the iterator state is changed.
487  // <br>The <src>rw</src> (read/write) versions should be used to read the
488  // data first. They are useful to update a lattice.
489  // The <src>wo</src> (writeonly) versions do not read the data.
490  // They only return a cursor of the correct shape and are useful to
491  // fill a lattice. Note that it sets the state to 'data read'. I.e.,
492  // a subsequent call to, say, <src>cursor()</src> does not read the
493  // data, which would destroy the contents of the cursor which may
494  // just be filled by the user.
495  // <group>
499  Array<T>& rwCursor();
503  Array<T>& woCursor();
504  //</group>
505 
506  // Function which checks the internals of the class for consistency.
507  // Returns True if everything is fine. Otherwise returns False.
508  Bool ok() const;
509 
510  //# Make members of parent class known.
511 public:
516 protected:
518 };
519 
520 
521 
522 } //# NAMESPACE CASACORE - END
523 
524 //# See comments in Lattice.h why Lattice.tcc is included here.
525 #ifndef CASACORE_NO_AUTO_TEMPLATES
526 #include <casacore/lattices/Lattices/Lattice.tcc>
527 #include <casacore/lattices/Lattices/LatticeIterator.tcc>
528 #endif //# CASACORE_NO_AUTO_TEMPLATES
529 #endif
casacore::Matrix
A 2-D Specialization of the Array class.
Definition: Array.h:50
casacore::IPosition
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
casacore::LatticeIterator::operator=
LatticeIterator< T > & operator=(const LatticeIterator< T > &other)
Assignment uses reference semantics (ie.
casacore::LatticeIterator::woCubeCursor
Cube< T > & woCubeCursor()
casacore::RO_LatticeIterator::operator++
Bool operator++()
Increment operator - increment the cursor to the next position.
casacore::LatticeIterator::rwMatrixCursor
Matrix< T > & rwMatrixCursor()
casacore::LatticeIterator::rwCubeCursor
Cube< T > & rwCubeCursor()
casacore::CountedPtr
Referenced counted pointer for constant data.
Definition: CountedPtr.h:80
casacore::LatticeIterator::ok
Bool ok() const
Function which checks the internals of the class for consistency.
casacore::RO_LatticeIterator::isNull
Bool isNull() const
Is the iterator object empty?
Definition: LatticeIterator.h:259
casacore::LatticeIterator
A read/write lattice iterator.
Definition: ImageRegrid.h:46
casacore::LatticeIterator::~LatticeIterator
~LatticeIterator()
destructor (cleans up dangling references and releases memory)
casacore::LatticeIterator::LatticeIterator
LatticeIterator()
The default constructor creates an empty object which is practically unusable.
casacore::Cube
A 3-D Specialization of the Array class.
Definition: ArrayIO.h:46
casacore::RO_LatticeIterator::atEnd
Bool atEnd() const
Function which returns a value of "True" if an attempt has been made to move the cursor beyond the en...
casacore::LatticeIterator::woCursor
Array< T > & woCursor()
casacore::RO_LatticeIterator::ok
Bool ok() const
Function which checks the internals of the class for consistency.
casacore::LatticeNavigator
Abstract base class to steer lattice iterators.
Definition: LatticeNavigator.h:182
casacore::RO_LatticeIterator::cursorShape
IPosition cursorShape() const
Function which returns the shape of the cursor which is iterating through the Lattice.
casacore::RO_LatticeIterator
A readonly iterator for Lattices.
Definition: LatticeIterator.h:208
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::RO_LatticeIterator::nsteps
uInt nsteps() const
Function to return the number of steps (increments or decrements) taken since construction (or since ...
casacore::RO_LatticeIterator::endPosition
IPosition endPosition() const
Function which returns the current position of the end of the cursor.
casacore::RO_LatticeIterator::lattice
Lattice< T > & lattice() const
Return the underlying lattice.
Definition: LatticeIterator.h:263
casacore::RO_LatticeIterator::cubeCursor
const Cube< T > & cubeCursor() const
casacore::RO_LatticeIterator::vectorCursor
const Vector< T > & vectorCursor() const
Functions which returns a window to the data in the Lattice.
casacore::RO_LatticeIterator::matrixCursor
const Matrix< T > & matrixCursor() const
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::RO_LatticeIterator::operator--
Bool operator--()
Decrement operator - decrement the cursor to the previous position.
casacore::True
const Bool True
Definition: aipstype.h:43
casacore::LatticeIterator::woVectorCursor
Vector< T > & woVectorCursor()
casacore::RO_LatticeIterator::~RO_LatticeIterator
~RO_LatticeIterator()
Destructor (cleans up dangling references and releases memory)
casacore::RO_LatticeIterator::copy
RO_LatticeIterator< T > copy() const
Make a copy of the iterator object.
casacore::Lattice
A templated, abstract base class for array-like objects.
Definition: Functional.h:37
casacore::Array
template <class T, class U> class vector;
Definition: Array.h:166
casacore::RO_LatticeIterator::atStart
Bool atStart() const
Function which returns a value of "True" if the cursor is at the beginning of the Lattice,...
casacore::LatticeIterator::rwCursor
Array< T > & rwCursor()
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::RO_LatticeIterator::itsIterPtr
CountedPtr< LatticeIterInterface< T > > itsIterPtr
The pointer to the Iterator.
Definition: LatticeIterator.h:344
casacore::LatticeIterator::woMatrixCursor
Matrix< T > & woMatrixCursor()
casacore::RO_LatticeIterator::latticeShape
IPosition latticeShape() const
Function which returns the shape of the Lattice being iterated through.
casacore::Vector
A 1-D Specialization of the Array class.
Definition: ArrayIO.h:45
casacore::RO_LatticeIterator::cursor
const Array< T > & cursor() const
casacore::RO_LatticeIterator::operator=
RO_LatticeIterator< T > & operator=(const RO_LatticeIterator< T > &other)
Assignment uses reference semantics (ie.
casacore::RO_LatticeIterator::position
IPosition position() const
Function which returns the current position of the beginning of the cursor within the Lattice.
casacore::LatticeIterator::rwVectorCursor
Vector< T > & rwVectorCursor()
Functions to return a window to the data in the Lattice.
casacore::LatticeIterator::copy
LatticeIterator< T > copy() const
Make a copy of the iterator object.
casacore::RO_LatticeIterator::RO_LatticeIterator
RO_LatticeIterator()
The default constructor creates an empty object which is practically unusable.
casacore::RO_LatticeIterator::reset
void reset()
Function which resets the cursor to the beginning of the Lattice and resets the number of steps taken...