casa
5.7.0-16
|
RFCubeLatticeIterator: iterator over a cubic buffer. More...
#include <RFCubeLattice.h>
Public Member Functions | |
RFCubeLattice () | |
default constructor creates empty cube More... | |
RFCubeLattice (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::uInt nAgent) | |
creates NX x NY x NZ cube More... | |
RFCubeLattice (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::uInt nAgent, const T &init_val) | |
creates NX x NY x NZ cube and fills with initial value More... | |
~RFCubeLattice () | |
destructor More... | |
void | init (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::uInt nAgent) |
creates NX x NY x NZ cube tile_mb is the tile size, in MB (when using paging) More... | |
void | init (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::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) More... | |
void | cleanup () |
destroys cube More... | |
void | reset () |
resets the lattice iterator to beginning. More... | |
void | advance (casacore::Int iz) |
advances internal iterator to specified slot along the Z axis More... | |
casacore::Int | position () |
returns position of internal iterator More... | |
casacore::IPosition & | shape () |
returns shape More... | |
T | operator() (casacore::uInt i, casacore::uInt j) const |
returns element at i,j of cursor More... | |
void | set (casacore::uInt i, casacore::uInt j, const T &val) |
sets element at i, j of cursor More... | |
void | set (casacore::uInt ichan, casacore::uInt ifr, casacore::uInt icorr, bool val) |
void | set_column (casacore::uInt ifr, const T &val) |
sets element for all (ichan, icorr) More... | |
RFCubeLatticeIterator< T > & | iterator () |
provides access to lattice itself std::vector<std::vector<bool> > & lattice() { return lat; } More... | |
RFCubeLatticeIterator< T > | newIter () |
creates a new iterator for this lattice More... | |
Static Public Member Functions | |
static casacore::uInt | estimateMemoryUse (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz) |
returns size of cube More... | |
Protected Attributes | |
casacore::IPosition | lat_shape |
std::vector< std::vector< bool > > | lat |
RFCubeLatticeIterator< T > | iter |
unsigned | n_chan |
unsigned | n_ifr |
unsigned | n_time |
unsigned | n_bit |
unsigned | n_corr |
RFCubeLatticeIterator: iterator over a cubic buffer.
RFCubeLatice: a cubic lattice.
Internal
See RFCubeLattice, below
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 casacore::Matrix<T> on the fly.
The buffer is no longer implemented using a casacore::TempLattice because the template parameter to casacore::TempLattice is restricted to certain types, and cannot be dynamic_bitset<>. Besides, casacore::TempLattice is currently(?) not* well implemented: it creates casacore::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 66 of file RFCubeLattice.h.
casa::RFCubeLattice< T >::RFCubeLattice | ( | ) |
default constructor creates empty cube
casa::RFCubeLattice< T >::RFCubeLattice | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::uInt | nAgent | ||
) |
creates NX x NY x NZ cube
casa::RFCubeLattice< T >::RFCubeLattice | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::uInt | nAgent, | ||
const T & | init_val | ||
) |
creates NX x NY x NZ cube and fills with initial value
casa::RFCubeLattice< T >::~RFCubeLattice | ( | ) |
destructor
|
inline |
advances internal iterator to specified slot along the Z axis
Definition at line 198 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::cleanup | ( | ) |
destroys cube
|
inlinestatic |
returns size of cube
Definition at line 189 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::init | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::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 | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::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)
|
inline |
provides access to lattice itself std::vector<std::vector<bool> > & lattice() { return lat; }
provides access to iterator
Definition at line 223 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().
|
inline |
returns element at i,j of cursor
Definition at line 207 of file RFCubeLattice.h.
|
inline |
returns position of internal iterator
Definition at line 201 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::reset | ( | ) |
resets the lattice iterator to beginning.
casacore::Matrix<T> * reset(casacore::Bool will_read=true, casacore::Bool will_write=true);
|
inline |
sets element at i, j of cursor
Definition at line 210 of file RFCubeLattice.h.
|
inline |
Definition at line 213 of file RFCubeLattice.h.
void casa::RFCubeLattice< T >::set_column | ( | casacore::uInt | ifr, |
const T & | val | ||
) |
sets element for all (ichan, icorr)
|
inline |
returns shape
Definition at line 204 of file RFCubeLattice.h.
|
protected |
|
protected |
Definition at line 166 of file RFCubeLattice.h.
|
protected |
Definition at line 165 of file RFCubeLattice.h.
Referenced by casa::RFCubeLattice< RFlagWord >::shape().
|
protected |
Definition at line 168 of file RFCubeLattice.h.
|
protected |
Definition at line 168 of file RFCubeLattice.h.
|
protected |
Definition at line 168 of file RFCubeLattice.h.
|
protected |
Definition at line 168 of file RFCubeLattice.h.
|
protected |
Definition at line 168 of file RFCubeLattice.h.