casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Attributes
casa::RFFloatLattice Class Reference

RFFloatLatice: a cubic lattice. More...

#include <RFFloatLattice.h>

List of all members.

Public Member Functions

 RFFloatLattice ()
 default constructor creates empty cube
 RFFloatLattice (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent, Int maxmem=-1)
 creates NX x NY x NZ cube
 RFFloatLattice (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent, const Float &init_val, Int maxmem=-1)
 creates NX x NY x NZ cube and fills with initial value
 ~RFFloatLattice ()
 destructor
void init (uInt nx, uInt ny, uInt nz, uInt ncorr, uInt nAgent, Int maxmem=-1, Int tile_mb=2)
 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 Float &init_val, Int maxmem=-1, 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)
void cleanup ()
 destroys cube
Matrix< Float > * reset (Bool will_read=True, Bool will_write=True)
 resets the lattice iterator to beginning.
Matrix< Float > * advance (Int iz)
 advances internal iterator to specified slot along the Z axis, returns cursor
Int position ()
 returns position of internal iterator
const IPositionshape ()
 returns shape
Matrix< Float > * cursor ()
 returns internal cursor
Floatoperator() (uInt i, uInt j)
 returns element at i,j of cursor
RFFloatLatticeIteratoriterator ()
 provides access to lattice itself std::vector<boost::dynamic_bitset<> > & lattice() { return lat; }
RFFloatLatticeIterator 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
RFFloatLatticeIterator iter
unsigned n_chan
unsigned n_ifr
unsigned n_time
unsigned n_bit
unsigned n_corr

Detailed Description

RFFloatLatice: a cubic lattice.

Intended use:

Internal

Prerequisite

Synopsis

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 Matrix<Float> 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!

Motivation

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.

Template Type Argument Requirements (T)

To Do

Definition at line 160 of file RFFloatLattice.h.


Constructor & Destructor Documentation

default constructor creates empty cube

casa::RFFloatLattice::RFFloatLattice ( uInt  nx,
uInt  ny,
uInt  nz,
uInt  ncorr,
uInt  nAgent,
Int  maxmem = -1 
)

creates NX x NY x NZ cube

casa::RFFloatLattice::RFFloatLattice ( uInt  nx,
uInt  ny,
uInt  nz,
uInt  ncorr,
uInt  nAgent,
const Float init_val,
Int  maxmem = -1 
)

creates NX x NY x NZ cube and fills with initial value

destructor


Member Function Documentation

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.

destroys cube

returns internal cursor

Definition at line 204 of file RFFloatLattice.h.

References casa::RFFloatLatticeIterator::cursor(), and iter.

static uInt casa::RFFloatLattice::estimateMemoryUse ( uInt  nx,
uInt  ny,
uInt  nz 
) [inline, static]

returns size of cube

Definition at line 187 of file RFFloatLattice.h.

void casa::RFFloatLattice::init ( uInt  nx,
uInt  ny,
uInt  nz,
uInt  ncorr,
uInt  nAgent,
Int  maxmem = -1,
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 ( uInt  nx,
uInt  ny,
uInt  nz,
uInt  ncorr,
uInt  nAgent,
const Float init_val,
Int  maxmem = -1,
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)

provides access to lattice itself std::vector<boost::dynamic_bitset<> > & lattice() { return lat; }

provides access to iterator

Definition at line 213 of file RFFloatLattice.h.

References iter.

creates a new iterator for this lattice

Float& casa::RFFloatLattice::operator() ( uInt  i,
uInt  j 
) [inline]

returns element at i,j of cursor

Definition at line 207 of file RFFloatLattice.h.

References casa::RFFloatLatticeIterator::cursor(), and iter.

returns position of internal iterator

Definition at line 198 of file RFFloatLattice.h.

References iter, and casa::RFFloatLatticeIterator::position().

Matrix<Float>* casa::RFFloatLattice::reset ( Bool  will_read = True,
Bool  will_write = True 
)

resets the lattice iterator to beginning.

returns shape

Definition at line 201 of file RFFloatLattice.h.

References lat_shape.


Member Data Documentation

Definition at line 165 of file RFFloatLattice.h.

Referenced by advance(), cursor(), iterator(), operator()(), and position().

std::vector<boost::dynamic_bitset<> > casa::RFFloatLattice::lat [protected]

Definition at line 164 of file RFFloatLattice.h.

Definition at line 163 of file RFFloatLattice.h.

Referenced by shape().

unsigned casa::RFFloatLattice::n_bit [protected]

Definition at line 166 of file RFFloatLattice.h.

unsigned casa::RFFloatLattice::n_chan [protected]

Definition at line 166 of file RFFloatLattice.h.

unsigned casa::RFFloatLattice::n_corr [protected]

Definition at line 166 of file RFFloatLattice.h.

unsigned casa::RFFloatLattice::n_ifr [protected]

Definition at line 166 of file RFFloatLattice.h.

unsigned casa::RFFloatLattice::n_time [protected]

Definition at line 166 of file RFFloatLattice.h.


The documentation for this class was generated from the following file: