casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::LineCollapser< T, U > Class Template Referenceabstract

Abstract base class for LatticeApply function signatures. More...

#include <LineCollapser.h>

Public Member Functions

virtual ~LineCollapser ()
 Destructor. More...
 
virtual void init (uInt nOutPixelsPerCollapse)=0
 The init function for a derived class. More...
 
virtual Bool canHandleNullMask () const
 Can the process function in the derived class handle a null mask? If not, LatticeApply ensures that it'll always pass a filled mask vector, even if the lattice does not have a mask (in that case that mask contains all True values). More...
 
virtual void process (U &result, Bool &resultMask, const Vector< T > &line, const Vector< Bool > &mask, const IPosition &pos)=0
 Collapse the given line and return one value from that operation. More...
 
virtual void multiProcess (Vector< U > &result, Vector< Bool > &resultMask, const Vector< T > &line, const Vector< Bool > &mask, const IPosition &pos)=0
 Collapse the given line and return a line of values from that operation. More...
 

Detailed Description

template<class T, class U = T>
class casacore::LineCollapser< T, U >

Abstract base class for LatticeApply function signatures.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

This is an abstract base class for the collapsing of lines to be used in function lineApply or lineMultiApply in class LatticeApply. It is meant for cases where the entire line is needed (e.g. moment calculation). If that is not needed (e.g. to calculate maximum), it is better to use function LatticeApply::tiledApply with class TiledCollapser.

The user has to derive a concrete class from this base class and implement the (pure) virtual functions.
The main function is process, which needs to do the calculation.
Other functions make it possible to perform an initial check.

The class is Doubly templated. Ths first template type is for the data type you are processing. The second type is for what type you want the results of the processing assigned to. For example, if you are computing sums of squares for statistical purposes, you might use higher precision (FLoat->Double) for this. No check is made that the template types are self-consistent.

Example

Motivation

To Do

Definition at line 93 of file LineCollapser.h.

Constructor & Destructor Documentation

template<class T, class U = T>
virtual casacore::LineCollapser< T, U >::~LineCollapser ( )
virtual

Destructor.

Member Function Documentation

template<class T, class U = T>
virtual Bool casacore::LineCollapser< T, U >::canHandleNullMask ( ) const
virtual

Can the process function in the derived class handle a null mask? If not, LatticeApply ensures that it'll always pass a filled mask vector, even if the lattice does not have a mask (in that case that mask contains all True values).


The default implementation returns False.
The function is there to make optimization possible when no masks are involved. On the other side, it allows the casual user to ignore optimization.

Reimplemented in casa::MomentClip< T >.

template<class T, class U = T>
virtual void casacore::LineCollapser< T, U >::init ( uInt  nOutPixelsPerCollapse)
pure virtual

The init function for a derived class.

It can be used to check if nOutPixelsPerCollapse corresponds with the number of pixels produced per collapsed line.

Implemented in casa::MomentCalcBase< T >.

template<class T, class U = T>
virtual void casacore::LineCollapser< T, U >::multiProcess ( Vector< U > &  result,
Vector< Bool > &  resultMask,
const Vector< T > &  line,
const Vector< Bool > &  mask,
const IPosition pos 
)
pure virtual

Collapse the given line and return a line of values from that operation.

The position in the Lattice at the start of the line is input as well.
When function canHandleNullMask returned True, it is possible that mask is an empty vector indicating that the input has no mask, thus all values are valid. If not empty, the mask has the same length as the line.

Implemented in casa::MomentWindow< T >, casa::MomentClip< T >, and casa::MomentFit< T >.

template<class T, class U = T>
virtual void casacore::LineCollapser< T, U >::process ( U &  result,
Bool resultMask,
const Vector< T > &  line,
const Vector< Bool > &  mask,
const IPosition pos 
)
pure virtual

Collapse the given line and return one value from that operation.

The position in the Lattice at the start of the line is input as well.
When function canHandleNullMask returned True, it is possible that mask is an empty vector indicating that the input has no mask, thus all values are valid. If not empty, the mask has the same length as the line.

Implemented in casa::MomentWindow< T >, casa::MomentClip< T >, and casa::MomentFit< T >.


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