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)
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
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
Default constructor creates a scalar with a false mask.
Constructor takes a scalar.
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.
Evaluate the scalar expression (get the constant)
Do further preparations (e.g. optimization) on the expression.
Get class name
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()
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
Destructor does nothing
virtual void eval (LELArray<T>& result, const Slicer& section) const
Recursively evaluate the expression.
Recursively evaluate the scalar expression.
Do further preparations (e.g. optimization) on the expression.
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.
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()
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
Destructor does nothing
virtual void eval (LELArray<Bool>& result, const Slicer& section) const
Recursively evaluate the expression.
Recursively evaluate the scalar expression.
Do further preparations (e.g. optimization) on the expression.
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.