|
| TempLattice () |
| The default constructor creates a TempLattice containing a default ArrayLattice object. More...
|
|
| TempLattice (const TiledShape &shape, Int maxMemoryInMB=-1) |
| Create a TempLattice of the specified shape. More...
|
|
| TempLattice (const TiledShape &shape, Double maxMemoryInMB) |
|
| TempLattice (const TempLattice< T > &other) |
| The copy constructor uses reference semantics. More...
|
|
virtual | ~TempLattice () |
| The destructor removes the Lattice from memory and if necessary disk. More...
|
|
TempLattice< T > & | operator= (const TempLattice< T > &other) |
| The assignment operator with reference semantics. More...
|
|
virtual Lattice< T > * | clone () const |
| Make a copy of the object (reference semantics). More...
|
|
virtual Bool | isPaged () const |
| Is the TempLattice paged to disk? More...
|
|
virtual Bool | canReferenceArray () const |
| Can the lattice data be referenced as an array section? More...
|
|
virtual Bool | isWritable () const |
| Is the TempLattice writable? It should be. More...
|
|
virtual void | flush () |
| Flush the data. More...
|
|
virtual void | tempClose () |
| Close the Lattice temporarily (if it is paged to disk). More...
|
|
virtual void | reopen () |
| If needed, reopen a temporarily closed TempLattice. More...
|
|
virtual IPosition | shape () const |
| Return the shape of the Lattice including all degenerate axes. More...
|
|
virtual void | set (const T &value) |
| Set all of the elements in the Lattice to the given value. More...
|
|
virtual void | apply (T(*function)(T)) |
| Replace every element, x, of the Lattice with the result of f(x). More...
|
|
virtual void | apply (T(*function)(const T &)) |
|
virtual void | apply (const Functional< T, T > &function) |
|
virtual uInt | advisedMaxPixels () const |
| This function returns the recommended maximum number of pixels to include in the cursor of an iterator. More...
|
|
virtual IPosition | doNiceCursorShape (uInt maxPixels) const |
| Get the best cursor shape. More...
|
|
virtual uInt | maximumCacheSize () const |
| Maximum size - not necessarily all used. More...
|
|
virtual void | setMaximumCacheSize (uInt howManyPixels) |
| Set the maximum (allowed) cache size as indicated. More...
|
|
virtual void | setCacheSizeFromPath (const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath) |
| Set the cache size as to "fit" the indicated path. More...
|
|
virtual void | setCacheSizeInTiles (uInt howManyTiles) |
| Set the actual cache size for this Array to be be big enough for the indicated number of tiles. More...
|
|
virtual void | clearCache () |
| Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called. More...
|
|
virtual void | showCacheStatistics (ostream &os) const |
| Report on cache success. More...
|
|
virtual T | getAt (const IPosition &where) const |
| Get or put a single element in the lattice. More...
|
|
virtual void | putAt (const T &value, const IPosition &where) |
|
virtual Bool | ok () const |
| Check class internals - used for debugging. More...
|
|
virtual LatticeIterInterface< T > * | makeIter (const LatticeNavigator &navigator, Bool useRef) const |
| This function is used by the LatticeIterator class to generate an iterator of the correct type for this Lattice. More...
|
|
virtual Bool | doGetSlice (Array< T > &buffer, const Slicer §ion) |
| Do the actual getting of an array of values. More...
|
|
virtual void | doPutSlice (const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride) |
| Do the actual getting of an array of values. More...
|
|
template<class T>
class casacore::TempLattice< T >
A Lattice that can be used for temporary storage.
Intended use:
Public interface
Review Status
- Reviewed By:
- Peter Barnes
- Date Reviewed:
- 1999/10/30
- Test programs:
- tTempLattice
Prerequisite
Etymology
A TempLattice disappears from both memory and disk when it goes out of scope. Hence it is only useful for temporary storage of data.
Synopsis
Lattice classes are designed to allow the memory-efficient handling of large amounts of data. But they can also used with much smaller arrays. With large amounts of data the PagedArray class should be used, as this will store the data on disk and efficiently access specified portions of the data on request. With small amounts of data the ArrayLattice class should be used as all the data is always in memory avoiding the I/O associated with PagedArrays.
Applications often cannot predict until run time whether they will be dealing with a large or small amount of data. So the use of a PagedArray or an ArrayLattice cannot be made until the size of the arrays are known. TempLattice makes this decision given the size of the Array. To help in making a good choice the TempLattice class also examines how much memory the operating system has (using an aipsrc variable) and compares it with the size of the requested Array.
The algorithm currently used is: create an ArrayLattice if the size of the array is less than a quarter of the total system memory; otherwise a PagedArray is created. The PagedArray is stored in the current working directory and given a unique name that contains the string "pagedArray". This pagedArray will be deleted once the TempLattice goes out of scope. So unlike PagedArrays which can be made to exist longer than the time they are used by a process, the PagedArrays created by the TempLattice class are always scratch arrays.
It is possible to temporarily close a TempLattice, which only takes effect when it is created as a PagedArray. In this way it is possible to reduce the number of open files in case a lot of TempLattice objects are used. A temporarily closed TempLattice will be reopened automatically when needed. It can also be reopened explicitly.
You can force the TempLattice to be disk based by setting the memory argument in the constructors to 0
TempLattice is implemented using TempLatticeImpl for reasons explained in that class.
Example
TempLattice<Float> myLat (IPosition(2,1024,1024));
myLat.set (0.);
myLat.tempClose();
myLat.set (1.);
Motivation
I needed a temporary Lattice when converting the Convolver class to using Lattices. This was to store the Transfer function.
Template Type Argument Requirements (T)
-
Any type that can be used by the Lattices can also be used by this class.
Definition at line 44 of file LatticeCleaner.h.