LELUnary.h

Classes

LELUnaryConst -- This LEL class handles scalar (unary) constants (full description)
LELUnary -- This LEL class handles numerical unary operators (full description)
LELUnaryBool -- This LEL class handles logical unary operators (full description)

template <class T> class LELUnaryConst : public LELInterface<T>

Interface

Public Members
LELUnaryConst()
LELUnaryConst(const T val)
~LELUnaryConst()
virtual void eval (LELArray<T>& result, const Slicer& section) const
virtual LELScalar<T> getScalar() const
virtual Bool prepareScalarExpr()
virtual String className() const

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This derived LEL letter class handles scalar (unary) constants

Synopsis

This LEL letter class is derived from LELInterface. It is used to construct LEL objects that represent scalars constants. They can be of type Float,Double,Complex,DComplex and Bool.

A description of the implementation details of the LEL classes can be found in Note 216

Example

Examples are not very useful as the user would never use these classes directly. Look in LatticeExprNode.cc to see how it invokes these classes. Examples of how the user would indirectly use this class (through the envelope) are:
    IPosition shape(2,5,10);
    ArrayLattice<Float> x(shape); x.set(1.0);
    ArrayLattice<Float> y(shape);
    ArrayLattice<Float> z(shape); 
    y.copyData(x+2.0);                 // y = x + 2.0
    z.copyData(True);                  // z = True
    

Motivation

Constants are a basic mathematical expression.

To Do

Member Description

LELUnaryConst()

Default constructor creates a scalar with a false mask.

LELUnaryConst(const T val)

Constructor takes a scalar.

~LELUnaryConst()

Destructor does nothing

virtual void eval (LELArray<T>& result, const Slicer& section) const

Evaluate the expression. This throws an exception, since only a scalar can be returned.

virtual LELScalar<T> getScalar() const

Evaluate the scalar expression (get the constant)

virtual Bool prepareScalarExpr()

Do further preparations (e.g. optimization) on the expression.

virtual String className() const

Get class name


template <class T> class LELUnary : public LELInterface<T>

Interface

LELUnary(const LELUnaryEnums::Operation op, const CountedPtr<LELInterface<T> >& pExpr)
~LELUnary()
virtual void eval (LELArray<T>& result, const Slicer& section) const
virtual LELScalar<T> getScalar() const
virtual Bool prepareScalarExpr()
virtual String className() const
virtual Bool lock (FileLocker::LockType, uInt nattempts)
virtual void unlock()
virtual Bool hasLock (FileLocker::LockType) const
virtual void resync()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This derived LEL letter class handles numerical unary operators

Synopsis

This LEL letter class is derived from LELInterface. It is used to construct LEL objects that apply numerical unary operators to Lattice expressions. They operate on numerical Lattice (Float,Double,Complex,DComplex) expressions and return the same numerical type. The available C++ operators are +,- with equivalents in the enum of PLUS and MINUS.

A description of the implementation details of the LEL classes can be found in Note 216

Example

Examples are not very useful as the user would never use these classes directly. Look in LatticeExprNode.cc to see how it invokes these classes. An example of how the user would indirectly use this class (through the envelope) is:
    IPosition shape(2,5,10);
    ArrayLattice<Float> x(shape); x.set(1.0);
    ArrayLattice<Float> y(shape); 
    y.copyData(-x);                 // y = -x
    

Motivation

Numerical unary operations are a basic mathematical expression.

To Do

Member Description

LELUnary(const LELUnaryEnums::Operation op, const CountedPtr<LELInterface<T> >& pExpr)

Constructor takes operation and expression to be operated upon

~LELUnary()

Destructor does nothing

virtual void eval (LELArray<T>& result, const Slicer& section) const

Recursively evaluate the expression.

virtual LELScalar<T> getScalar() const

Recursively evaluate the scalar expression.

virtual Bool prepareScalarExpr()

Do further preparations (e.g. optimization) on the expression.

virtual String className() const

Get class name

virtual Bool lock (FileLocker::LockType, uInt nattempts)
virtual void unlock()
virtual Bool hasLock (FileLocker::LockType) const
virtual void resync()

Handle locking/syncing of a lattice in a lattice expression.


class LELUnaryBool : public LELInterface<Bool>

Interface

LELUnaryBool(const LELUnaryEnums::Operation op, const CountedPtr<LELInterface<Bool> >& pExpr)
~LELUnaryBool()
virtual void eval (LELArray<Bool>& result, const Slicer& section) const
virtual LELScalar<Bool> getScalar() const
virtual Bool prepareScalarExpr()
virtual String className() const
virtual Bool lock (FileLocker::LockType, uInt nattempts)
virtual void unlock()
virtual Bool hasLock (FileLocker::LockType) const
virtual void resync()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This derived LEL letter class handles logical unary operators

Synopsis

This LEL letter class is derived from LELInterface. It is used to construct LEL objects that apply logical unary operators to Lattice expressions. They operate on Bool Lattice expressions only and return a Bool. The available C++ operator is ! with the equivalent in the enum of NOT.

A description of the implementation details of the LEL classes can be found in Note 216

Example

Examples are not very useful as the user would never use these classes directly. Look in LatticeExprNode.cc to see how it invokes these classes. An example of how the user would indirectly use this class (through the envelope) is:
    IPosition shape(2,5,10);
    ArrayLattice<Bool> x(shape); x.set(True);
    ArrayLattice<Bool> y(shape); 
    y.copyData(!x);                 // y = !x
    

Motivation

Logical unary operations are a basic mathematical expression.

To Do

Member Description

LELUnaryBool(const LELUnaryEnums::Operation op, const CountedPtr<LELInterface<Bool> >& pExpr)

Constructor takes operation and expression to be operated upon

~LELUnaryBool()

Destructor does nothing

virtual void eval (LELArray<Bool>& result, const Slicer& section) const

Recursively evaluate the expression.

virtual LELScalar<Bool> getScalar() const

Recursively evaluate the scalar expression.

virtual Bool prepareScalarExpr()

Do further preparations (e.g. optimization) on the expression.

virtual String className() const

Get class name

virtual Bool lock (FileLocker::LockType, uInt nattempts)
virtual void unlock()
virtual Bool hasLock (FileLocker::LockType) const
virtual void resync()

Handle locking/syncing of a lattice in a lattice expression.