28 #ifndef LATTICES_LATTICE_H
29 #define LATTICES_LATTICE_H
42 class LatticeNavigator;
43 template <
class T>
class COWPtr;
44 template <
class Domain,
class Range>
class Functional;
45 template <
class T>
class LatticeIterInterface;
231 template <
class T>
class Lattice :
public LatticeBase
239 virtual Lattice<T>*
clone()
const = 0;
249 virtual T
getAt (
const IPosition& where)
const;
254 virtual void putAt (
const T&
value,
const IPosition& where);
291 Bool get (COWPtr<Array<T> >& buffer,
293 Bool getSlice (COWPtr<Array<T> >& buffer,
const Slicer& section,
295 Bool getSlice (COWPtr<Array<T> >& buffer,
const IPosition& start,
296 const IPosition&
shape,
298 Bool getSlice (COWPtr<Array<T> >& buffer,
const IPosition& start,
299 const IPosition&
shape,
const IPosition& stride,
301 Bool get (Array<T>& buffer,
305 Bool getSlice (Array<T>& buffer,
const IPosition& start,
306 const IPosition&
shape,
308 Bool getSlice (Array<T>& buffer,
const IPosition& start,
309 const IPosition&
shape,
const IPosition& stride,
311 Array<T>
get (
Bool removeDegenerateAxes=
False)
const;
312 Array<T>
getSlice (
const Slicer& section,
314 Array<T>
getSlice (
const IPosition& start,
315 const IPosition&
shape,
317 Array<T>
getSlice (
const IPosition& start,
318 const IPosition&
shape,
const IPosition& stride,
352 virtual void apply (T (*
function)(T));
353 virtual void apply (T (*
function)(
const T&));
444 #ifndef CASACORE_NO_AUTO_TEMPLATES
446 #endif //# CASACORE_NO_AUTO_TEMPLATES
A Vector of integers, for indexing into Array<T> objects.
void operator+=(const Lattice< T > &other)
Add, subtract, multiple, or divide by another Lattice.
void operator*=(const Lattice< T > &other)
Map a domain object into a range object via operator().
virtual void set(const T &value)
Set all elements in the Lattice to the given value.
void operator/=(const Lattice< T > &other)
virtual void copyData(const Lattice< T > &from)
Copy the data from the given lattice to this one.
virtual ~Lattice()
a virtual destructor is needed so that it will use the actual destructor in the derived class ...
A non-templated, abstract base class for array-like objects.
T operator()(const IPosition &where) const
Return the value of the single element located at the argument IPosition.
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...
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...
virtual void putAt(const T &value, const IPosition &where)
Put the value of a single element.
A base class for Lattice iterators.
A templated, abstract base class for array-like objects.
virtual IPosition shape() const =0
Return the shape of the Lattice including all degenerate axes (ie.
virtual Lattice< T > * clone() const =0
Make a copy of the derived object (reference semantics).
void put(const Array< T > &sourceBuffer)
Lattice< T > & operator=(const Lattice< T > &)
virtual void handleMath(const Lattice< T > &from, int oper)
Handle the Math operators (+=, -=, *=, /=).
virtual void copyDataTo(Lattice< T > &to) const
Copy the data from this lattice to the given lattice.
void operator-=(const Lattice< T > &other)
virtual void handleMathTo(Lattice< T > &to, int oper) const
bool Bool
Define the standard types used by Casacore.
virtual Bool doGetSlice(Array< T > &buffer, const Slicer §ion)=0
The functions (in the derived classes) doing the actual work.
Bool getSlice(COWPtr< Array< T > > &buffer, const Slicer §ion, Bool removeDegenerateAxes=False) const
virtual DataType dataType() const
Get the data type of the lattice.
Specify which elements to extract from an n-dimensional array.
virtual T getAt(const IPosition &where) const
virtual uInt advisedMaxPixels() const
This function returns the advised maximum number of pixels to include in the cursor of an iterator...
virtual void apply(T(*function)(T))
Replace every element, x, of the Lattice with the result of f(x).
Lattice()
Define default constructor to satisfy compiler.
virtual void doPutSlice(const Array< T > &buffer, const IPosition &where, const IPosition &stride)=0
Lattice(const Lattice< T > &)
Copy constructor and assignment can only be used by derived classes.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
Abstract base class to steer lattice iterators.