casa
$Rev:20696$
|
RFCubeLatice: a cubic lattice. More...
#include <RFCubeLattice.h>
Public Member Functions | |
RFCubeLattice () | |
default constructor creates empty cube | |
RFCubeLattice (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent) | |
creates NX x NY x NZ cube | |
RFCubeLattice (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent, const T &init_val) | |
creates NX x NY x NZ cube and fills with initial value | |
~RFCubeLattice () | |
destructor | |
void | init (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent) |
creates NX x NY x NZ cube tile_mb is the tile size, in MB (when using paging) | |
void | init (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent, const T &init_val) |
creates NX x NY x NZ cube and fills with initial value tile_mb is the tile size, in MB (when using paging) | |
void | cleanup () |
destroys cube | |
void | reset () |
resets the lattice iterator to beginning. | |
void | advance (Int iz) |
advances internal iterator to specified slot along the Z axis | |
Int | position () |
returns position of internal iterator | |
IPosition & | shape () |
returns shape | |
T | operator() (uInt i, uInt j) const |
returns element at i,j of cursor | |
void | set (uInt i, uInt j, const T &val) |
sets element at i, j of cursor | |
void | set (uInt ichan, uInt ifr, uInt icorr, bool val) |
void | set_column (uInt ifr, const T &val) |
sets element for all (ichan, icorr) | |
RFCubeLatticeIterator< T > & | iterator () |
provides access to lattice itself std::vector<boost::dynamic_bitset<> > & lattice() { return lat; } | |
RFCubeLatticeIterator< T > | newIter () |
creates a new iterator for this lattice | |
Static Public Member Functions | |
static uInt | estimateMemoryUse (uInt nx, uInt ny, uInt nz) |
returns size of cube | |
Protected Attributes | |
IPosition | lat_shape |
std::vector < boost::dynamic_bitset<> > | lat |
RFCubeLatticeIterator< T > | iter |
unsigned | n_chan |
unsigned | n_ifr |
unsigned | n_time |
unsigned | n_bit |
unsigned | n_corr |
RFCubeLatice: a cubic lattice.
Internal
RFCubeLattice is a [NX,NY,NZ] vector of Matrices which is iterated over the Z axis. While a vector of Matrices may not be localized in memory, it has the advantage that the total amount of memory allocated can exceed the available RAM, which is probably not possible if allocated as a single giant block. Each element of the matrices is a few bits, therefore (in order to save memory), the full matrix is represented as a bitsequence, which is converted to Matrix<T> on the fly.
The buffer is no longer implemented using a TempLattice because the template parameter to TempLattice is restricted to certain types, and cannot be boost::dynamic_bitset<>. Besides, TempLattice is currently(?) not well implemented: it creates TempLattice disk files although most of the RAM is free.
If more memory than avilable RAM is requested, swapping will occur. The underlying OS probably knows better when to swap!
Many flagging agents make use of cubic lattices (typically, to maintain [NCHAN,NIFR,NTIME] cubes of something) in an identical way. This class provides a clean and convenient interface to the basic functions.
Definition at line 163 of file RFCubeLattice.h.
casa::RFCubeLattice< T >::RFCubeLattice | ( | ) |
default constructor creates empty cube
casa::RFCubeLattice< T >::RFCubeLattice | ( | uInt | nx, |
uInt | ny, | ||
uInt | nz, | ||
uInt | ncorr, | ||
uInt | nAgent | ||
) |
creates NX x NY x NZ cube
casa::RFCubeLattice< T >::RFCubeLattice | ( | uInt | nx, |
uInt | ny, | ||
uInt | nz, | ||
uInt | ncorr, | ||
uInt | nAgent, | ||
const T & | init_val | ||
) |
creates NX x NY x NZ cube and fills with initial value
casa::RFCubeLattice< T >::~RFCubeLattice | ( | ) |
destructor
void casa::RFCubeLattice< T >::advance | ( | Int | iz | ) | [inline] |
advances internal iterator to specified slot along the Z axis
Definition at line 199 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::cleanup | ( | ) |
destroys cube
static uInt casa::RFCubeLattice< T >::estimateMemoryUse | ( | uInt | nx, |
uInt | ny, | ||
uInt | nz | ||
) | [inline, static] |
returns size of cube
Definition at line 190 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::init | ( | uInt | nx, |
uInt | ny, | ||
uInt | nz, | ||
uInt | ncorr, | ||
uInt | nAgent | ||
) |
creates NX x NY x NZ cube tile_mb is the tile size, in MB (when using paging)
void casa::RFCubeLattice< T >::init | ( | uInt | nx, |
uInt | ny, | ||
uInt | nz, | ||
uInt | ncorr, | ||
uInt | nAgent, | ||
const T & | init_val | ||
) |
creates NX x NY x NZ cube and fills with initial value tile_mb is the tile size, in MB (when using paging)
RFCubeLatticeIterator<T>& casa::RFCubeLattice< T >::iterator | ( | ) | [inline] |
provides access to lattice itself std::vector<boost::dynamic_bitset<> > & lattice() { return lat; }
provides access to iterator
Definition at line 224 of file RFCubeLattice.h.
Referenced by casa::RFFlagCube::clearFlag(), casa::RFFlagCube::getFlag(), casa::RFFlagCube::iterator(), and casa::RFFlagCube::setFlag().
RFCubeLatticeIterator<T> casa::RFCubeLattice< T >::newIter | ( | ) |
creates a new iterator for this lattice
Referenced by casa::RFFlagCube::newCustomIter().
T casa::RFCubeLattice< T >::operator() | ( | uInt | i, |
uInt | j | ||
) | const [inline] |
returns element at i,j of cursor
Definition at line 208 of file RFCubeLattice.h.
Int casa::RFCubeLattice< T >::position | ( | ) | [inline] |
returns position of internal iterator
Definition at line 202 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::reset | ( | ) |
resets the lattice iterator to beginning.
Matrix<T> * reset( Bool will_read=True, Bool will_write=True );
void casa::RFCubeLattice< T >::set | ( | uInt | i, |
uInt | j, | ||
const T & | val | ||
) | [inline] |
sets element at i, j of cursor
Definition at line 211 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::set | ( | uInt | ichan, |
uInt | ifr, | ||
uInt | icorr, | ||
bool | val | ||
) | [inline] |
Definition at line 214 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::set_column | ( | uInt | ifr, |
const T & | val | ||
) |
sets element for all (ichan, icorr)
IPosition& casa::RFCubeLattice< T >::shape | ( | ) | [inline] |
returns shape
Definition at line 205 of file RFCubeLattice.h.
RFCubeLatticeIterator<T> casa::RFCubeLattice< T >::iter [protected] |
std::vector<boost::dynamic_bitset<> > casa::RFCubeLattice< T >::lat [protected] |
Definition at line 167 of file RFCubeLattice.h.
IPosition casa::RFCubeLattice< T >::lat_shape [protected] |
Definition at line 166 of file RFCubeLattice.h.
Referenced by casa::RFCubeLattice< RFlagWord >::shape().
unsigned casa::RFCubeLattice< T >::n_bit [protected] |
Definition at line 169 of file RFCubeLattice.h.
unsigned casa::RFCubeLattice< T >::n_chan [protected] |
Definition at line 169 of file RFCubeLattice.h.
unsigned casa::RFCubeLattice< T >::n_corr [protected] |
Definition at line 169 of file RFCubeLattice.h.
unsigned casa::RFCubeLattice< T >::n_ifr [protected] |
Definition at line 169 of file RFCubeLattice.h.
unsigned casa::RFCubeLattice< T >::n_time [protected] |
Definition at line 169 of file RFCubeLattice.h.