Class representing an array function in table select expression. More...
#include <ExprFuncNodeArray.h>
Public Member Functions | |
TableExprFuncNodeArray (TableExprFuncNode::FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source, const TaQLStyle &) | |
Constructor. | |
~TableExprFuncNodeArray () | |
Destructor. | |
virtual void | getAggrNodes (vector< TableExprNodeRep * > &aggr) |
Get the nodes representing an aggregate function. | |
virtual void | getColumnNodes (vector< TableExprNodeRep * > &cols) |
Get the nodes representing a table column. | |
virtual MArray< Bool > | getArrayBool (const TableExprId &id) |
'get' Functions to get the desired result of a function | |
virtual MArray< Int64 > | getArrayInt (const TableExprId &id) |
virtual MArray< Double > | getArrayDouble (const TableExprId &id) |
The default implementation of getArrayDouble does getArrayInt and converts the result. | |
virtual MArray< DComplex > | getArrayDComplex (const TableExprId &id) |
The default implementation of getArrayDComplex does getArrayDouble and converts the result. | |
virtual MArray< String > | getArrayString (const TableExprId &id) |
virtual MArray< MVTime > | getArrayDate (const TableExprId &id) |
TableExprFuncNode * | getChild () |
Get the function node. | |
const TableExprFuncNode * | getChild () const |
Static Public Member Functions | |
static TableExprNodeRep * | fillNode (TableExprFuncNodeArray *thisNode, PtrBlock< TableExprNodeRep * > &nodes, const Block< Int > &dtypeOper) |
Link the children to the node and convert the children to constants if possible. | |
Protected Member Functions | |
void | tryToConst () |
Try if the function gives a constant result. | |
const PtrBlock < TableExprNodeRep * > & | operands () const |
Some functions to be used by TableExprNodeFuncArray. | |
PtrBlock< TableExprNodeRep * > & | rwOperands () |
TableExprFuncNode::FunctionType | funcType () const |
NodeDataType | argDataType () const |
Private Member Functions | |
void | setScale (Double scale) |
Set unit scale factor (needed for sqrt). | |
IPosition | getAxes (const TableExprId &id, Int ndim, uInt axarg=1, Bool swapRemove=True) |
Get the collapse axes for the partial functions. | |
IPosition | removeAxes (const IPosition &axes, Int ndim) const |
Remove axes exceeding ndim. | |
const IPosition & | getArrayShape (const TableExprId &id, uInt axarg=1) |
Get the shape for the array function. | |
IPosition | getOrder (const TableExprId &id, Int ndim) |
Get the transpose order of the array axes. | |
const IPosition & | getDiagonalArg (const TableExprId &id, const IPosition &shp) |
Get the arguments for the diagonals function. | |
const IPosition & | getAlternate (const TableExprId &id) |
Set the alternate value expandAlt_p for array expand and return it. | |
template<typename T > | |
MArray< T > | TEFResize (const MArray< T > &arr, const TableExprId &id) |
Templated fucntion to resize/expand an array. | |
Private Attributes | |
TableExprFuncNode | node_p |
Int | origin_p |
Bool | isCOrder_p |
Bool | constAxes_p |
Bool | constAlt_p |
IPosition | ipos_p |
IPosition | iposN_p |
IPosition | expandAlt_p |
Class representing an array function in table select expression.
Internal
This class can be seen as a specialization of TableExprFuncNode for functions returning arrays. However, it is derived from TableExprNodeArray to make it possible that the ExprNode classes use all array functionality offered by that base class.
Internally an TableExprFuncNode object is used.
When a TaQL function is used, TableExprFuncNode::checkOperands determines whether the result is a scalar or an array. Thereafter TableExprNode::newFunctionNode creates a TableExprFuncNode for scalars or a TableExprFuncNodeArray for arrays.
Definition at line 70 of file ExprFuncNodeArray.h.
casacore::TableExprFuncNodeArray::TableExprFuncNodeArray | ( | TableExprFuncNode::FunctionType | , | |
NodeDataType | , | |||
ValueType | , | |||
const TableExprNodeSet & | source, | |||
const TaQLStyle & | ||||
) |
Constructor.
casacore::TableExprFuncNodeArray::~TableExprFuncNodeArray | ( | ) |
Destructor.
NodeDataType casacore::TableExprFuncNodeArray::argDataType | ( | ) | const [inline, protected] |
Definition at line 124 of file ExprFuncNodeArray.h.
References casacore::TableExprFuncNode::argDataType(), and node_p.
static TableExprNodeRep* casacore::TableExprFuncNodeArray::fillNode | ( | TableExprFuncNodeArray * | thisNode, | |
PtrBlock< TableExprNodeRep * > & | nodes, | |||
const Block< Int > & | dtypeOper | |||
) | [static] |
Link the children to the node and convert the children to constants if possible.
Also convert the node to constant if possible.
Reimplemented in casacore::TableExprConeNodeArray.
TableExprFuncNode::FunctionType casacore::TableExprFuncNodeArray::funcType | ( | ) | const [inline, protected] |
Definition at line 122 of file ExprFuncNodeArray.h.
References casacore::TableExprFuncNode::funcType(), and node_p.
virtual void casacore::TableExprFuncNodeArray::getAggrNodes | ( | vector< TableExprNodeRep * > & | aggr | ) | [virtual] |
Get the nodes representing an aggregate function.
Reimplemented from casacore::TableExprNodeBinary.
Reimplemented in casacore::TableExprAggrNodeArray.
const IPosition& casacore::TableExprFuncNodeArray::getAlternate | ( | const TableExprId & | id | ) | [private] |
Set the alternate value expandAlt_p for array expand and return it.
virtual MArray<Bool> casacore::TableExprFuncNodeArray::getArrayBool | ( | const TableExprId & | id | ) | [virtual] |
'get' Functions to get the desired result of a function
Reimplemented from casacore::TableExprNodeRep.
Reimplemented in casacore::TableExprAggrNodeArray, and casacore::TableExprConeNodeArray.
virtual MArray<MVTime> casacore::TableExprFuncNodeArray::getArrayDate | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprNodeRep.
Reimplemented in casacore::TableExprAggrNodeArray.
virtual MArray<DComplex> casacore::TableExprFuncNodeArray::getArrayDComplex | ( | const TableExprId & | id | ) | [virtual] |
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
Reimplemented from casacore::TableExprNodeArray.
Reimplemented in casacore::TableExprAggrNodeArray.
virtual MArray<Double> casacore::TableExprFuncNodeArray::getArrayDouble | ( | const TableExprId & | id | ) | [virtual] |
The default implementation of getArrayDouble does getArrayInt and converts the result.
Reimplemented from casacore::TableExprNodeArray.
Reimplemented in casacore::TableExprAggrNodeArray.
virtual MArray<Int64> casacore::TableExprFuncNodeArray::getArrayInt | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprNodeRep.
Reimplemented in casacore::TableExprAggrNodeArray, and casacore::TableExprConeNodeArray.
const IPosition& casacore::TableExprFuncNodeArray::getArrayShape | ( | const TableExprId & | id, | |
uInt | axarg = 1 | |||
) | [private] |
Get the shape for the array function.
axarg gives the argument nr of the shape.
virtual MArray<String> casacore::TableExprFuncNodeArray::getArrayString | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprNodeRep.
Reimplemented in casacore::TableExprAggrNodeArray.
IPosition casacore::TableExprFuncNodeArray::getAxes | ( | const TableExprId & | id, | |
Int | ndim, | |||
uInt | axarg = 1 , |
|||
Bool | swapRemove = True | |||
) | [private] |
Get the collapse axes for the partial functions.
It compares the values with the #dim and removes them if too high. axarg gives the argument nr of the axes.
const TableExprFuncNode* casacore::TableExprFuncNodeArray::getChild | ( | ) | const [inline] |
Definition at line 101 of file ExprFuncNodeArray.h.
References node_p.
TableExprFuncNode* casacore::TableExprFuncNodeArray::getChild | ( | ) | [inline] |
virtual void casacore::TableExprFuncNodeArray::getColumnNodes | ( | vector< TableExprNodeRep * > & | cols | ) | [virtual] |
Get the nodes representing a table column.
Reimplemented from casacore::TableExprNodeBinary.
const IPosition& casacore::TableExprFuncNodeArray::getDiagonalArg | ( | const TableExprId & | id, | |
const IPosition & | shp | |||
) | [private] |
Get the arguments for the diagonals function.
They are checked and if needed adapted if the shape is not empty.
IPosition casacore::TableExprFuncNodeArray::getOrder | ( | const TableExprId & | id, | |
Int | ndim | |||
) | [private] |
Get the transpose order of the array axes.
const PtrBlock<TableExprNodeRep*>& casacore::TableExprFuncNodeArray::operands | ( | ) | const [inline, protected] |
Some functions to be used by TableExprNodeFuncArray.
Definition at line 118 of file ExprFuncNodeArray.h.
References node_p, and casacore::TableExprFuncNode::operands().
Referenced by casacore::TableExprAggrNodeArray::operand().
IPosition casacore::TableExprFuncNodeArray::removeAxes | ( | const IPosition & | axes, | |
Int | ndim | |||
) | const [private] |
Remove axes exceeding ndim.
PtrBlock<TableExprNodeRep*>& casacore::TableExprFuncNodeArray::rwOperands | ( | ) | [inline, protected] |
Definition at line 120 of file ExprFuncNodeArray.h.
References node_p, and casacore::TableExprFuncNode::rwOperands().
void casacore::TableExprFuncNodeArray::setScale | ( | Double | scale | ) | [inline, private] |
Set unit scale factor (needed for sqrt).
Definition at line 130 of file ExprFuncNodeArray.h.
References node_p, and casacore::TableExprFuncNode::setScale().
MArray<T> casacore::TableExprFuncNodeArray::TEFResize | ( | const MArray< T > & | arr, | |
const TableExprId & | id | |||
) | [inline, private] |
Templated fucntion to resize/expand an array.
void casacore::TableExprFuncNodeArray::tryToConst | ( | ) | [protected] |
Try if the function gives a constant result.
If so, set the expression type to Constant.
Reimplemented in casacore::TableExprConeNodeArray.
Definition at line 167 of file ExprFuncNodeArray.h.
Definition at line 166 of file ExprFuncNodeArray.h.
Definition at line 170 of file ExprFuncNodeArray.h.
Definition at line 168 of file ExprFuncNodeArray.h.
Definition at line 169 of file ExprFuncNodeArray.h.
Definition at line 165 of file ExprFuncNodeArray.h.
Definition at line 163 of file ExprFuncNodeArray.h.
Referenced by argDataType(), funcType(), getChild(), operands(), rwOperands(), and setScale().
Reimplemented in casacore::TableExprConeNodeArray.
Definition at line 164 of file ExprFuncNodeArray.h.