casa
5.7.0-16
|
RFFloatLatice: a cubic lattice. More...
#include <RFFloatLattice.h>
Public Member Functions | |
RFFloatLattice () | |
default constructor creates empty cube More... | |
RFFloatLattice (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::uInt nAgent, casacore::Int maxmem=-1) | |
creates NX x NY x NZ cube More... | |
RFFloatLattice (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::uInt nAgent, const casacore::Float &init_val, casacore::Int maxmem=-1) | |
creates NX x NY x NZ cube and fills with initial value More... | |
~RFFloatLattice () | |
destructor More... | |
void | init (casacore::uInt nx, casacore::uInt ny, casacore::uInt nz, casacore::uInt ncorr, casacore::uInt nAgent, casacore::Int maxmem=-1, casacore::Int tile_mb=2) |
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 casacore::Float &init_val, casacore::Int maxmem=-1, casacore::Int tile_mb=2) |
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... | |
casacore::Matrix < casacore::Float > * | reset (casacore::Bool will_read=true, casacore::Bool will_write=true) |
resets the lattice iterator to beginning. More... | |
casacore::Matrix < casacore::Float > * | advance (casacore::Int iz) |
advances internal iterator to specified slot along the Z axis, returns cursor More... | |
casacore::Int | position () |
returns position of internal iterator More... | |
const casacore::IPosition & | shape () |
returns shape More... | |
casacore::Matrix < casacore::Float > * | cursor () |
returns internal cursor More... | |
casacore::Float & | operator() (casacore::uInt i, casacore::uInt j) |
returns element at i,j of cursor More... | |
RFFloatLatticeIterator & | iterator () |
provides access to lattice itself std::vector<std::vector<bool> > & lattice() { return lat; } More... | |
RFFloatLatticeIterator | 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 |
RFFloatLatticeIterator | iter |
unsigned | n_chan |
unsigned | n_ifr |
unsigned | n_time |
unsigned | n_bit |
unsigned | n_corr |
RFFloatLatice: a cubic lattice.
Internal
RFFloatLattice 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<casacore::Float> 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 160 of file RFFloatLattice.h.
casa::RFFloatLattice::RFFloatLattice | ( | ) |
default constructor creates empty cube
casa::RFFloatLattice::RFFloatLattice | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::uInt | nAgent, | ||
casacore::Int | maxmem = -1 |
||
) |
creates NX x NY x NZ cube
casa::RFFloatLattice::RFFloatLattice | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::uInt | nAgent, | ||
const casacore::Float & | init_val, | ||
casacore::Int | maxmem = -1 |
||
) |
creates NX x NY x NZ cube and fills with initial value
casa::RFFloatLattice::~RFFloatLattice | ( | ) |
destructor
|
inline |
advances internal iterator to specified slot along the Z axis, returns cursor
Definition at line 195 of file RFFloatLattice.h.
References casa::RFFloatLatticeIterator::advance(), and iter.
void casa::RFFloatLattice::cleanup | ( | ) |
destroys cube
|
inline |
returns internal cursor
Definition at line 204 of file RFFloatLattice.h.
References casa::RFFloatLatticeIterator::cursor(), and iter.
|
inlinestatic |
returns size of cube
Definition at line 187 of file RFFloatLattice.h.
void casa::RFFloatLattice::init | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::uInt | nAgent, | ||
casacore::Int | maxmem = -1 , |
||
casacore::Int | tile_mb = 2 |
||
) |
creates NX x NY x NZ cube tile_mb is the tile size, in MB (when using paging)
void casa::RFFloatLattice::init | ( | casacore::uInt | nx, |
casacore::uInt | ny, | ||
casacore::uInt | nz, | ||
casacore::uInt | ncorr, | ||
casacore::uInt | nAgent, | ||
const casacore::Float & | init_val, | ||
casacore::Int | maxmem = -1 , |
||
casacore::Int | tile_mb = 2 |
||
) |
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 213 of file RFFloatLattice.h.
References iter.
RFFloatLatticeIterator casa::RFFloatLattice::newIter | ( | ) |
creates a new iterator for this lattice
|
inline |
returns element at i,j of cursor
Definition at line 207 of file RFFloatLattice.h.
References casa::RFFloatLatticeIterator::cursor(), and iter.
|
inline |
returns position of internal iterator
Definition at line 198 of file RFFloatLattice.h.
References iter, and casa::RFFloatLatticeIterator::position().
casacore::Matrix<casacore::Float>* casa::RFFloatLattice::reset | ( | casacore::Bool | will_read = true , |
casacore::Bool | will_write = true |
||
) |
resets the lattice iterator to beginning.
|
inline |
|
protected |
Definition at line 165 of file RFFloatLattice.h.
Referenced by advance(), cursor(), iterator(), operator()(), and position().
|
protected |
Definition at line 164 of file RFFloatLattice.h.
|
protected |
Definition at line 163 of file RFFloatLattice.h.
Referenced by shape().
|
protected |
Definition at line 166 of file RFFloatLattice.h.
|
protected |
Definition at line 166 of file RFFloatLattice.h.
|
protected |
Definition at line 166 of file RFFloatLattice.h.
|
protected |
Definition at line 166 of file RFFloatLattice.h.
|
protected |
Definition at line 166 of file RFFloatLattice.h.