casacore
ExprNode.h
Go to the documentation of this file.
1 //# ExprNode.h: Handle class for a table column expression tree
2 //# Copyright (C) 1994,1995,1996,1997,1998,2000,2001,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: ExprNode.h 21277 2012-10-31 16:07:31Z gervandiepen $
27 
28 #ifndef TABLES_EXPRNODE_H
29 #define TABLES_EXPRNODE_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/TaQL/ExprNodeRep.h>
34 #include <casacore/tables/TaQL/ExprRange.h>
35 #include <casacore/tables/TaQL/ExprFuncNode.h>
36 #include <casacore/tables/TaQL/TaQLStyle.h>
37 #include <casacore/tables/TaQL/MArray.h>
38 #include <casacore/casa/Utilities/CountedPtr.h>
39 #include <casacore/casa/Utilities/DataType.h>
40 #include <casacore/casa/BasicSL/Complex.h>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 //# Forward Declarations
45 class Table;
46 class String;
47 class Regex;
48 class StringDistance;
49 class Unit;
50 class Record;
51 class TableRecord;
52 class TableExprNodeBinary;
53 class TableExprNodeSet;
54 template<class T> class Block;
55 template<class T> class Array;
56 template<class T> class MArray;
57 class TableExprNode;
58 
59 
60 // Define all global functions operating on a TableExprNode.
61 // <group name=GlobalTableExprNode>
62 
63  //# Define the operations we allow.
64  //# Note that the arguments are defined as const. This is necessary
65  //# because the compiler generates temporaries when converting a constant
66  //# to a TableExprNode using the constructors. Temporaries has to be const.
67  //# However, we have to delete created nodes, so lnode_p and rnode_p
68  //# cannot be const. The const arguments are casted to a non-const in
69  //# the function fill which calls the non-const function simplify.
70 
71  // Arithmetic operators for numeric TableExprNode's.
72  // <group>
73  // + is also defined for strings (means concatenation).
75  const TableExprNode& right);
77  const TableExprNode& right);
79  const TableExprNode& right);
81  const TableExprNode& right);
83  const TableExprNode& right);
85  const TableExprNode& right);
87  const TableExprNode& right);
89  const TableExprNode& right);
90  // </group>
91 
92  // Comparison operators.
93  // <group>
95  const TableExprNode& right);
97  const TableExprNode& right);
98  // Not defined for Bool.
99  // <group>
101  const TableExprNode& right);
103  const TableExprNode& right);
105  const TableExprNode& right);
107  const TableExprNode& right);
108  // </group>
109  // </group>
110 
111  // Logical operators to combine boolean TableExprNode's.
112  // A null TableExprNode object is ignored, so it is possible to
113  // build up a full expression gradually.
114  // <group>
116  const TableExprNode& right);
118  const TableExprNode& right);
119  // </group>
120 
121  // Functions to return whether a value is "relatively" near another.
122  // Returns <src> tol > abs(val2 - val1)/max(abs(val1),(val2))</src>.
123  // If tol <= 0, returns val1 == val2. If either val is 0.0, takes
124  // care of area around the minimum number that can be represented.
125  // <br>The nearAbs functions return whether a value is "absolutely" near
126  // another. Returns <src> tol > abs(val2 - val1)</src>.
127  // Default tolerance is 1.0e-13.
128  // They operate on scalars and arrays.
129  // <group>
130  TableExprNode near (const TableExprNode& left,
131  const TableExprNode& right);
132  TableExprNode near (const TableExprNode& left,
133  const TableExprNode& right,
134  const TableExprNode& tolerance);
135  TableExprNode nearAbs (const TableExprNode& left,
136  const TableExprNode& right);
137  TableExprNode nearAbs (const TableExprNode& left,
138  const TableExprNode& right,
139  const TableExprNode& tolerance);
140  // </group>
141 
142  // Angular distance between positions.
143  // Both arguments have to be arrays. If both arrays contain 2 values
144  // (ra and dec), the result is a scalar.
145  // Otherwise the arrays have to contain a multiple of 2 values and the
146  // result is a 2-dim array giving the distance of each position in the
147  // first array to each position in the second array.
148  TableExprNode angdist (const TableExprNode& pos1,
149  const TableExprNode& pos2);
150 
151  // Angular distance as above, but only pair-wise enties are used if
152  // both arguments are arrays.
153  TableExprNode angdistx (const TableExprNode& pos1,
154  const TableExprNode& pos2);
155 
156  // Cone search; test if the position of a source is inside a cone.
157  // <br>Argument <src>sourcePos</src> must be a double array
158  // containing two values (ra and dec of source) in radians.
159  // <br>Argument <src>cones</src> must be a double array
160  // specifying the position of the cone centers and radii in radians.
161  // So the array must contain three values (ra,dec,radius)
162  // or a multiple of it.
163  // <group>
164  // The result is a bool array telling for each cone if it contains the
165  // source. If there is only one cone, the result is a scalar.
166  TableExprNode cones (const TableExprNode& sourcePos,
167  const TableExprNode& cones);
168  // The result is always a Bool scalar telling if any cone contains
169  // the source.
170  TableExprNode anyCone (const TableExprNode& sourcePos,
171  const TableExprNode& cones);
172  // The sourcePos can contain multiple sources.
173  // The result is a double array giving the index of the first
174  // cone containing the corresponding source.
175  // If there is one source, the result is a double scalar.
176  TableExprNode findCone (const TableExprNode& sourcePos,
177  const TableExprNode& cones);
178  // </group>
179 
180  // Cone search as above.
181  // However, the cone positions and radii are specified separately
182  // and (virtually) a larger array containing every combination of
183  // position/radius is formed.
184  // <group>
185  TableExprNode cones (const TableExprNode& sourcePos,
186  const TableExprNode& conePos,
187  const TableExprNode& radii);
188  TableExprNode anyCone (const TableExprNode& sourcePos,
189  const TableExprNode& conePos,
190  const TableExprNode& radii);
191  TableExprNode findCone (const TableExprNode& sourcePos,
192  const TableExprNode& conePos,
193  const TableExprNode& radii);
194  // </group>
195 
196  // Transcendental functions that can be applied to essentially all numeric
197  // nodes containing scalars or arrays.
198  // <group>
199  TableExprNode sin (const TableExprNode& node);
200  TableExprNode sinh (const TableExprNode& node);
201  TableExprNode cos (const TableExprNode& node);
202  TableExprNode cosh (const TableExprNode& node);
203  TableExprNode exp (const TableExprNode& node);
204  TableExprNode log (const TableExprNode& node);
205  TableExprNode log10 (const TableExprNode& node);
206  TableExprNode pow (const TableExprNode& x, const TableExprNode& exp);
207  TableExprNode square (const TableExprNode& node);
208  TableExprNode cube (const TableExprNode& node);
209  TableExprNode sqrt (const TableExprNode& node);
210  TableExprNode norm (const TableExprNode& node);
211  // </group>
212 
213  // Transcendental functions applied to to nodes containing scalars or
214  // arrays with double values.
215  // They are invalid for Complex nodes.
216  // <group>
217  TableExprNode asin (const TableExprNode& node);
218  TableExprNode acos (const TableExprNode& node);
219  TableExprNode atan (const TableExprNode& node);
221  const TableExprNode& x);
222  TableExprNode tan (const TableExprNode& node);
223  TableExprNode tanh (const TableExprNode& node);
224  TableExprNode sign (const TableExprNode& node);
225  TableExprNode round (const TableExprNode& node);
226  TableExprNode ceil (const TableExprNode& node);
227  TableExprNode abs (const TableExprNode& node);
228  TableExprNode floor (const TableExprNode& node);
229  TableExprNode fmod (const TableExprNode& x,
230  const TableExprNode& y);
231  // </group>
232 
233  // String functions on scalars or arrays.
234  // <group>
235  TableExprNode strlength (const TableExprNode& node);
236  TableExprNode upcase (const TableExprNode& node);
237  TableExprNode downcase (const TableExprNode& node);
239  TableExprNode trim (const TableExprNode& node);
240  TableExprNode ltrim (const TableExprNode& node);
241  TableExprNode rtrim (const TableExprNode& node);
242  TableExprNode substr (const TableExprNode& str,
243  const TableExprNode& pos);
244  TableExprNode substr (const TableExprNode& str,
245  const TableExprNode& pos,
246  const TableExprNode& npos);
247  TableExprNode replace (const TableExprNode& str,
248  const TableExprNode& patt);
249  TableExprNode replace (const TableExprNode& str,
250  const TableExprNode& patt,
251  const TableExprNode& repl);
252  // </group>
253 
254  // Functions for regular expression matching and
255  // pattern matching. Defined for scalars and arrays.
256  // <br><src>pattern</src> is for a file name like pattern.
257  // <br><src>sqlpattern</src> is for an SQL like pattern.
258  // <group>
259  TableExprNode regex (const TableExprNode& node);
260  TableExprNode pattern (const TableExprNode& node);
261  TableExprNode sqlpattern (const TableExprNode& node);
262  // </group>
263 
264  // Functions for date-values. Defined for scalars and arrays.
265  //# Note, ctod is called ctodt, because Mac OS-X defines a macro
266  //# ctod in param.h
267  // <group>
268  TableExprNode datetime (const TableExprNode& node);
269  TableExprNode mjdtodate (const TableExprNode& node);
270  TableExprNode mjd (const TableExprNode& node);
271  TableExprNode date (const TableExprNode& node);
272  TableExprNode year (const TableExprNode& node);
273  TableExprNode month (const TableExprNode& node);
274  TableExprNode day (const TableExprNode& node);
275  TableExprNode cmonth (const TableExprNode& node);
276  TableExprNode weekday (const TableExprNode& node);
277  TableExprNode cdow (const TableExprNode& node);
278  TableExprNode ctodt (const TableExprNode& node);
279  TableExprNode cdate (const TableExprNode& node);
280  TableExprNode ctime (const TableExprNode& node);
281  TableExprNode week (const TableExprNode& node);
282  TableExprNode time (const TableExprNode& node);
283  // </group>
284 
285  // Functions for angle-values. Defined for scalars and arrays.
286  // dhms converts pairs of values to hms and dms and only works for arrays.
287  // <group>
288  TableExprNode hms (const TableExprNode& node);
289  TableExprNode dms (const TableExprNode& node);
290  TableExprNode hdms (const TableExprNode& node);
291  // </group>
292 
293  // Function to convert any value to a string.
294  // See TaQL note 199 for possible format values.
295  // <group>
296  TableExprNode toString (const TableExprNode& node);
297  TableExprNode toString (const TableExprNode& node,
298  const TableExprNode& format);
299  // </group>
300 
301  // Function to test if a scalar or array is NaN (not-a-number).
302  // It results in a Bool scalar or array.
303  TableExprNode isNaN (const TableExprNode& node);
304 
305  // Function to test if a scalar or array is finite.
306  // It results in a Bool scalar or array.
307  TableExprNode isFinite (const TableExprNode& node);
308 
309  // Minimum or maximum of 2 nodes.
310  // Makes sense for numeric and String values. For Complex values
311  // the norm is compared.
312  // One or both arguments can be scalar or array.
313  // <group>
314  TableExprNode min (const TableExprNode& a, const TableExprNode& b);
315  TableExprNode max (const TableExprNode& a, const TableExprNode& b);
316  // </group>
317 
318  // The complex conjugate of a complex node.
319  // Defined for scalars and arrays.
320  TableExprNode conj (const TableExprNode& node);
321 
322  // The real part of a complex node.
323  // Defined for scalars and arrays.
324  TableExprNode real (const TableExprNode& node);
325 
326  // The imaginary part of a complex node.
327  // Defined for scalars and arrays.
328  TableExprNode imag (const TableExprNode& node);
329 
330  // Convert double, bool, or string to int (using floor).
331  TableExprNode integer (const TableExprNode& node);
332 
333  // Convert numeric or string value to bool (0, no, false, - means false)
334  TableExprNode boolean (const TableExprNode& node);
335 
336  // The amplitude (i.e. sqrt(re*re + im*im)) of a complex node.
337  // This is a synonym for function abs.
338  // Defined for scalars and arrays.
339  TableExprNode amplitude (const TableExprNode& node);
340 
341  // The phase (i.e. atan2(im, re)) of a complex node.
342  // This is a synonym for function arg.
343  // Defined for scalars and arrays.
344  TableExprNode phase (const TableExprNode& node);
345 
346  // The arg (i.e. atan2(im, re)) of a complex node.
347  // Defined for scalars and arrays.
348  TableExprNode arg (const TableExprNode& node);
349 
350  // Form a complex number from two Doubles.
351  // One or both arguments can be scalar or array.
353  const TableExprNode& imag);
354  // Form a complex number from a string.
355  // Defined for scalars and arrays.
357 
358  // Functions operating on a Double or Complex scalar or array resulting in
359  // a scalar with the same data type.
360  // <group>
364  // </group>
365 
366  // Functions operating on a Double scalar or array resulting in
367  // a Double scalar.
368  // <group>
378  const TableExprNode& fraction);
379  // </group>
380 
381  // <group>
386  // </group>
387 
388  // The partial version of the functions above.
389  // They are applied to the array subsets defined by the axes in the set
390  // using the partialXXX functions in ArrayMath.
391  // The axes must be 0-relative.
392  // <group>
394  const TableExprNodeSet& collapseAxes);
396  const TableExprNodeSet& collapseAxes);
398  const TableExprNodeSet& collapseAxes);
400  const TableExprNodeSet& collapseAxes);
402  const TableExprNodeSet& collapseAxes);
404  const TableExprNodeSet& collapseAxes);
406  const TableExprNodeSet& collapseAxes);
408  const TableExprNodeSet& collapseAxes);
410  const TableExprNodeSet& collapseAxes);
412  const TableExprNodeSet& collapseAxes);
414  const TableExprNodeSet& collapseAxes);
416  const TableExprNode& fraction,
417  const TableExprNodeSet& collapseAxes);
419  const TableExprNodeSet& collapseAxes);
421  const TableExprNodeSet& collapseAxes);
423  const TableExprNodeSet& collapseAxes);
425  const TableExprNodeSet& collapseAxes);
426  // </group>
427 
428  // Functions operating for each element on a box around that element.
429  // The elements at the edges (where no full box can be made) are set to 0.
430  // <group>
432  const TableExprNodeSet& halfBoxWidth);
434  const TableExprNodeSet& halfBoxWidth);
436  const TableExprNodeSet& halfBoxWidth);
438  const TableExprNodeSet& halfBoxWidth);
440  const TableExprNodeSet& halfBoxWidth);
442  const TableExprNodeSet& halfBoxWidth);
444  const TableExprNodeSet& halfBoxWidth);
446  const TableExprNodeSet& halfBoxWidth);
448  const TableExprNodeSet& halfBoxWidth);
450  const TableExprNodeSet& halfBoxWidth);
451  // </group>
452 
453  // Create an array of the given shape and fill it with the values.
454  // The <src>values</src> array is rewound as needed.
455  TableExprNode array (const TableExprNode& values,
456  const TableExprNodeSet& shape);
457 
458  // Form a masked array.
460  const TableExprNode& mask);
461 
462  // Get the data array of a masked array.
464 
465  // Flatten a masked array (get unmasked elements).
467 
468  // Get the mask of a masked array.
469  // If the array has no mask, it return an array with all False values.
471 
472  // Get the diagonal of a (masked) array;
473  // If the array is not a Matrix, it will take the diagonals of the
474  // subarrays given by the two axes in the axes argument. Those
475  // axes have to have the same length (thus each subarray is a Matrix).
476  // If no axes are given, they default to the first two axes.
477  // <br>The <src>diag</src> argument tells which diagonal to take.
478  // 0 is the main diagonal, >0 is above main diagonal, <0 is below.
481  const TableExprNode& firstAxis);
483  const TableExprNode& firstAxis,
484  const TableExprNode& diag);
485 
486  // Transpose all axes of a (masked) array.
488  // Transpose a (masked) array by making the given axes the first axes.
490  const TableExprNode& axes);
491 
492  // Function operating on a field resulting in a bool scalar.
493  // It can be used to test if a column has an array in the current row.
494  // It can also be used to test if a record contains a field.
496 
497  // Functions operating on any scalar or array resulting in a Double scalar.
498  // A scalar has 1 element and dimensionality 0.
499  // <group>
502  // </group>
503 
504  // Function operating on any scalar or array resulting in a Double array
505  // containing the shape. A scalar has shape [1].
507 
508  // Function resembling the ternary <src>?:</src> construct in C++.
509  // The argument "condition" has to be a Bool value.
510  // If an element in "condition" is True, the corresponding element from
511  // "arg1" is taken, otherwise it is taken from "arg2".
512  // The arguments can be scalars or array or any combination.
513  TableExprNode iif (const TableExprNode& condition,
514  const TableExprNode& arg1,
515  const TableExprNode& arg2);
516 // </group>
517 
518 
519 
520 // <summary>
521 // Handle class for a table column expression tree
522 // </summary>
523 
524 // <use visibility=export>
525 
526 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
527 // </reviewed>
528 
529 // <prerequisite>
530 //# Classes you should understand before using this one.
531 // <li> <linkto class=Table>Table</linkto>
532 // <li> Note 199 describing
533 // <a href="../notes/199.html">
534 // TaQL</a>
535 // </prerequisite>
536 
537 // <etymology>
538 // TableExprNode represents a node in the tree reflecting a
539 // table select expression.
540 // </etymology>
541 
542 // <synopsis>
543 // TableExprNode is the class to store a table select expression,
544 // which allows to select rows from the table. The selected rows form
545 // a table which is a view of the original table.
546 // <p>
547 // TableExprNode is a handle class for the counted referenced class
548 // TableExprNodeRep.
549 // Classes (like TableExprNodePlusXX) derived from TableExprNodeRep
550 // hold the individual
551 // nodes in the expression, i.e. the operators and operands. The nodes
552 // form a binary tree reflecting the expression.
553 // E.g. the expression 2*COLUMN results in the node TableExprNodeTimes
554 // with its children TableExprNodeConst and TableExprNodeColumn.
555 // Constant subexpressions (like 2*3) are evaluated immediately and
556 // only the result is stored as a node.
557 // <p>
558 // There are a few TableExprNode constructors taking a constant scalar or array.
559 // In this way constant value are automatically converted to the
560 // appropriate TableExprNodeConst object.
561 // <p>
562 // The derived classes also reflect the data type of the node.
563 // Data types Bool, Double, DComplex and String are used.
564 // Char, uChar, Short, uShort, Int, uInt and float are converted
565 // to Double and Complex to DComplex.
566 // Binary operators +, -, *, /, %, &, }, ^, ==, >=, >, <, <= and != are
567 // recognized. Also &&, ||, parentheses and unary +, -, ~ and ! are recognized.
568 // For strings the binary operator + can also be used.
569 // The operators have the normal C++ precedence.
570 // Furthermore functions (like sin, max, ceil) can be used in an expression.
571 // <br>Operator() can be used to take a slice from an array.
572 // <p>
573 // The Table function col has to be used to create a TableExprNode
574 // object for a column in the table. The Table
575 // <linkto file="Table.h#keycol">operator()</linkto> can be used
576 // the do the actual selection from the top TableExprNode object.
577 // </synopsis>
578 
579 // <example>
580 // <srcblock>
581 // // Select from table X all rows where column RA<5 and where column
582 // // SWITCH is true.
583 // Table table("X");
584 // Table subtable = table(table.col("RA") < 5 && table.col("SWITCH"));
585 //
586 // // Select from that result all rows where the concatenation of
587 // // the strings in columns STR1 and STR2 is equal to the string
588 // // in keyword STRKEY.
589 // Table subsub = subtable(subtable.col("STR1") + subtable.col("STR2")
590 // == subtable.key("STRKEY"));
591 // </srcblock>
592 // </example>
593 
594 // <motivation>
595 // Having TableExprNode as a handle class makes it possible to
596 // handle temporary objects created by the compiler in a smooth way.
597 // TableExprNode and its derivations allow to store an expression
598 // before actually evaluating it. This also allows the classes to
599 // be used by the table expression parser defined in TableParse and
600 // TableGram.
601 //
602 // For each operator a special derived class is implemented.
603 // Another approach could have been to store the operator as
604 // a flag and switch on that. However, that causes extra overhead
605 // and the C++ virtual function mechanism is the designed for
606 // these purposes.
607 // </motivation>
608 
609 // <todo asof="$DATE:$">
610 //# A List of bugs, limitations, extensions or planned refinements.
611 // <li> add operations on arrays
612 // <li> add selection by comparing with a set of values
613 // </todo>
614 
615 
617 {
618  //# Define the operations we allow.
619  //# Note that the arguments are defined as const. This is necessary
620  //# because the compiler generates temporaries when converting a constant
621  //# to a TableExprNode using the constructors. Temporaries has to be const.
622  //# However, we have to delete created nodes, so lnode_p and rnode_p
623  //# cannot be const. The const arguments are casted to a non-const in
624  //# the function fill which calls the non-const function simplify.
625 
626  // Define all global functions as friends.
627  // <group>
628  friend TableExprNode operator+ (const TableExprNode& left,
629  const TableExprNode& right);
630  friend TableExprNode operator- (const TableExprNode& left,
631  const TableExprNode& right);
632  friend TableExprNode operator* (const TableExprNode& left,
633  const TableExprNode& right);
634  friend TableExprNode operator/ (const TableExprNode& left,
635  const TableExprNode& right);
636  friend TableExprNode operator% (const TableExprNode& left,
637  const TableExprNode& right);
638  friend TableExprNode operator& (const TableExprNode& left,
639  const TableExprNode& right);
640  friend TableExprNode operator| (const TableExprNode& left,
641  const TableExprNode& right);
642  friend TableExprNode operator^ (const TableExprNode& left,
643  const TableExprNode& right);
644  friend TableExprNode operator== (const TableExprNode& left,
645  const TableExprNode& right);
646  friend TableExprNode operator!= (const TableExprNode& left,
647  const TableExprNode& right);
648  friend TableExprNode operator>= (const TableExprNode& left,
649  const TableExprNode& right);
650  friend TableExprNode operator> (const TableExprNode& left,
651  const TableExprNode& right);
652  friend TableExprNode operator<= (const TableExprNode& left,
653  const TableExprNode& right);
654  friend TableExprNode operator< (const TableExprNode& left,
655  const TableExprNode& right);
656  friend TableExprNode operator&& (const TableExprNode& left,
657  const TableExprNode& right);
658  friend TableExprNode operator|| (const TableExprNode& left,
659  const TableExprNode& right);
660  friend TableExprNode near (const TableExprNode& left,
661  const TableExprNode& right);
662  friend TableExprNode near (const TableExprNode& left,
663  const TableExprNode& right,
664  const TableExprNode& tolerance);
665  friend TableExprNode nearAbs (const TableExprNode& left,
666  const TableExprNode& right);
667  friend TableExprNode nearAbs (const TableExprNode& left,
668  const TableExprNode& right,
669  const TableExprNode& tolerance);
670  friend TableExprNode angdist (const TableExprNode& pos1,
671  const TableExprNode& pos2);
672  friend TableExprNode cones (const TableExprNode& sourcePos,
673  const TableExprNode& cones);
674  friend TableExprNode anyCone (const TableExprNode& sourcePos,
675  const TableExprNode& cones);
676  friend TableExprNode findCone (const TableExprNode& sourcePos,
677  const TableExprNode& cones);
678  friend TableExprNode cones (const TableExprNode& sourcePos,
679  const TableExprNode& conePos,
680  const TableExprNode& radii);
681  friend TableExprNode anyCone (const TableExprNode& sourcePos,
682  const TableExprNode& conePos,
683  const TableExprNode& radii);
684  friend TableExprNode findCone (const TableExprNode& sourcePos,
685  const TableExprNode& conePos,
686  const TableExprNode& radii);
687  friend TableExprNode sin (const TableExprNode& node);
688  friend TableExprNode sinh (const TableExprNode& node);
689  friend TableExprNode cos (const TableExprNode& node);
690  friend TableExprNode cosh (const TableExprNode& node);
691  friend TableExprNode exp (const TableExprNode& node);
692  friend TableExprNode log (const TableExprNode& node);
693  friend TableExprNode log10 (const TableExprNode& node);
694  friend TableExprNode pow (const TableExprNode& x,
695  const TableExprNode& exp);
696  friend TableExprNode square (const TableExprNode& node);
697  friend TableExprNode cube (const TableExprNode& node);
698  friend TableExprNode sqrt (const TableExprNode& node);
699  friend TableExprNode norm (const TableExprNode& node);
700  friend TableExprNode asin (const TableExprNode& node);
701  friend TableExprNode acos (const TableExprNode& node);
702  friend TableExprNode atan (const TableExprNode& node);
703  friend TableExprNode atan2 (const TableExprNode& y,
704  const TableExprNode& x);
705  friend TableExprNode tan (const TableExprNode& node);
706  friend TableExprNode tanh (const TableExprNode& node);
707  friend TableExprNode sign (const TableExprNode& node);
708  friend TableExprNode round (const TableExprNode& node);
709  friend TableExprNode ceil (const TableExprNode& node);
710  friend TableExprNode abs (const TableExprNode& node);
711  friend TableExprNode floor (const TableExprNode& node);
712  friend TableExprNode fmod (const TableExprNode& x,
713  const TableExprNode& y);
714  friend TableExprNode strlength (const TableExprNode& node);
715  friend TableExprNode upcase (const TableExprNode& node);
716  friend TableExprNode downcase (const TableExprNode& node);
717  friend TableExprNode capitalize(const TableExprNode& node);
718  friend TableExprNode trim (const TableExprNode& node);
719  friend TableExprNode ltrim (const TableExprNode& node);
720  friend TableExprNode rtrim (const TableExprNode& node);
721  friend TableExprNode substr (const TableExprNode& str,
722  const TableExprNode& pos);
723  friend TableExprNode substr (const TableExprNode& str,
724  const TableExprNode& pos,
725  const TableExprNode& npos);
726  friend TableExprNode replace (const TableExprNode& str,
727  const TableExprNode& patt);
728  friend TableExprNode replace (const TableExprNode& str,
729  const TableExprNode& patt,
730  const TableExprNode& repl);
731  friend TableExprNode regex (const TableExprNode& node);
732  friend TableExprNode pattern (const TableExprNode& node);
733  friend TableExprNode sqlpattern(const TableExprNode& node);
734  friend TableExprNode datetime (const TableExprNode& node);
735  friend TableExprNode mjdtodate (const TableExprNode& node);
736  friend TableExprNode mjd (const TableExprNode& node);
737  friend TableExprNode date (const TableExprNode& node);
738  friend TableExprNode year (const TableExprNode& node);
739  friend TableExprNode month (const TableExprNode& node);
740  friend TableExprNode day (const TableExprNode& node);
741  friend TableExprNode cmonth (const TableExprNode& node);
742  friend TableExprNode weekday (const TableExprNode& node);
743  friend TableExprNode cdow (const TableExprNode& node);
744  friend TableExprNode ctodt (const TableExprNode& node);
745  friend TableExprNode cdate (const TableExprNode& node);
746  friend TableExprNode ctime (const TableExprNode& node);
747  friend TableExprNode week (const TableExprNode& node);
748  friend TableExprNode time (const TableExprNode& node);
749  friend TableExprNode isNaN (const TableExprNode& node);
750  friend TableExprNode isFinite (const TableExprNode& node);
751  friend TableExprNode min (const TableExprNode& a, const TableExprNode& b);
752  friend TableExprNode max (const TableExprNode& a, const TableExprNode& b);
753  friend TableExprNode conj (const TableExprNode& node);
754  friend TableExprNode real (const TableExprNode& node);
755  friend TableExprNode imag (const TableExprNode& node);
756  friend TableExprNode integer (const TableExprNode& node);
757  friend TableExprNode boolean (const TableExprNode& node);
758  friend TableExprNode amplitude (const TableExprNode& node);
759  friend TableExprNode phase (const TableExprNode& node);
760  friend TableExprNode arg (const TableExprNode& node);
761  friend TableExprNode formComplex (const TableExprNode& real,
762  const TableExprNode& imag);
763  friend TableExprNode formComplex (const TableExprNode& node);
764  friend TableExprNode sum (const TableExprNode& array);
765  friend TableExprNode product (const TableExprNode& array);
766  friend TableExprNode sumSquare (const TableExprNode& array);
767  friend TableExprNode min (const TableExprNode& array);
768  friend TableExprNode max (const TableExprNode& array);
769  friend TableExprNode mean (const TableExprNode& array);
770  friend TableExprNode variance (const TableExprNode& array);
771  friend TableExprNode stddev (const TableExprNode& array);
772  friend TableExprNode avdev (const TableExprNode& array);
773  friend TableExprNode rms (const TableExprNode& array);
774  friend TableExprNode median (const TableExprNode& array);
775  friend TableExprNode fractile (const TableExprNode& array,
776  const TableExprNode& fraction);
777  friend TableExprNode any (const TableExprNode& array);
778  friend TableExprNode all (const TableExprNode& array);
779  friend TableExprNode ntrue (const TableExprNode& array);
780  friend TableExprNode nfalse (const TableExprNode& array);
781  friend TableExprNode sums (const TableExprNode& array,
782  const TableExprNodeSet& collapseAxes);
783  friend TableExprNode products (const TableExprNode& array,
784  const TableExprNodeSet& collapseAxes);
785  friend TableExprNode sumSquares (const TableExprNode& array,
786  const TableExprNodeSet& collapseAxes);
787  friend TableExprNode mins (const TableExprNode& array,
788  const TableExprNodeSet& collapseAxes);
789  friend TableExprNode maxs (const TableExprNode& array,
790  const TableExprNodeSet& collapseAxes);
791  friend TableExprNode means (const TableExprNode& array,
792  const TableExprNodeSet& collapseAxes);
793  friend TableExprNode variances (const TableExprNode& array,
794  const TableExprNodeSet& collapseAxes);
795  friend TableExprNode stddevs (const TableExprNode& array,
796  const TableExprNodeSet& collapseAxes);
797  friend TableExprNode avdevs (const TableExprNode& array,
798  const TableExprNodeSet& collapseAxes);
799  friend TableExprNode rmss (const TableExprNode& array,
800  const TableExprNodeSet& collapseAxes);
801  friend TableExprNode medians (const TableExprNode& array,
802  const TableExprNodeSet& collapseAxes);
803  friend TableExprNode fractiles (const TableExprNode& array,
804  const TableExprNode& fraction,
805  const TableExprNodeSet& collapseAxes);
806  friend TableExprNode anys (const TableExprNode& array,
807  const TableExprNodeSet& collapseAxes);
808  friend TableExprNode alls (const TableExprNode& array,
809  const TableExprNodeSet& collapseAxes);
810  friend TableExprNode ntrues (const TableExprNode& array,
811  const TableExprNodeSet& collapseAxes);
812  friend TableExprNode nfalses (const TableExprNode& array,
813  const TableExprNodeSet& collapseAxes);
814  friend TableExprNode runningMin (const TableExprNode& array);
815  friend TableExprNode runningMax (const TableExprNode& array);
816  friend TableExprNode runningMean (const TableExprNode& array);
817  friend TableExprNode runningVariance (const TableExprNode& array);
818  friend TableExprNode runningStddev (const TableExprNode& array);
819  friend TableExprNode runningAvdev (const TableExprNode& array);
820  friend TableExprNode runningRms (const TableExprNode& array);
821  friend TableExprNode runningMedian (const TableExprNode& array);
822  friend TableExprNode runningAny (const TableExprNode& array);
823  friend TableExprNode runningAll (const TableExprNode& array);
824  friend TableExprNode array (const TableExprNode& values,
825  const TableExprNodeSet& shape);
826  friend TableExprNode marray (const TableExprNode& array,
827  const TableExprNode& mask);
828  friend TableExprNode arrayData (const TableExprNode& array);
829  friend TableExprNode arrayMask (const TableExprNode& array);
830  friend TableExprNode arrayFlatten (const TableExprNode& array);
831  friend TableExprNode transpose (const TableExprNode& array);
832  friend TableExprNode transpose (const TableExprNode& array,
833  const TableExprNodeSet& axes);
834  friend TableExprNode diagonal (const TableExprNode& array);
835  friend TableExprNode diagonal (const TableExprNode& array,
836  const TableExprNode& firstAxis);
837  friend TableExprNode diagonal (const TableExprNode& array,
838  const TableExprNode& firstAxis,
839  const TableExprNode& diag);
840  friend TableExprNode isdefined (const TableExprNode& array);
841  friend TableExprNode nelements (const TableExprNode& array);
842  friend TableExprNode ndim (const TableExprNode& array);
843  friend TableExprNode shape (const TableExprNode& array);
844  friend TableExprNode iif (const TableExprNode& condition,
845  const TableExprNode& arg1,
846  const TableExprNode& arg2);
847  // </group>
848 
849 public:
850  TableExprNode ();
851 
852  // Unary operators on numeric TableExprNode's.
853  // <group>
854  TableExprNode operator+ () const;
855  TableExprNode operator- () const;
856  // </group>
857  // Unary NOT-operator on boolean TableExprNode's.
858  TableExprNode operator! () const;
859  // Unary bitwise negate-operator on integer TableExprNode's.
860  TableExprNode operator~ () const;
861 
862  // Slicing in a node containing an array. It is possible to
863  // address a single pixel or an n-dimensional subarray.
864  // In case of a single pixel the result is a scalar node.
865  // Otherwise the result is an array node with the same dimensionality
866  // as the source.
867  // <br>Note that there exist TableExprNodeSet constructors to
868  // convert an <src>IPosition</src> or <src>Slicer</src> object
869  // automatically to a <src>TableExprNodeSet</src>.
870  // An <src>IPosition</src> addresses a single element and results in
871  // a scalar node, while a <src>Slicer</src> can address multiple
872  // elements and always results in an array node.
874 
875  // The IN operator to test if a value is contained in an array or set.
876  // The array can also be a scalar.
877  // <group>
878  TableExprNode in (const TableExprNode& array,
879  const TaQLStyle& = TaQLStyle(0)) const;
880  TableExprNode in (const TableExprNodeSet& set,
881  const TaQLStyle& = TaQLStyle(0)) const;
882  // </group>
883 
884  // Use a unit for the given TableExprNode.
885  // Note that if a column has a unit, it is automatically set. In that case
886  // this can be used to convert units.
887  TableExprNode useUnit (const Unit& unit) const;
888 
889  // Constructors to convert a constant value to a TableExprNode.
890  // The constructor for char* is also supported to convert a
891  // character-array to a string, since a two step conversion
892  // is not done automatically.
893  // <group>
894  TableExprNode (const Bool& value);
895  TableExprNode (const Int64& value);
896  TableExprNode (const Int& value);
897  TableExprNode (const uInt& value);
898  TableExprNode (const Float& value);
899  TableExprNode (const Double& value);
900  TableExprNode (const Complex& value);
901  TableExprNode (const DComplex& value);
902  TableExprNode (const String& value);
903  TableExprNode (const std::string& value);
904  TableExprNode (const char*);
905  TableExprNode (const Regex& value);
906  TableExprNode (const StringDistance& value);
907  TableExprNode (const TaqlRegex& value);
908  TableExprNode (const MVTime& value);
909  TableExprNode (const Array<Bool>& value);
910  TableExprNode (const Array<uChar>& value);
911  TableExprNode (const Array<Short>& value);
912  TableExprNode (const Array<uShort>& value);
913  TableExprNode (const Array<Int>& value);
914  TableExprNode (const Array<uInt>& value);
915  TableExprNode (const Array<Float>& value);
916  TableExprNode (const Array<Double>& value);
917  TableExprNode (const Array<Complex>& value);
918  TableExprNode (const Array<DComplex>& value);
919  TableExprNode (const Array<String>& value);
920  TableExprNode (const Array<MVTime>& value);
921  TableExprNode (const MArray<Bool>& value);
922  TableExprNode (const MArray<uChar>& value);
923  TableExprNode (const MArray<Short>& value);
924  TableExprNode (const MArray<uShort>& value);
925  TableExprNode (const MArray<Int>& value);
926  TableExprNode (const MArray<uInt>& value);
927  TableExprNode (const MArray<Float>& value);
928  TableExprNode (const MArray<Double>& value);
929  TableExprNode (const MArray<Complex>& value);
930  TableExprNode (const MArray<DComplex>& value);
931  TableExprNode (const MArray<String>& value);
932  TableExprNode (const MArray<MVTime>& value);
933  // </group>
934 
935  // Construct a node from a node representation shared pointer
936  // which increments the reference count.
937  TableExprNode (const TENShPtr&);
938 
939  // Construct from a node representation. It takes over the pointer, so the
940  // object gets deleted automatically.
942  : node_p(TENShPtr(rep)) {}
943 
944  // copy constructor (reference semantics).
945  TableExprNode (const TableExprNode&);
946 
947  // Assignment (reference semantics).
949 
950  // The destructor deletes all the underlying TableExprNode objects,
951  ~TableExprNode ();
952 
953  // Does the node contain no actual node?
954  Bool isNull() const
955  { return !node_p; }
956 
957  // Do not apply the selection.
960 
961  // Re-create the column object for a selection of rows.
962  // Nothing is done if the node does not represent a column object.
963  void applySelection (const Vector<uInt>& rownrs)
964  { node_p->applySelection (rownrs); }
965 
966  // Get the unit of the expression.
967  const Unit& unit() const
968  { return node_p->unit(); }
969 
970  // Get the attributes of the expression.
971  const Record& attributes() const
972  { return node_p->attributes(); }
973 
974  // Get the data type of the expression.
975  // Currently the only possible values are TpBool, TpInt, TpDouble,
976  // TpDComplex, TpString, and TpOther.
977  // The latter is returned for a date or regex.
978  DataType dataType() const;
979 
980  // Is the expression a scalar?
981  Bool isScalar() const
982  { return (node_p->valueType() == TableExprNodeRep::VTScalar); }
983 
984  // Get the number of rows in the table associated with this expression.
985  // One is returned if the expression is a constant.
986  // Zero is returned if no table is associated with it.
987  uInt nrow() const
988  { return node_p->nrow(); }
989 
990  // Get a value for this node in the given row.
991  // These functions are implemented in the derived classes and
992  // will usually invoke the get in their children and apply the
993  // operator on the resulting values.
994  // <group>
995  void get (const TableExprId& id, Bool& value) const;
996  void get (const TableExprId& id, Int64& value) const;
997  void get (const TableExprId& id, Double& value) const;
998  void get (const TableExprId& id, DComplex& value) const;
999  void get (const TableExprId& id, String& value) const;
1000  void get (const TableExprId& id, TaqlRegex& value) const;
1001  void get (const TableExprId& id, MVTime& value) const;
1002  void get (const TableExprId& id, MArray<Bool>& value) const;
1003  void get (const TableExprId& id, MArray<Int64>& value) const;
1004  void get (const TableExprId& id, MArray<Double>& value) const;
1005  void get (const TableExprId& id, MArray<DComplex>& value) const;
1006  void get (const TableExprId& id, MArray<String>& value) const;
1007  void get (const TableExprId& id, MArray<MVTime>& value) const;
1008  void get (const TableExprId& id, Array<Bool>& value) const;
1009  void get (const TableExprId& id, Array<Int64>& value) const;
1010  void get (const TableExprId& id, Array<Double>& value) const;
1011  void get (const TableExprId& id, Array<DComplex>& value) const;
1012  void get (const TableExprId& id, Array<String>& value) const;
1013  void get (const TableExprId& id, Array<MVTime>& value) const;
1014  Bool getBool (const TableExprId& id) const;
1015  Int64 getInt (const TableExprId& id) const;
1016  Double getDouble (const TableExprId& id) const;
1017  DComplex getDComplex (const TableExprId& id) const;
1018  MVTime getDate (const TableExprId& id) const;
1019  String getString (const TableExprId& id) const;
1020  Array<Bool> getArrayBool (const TableExprId& id) const;
1021  Array<Int64> getArrayInt (const TableExprId& id) const;
1022  Array<Double> getArrayDouble (const TableExprId& id) const;
1023  Array<DComplex> getArrayDComplex (const TableExprId& id) const;
1024  Array<String> getArrayString (const TableExprId& id) const;
1025  Array<MVTime> getArrayDate (const TableExprId& id) const;
1026  // Get a value as an array, even it it is a scalar.
1027  // This is useful in case one can give an argument as scalar or array.
1028  // <group>
1029  MArray<Bool> getBoolAS (const TableExprId& id) const;
1030  MArray<Int64> getIntAS (const TableExprId& id) const;
1031  MArray<Double> getDoubleAS (const TableExprId& id) const;
1032  MArray<DComplex> getDComplexAS (const TableExprId& id) const;
1033  MArray<String> getStringAS (const TableExprId& id) const;
1034  MArray<MVTime> getDateAS (const TableExprId& id) const;
1035  // </group>
1036 
1037  // </group>
1038 
1039  // Get the data type for doing a getColumn on the expression.
1040  // This is the data type of the column if the expression
1041  // consists of a single column only.
1042  // Otherwise it is the expression data type as returned by
1043  // function <src>dataType</src>.
1044  DataType getColumnDataType() const;
1045 
1046  // Get the value of the expression evaluated for the entire column.
1047  // The data of function called should match the data type as
1048  // returned by function <src>getColumnDataType</src>.
1049  // <group>
1050  Array<Bool> getColumnBool (const Vector<uInt>& rownrs) const;
1051  Array<uChar> getColumnuChar (const Vector<uInt>& rownrs) const;
1052  Array<Short> getColumnShort (const Vector<uInt>& rownrs) const;
1053  Array<uShort> getColumnuShort (const Vector<uInt>& rownrs) const;
1054  Array<Int> getColumnInt (const Vector<uInt>& rownrs) const;
1055  Array<uInt> getColumnuInt (const Vector<uInt>& rownrs) const;
1056  Array<Float> getColumnFloat (const Vector<uInt>& rownrs) const;
1057  Array<Double> getColumnDouble (const Vector<uInt>& rownrs) const;
1058  Array<Complex> getColumnComplex (const Vector<uInt>& rownrs) const;
1059  Array<DComplex> getColumnDComplex (const Vector<uInt>& rownrs) const;
1060  Array<String> getColumnString (const Vector<uInt>& rownrs) const;
1061  // </group>
1062 
1063  // Show the tree.
1064  void show (ostream&) const;
1065 
1066  // Convert the tree to a number of range vectors which at least
1067  // select the same things.
1068  // This function is very useful to convert the expression to
1069  // some intervals covering the select expression. This can
1070  // be used to do a rough fast selection via an index and do the
1071  // the slower final selection on that much smaller subset.
1072  // The function can only convert direct comparisons of columns
1073  // with constants (via ==, !=, >, >=, < or <=) and their combinations
1074  // using && or ||.
1075  void ranges (Block<TableExprRange>&);
1076 
1077  // Check if tables used in expression have the same number of
1078  // rows as the given table.
1079  Bool checkTableSize (const Table& table, Bool canBeConst) const;
1080 
1081  // Get table. This gets the Table object to which a
1082  // TableExprNode belongs. A TableExprNode belongs to the Table to
1083  // which the column(s) used in an expression belong. Note that
1084  // all columns in an expression have to belong to the same table.
1085  const Table& table() const;
1086 
1087  // Create a column node on behalf of the Table class.
1088  // For builtin data types another type of node is created than
1089  // for other data types.
1090  static TableExprNode newColumnNode (const Table& tab,
1091  const String& name,
1092  const Vector<String>& fieldNames);
1093 
1094  // Create a TableExprNodeConst for a table keyword
1095  // (which is handled as a constant).
1096  static TableExprNode newKeyConst (const TableRecord&,
1097  const Vector<String>& fieldNames);
1098 
1099  // Handle all field names except the last one. ALl of them must
1100  // be records. The last record is returned.
1101  // fullName is filled with the full keyword name separated by dots.
1102  static TableRecord* findLastKeyRec (const TableRecord& keyset,
1103  const Vector<String>& fieldNames,
1104  String& fullName);
1105 
1106  // Throw invalid data type exception.
1107  static void throwInvDT (const String& message);
1108 
1109  // Create function node of the given type with the given arguments.
1110  // <group>
1112  const TableExprNodeSet& set,
1113  const Table& table,
1114  const TaQLStyle& = TaQLStyle(0));
1116  const TableExprNode& node);
1118  const TableExprNode& node1,
1119  const TableExprNode& node2);
1121  const TableExprNode& node1,
1122  const TableExprNode& node2,
1123  const TableExprNode& node3);
1125  const TableExprNode& array,
1126  const TableExprNodeSet& axes);
1128  const TableExprNode& array,
1129  const TableExprNode& node,
1130  const TableExprNodeSet& axes);
1131  // </group>
1132 
1133  // Create a user defined function node.
1134  static TableExprNode newUDFNode (const String& name,
1135  const TableExprNodeSet& set,
1136  const Table& table,
1137  const TaQLStyle& = TaQLStyle(0));
1138 
1139  // Create cone function node of the given type with the given arguments.
1140  // <group>
1142  const TableExprNodeSet& set,
1143  uInt origin = 0);
1145  const TableExprNode& node1,
1146  const TableExprNode& node2);
1148  const TableExprNode& node1,
1149  const TableExprNode& node2,
1150  const TableExprNode& node3);
1151  // </group>
1152 
1153  // Create rownumber() function node.
1154  // Origin indicates whether the first row should be zero (for C++ binding)
1155  // or an other value (one for TaQL binding).
1156  static TableExprNode newRownrNode (const Table& table, uInt origin);
1157 
1158  // Create rowid() function node.
1159  // Origin is always 0.
1160  static TableExprNode newRowidNode (const Table& table);
1161 
1162  // Create rand() function node.
1163  static TableExprNode newRandomNode (const Table& table);
1164 
1165  // Create ArrayElement node for the given array with the given index.
1166  // The origin is 0 for C++ and 1 for TaQL.
1167  static TableExprNode newArrayPartNode (const TableExprNode& arrayNode,
1168  const TableExprNodeSet& indices,
1169  const TaQLStyle& = TaQLStyle(0));
1170 
1171  // returns const pointer to the underlying TableExprNodeRep object.
1172  const TENShPtr& getRep() const;
1173  const TableExprNodeRep* getNodeRep() const;
1174 
1175  // Adapt the unit of the expression to the given unit (if not empty).
1176  void adaptUnit (const Unit&);
1177 
1178 private:
1179  // Put the new binary node object in a shared pointer.
1180  // Set the node's info and adapt the children if needed.
1181  // If the node is constant, it is evaluated and returned as result.
1183  const TENShPtr& right=TENShPtr()) const;
1184 
1185  // convert Block of TableExprNode to vector of TENShPtr.
1186  static std::vector<TENShPtr> convertBlockTEN (Block<TableExprNode>& nodes);
1187 
1188  // Construct a new node for the given operation.
1189  // <group>
1190  TENShPtr newPlus (const TENShPtr& right) const;
1191  TENShPtr newMinus (const TENShPtr& right) const;
1192  TENShPtr newTimes (const TENShPtr& right) const;
1193  TENShPtr newDivide (const TENShPtr& right) const;
1194  TENShPtr newModulo (const TENShPtr& right) const;
1195  TENShPtr newBitAnd (const TENShPtr& right) const;
1196  TENShPtr newBitOr (const TENShPtr& right) const;
1197  TENShPtr newBitXor (const TENShPtr& right) const;
1198  TENShPtr newEQ (const TENShPtr& right) const;
1199  TENShPtr newNE (const TENShPtr& right) const;
1200  TENShPtr newGE (const TENShPtr& right) const;
1201  TENShPtr newGT (const TENShPtr& right) const;
1202  TENShPtr newIN (const TENShPtr& right, const TaQLStyle&) const;
1203  TENShPtr newOR (const TENShPtr& right) const;
1204  TENShPtr newAND (const TENShPtr& right) const;
1205  // </group>
1206 
1207  // The actual (counted referenced) representation of a node.
1209 };
1210 
1211 
1212 
1214  { node_p->ranges (blrange); }
1215 
1216 //# Get the table from which the node is derived.
1217 inline const Table& TableExprNode::table() const
1218  { return node_p->table(); }
1219 
1220 //# Get the value of an expression.
1221 inline void TableExprNode::get (const TableExprId& id, Bool& value) const
1222  { value = node_p->getBool (id); }
1223 inline void TableExprNode::get (const TableExprId& id, Int64& value) const
1224  { value = node_p->getInt (id); }
1225 inline void TableExprNode::get (const TableExprId& id, Double& value) const
1226  { value = node_p->getDouble (id); }
1227 inline void TableExprNode::get (const TableExprId& id, DComplex& value) const
1228  { value = node_p->getDComplex (id); }
1229 inline void TableExprNode::get (const TableExprId& id, String& value) const
1230  { value = node_p->getString (id); }
1231 inline void TableExprNode::get (const TableExprId& id, TaqlRegex& value) const
1232  { value = node_p->getRegex (id); }
1233 inline void TableExprNode::get (const TableExprId& id, MVTime& value) const
1234  { value = node_p->getDate (id); }
1235 inline void TableExprNode::get (const TableExprId& id,
1236  MArray<Bool>& value) const
1237  { value = node_p->getArrayBool (id); }
1238 inline void TableExprNode::get (const TableExprId& id,
1239  MArray<Int64>& value) const
1240  { value = node_p->getArrayInt (id); }
1241 inline void TableExprNode::get (const TableExprId& id,
1242  MArray<Double>& value) const
1243  { value = node_p->getArrayDouble (id); }
1244 inline void TableExprNode::get (const TableExprId& id,
1245  MArray<DComplex>& value) const
1246  { value = node_p->getArrayDComplex (id); }
1247 inline void TableExprNode::get (const TableExprId& id,
1248  MArray<String>& value) const
1249  { value = node_p->getArrayString (id); }
1250 inline void TableExprNode::get (const TableExprId& id,
1251  MArray<MVTime>& value) const
1252  { value = node_p->getArrayDate (id); }
1253 inline void TableExprNode::get (const TableExprId& id,
1254  Array<Bool>& value) const
1255  { value = node_p->getArrayBool (id).array(); }
1256 inline void TableExprNode::get (const TableExprId& id,
1257  Array<Int64>& value) const
1258  { value = node_p->getArrayInt (id).array(); }
1259 inline void TableExprNode::get (const TableExprId& id,
1260  Array<Double>& value) const
1261  { value = node_p->getArrayDouble (id).array(); }
1262 inline void TableExprNode::get (const TableExprId& id,
1263  Array<DComplex>& value) const
1264  { value = node_p->getArrayDComplex (id).array(); }
1265 inline void TableExprNode::get (const TableExprId& id,
1266  Array<String>& value) const
1267  { value = node_p->getArrayString (id).array(); }
1268 inline void TableExprNode::get (const TableExprId& id,
1269  Array<MVTime>& value) const
1270  { value = node_p->getArrayDate (id).array(); }
1271 inline Bool TableExprNode::getBool (const TableExprId& id) const
1272  { return node_p->getBool (id); }
1273 inline Int64 TableExprNode::getInt (const TableExprId& id) const
1274  { return node_p->getInt (id); }
1276  { return node_p->getDouble (id); }
1278  { return node_p->getDComplex (id); }
1280  { return node_p->getDate (id); }
1282  { return node_p->getString (id); }
1284  { return node_p->getArrayBool (id).array(); }
1286  { return node_p->getArrayInt (id).array(); }
1288  { return node_p->getArrayDouble (id).array(); }
1290  { return node_p->getArrayDComplex (id).array(); }
1292  { return node_p->getArrayString (id).array(); }
1294  { return node_p->getArrayDate (id).array(); }
1296  { return node_p->getBoolAS (id); }
1298  { return node_p->getIntAS (id); }
1300  { return node_p->getDoubleAS (id); }
1302  { return node_p->getDComplexAS (id); }
1304  { return node_p->getStringAS (id); }
1306  { return node_p->getDateAS (id); }
1307 
1309  { return node_p->getColumnBool (rownrs); }
1311  { return node_p->getColumnuChar (rownrs); }
1313  { return node_p->getColumnShort (rownrs); }
1315  { return node_p->getColumnuShort (rownrs); }
1317  { return node_p->getColumnInt (rownrs); }
1319  { return node_p->getColumnuInt (rownrs); }
1321  { return node_p->getColumnFloat (rownrs); }
1323  { return node_p->getColumnDouble (rownrs); }
1325  { return node_p->getColumnComplex (rownrs); }
1327  { return node_p->getColumnDComplex (rownrs); }
1329  { return node_p->getColumnString (rownrs); }
1330 
1331 
1333  const TableExprNode& right)
1334 {
1335  return left.newPlus (right.node_p);
1336 }
1338  const TableExprNode& right)
1339 {
1340  return left.newMinus (right.node_p);
1341 }
1343  const TableExprNode& right)
1344 {
1345  return left.newTimes (right.node_p);
1346 }
1348  const TableExprNode& right)
1349 {
1350  return left.newDivide (right.node_p);
1351 }
1353  const TableExprNode& right)
1354 {
1355  return left.newModulo (right.node_p);
1356 }
1358  const TableExprNode& right)
1359 {
1360  return left.newBitAnd (right.node_p);
1361 }
1363  const TableExprNode& right)
1364 {
1365  return left.newBitOr (right.node_p);
1366 }
1368  const TableExprNode& right)
1369 {
1370  return left.newBitXor (right.node_p);
1371 }
1373  const TableExprNode& right)
1374 {
1375  return left.newEQ (right.node_p);
1376 }
1378  const TableExprNode& right)
1379 {
1380  return left.newNE (right.node_p);
1381 }
1383  const TableExprNode& right)
1384 {
1385  return left.newGT (right.node_p);
1386 }
1388  const TableExprNode& right)
1389 {
1390  return left.newGE (right.node_p);
1391 }
1393  const TableExprNode& right)
1394 {
1395  return right.newGE (left.node_p);
1396 }
1398  const TableExprNode& right)
1399 {
1400  return right.newGT (left.node_p);
1401 }
1403  const TaQLStyle& style) const
1404 {
1405  return newIN (right.node_p, style);
1406 }
1408 {
1409  // C++ indexing is 0-based.
1410  return newArrayPartNode (*this, indices, TaQLStyle(0));
1411 }
1412 
1413 inline TableExprNode near (const TableExprNode& left,
1414  const TableExprNode& right)
1415 {
1417  left, right);
1418 }
1419 inline TableExprNode near (const TableExprNode& left,
1420  const TableExprNode& right,
1421  const TableExprNode& tolerance)
1422 {
1424  left, right, tolerance);
1425 }
1427  const TableExprNode& right)
1428 {
1430  left, right);
1431 }
1433  const TableExprNode& right,
1434  const TableExprNode& tolerance)
1435 {
1437  left, right, tolerance);
1438 }
1440  const TableExprNode& pos2)
1441 {
1443  pos1, pos2);
1444 }
1446  const TableExprNode& pos2)
1447 {
1449  pos1, pos2);
1450 }
1451 inline TableExprNode cones (const TableExprNode& sourcePos,
1452  const TableExprNode& cones)
1453 {
1455  sourcePos, cones);
1456 }
1457 inline TableExprNode anyCone (const TableExprNode& sourcePos,
1458  const TableExprNode& cones)
1459 {
1461  sourcePos, cones);
1462 }
1463 inline TableExprNode findCone (const TableExprNode& sourcePos,
1464  const TableExprNode& cones)
1465 {
1467  sourcePos, cones);
1468 }
1469 inline TableExprNode cones (const TableExprNode& sourcePos,
1470  const TableExprNode& conePos,
1471  const TableExprNode& radii)
1472 {
1474  sourcePos, conePos, radii);
1475 }
1476 inline TableExprNode anyCone (const TableExprNode& sourcePos,
1477  const TableExprNode& conePos,
1478  const TableExprNode& radii)
1479 {
1481  sourcePos, conePos, radii);
1482 }
1483 inline TableExprNode findCone (const TableExprNode& sourcePos,
1484  const TableExprNode& conePos,
1485  const TableExprNode& radii)
1486 {
1488  sourcePos, conePos, radii);
1489 }
1490 inline TableExprNode cos (const TableExprNode& node)
1491 {
1493 }
1494 inline TableExprNode cosh (const TableExprNode& node)
1495 {
1497 }
1498 inline TableExprNode exp (const TableExprNode& node)
1499 {
1501 }
1502 inline TableExprNode log (const TableExprNode& node)
1503 {
1505 }
1506 inline TableExprNode log10 (const TableExprNode& node)
1507 {
1509 }
1510 inline TableExprNode pow (const TableExprNode& x, const TableExprNode& y)
1511 {
1513 }
1514 inline TableExprNode sin (const TableExprNode& node)
1515 {
1517 }
1518 inline TableExprNode sinh (const TableExprNode& node)
1519 {
1521 }
1522 inline TableExprNode square (const TableExprNode& node)
1523 {
1525  node);
1526 }
1527 inline TableExprNode cube (const TableExprNode& node)
1528 {
1530  node);
1531 }
1532 inline TableExprNode sqrt (const TableExprNode& node)
1533 {
1535 }
1536 inline TableExprNode norm (const TableExprNode& node)
1537 {
1539 }
1540 inline TableExprNode acos (const TableExprNode& node)
1541 {
1543 }
1544 inline TableExprNode asin (const TableExprNode& node)
1545 {
1547 }
1548 inline TableExprNode atan (const TableExprNode& node)
1549 {
1551 }
1552 inline TableExprNode atan2 (const TableExprNode& y, const TableExprNode& x)
1553 {
1555 }
1556 inline TableExprNode sign (const TableExprNode& node)
1557 {
1559 }
1560 inline TableExprNode round (const TableExprNode& node)
1561 {
1563 }
1564 inline TableExprNode ceil (const TableExprNode& node)
1565 {
1567 }
1568 inline TableExprNode abs (const TableExprNode& node)
1569 {
1571 }
1572 inline TableExprNode floor (const TableExprNode& node)
1573 {
1575 }
1576 inline TableExprNode fmod (const TableExprNode& x, const TableExprNode& y)
1577 {
1579 }
1580 inline TableExprNode tan (const TableExprNode& node)
1581 {
1583 }
1584 inline TableExprNode tanh (const TableExprNode& node)
1585 {
1587 }
1588 inline TableExprNode min (const TableExprNode& a, const TableExprNode& b)
1589 {
1591 }
1592 inline TableExprNode max (const TableExprNode& a, const TableExprNode& b)
1593 {
1595 }
1596 inline TableExprNode real (const TableExprNode& node)
1597 {
1599 }
1600 inline TableExprNode imag (const TableExprNode& node)
1601 {
1603 }
1605 {
1607 }
1609 {
1611 }
1612 inline TableExprNode conj (const TableExprNode& node)
1613 {
1615 }
1617 {
1619 }
1620 inline TableExprNode arg (const TableExprNode& node)
1621 {
1623 }
1624 inline TableExprNode phase (const TableExprNode& node)
1625 {
1627 }
1629  const TableExprNode& imag)
1630 {
1632  real, imag);
1633 }
1635 {
1637  node);
1638 }
1640 {
1642  node);
1643 }
1644 inline TableExprNode upcase (const TableExprNode& node)
1645 {
1647  node);
1648 }
1650 {
1652  node);
1653 }
1655 {
1657  node);
1658 }
1659 inline TableExprNode regex (const TableExprNode& node)
1660 {
1662 }
1664 {
1666  node);
1667 }
1669 {
1671  node);
1672 }
1674 {
1676  node);
1677 }
1679 {
1681  node);
1682 }
1683 inline TableExprNode mjd (const TableExprNode& node)
1684 {
1686 }
1687 inline TableExprNode date (const TableExprNode& node)
1688 {
1690 }
1691 inline TableExprNode year (const TableExprNode& node)
1692 {
1694 }
1695 inline TableExprNode month (const TableExprNode& node)
1696 {
1698 }
1699 inline TableExprNode day (const TableExprNode& node)
1700 {
1702 }
1703 inline TableExprNode cmonth (const TableExprNode& node)
1704 {
1706  node);
1707 }
1709 {
1711  node);
1712 }
1713 inline TableExprNode cdow (const TableExprNode& node)
1714 {
1716 }
1717 inline TableExprNode ctodt (const TableExprNode& node)
1718 {
1720 }
1721 inline TableExprNode cdate (const TableExprNode& node)
1722 {
1724 }
1725 inline TableExprNode ctime (const TableExprNode& node)
1726 {
1728 }
1729 inline TableExprNode hms (const TableExprNode& node)
1730 {
1732 }
1733 inline TableExprNode dms (const TableExprNode& node)
1734 {
1736 }
1737 inline TableExprNode hdms (const TableExprNode& node)
1738 {
1740 }
1742 {
1744  node);
1745 }
1747  const TableExprNode& format)
1748 {
1750  node, format);
1751 }
1752 inline TableExprNode week (const TableExprNode& node)
1753 {
1755 }
1756 inline TableExprNode time (const TableExprNode& node)
1757 {
1759 }
1760 inline TableExprNode trim (const TableExprNode& node)
1761 {
1763 }
1764 inline TableExprNode ltrim (const TableExprNode& node)
1765 {
1767 }
1768 inline TableExprNode rtrim (const TableExprNode& node)
1769 {
1771 }
1772 inline TableExprNode substr (const TableExprNode& node,
1773  const TableExprNode& pos)
1774 {
1776  node, pos);
1777 }
1778 inline TableExprNode substr (const TableExprNode& node,
1779  const TableExprNode& pos,
1780  const TableExprNode& npos)
1781 {
1783  node, pos, npos);
1784 }
1786  const TableExprNode& patt)
1787 {
1789  node, patt);
1790 }
1792  const TableExprNode& patt,
1793  const TableExprNode& repl)
1794 {
1796  node, patt, repl);
1797 }
1798 inline TableExprNode isNaN (const TableExprNode& node)
1799 {
1801 }
1802 inline TableExprNode isInf (const TableExprNode& node)
1803 {
1805 }
1807 {
1809  node);
1810 }
1811 inline TableExprNode min (const TableExprNode& node)
1812 {
1814  node);
1815 }
1816 inline TableExprNode max (const TableExprNode& node)
1817 {
1819  node);
1820 }
1821 inline TableExprNode sum (const TableExprNode& node)
1822 {
1824  node);
1825 }
1827 {
1829  node);
1830 }
1832 {
1834  node);
1835 }
1836 inline TableExprNode mean (const TableExprNode& node)
1837 {
1839  node);
1840 }
1842 {
1844  node);
1845 }
1846 inline TableExprNode stddev (const TableExprNode& node)
1847 {
1849  node);
1850 }
1851 inline TableExprNode avdev (const TableExprNode& node)
1852 {
1854  node);
1855 }
1856 inline TableExprNode rms (const TableExprNode& node)
1857 {
1859  node);
1860 }
1861 inline TableExprNode median (const TableExprNode& node)
1862 {
1864  node);
1865 }
1867  const TableExprNode& fraction)
1868 {
1870  node, fraction);
1871 }
1872 inline TableExprNode any (const TableExprNode& node)
1873 {
1875 }
1876 inline TableExprNode all (const TableExprNode& node)
1877 {
1879 }
1880 inline TableExprNode ntrue (const TableExprNode& node)
1881 {
1883 }
1884 inline TableExprNode nfalse (const TableExprNode& node)
1885 {
1887 }
1889  const TableExprNodeSet& axes)
1890 {
1892  array, axes);
1893 }
1895  const TableExprNodeSet& axes)
1896 {
1898  array, axes);
1899 }
1901  const TableExprNodeSet& axes)
1902 {
1904  array, axes);
1905 }
1907  const TableExprNodeSet& axes)
1908 {
1910  array, axes);
1911 }
1913  const TableExprNodeSet& axes)
1914 {
1916  array, axes);
1917 }
1919  const TableExprNodeSet& axes)
1920 {
1922  array, axes);
1923 }
1925  const TableExprNodeSet& axes)
1926 {
1928  array, axes);
1929 }
1931  const TableExprNodeSet& axes)
1932 {
1934  array, axes);
1935 }
1937  const TableExprNodeSet& axes)
1938 {
1940  array, axes);
1941 }
1943  const TableExprNodeSet& axes)
1944 {
1946  array, axes);
1947 }
1949  const TableExprNodeSet& axes)
1950 {
1952  array, axes);
1953 }
1955  const TableExprNode& fraction,
1956  const TableExprNodeSet& axes)
1957 {
1959  array, fraction, axes);
1960 }
1962  const TableExprNodeSet& axes)
1963 {
1965  array, axes);
1966 }
1968  const TableExprNodeSet& axes)
1969 {
1971  array, axes);
1972 }
1974  const TableExprNodeSet& axes)
1975 {
1977  array, axes);
1978 }
1980  const TableExprNodeSet& axes)
1981 {
1983  array, axes);
1984 }
1986  const TableExprNodeSet& halfBoxWidth)
1987 {
1989  node, halfBoxWidth);
1990 }
1992  const TableExprNodeSet& halfBoxWidth)
1993 {
1995  node, halfBoxWidth);
1996 }
1998  const TableExprNodeSet& halfBoxWidth)
1999 {
2001  node, halfBoxWidth);
2002 }
2004  const TableExprNodeSet& halfBoxWidth)
2005 {
2007  node, halfBoxWidth);
2008 }
2010  const TableExprNodeSet& halfBoxWidth)
2011 {
2013  node, halfBoxWidth);
2014 }
2016  const TableExprNodeSet& halfBoxWidth)
2017 {
2019  node, halfBoxWidth);
2020 }
2022  const TableExprNodeSet& halfBoxWidth)
2023 {
2025  node, halfBoxWidth);
2026 }
2028  const TableExprNodeSet& halfBoxWidth)
2029 {
2031  node, halfBoxWidth);
2032 }
2034  const TableExprNodeSet& halfBoxWidth)
2035 {
2037  node, halfBoxWidth);
2038 }
2040  const TableExprNodeSet& halfBoxWidth)
2041 {
2043  node, halfBoxWidth);
2044 }
2046  const TableExprNodeSet& halfBoxWidth)
2047 {
2049  node, halfBoxWidth);
2050 }
2052  const TableExprNodeSet& halfBoxWidth)
2053 {
2055  node, halfBoxWidth);
2056 }
2058  const TableExprNodeSet& halfBoxWidth)
2059 {
2061  node, halfBoxWidth);
2062 }
2064  const TableExprNodeSet& halfBoxWidth)
2065 {
2067  node, halfBoxWidth);
2068 }
2070  const TableExprNodeSet& halfBoxWidth)
2071 {
2073  node, halfBoxWidth);
2074 }
2076  const TableExprNodeSet& halfBoxWidth)
2077 {
2079  node, halfBoxWidth);
2080 }
2082  const TableExprNodeSet& halfBoxWidth)
2083 {
2085  node, halfBoxWidth);
2086 }
2088  const TableExprNodeSet& halfBoxWidth)
2089 {
2091  node, halfBoxWidth);
2092 }
2094  const TableExprNodeSet& halfBoxWidth)
2095 {
2097  node, halfBoxWidth);
2098 }
2100  const TableExprNodeSet& halfBoxWidth)
2101 {
2103  node, halfBoxWidth);
2104 }
2105 inline TableExprNode array (const TableExprNode& values,
2106  const TableExprNodeSet& shape)
2107 {
2109  values, shape);
2110 }
2112  const TableExprNode& mask)
2113 {
2115  array, mask);
2116 }
2118 {
2120  array);
2121 }
2123 {
2125  array);
2126 }
2128 {
2130  array);
2131 }
2133 {
2134  // Needs an empty axes argument.
2136  array,
2138 }
2140  const TableExprNodeSet& axes)
2141 {
2143  array, axes);
2144 }
2146 {
2148  array,
2150 }
2152 {
2154 }
2156 {
2158 }
2159 inline TableExprNode ndim (const TableExprNode& node)
2160 {
2162 }
2163 inline TableExprNode shape (const TableExprNode& node)
2164 {
2166 }
2167 inline TableExprNode iif (const TableExprNode& condition,
2168  const TableExprNode& arg1,
2169  const TableExprNode& arg2)
2170 {
2172  condition, arg1, arg2);
2173 }
2174 
2175 
2176 inline void TableExprNode::show (ostream& os) const
2177 {
2178  node_p->show (os, 0);
2179 }
2180 inline const TENShPtr& TableExprNode::getRep() const
2181 {
2182  return node_p;
2183 }
2185 {
2186  return node_p.get();
2187 }
2188 
2189 
2190 
2191 } //# NAMESPACE CASACORE - END
2192 
2193 #endif
friend TableExprNode runningMax(const TableExprNode &array)
LatticeExprNode log10(const LatticeExprNode &expr)
friend TableExprNode norm(const TableExprNode &node)
Definition: ExprNode.h:1536
friend TableExprNode cones(const TableExprNode &sourcePos, const TableExprNode &cones)
Cone search; test if the position of a source is inside a cone.
Definition: ExprNode.h:1451
CountedPtr< TableExprNodeRep > TENShPtr
Definition: ExprNodeRep.h:56
friend TableExprNode ceil(const TableExprNode &node)
Definition: ExprNode.h:1564
friend TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1691
const Record & attributes() const
Get the attributes.
Definition: ExprNodeRep.h:733
Array< String > getArrayString(const TableExprId &id) const
Definition: ExprNode.h:1291
friend TableExprNode operator<(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1397
friend TableExprNode ntrues(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1973
Array< Double > getArrayDouble(const TableExprId &id) const
Definition: ExprNode.h:1287
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
TableExprNode dms(const TableExprNode &node)
Definition: ExprNode.h:1733
friend TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1695
Class to handle an Array with an optional mask.
Definition: ExprNode.h:56
MArray< Double > getDoubleAS(const TableExprId &id)
TableExprNode boxedStddev(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2069
TableExprNode anyCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The result is always a Bool scalar telling if any cone contains the source.
Definition: ExprNode.h:1457
int Int
Definition: aipstype.h:50
TableExprNode transpose(const TableExprNode &array)
Transpose all axes of a (masked) array.
Definition: ExprNode.h:2132
return angles as dms strings
Definition: ExprFuncNode.h:254
friend TableExprNode sin(const TableExprNode &node)
Transcendental functions that can be applied to essentially all numeric nodes containing scalars or a...
Definition: ExprNode.h:1514
Array< Int64 > getArrayInt(const TableExprId &id) const
Definition: ExprNode.h:1285
TableExprNode alls(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1967
virtual Array< uInt > getColumnuInt(const Vector< uInt > &rownrs)
friend TableExprNode mjdtodate(const TableExprNode &node)
Definition: ExprNode.h:1678
LatticeExprNode log(const LatticeExprNode &expr)
friend TableExprNode runningRms(const TableExprNode &array)
t * get() const
Get the underlying pointer.
Definition: CountedPtr.h:183
friend TableExprNode cdate(const TableExprNode &node)
Definition: ExprNode.h:1721
friend TableExprNode cosh(const TableExprNode &node)
Definition: ExprNode.h:1494
friend TableExprNode rmss(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1942
LatticeExprNode arg(const LatticeExprNode &expr)
TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1918
TableExprNode runningRms(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2021
friend TableExprNode tanh(const TableExprNode &node)
Definition: ExprNode.h:1584
TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1649
friend TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1918
LatticeExprNode median(const LatticeExprNode &expr)
for Int, Double or Complex returning Double or Complex
Definition: ExprFuncNode.h:118
friend TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1699
Array< DComplex > getColumnDComplex(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1326
TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1756
for any array returning Bool scalar
Definition: ExprFuncNode.h:211
virtual Array< Bool > getColumnBool(const Vector< uInt > &rownrs)
Get the value of the expression evaluated for the entire column.
friend TableExprNode runningMin(const TableExprNode &array)
TENShPtr newGT(const TENShPtr &right) const
friend TableExprNode operator &(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1357
Main interface class to a read/write table.
Definition: Table.h:153
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode runningVariance(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2003
const TableExprNodeRep * getNodeRep() const
Definition: ExprNode.h:2184
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
cone search functions, implemented in derived class
Definition: ExprFuncNode.h:269
friend TableExprNode cos(const TableExprNode &node)
Definition: ExprNode.h:1490
friend TableExprNode ndim(const TableExprNode &array)
Definition: ExprNode.h:2159
friend TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1649
T product(const TableVector< T > &tv)
Definition: TabVecMath.h:385
friend TableExprNode any(const TableExprNode &array)
Definition: ExprNode.h:1872
LatticeExprNode imag(const LatticeExprNode &expr)
TableExprNode variances(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1924
friend TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1362
for Bool array returning Int scalar
Definition: ExprFuncNode.h:193
friend TableExprNode datetime(const TableExprNode &node)
Functions for date-values.
Definition: ExprNode.h:1673
MArray< String > getStringAS(const TableExprId &id)
friend TableExprNode variance(const TableExprNode &array)
Definition: ExprNode.h:1841
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
Array< Short > getColumnShort(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1312
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition: ExprNode.h:2105
Class to hold multiple table expression nodes.
Definition: ExprNodeSet.h:311
LatticeExprNode sum(const LatticeExprNode &expr)
MArray< DComplex > getDComplexAS(const TableExprId &id) const
Definition: ExprNode.h:1301
TableExprNode(TableExprNodeRep *rep)
Construct from a node representation.
Definition: ExprNode.h:941
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode operator-() const
TableExprNode weekday(const TableExprNode &node)
Definition: ExprNode.h:1708
Handle class for a table column expression tree.
Definition: ExprNode.h:616
LatticeExprNode operator%(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode atan(const TableExprNode &node)
Definition: ExprNode.h:1548
TENShPtr newBitAnd(const TENShPtr &right) const
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
TableExprNode runningAll(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2039
friend TableExprNode fmod(const TableExprNode &x, const TableExprNode &y)
Definition: ExprNode.h:1576
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1624
virtual MVTime getDate(const TableExprId &id)
TENShPtr newBitXor(const TENShPtr &right) const
friend TableExprNode median(const TableExprNode &array)
Definition: ExprNode.h:1861
friend TableExprNode nelements(const TableExprNode &array)
Functions operating on any scalar or array resulting in a Double scalar.
Definition: ExprNode.h:2155
TableExprNode ltrim(const TableExprNode &node)
Definition: ExprNode.h:1764
static TableExprNode newRandomNode(const Table &table)
Create rand() function node.
Bool near(const GaussianBeam &left, const GaussianBeam &other, const Double relWidthTol, const Quantity &absPaTol)
friend TableExprNode runningAny(const TableExprNode &array)
TENShPtr newTimes(const TENShPtr &right) const
friend TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
Definition: ExprNode.h:2111
friend TableExprNode findCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The sourcePos can contain multiple sources.
Definition: ExprNode.h:1463
friend TableExprNode log(const TableExprNode &node)
Definition: ExprNode.h:1502
MArray< String > getStringAS(const TableExprId &id) const
Definition: ExprNode.h:1303
for Int, Double, Complex or String returning Bool
Definition: ExprFuncNode.h:276
LatticeExprNode ntrue(const LatticeExprNode &expr)
friend TableExprNode replace(const TableExprNode &str, const TableExprNode &patt)
Definition: ExprNode.h:1785
virtual Int64 getInt(const TableExprId &id)
friend TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1616
friend TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1663
for Int, Double or DComplex returning Double
Definition: ExprFuncNode.h:110
void show(ostream &) const
Show the tree.
Definition: ExprNode.h:2176
friend TableExprNode abs(const TableExprNode &node)
Definition: ExprNode.h:1568
Array< uChar > getColumnuChar(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1310
virtual Array< Double > getColumnDouble(const Vector< uInt > &rownrs)
virtual Array< uShort > getColumnuShort(const Vector< uInt > &rownrs)
friend TableExprNode isFinite(const TableExprNode &node)
Function to test if a scalar or array is finite.
Definition: ExprNode.h:1806
friend TableExprNode operator<=(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1392
TableExprNode mins(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1906
virtual Array< Float > getColumnFloat(const Vector< uInt > &rownrs)
uInt nrow() const
Get the number of rows in the table associated with this expression.
friend TableExprNode runningVariance(const TableExprNode &array)
LatticeExprNode fractile(const LatticeExprNode &expr, const LatticeExprNode &fraction)
Determine the value of the element at the part fraction from the beginning of the given lattice...
void adaptUnit(const Unit &)
Adapt the unit of the expression to the given unit (if not empty).
TableExprNode maxs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1912
angular distance returning radians
Definition: ExprFuncNode.h:266
TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1691
MArray< Int64 > getIntAS(const TableExprId &id)
Bool checkTableSize(const Table &table, Bool canBeConst) const
Check if tables used in expression have the same number of rows as the given table.
friend TableExprNode nearAbs(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1426
friend TableExprNode ctime(const TableExprNode &node)
Definition: ExprNode.h:1725
static TableExprNode newFunctionNode(TableExprFuncNode::FunctionType, const TableExprNodeSet &set, const Table &table, const TaQLStyle &=TaQLStyle(0))
Create function node of the given type with the given arguments.
LatticeExprNode exp(const LatticeExprNode &expr)
Bool isNull() const
Does the node contain no actual node?
Definition: ExprNode.h:954
friend TableExprNode real(const TableExprNode &node)
The real part of a complex node.
Definition: ExprNode.h:1596
friend TableExprNode sum(const TableExprNode &array)
Functions operating on a Double or Complex scalar or array resulting in a scalar with the same data t...
Definition: ExprNode.h:1821
friend TableExprNode angdist(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance between positions.
Definition: ExprNode.h:1439
TableExprNode mjd(const TableExprNode &node)
Definition: ExprNode.h:1683
friend TableExprNode substr(const TableExprNode &str, const TableExprNode &pos)
Definition: ExprNode.h:1772
bool operator==(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition: Allocator.h:126
friend TableExprNode runningMedian(const TableExprNode &array)
friend TableExprNode floor(const TableExprNode &node)
Definition: ExprNode.h:1572
friend TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1624
void applySelection(const Vector< uInt > &rownrs)
Re-create the column object for a selection of rows.
Definition: ExprNode.h:963
TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1695
virtual Array< DComplex > getColumnDComplex(const Vector< uInt > &rownrs)
Abstract base class for a node in a table column expression tree.
Definition: ExprNodeRep.h:157
MArray< MVTime > getDateAS(const TableExprId &id)
static TableExprNode newKeyConst(const TableRecord &, const Vector< String > &fieldNames)
Create a TableExprNodeConst for a table keyword (which is handled as a constant). ...
TENShPtr setBinaryNodeInfo(TableExprNodeBinary *tsnptr, const TENShPtr &right=TENShPtr()) const
Put the new binary node object in a shared pointer.
TableExprNode operator+() const
Unary operators on numeric TableExprNode&#39;s.
TableExprNode boxedAvdev(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2075
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
Definition: ExprNode.h:2111
TableExprNode runningMax(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1991
TableExprNode strlength(const TableExprNode &node)
String functions on scalars or arrays.
Definition: ExprNode.h:1639
LatticeExprNode any(const LatticeExprNode &expr)
Functions operating on a logical expression resulting in a scalar; Functions "any" (are any pixels "T...
TableExprNode boxedMedian(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2087
friend TableExprNode isNaN(const TableExprNode &node)
Function to test if a scalar or array is NaN (not-a-number).
Definition: ExprNode.h:1798
Array< Bool > getArrayBool(const TableExprId &id) const
Definition: ExprNode.h:1283
LatticeExprNode floor(const LatticeExprNode &expr)
TableExprNode arrayMask(const TableExprNode &array)
Get the mask of a masked array.
Definition: ExprNode.h:2122
MArray< Int64 > getIntAS(const TableExprId &id) const
Definition: ExprNode.h:1297
TableExprNode cones(const TableExprNode &sourcePos, const TableExprNode &cones)
Cone search; test if the position of a source is inside a cone.
Definition: ExprNode.h:1451
TableExprNode boolean(const TableExprNode &node)
Convert numeric or string value to bool (0, no, false, - means false)
Definition: ExprNode.h:1608
friend TableExprNode arrayFlatten(const TableExprNode &array)
Flatten a masked array (get unmasked elements).
Definition: ExprNode.h:2127
DComplex getDComplex(const TableExprId &id) const
Definition: ExprNode.h:1277
friend TableExprNode log10(const TableExprNode &node)
Definition: ExprNode.h:1506
static TableExprNode newRowidNode(const Table &table)
Create rowid() function node.
LatticeExprNode cos(const LatticeExprNode &expr)
MArray< Double > getDoubleAS(const TableExprId &id) const
Definition: ExprNode.h:1299
ValueType valueType() const
Get the value type.
Definition: ExprNodeRep.h:710
for any array returning Int scalar
Definition: ExprFuncNode.h:216
for any array returning Int array
Definition: ExprFuncNode.h:219
for Int, Double, Bool or String returning Int (using floor)
Definition: ExprFuncNode.h:116
TableExprNode rtrim(const TableExprNode &node)
Definition: ExprNode.h:1768
friend TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1856
MArray< MVTime > getDateAS(const TableExprId &id) const
Definition: ExprNode.h:1305
TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1663
friend TableExprNode operator*(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1342
friend TableExprNode boolean(const TableExprNode &node)
Convert numeric or string value to bool (0, no, false, - means false)
Definition: ExprNode.h:1608
LatticeExprNode operator>=(const LatticeExprNode &left, const LatticeExprNode &right)
virtual void applySelection(const Vector< uInt > &rownrs)
Re-create the column object for a selection of rows.
void ranges(Block< TableExprRange > &)
Convert the tree to a number of range vectors which at least select the same things.
Definition: ExprNode.h:1213
virtual Array< Int > getColumnInt(const Vector< uInt > &rownrs)
friend TableExprNode tan(const TableExprNode &node)
Definition: ExprNode.h:1580
TENShPtr node_p
The actual (counted referenced) representation of a node.
Definition: ExprNode.h:1208
Array< String > getColumnString(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1328
defines physical units
Definition: Unit.h:189
LatticeExprNode conj(const LatticeExprNode &expr)
Array< Bool > getColumnBool(const Vector< uInt > &rownrs) const
Get the value of the expression evaluated for the entire column.
Definition: ExprNode.h:1308
friend TableExprNode asin(const TableExprNode &node)
Transcendental functions applied to to nodes containing scalars or arrays with double values...
Definition: ExprNode.h:1544
Array< MVTime > getArrayDate(const TableExprId &id) const
Definition: ExprNode.h:1293
virtual MArray< Double > getArrayDouble(const TableExprId &id)
friend TableExprNode stddev(const TableExprNode &array)
Definition: ExprNode.h:1846
friend TableExprNode operator||(const TableExprNode &left, const TableExprNode &right)
friend TableExprNode rtrim(const TableExprNode &node)
Definition: ExprNode.h:1768
friend TableExprNode avdevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1936
TENShPtr newModulo(const TENShPtr &right) const
const Unit & unit() const
Get the unit of the expression.
Definition: ExprNode.h:967
virtual Double getDouble(const TableExprId &id)
~TableExprNode()
The destructor deletes all the underlying TableExprNode objects,.
for any type returning array of that type
Definition: ExprFuncNode.h:202
for Int, Double or DComplex returning Int, Double or Complex
Definition: ExprFuncNode.h:102
TableExprNode & operator=(const TableExprNode &)
Assignment (reference semantics).
friend TableExprNode runningStddev(const TableExprNode &array)
LatticeExprNode nfalse(const LatticeExprNode &expr)
TableExprNode operator!() const
Unary NOT-operator on boolean TableExprNode&#39;s.
friend TableExprNode integer(const TableExprNode &node)
Convert double, bool, or string to int (using floor).
Definition: ExprNode.h:1604
friend TableExprNode ntrue(const TableExprNode &array)
Definition: ExprNode.h:1880
friend TableExprNode products(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1894
void disableApplySelection()
Do not apply the selection.
Definition: ExprNode.h:958
Float pow(Float f1, Float f2)
Definition: math.h:90
special function resembling if statement
Definition: ExprFuncNode.h:264
friend TableExprNode exp(const TableExprNode &node)
Definition: ExprNode.h:1498
for Double or DComplex returning Double
Definition: ExprFuncNode.h:114
TableExprNode medians(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1948
friend TableExprNode sqrt(const TableExprNode &node)
Definition: ExprNode.h:1532
TableExprNode sumSquares(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1900
LatticeExprNode tanh(const LatticeExprNode &expr)
friend TableExprNode mjd(const TableExprNode &node)
Definition: ExprNode.h:1683
TENShPtr newBitOr(const TENShPtr &right) const
TableExprNode ntrues(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1973
for Int, Double or DComplex array returning Bool
Definition: ExprFuncNode.h:207
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
TableExprNode fractiles(const TableExprNode &array, const TableExprNode &fraction, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1954
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode boxedAny(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2093
LatticeExprNode avdev(const LatticeExprNode &expr)
friend TableExprNode runningAll(const TableExprNode &array)
TableExprNode isInf(const TableExprNode &node)
Definition: ExprNode.h:1802
const Array< T > & array() const
Get access to the array.
Definition: MArray.h:153
friend TableExprNode mins(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1906
TENShPtr newMinus(const TENShPtr &right) const
TableExprNode arrayFlatten(const TableExprNode &array)
Flatten a masked array (get unmasked elements).
Definition: ExprNode.h:2127
TENShPtr newEQ(const TENShPtr &right) const
for Int, Double or DComplex returning Double or Complex
Definition: ExprFuncNode.h:91
friend TableExprNode arrayData(const TableExprNode &array)
Get the data array of a masked array.
Definition: ExprNode.h:2117
LatticeExprNode replace(const LatticeExprNode &arg1, const LatticeExprNode &arg2)
This function replaces every masked-off element in the first argument with the corresponding element ...
TableExprNode useUnit(const Unit &unit) const
Use a unit for the given TableExprNode.
for Int, or Double or Complex returning Bool (2 is with default tolerance)
Definition: ExprFuncNode.h:86
friend TableExprNode alls(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1967
friend TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:2163
static TableExprNode newRownrNode(const Table &table, uInt origin)
Create rownumber() function node.
friend TableExprNode upcase(const TableExprNode &node)
Definition: ExprNode.h:1644
double Double
Definition: aipstype.h:55
TableExprNode cdate(const TableExprNode &node)
Definition: ExprNode.h:1721
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
Regular expression class.
Definition: Regex.h:198
return angles as hms/dms strings
Definition: ExprFuncNode.h:256
TableExprNode arrayData(const TableExprNode &array)
Get the data array of a masked array.
Definition: ExprNode.h:2117
friend TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1527
TableExprNode trim(const TableExprNode &node)
Definition: ExprNode.h:1760
Class with static members defining the TaQL style.
Definition: TaQLStyle.h:64
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
friend TableExprNode max(const TableExprNode &a, const TableExprNode &b)
Definition: ExprNode.h:1592
LatticeExprNode operator<=(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode operator!=(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1377
String toString(const SubScanKey &subScanKey)
void get(const TableExprId &id, Bool &value) const
Get a value for this node in the given row.
Definition: ExprNode.h:1221
friend TableExprNode transpose(const TableExprNode &array)
Transpose all axes of a (masked) array.
Definition: ExprNode.h:2132
Bool isScalar() const
Is the expression a scalar?
Definition: ExprNode.h:981
for Int, Double or Complex array returning the same
Definition: ExprFuncNode.h:133
LatticeExprNode formComplex(const LatticeExprNode &left, const LatticeExprNode &right)
Form a complex number from two real numbers.
TableExprNode boxedAll(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2099
LatticeExprNode iif(const LatticeExprNode &condition, const LatticeExprNode &arg1, const LatticeExprNode &arg2)
Function resembling the ternary ?: construct in C++.
LatticeExprNode nelements(const LatticeExprNode &expr)
1-argument function to get the number of elements in a lattice.
friend TableExprNode cmonth(const TableExprNode &node)
Definition: ExprNode.h:1703
virtual Array< String > getColumnString(const Vector< uInt > &rownrs)
uInt nrow() const
Get the number of rows in the table associated with this expression.
Definition: ExprNode.h:987
friend TableExprNode operator/(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1347
friend TableExprNode atan2(const TableExprNode &y, const TableExprNode &x)
Definition: ExprNode.h:1552
friend TableExprNode pow(const TableExprNode &x, const TableExprNode &exp)
Definition: ExprNode.h:1510
TableExprNode anys(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1961
TableExprNode boxedMax(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2051
LatticeExprNode sign(const LatticeExprNode &expr)
LatticeExprNode sqrt(const LatticeExprNode &expr)
friend TableExprNode stddevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1930
TableExprNode products(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1894
friend TableExprNode operator%(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1352
friend TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1687
LatticeExprNode tan(const LatticeExprNode &expr)
friend TableExprNode sumSquare(const TableExprNode &array)
Definition: ExprNode.h:1831
for Int or Double returning Int or Double
Definition: ExprFuncNode.h:125
TableExprNode isFinite(const TableExprNode &node)
Function to test if a scalar or array is finite.
Definition: ExprNode.h:1806
friend TableExprNode round(const TableExprNode &node)
Definition: ExprNode.h:1560
friend TableExprNode operator==(const TableExprNode &left, const TableExprNode &right)
Comparison operators.
Definition: ExprNode.h:1372
TableExprNode runningAny(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2033
friend TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition: ExprNode.h:2105
LatticeExprNode atan(const LatticeExprNode &expr)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
TableExprNode in(const TableExprNode &array, const TaQLStyle &=TaQLStyle(0)) const
The IN operator to test if a value is contained in an array or set.
Definition: ExprNode.h:1402
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
TableExprNode upcase(const TableExprNode &node)
Definition: ExprNode.h:1644
friend TableExprNode operator &&(const TableExprNode &left, const TableExprNode &right)
Logical operators to combine boolean TableExprNode&#39;s.
TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1527
LatticeExprNode stddev(const LatticeExprNode &expr)
TableExprNode runningMedian(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2027
TableExprNode angdistx(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance as above, but only pair-wise enties are used if both arguments are arrays...
Definition: ExprNode.h:1445
virtual void ranges(Block< TableExprRange > &)
Convert the tree to a number of range vectors which at least select the same things.
static std::vector< TENShPtr > convertBlockTEN(Block< TableExprNode > &nodes)
convert Block of TableExprNode to vector of TENShPtr.
friend TableExprNode maxs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1912
for DComplex or String returning DComplex
Definition: ExprFuncNode.h:131
LatticeExprNode round(const LatticeExprNode &expr)
friend TableExprNode operator>(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1382
float Float
Definition: aipstype.h:54
TableExprNode runningStddev(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2009
friend TableExprNode sqlpattern(const TableExprNode &node)
Definition: ExprNode.h:1668
return angles as hms strings
Definition: ExprFuncNode.h:252
TableExprNode substr(const TableExprNode &str, const TableExprNode &pos)
Definition: ExprNode.h:1772
friend TableExprNode acos(const TableExprNode &node)
Definition: ExprNode.h:1540
const Unit & unit() const
Get the unit.
Definition: ExprNodeRep.h:730
friend TableExprNode runningAvdev(const TableExprNode &array)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual void show(ostream &, uInt indent) const
Show the expression tree.
friend TableExprNode ltrim(const TableExprNode &node)
Definition: ExprNode.h:1764
virtual Bool getBool(const TableExprId &id)
Get a scalar value for this node in the given row.
Bool getBool(const TableExprId &id) const
Definition: ExprNode.h:1271
TableExprNode sqlpattern(const TableExprNode &node)
Definition: ExprNode.h:1668
friend TableExprNode anyCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The result is always a Bool scalar telling if any cone contains the source.
Definition: ExprNode.h:1457
DataType dataType() const
Get the data type of the expression.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:2163
LatticeExprNode operator &&(const LatticeExprNode &left, const LatticeExprNode &right)
Logical binary operators.
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:182
LatticeExprNode operator>(const LatticeExprNode &left, const LatticeExprNode &right)
Array< DComplex > getArrayDComplex(const TableExprId &id) const
Definition: ExprNode.h:1289
static TableExprNode newColumnNode(const Table &tab, const String &name, const Vector< String > &fieldNames)
Create a column node on behalf of the Table class.
TENShPtr newPlus(const TENShPtr &right) const
Construct a new node for the given operation.
friend TableExprNode conj(const TableExprNode &node)
The complex conjugate of a complex node.
Definition: ExprNode.h:1612
Array< Int > getColumnInt(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1316
TableExprNode cmonth(const TableExprNode &node)
Definition: ExprNode.h:1703
TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1362
friend TableExprNode runningMean(const TableExprNode &array)
LatticeExprNode atan2(const LatticeExprNode &left, const LatticeExprNode &right)
Numerical 2-argument functions.
TableExprNode integer(const TableExprNode &node)
Convert double, bool, or string to int (using floor).
Definition: ExprNode.h:1604
friend TableExprNode week(const TableExprNode &node)
Definition: ExprNode.h:1752
TableExprNode runningMean(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1997
TableExprNode findCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The sourcePos can contain multiple sources.
Definition: ExprNode.h:1463
friend TableExprNode arrayMask(const TableExprNode &array)
Get the mask of a masked array.
Definition: ExprNode.h:2122
friend TableExprNode fractile(const TableExprNode &array, const TableExprNode &fraction)
Definition: ExprNode.h:1866
virtual void disableApplySelection()
Do not apply the selection.
TableExprNode boxedMean(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2057
DataType getColumnDataType() const
Get the data type for doing a getColumn on the expression.
virtual Array< Complex > getColumnComplex(const Vector< uInt > &rownrs)
simple 1-D array
Definition: ArrayIO.h:47
friend TableExprNode avdev(const TableExprNode &array)
Definition: ExprNode.h:1851
TableExprNode nfalses(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1979
friend TableExprNode strlength(const TableExprNode &node)
String functions on scalars or arrays.
Definition: ExprNode.h:1639
TableExprNode boxedVariance(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2063
friend TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1659
friend TableExprNode weekday(const TableExprNode &node)
Definition: ExprNode.h:1708
TableExprNode angdist(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance between positions.
Definition: ExprNode.h:1439
for Int or Double array returning Int or Double
Definition: ExprFuncNode.h:146
MArray< Bool > getBoolAS(const TableExprId &id)
Get a value as an array, even it it is a scalar.
TableExprNode isdefined(const TableExprNode &array)
Function operating on a field resulting in a bool scalar.
Definition: ExprNode.h:2151
TableExprNode boxedRms(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2081
MVTime getDate(const TableExprId &id) const
Definition: ExprNode.h:1279
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1659
LatticeExprNode fmod(const LatticeExprNode &left, const LatticeExprNode &right)
MArray< Bool > getBoolAS(const TableExprId &id) const
Get a value as an array, even it it is a scalar.
Definition: ExprNode.h:1295
TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1699
friend TableExprNode nfalse(const TableExprNode &array)
Definition: ExprNode.h:1884
The identification of a TaQL selection subject.
Definition: TableExprId.h:97
LatticeExprNode asin(const LatticeExprNode &expr)
TENShPtr newDivide(const TENShPtr &right) const
Array< uShort > getColumnuShort(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1314
friend TableExprNode ctodt(const TableExprNode &node)
Definition: ExprNode.h:1717
TableExprNode cdow(const TableExprNode &node)
Definition: ExprNode.h:1713
TableExprNode boxedMin(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2045
LatticeExprNode mean(const LatticeExprNode &expr)
Array< Double > getColumnDouble(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1322
virtual String getString(const TableExprId &id)
Table & table()
Get table.
Definition: ExprNodeRep.h:748
friend TableExprNode mean(const TableExprNode &array)
Definition: ExprNode.h:1836
TENShPtr newIN(const TENShPtr &right, const TaQLStyle &) const
TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1856
TableExprNode runningAvdev(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2015
LatticeExprNode sinh(const LatticeExprNode &expr)
for Int, Double or DComplex returning Int or Double
Definition: ExprFuncNode.h:107
Double getDouble(const TableExprId &id) const
Definition: ExprNode.h:1275
Array< uInt > getColumnuInt(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1318
Class to handle a Regex or StringDistance.
Definition: ExprNodeRep.h:81
LatticeExprNode acos(const LatticeExprNode &expr)
TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1522
virtual TaqlRegex getRegex(const TableExprId &id)
TableExprNode runningMin(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Functions operating for each element on a box around that element.
Definition: ExprNode.h:1985
virtual MArray< String > getArrayString(const TableExprId &id)
friend TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1522
for Bool array returning Bool
Definition: ExprFuncNode.h:184
static TableExprNode newUDFNode(const String &name, const TableExprNodeSet &set, const Table &table, const TaQLStyle &=TaQLStyle(0))
Create a user defined function node.
TableExprNode sumSquare(const TableExprNode &array)
Definition: ExprNode.h:1831
TableExprNode capitalize(const TableExprNode &node)
Definition: ExprNode.h:1654
friend TableExprNode nfalses(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1979
LatticeExprNode operator-(const LatticeExprNode &expr)
TableExprNode operator~() const
Unary bitwise negate-operator on integer TableExprNode&#39;s.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
friend TableExprNode cdow(const TableExprNode &node)
Definition: ExprNode.h:1713
static TableRecord * findLastKeyRec(const TableRecord &keyset, const Vector< String > &fieldNames, String &fullName)
Handle all field names except the last one.
const Record & attributes() const
Get the attributes of the expression.
Definition: ExprNode.h:971
TableExprNode nearAbs(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1426
static TableExprNode newArrayPartNode(const TableExprNode &arrayNode, const TableExprNodeSet &indices, const TaQLStyle &=TaQLStyle(0))
Create ArrayElement node for the given array with the given index.
Array< Complex > getColumnComplex(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1324
TableExprNode stddevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1930
TableExprNode datetime(const TableExprNode &node)
Functions for date-values.
Definition: ExprNode.h:1673
T norm(const TableVector< T > &tv)
Definition: TabVecMath.h:414
LatticeExprNode operator^(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode operator<(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode isNaN(const LatticeExprNode &expr)
Test if a value is a NaN.
TableExprNode operator &(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1357
TENShPtr newOR(const TENShPtr &right) const
friend TableExprNode medians(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1948
Class to deal with Levensthein distance of strings.
TableExprNode avdevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1936
MArray< DComplex > getDComplexAS(const TableExprId &id)
TableExprNode mjdtodate(const TableExprNode &node)
Definition: ExprNode.h:1678
friend TableExprNode iif(const TableExprNode &condition, const TableExprNode &arg1, const TableExprNode &arg2)
Function resembling the ternary ?: construct in C++.
Definition: ExprNode.h:2167
TENShPtr newGE(const TENShPtr &right) const
friend TableExprNode arg(const TableExprNode &node)
The arg (i.e.
Definition: ExprNode.h:1620
TableExprNode ctodt(const TableExprNode &node)
Definition: ExprNode.h:1717
static void throwInvDT(const String &message)
Throw invalid data type exception.
friend TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1756
virtual DComplex getDComplex(const TableExprId &id)
TENShPtr newNE(const TENShPtr &right) const
virtual Array< uChar > getColumnuChar(const Vector< uInt > &rownrs)
LatticeExprNode variance(const LatticeExprNode &expr)
friend TableExprNode min(const TableExprNode &a, const TableExprNode &b)
Minimum or maximum of 2 nodes.
Definition: ExprNode.h:1588
LatticeExprNode ceil(const LatticeExprNode &expr)
friend TableExprNode imag(const TableExprNode &node)
The imaginary part of a complex node.
Definition: ExprNode.h:1600
for Int or Double array returning Double
Definition: ExprFuncNode.h:155
String getString(const TableExprId &id) const
Definition: ExprNode.h:1281
Array< Float > getColumnFloat(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1320
Class to handle date/time type conversions and I/O.
Definition: MVTime.h:266
TableExprNode rmss(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1942
bool operator!=(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition: Allocator.h:132
friend TableExprNode sinh(const TableExprNode &node)
Definition: ExprNode.h:1518
TableExprNode ctime(const TableExprNode &node)
Definition: ExprNode.h:1725
TableExprNode hms(const TableExprNode &node)
Functions for angle-values.
Definition: ExprNode.h:1729
LatticeExprNode all(const LatticeExprNode &expr)
friend TableExprNode near(const TableExprNode &left, const TableExprNode &right)
Functions to return whether a value is "relatively" near another.
Definition: ExprNode.h:1413
friend TableExprNode diagonal(const TableExprNode &array)
Get the diagonal of a (masked) array; If the array is not a Matrix, it will take the diagonals of the...
Definition: ExprNode.h:2145
friend TableExprNode all(const TableExprNode &array)
Definition: ExprNode.h:1876
TENShPtr newAND(const TENShPtr &right) const
friend TableExprNode capitalize(const TableExprNode &node)
Definition: ExprNode.h:1654
Int64 getInt(const TableExprId &id) const
Definition: ExprNode.h:1273
TableExprNode diagonal(const TableExprNode &array)
Get the diagonal of a (masked) array; If the array is not a Matrix, it will take the diagonals of the...
Definition: ExprNode.h:2145
friend TableExprNode isdefined(const TableExprNode &array)
Function operating on a field resulting in a bool scalar.
Definition: ExprNode.h:2151
friend TableExprNode trim(const TableExprNode &node)
Definition: ExprNode.h:1760
friend TableExprNode anys(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1961
Abstract base class for a node having 0, 1, or 2 child nodes.
Definition: ExprNodeRep.h:557
friend TableExprNode operator^(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1367
friend TableExprNode operator>=(const TableExprNode &left, const TableExprNode &right)
Not defined for Bool.
Definition: ExprNode.h:1387
TableExprNode operator()(const TableExprNodeSet &indices)
Slicing in a node containing an array.
Definition: ExprNode.h:1407
TableExprNode sums(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
The partial version of the functions above.
Definition: ExprNode.h:1888
LatticeExprNode operator||(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode formComplex(const TableExprNode &real, const TableExprNode &imag)
Form a complex number from two Doubles.
Definition: ExprNode.h:1628
this file contains all the compiler specific defines
Definition: mainpage.dox:28
MVBaseline operator*(const RotMatrix &left, const MVBaseline &right)
Rotate a Baseline vector with rotation matrix and other multiplications.
LatticeExprNode cosh(const LatticeExprNode &expr)
friend TableExprNode fractiles(const TableExprNode &array, const TableExprNode &fraction, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1954
virtual Array< Short > getColumnShort(const Vector< uInt > &rownrs)
friend TableExprNode sumSquares(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1900
TableExprNode week(const TableExprNode &node)
Definition: ExprNode.h:1752
TableExprNode hdms(const TableExprNode &node)
Definition: ExprNode.h:1737
LatticeExprNode real(const LatticeExprNode &expr)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
for Int, Double, DComplex, Bool or String returning Double
Definition: ExprFuncNode.h:112
static TableExprNode newConeNode(TableExprFuncNode::FunctionType, const TableExprNodeSet &set, uInt origin=0)
Create cone function node of the given type with the given arguments.
unsigned int uInt
Definition: aipstype.h:51
const TENShPtr & getRep() const
returns const pointer to the underlying TableExprNodeRep object.
Definition: ExprNode.h:2180
const Table & table() const
Get table.
Definition: ExprNode.h:1217
friend TableExprNode sign(const TableExprNode &node)
Definition: ExprNode.h:1556
friend TableExprNode sums(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
The partial version of the functions above.
Definition: ExprNode.h:1888
TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1687
friend TableExprNode variances(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1924
TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1616
friend TableExprNode product(const TableExprNode &array)
Definition: ExprNode.h:1826