28 #ifndef LATTICES_LATTICE_H
29 #define LATTICES_LATTICE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/ArrayFwd.h>
35 #include <casacore/lattices/Lattices/LatticeBase.h>
36 #include <casacore/casa/Arrays/Slicer.h>
42 class LatticeNavigator;
43 template <
class T>
class COWPtr;
44 template <
class Domain,
class Range>
class Functional;
45 template <
class T>
class LatticeIterInterface;
352 virtual void apply (T (*
function)(T));
353 virtual void apply (T (*
function)(
const T&));
444 #ifndef CASACORE_NO_AUTO_TEMPLATES
445 #include <casacore/lattices/Lattices/LatticeIterator.h>
virtual IPosition shape() const =0
Return the shape of the Lattice including all degenerate axes (ie.
void putSlice(const Array< T > &sourceBuffer, const IPosition &where)
void operator-=(const Lattice< T > &other)
virtual void apply(T(*function)(const T &))
Bool getSlice(COWPtr< Array< T > > &buffer, const Slicer §ion, Bool removeDegenerateAxes=False) const
Array< T > getSlice(const Slicer §ion, Bool removeDegenerateAxes=False) const
virtual Lattice< T > * clone() const =0
Make a copy of the derived object (reference semantics).
Bool get(COWPtr< Array< T > > &buffer, Bool removeDegenerateAxes=False) const
Functions which extract an Array of values from a Lattice.
virtual void handleMath(const Lattice< T > &from, int oper)
Handle the Math operators (+=, -=, *=, /=).
void put(const Array< T > &sourceBuffer)
virtual void copyData(const Lattice< T > &from)
Copy the data from the given lattice to this one.
Bool getSlice(Array< T > &buffer, const IPosition &start, const IPosition &shape, const IPosition &stride, Bool removeDegenerateAxes=False)
virtual T getAt(const IPosition &where) const
Bool getSlice(COWPtr< Array< T > > &buffer, const IPosition &start, const IPosition &shape, Bool removeDegenerateAxes=False) const
Lattice()
Define default constructor to satisfy compiler.
Lattice< T > & operator=(const Lattice< T > &)
virtual void apply(T(*function)(T))
Replace every element, x, of the Lattice with the result of f(x).
Bool get(Array< T > &buffer, Bool removeDegenerateAxes=False)
Array< T > getSlice(const IPosition &start, const IPosition &shape, const IPosition &stride, Bool removeDegenerateAxes=False) const
virtual ~Lattice()
a virtual destructor is needed so that it will use the actual destructor in the derived class
Lattice(const Lattice< T > &)
Copy constructor and assignment can only be used by derived classes.
virtual Bool doGetSlice(Array< T > &buffer, const Slicer §ion)=0
The functions (in the derived classes) doing the actual work.
Array< T > get(Bool removeDegenerateAxes=False) const
Bool getSlice(Array< T > &buffer, const IPosition &start, const IPosition &shape, Bool removeDegenerateAxes=False)
virtual void putAt(const T &value, const IPosition &where)
Put the value of a single element.
void operator/=(const Lattice< T > &other)
void operator*=(const Lattice< T > &other)
virtual void set(const T &value)
Set all elements in the Lattice to the given value.
virtual void handleMathTo(Lattice< T > &to, int oper) const
void operator+=(const Lattice< T > &other)
Add, subtract, multiple, or divide by another Lattice.
void putSlice(const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride)
A function which places an Array of values within this instance of the Lattice at the location specif...
Bool getSlice(Array< T > &buffer, const Slicer §ion, Bool removeDegenerateAxes=False)
virtual void doPutSlice(const Array< T > &buffer, const IPosition &where, const IPosition &stride)=0
virtual void apply(const Functional< T, T > &function)
Array< T > getSlice(const IPosition &start, const IPosition &shape, Bool removeDegenerateAxes=False) const
virtual void copyDataTo(Lattice< T > &to) const
Copy the data from this lattice to the given lattice.
virtual uInt advisedMaxPixels() const
This function returns the advised maximum number of pixels to include in the cursor of an iterator.
virtual LatticeIterInterface< T > * makeIter(const LatticeNavigator &navigator, Bool useRef) const
These functions are used by the LatticeIterator class to generate an iterator of the correct type for...
Bool getSlice(COWPtr< Array< T > > &buffer, const IPosition &start, const IPosition &shape, const IPosition &stride, Bool removeDegenerateAxes=False) const
T operator()(const IPosition &where) const
Return the value of the single element located at the argument IPosition.
virtual DataType dataType() const
Get the data type of the lattice.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.