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/ExprConeNode.h>
37 #include <casacore/tables/TaQL/TaQLStyle.h>
38 #include <casacore/tables/TaQL/MArray.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 TableRecord;
51 class TableExprNodeSet;
52 template<class T> class Block;
53 template<class T> class Array;
54 template<class T> class MArray;
55 class TableExprNode;
56 
57 
58 // Define all global functions operating on a TableExprNode.
59 // <group name=GlobalTableExprNode>
60 
61  //# Define the operations we allow.
62  //# Note that the arguments are defined as const. This is necessary
63  //# because the compiler generates temporaries when converting a constant
64  //# to a TableExprNode using the constructors. Temporaries has to be const.
65  //# However, we have to delete created nodes, so lnode_p and rnode_p
66  //# cannot be const. The const arguments are casted to a non-const in
67  //# the function fill which calls the non-const function simplify.
68 
69  // Arithmetic operators for numeric TableExprNode's.
70  // <group>
71  // + is also defined for strings (means concatenation).
73  const TableExprNode& right);
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);
88  // </group>
89 
90  // Comparison operators.
91  // <group>
93  const TableExprNode& right);
95  const TableExprNode& right);
96  // Not defined for Bool.
97  // <group>
99  const TableExprNode& right);
101  const TableExprNode& right);
103  const TableExprNode& right);
105  const TableExprNode& right);
106  // </group>
107  // </group>
108 
109  // Logical operators to combine boolean TableExprNode's.
110  // A null TableExprNode object is ignored, so it is possible to
111  // build up a full expression gradually.
112  // <group>
114  const TableExprNode& right);
116  const TableExprNode& right);
117  // </group>
118 
119  // Functions to return whether a value is "relatively" near another.
120  // Returns <src> tol > abs(val2 - val1)/max(abs(val1),(val2))</src>.
121  // If tol <= 0, returns val1 == val2. If either val is 0.0, takes
122  // care of area around the minimum number that can be represented.
123  // <br>The nearAbs functions return whether a value is "absolutely" near
124  // another. Returns <src> tol > abs(val2 - val1)</src>.
125  // Default tolerance is 1.0e-13.
126  // They operate on scalars and arrays.
127  // <group>
128  TableExprNode near (const TableExprNode& left,
129  const TableExprNode& right);
130  TableExprNode near (const TableExprNode& left,
131  const TableExprNode& right,
132  const TableExprNode& tolerance);
133  TableExprNode nearAbs (const TableExprNode& left,
134  const TableExprNode& right);
135  TableExprNode nearAbs (const TableExprNode& left,
136  const TableExprNode& right,
137  const TableExprNode& tolerance);
138  // </group>
139 
140  // Angular distance between positions.
141  // Both arguments have to be arrays. If both arrays contain 2 values
142  // (ra and dec), the result is a scalar.
143  // Otherwise the arrays have to contain a multiple of 2 values and the
144  // result is a 2-dim array giving the distance of each position in the
145  // first array to each position in the second array.
146  TableExprNode angdist (const TableExprNode& pos1,
147  const TableExprNode& pos2);
148 
149  // Angular distance as above, but only pair-wise enties are used if
150  // both arguments are arrays.
151  TableExprNode angdistx (const TableExprNode& pos1,
152  const TableExprNode& pos2);
153 
154  // Cone search; test if the position of a source is inside a cone.
155  // <br>Argument <src>sourcePos</src> must be a double array
156  // containing two values (ra and dec of source) in radians.
157  // <br>Argument <src>cones</src> must be a double array
158  // specifying the position of the cone centers and radii in radians.
159  // So the array must contain three values (ra,dec,radius)
160  // or a multiple of it.
161  // <group>
162  // The result is a bool array telling for each cone if it contains the
163  // source. If there is only one cone, the result is a scalar.
164  TableExprNode cones (const TableExprNode& sourcePos,
165  const TableExprNode& cones);
166  // The result is always a Bool scalar telling if any cone contains
167  // the source.
168  TableExprNode anyCone (const TableExprNode& sourcePos,
169  const TableExprNode& cones);
170  // The sourcePos can contain multiple sources.
171  // The result is a double array giving the index of the first
172  // cone containing the corresponding source.
173  // If there is one source, the result is a double scalar.
174  TableExprNode findCone (const TableExprNode& sourcePos,
175  const TableExprNode& cones);
176  // </group>
177 
178  // Cone search as above.
179  // However, the cone positions and radii are specified separately
180  // and (virtually) a larger array containing every combination of
181  // position/radius is formed.
182  // <group>
183  TableExprNode cones (const TableExprNode& sourcePos,
184  const TableExprNode& conePos,
185  const TableExprNode& radii);
186  TableExprNode anyCone (const TableExprNode& sourcePos,
187  const TableExprNode& conePos,
188  const TableExprNode& radii);
189  TableExprNode findCone (const TableExprNode& sourcePos,
190  const TableExprNode& conePos,
191  const TableExprNode& radii);
192  // </group>
193 
194  // Transcendental functions that can be applied to essentially all numeric
195  // nodes containing scalars or arrays.
196  // <group>
197  TableExprNode sin (const TableExprNode& node);
198  TableExprNode sinh (const TableExprNode& node);
199  TableExprNode cos (const TableExprNode& node);
200  TableExprNode cosh (const TableExprNode& node);
201  TableExprNode exp (const TableExprNode& node);
202  TableExprNode log (const TableExprNode& node);
203  TableExprNode log10 (const TableExprNode& node);
204  TableExprNode pow (const TableExprNode& x, const TableExprNode& exp);
205  TableExprNode square (const TableExprNode& node);
206  TableExprNode cube (const TableExprNode& node);
207  TableExprNode sqrt (const TableExprNode& node);
208  TableExprNode norm (const TableExprNode& node);
209  // </group>
210 
211  // Transcendental functions applied to to nodes containing scalars or
212  // arrays with double values.
213  // They are invalid for Complex nodes.
214  // <group>
215  TableExprNode asin (const TableExprNode& node);
216  TableExprNode acos (const TableExprNode& node);
217  TableExprNode atan (const TableExprNode& node);
219  const TableExprNode& x);
220  TableExprNode tan (const TableExprNode& node);
221  TableExprNode tanh (const TableExprNode& node);
222  TableExprNode sign (const TableExprNode& node);
223  TableExprNode round (const TableExprNode& node);
224  TableExprNode ceil (const TableExprNode& node);
225  TableExprNode abs (const TableExprNode& node);
226  TableExprNode floor (const TableExprNode& node);
227  TableExprNode fmod (const TableExprNode& x,
228  const TableExprNode& y);
229  // </group>
230 
231  // String functions on scalars or arrays.
232  // <group>
233  TableExprNode strlength (const TableExprNode& node);
234  TableExprNode upcase (const TableExprNode& node);
235  TableExprNode downcase (const TableExprNode& node);
237  TableExprNode trim (const TableExprNode& node);
238  TableExprNode ltrim (const TableExprNode& node);
239  TableExprNode rtrim (const TableExprNode& node);
240  TableExprNode substr (const TableExprNode& str,
241  const TableExprNode& pos);
242  TableExprNode substr (const TableExprNode& str,
243  const TableExprNode& pos,
244  const TableExprNode& npos);
245  TableExprNode replace (const TableExprNode& str,
246  const TableExprNode& patt);
247  TableExprNode replace (const TableExprNode& str,
248  const TableExprNode& patt,
249  const TableExprNode& repl);
250  // </group>
251 
252  // Functions for regular expression matching and
253  // pattern matching. Defined for scalars and arrays.
254  // <br><src>pattern</src> is for a file name like pattern.
255  // <br><src>sqlpattern</src> is for an SQL like pattern.
256  // <group>
257  TableExprNode regex (const TableExprNode& node);
258  TableExprNode pattern (const TableExprNode& node);
259  TableExprNode sqlpattern (const TableExprNode& node);
260  // </group>
261 
262  // Functions for date-values. Defined for scalars and arrays.
263  //# Note, ctod is called ctodt, because Mac OS-X defines a macro
264  //# ctod in param.h
265  // <group>
266  TableExprNode datetime (const TableExprNode& node);
267  TableExprNode mjdtodate (const TableExprNode& node);
268  TableExprNode mjd (const TableExprNode& node);
269  TableExprNode date (const TableExprNode& node);
270  TableExprNode year (const TableExprNode& node);
271  TableExprNode month (const TableExprNode& node);
272  TableExprNode day (const TableExprNode& node);
273  TableExprNode cmonth (const TableExprNode& node);
274  TableExprNode weekday (const TableExprNode& node);
275  TableExprNode cdow (const TableExprNode& node);
276  TableExprNode ctodt (const TableExprNode& node);
277  TableExprNode cdate (const TableExprNode& node);
278  TableExprNode ctime (const TableExprNode& node);
279  TableExprNode week (const TableExprNode& node);
280  TableExprNode time (const TableExprNode& node);
281  // </group>
282 
283  // Functions for angle-values. Defined for scalars and arrays.
284  // dhms converts pairs of values to hms and dms and only works for arrays.
285  // <group>
286  TableExprNode hms (const TableExprNode& node);
287  TableExprNode dms (const TableExprNode& node);
288  TableExprNode hdms (const TableExprNode& node);
289  // </group>
290 
291  // Function to convert any value to a string.
292  // See TaQL note 199 for possible format values.
293  // <group>
294  TableExprNode toString (const TableExprNode& node);
295  TableExprNode toString (const TableExprNode& node,
296  const TableExprNode& format);
297  // </group>
298 
299  // Function to test if a scalar or array is NaN (not-a-number).
300  // It results in a Bool scalar or array.
301  TableExprNode isNaN (const TableExprNode& node);
302 
303  // Function to test if a scalar or array is finite.
304  // It results in a Bool scalar or array.
305  TableExprNode isFinite (const TableExprNode& node);
306 
307  // Minimum or maximum of 2 nodes.
308  // Makes sense for numeric and String values. For Complex values
309  // the norm is compared.
310  // One or both arguments can be scalar or array.
311  // <group>
312  TableExprNode min (const TableExprNode& a, const TableExprNode& b);
313  TableExprNode max (const TableExprNode& a, const TableExprNode& b);
314  // </group>
315 
316  // The complex conjugate of a complex node.
317  // Defined for scalars and arrays.
318  TableExprNode conj (const TableExprNode& node);
319 
320  // The real part of a complex node.
321  // Defined for scalars and arrays.
322  TableExprNode real (const TableExprNode& node);
323 
324  // The imaginary part of a complex node.
325  // Defined for scalars and arrays.
326  TableExprNode imag (const TableExprNode& node);
327 
328  // Convert double, bool, or string to int (using floor).
329  TableExprNode integer (const TableExprNode& node);
330 
331  // Convert numeric or string value to bool (0, no, false, - means false)
332  TableExprNode boolean (const TableExprNode& node);
333 
334  // The amplitude (i.e. sqrt(re*re + im*im)) of a complex node.
335  // This is a synonym for function abs.
336  // Defined for scalars and arrays.
337  TableExprNode amplitude (const TableExprNode& node);
338 
339  // The phase (i.e. atan2(im, re)) of a complex node.
340  // This is a synonym for function arg.
341  // Defined for scalars and arrays.
342  TableExprNode phase (const TableExprNode& node);
343 
344  // The arg (i.e. atan2(im, re)) of a complex node.
345  // Defined for scalars and arrays.
346  TableExprNode arg (const TableExprNode& node);
347 
348  // Form a complex number from two Doubles.
349  // One or both arguments can be scalar or array.
351  const TableExprNode& imag);
352  // Form a complex number from a string.
353  // Defined for scalars and arrays.
355 
356  // Functions operating on a Double or Complex scalar or array resulting in
357  // a scalar with the same data type.
358  // <group>
362  // </group>
363 
364  // Functions operating on a Double scalar or array resulting in
365  // a Double scalar.
366  // <group>
376  const TableExprNode& fraction);
377  // </group>
378 
379  // <group>
384  // </group>
385 
386  // The partial version of the functions above.
387  // They are applied to the array subsets defined by the axes in the set
388  // using the partialXXX functions in ArrayMath.
389  // The axes must be 0-relative.
390  // <group>
392  const TableExprNodeSet& collapseAxes);
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 TableExprNode& fraction,
415  const TableExprNodeSet& collapseAxes);
417  const TableExprNodeSet& collapseAxes);
419  const TableExprNodeSet& collapseAxes);
421  const TableExprNodeSet& collapseAxes);
423  const TableExprNodeSet& collapseAxes);
424  // </group>
425 
426  // Functions operating for each element on a box around that element.
427  // The elements at the edges (where no full box can be made) are set to 0.
428  // <group>
430  const TableExprNodeSet& halfBoxWidth);
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);
449  // </group>
450 
451  // Create an array of the given shape and fill it with the values.
452  // The <src>values</src> array is rewound as needed.
453  TableExprNode array (const TableExprNode& values,
454  const TableExprNodeSet& shape);
455 
456  // Form a masked array.
458  const TableExprNode& mask);
459 
460  // Get the data array of a masked array.
462 
463  // Flatten a masked array (get unmasked elements).
465 
466  // Get the mask of a masked array.
467  // If the array has no mask, it return an array with all False values.
469 
470  // Get the diagonal of a (masked) array;
471  // If the array is not a Matrix, it will take the diagonals of the
472  // subarrays given by the two axes in the axes argument. Those
473  // axes have to have the same length (thus each subarray is a Matrix).
474  // If no axes are given, they default to the first two axes.
475  // <br>The <src>diag</src> argument tells which diagonal to take.
476  // 0 is the main diagonal, >0 is above main diagonal, <0 is below.
479  const TableExprNode& firstAxis);
481  const TableExprNode& firstAxis,
482  const TableExprNode& diag);
483 
484  // Transpose all axes of a (masked) array.
486  // Transpose a (masked) array by making the given axes the first axes.
488  const TableExprNode& axes);
489 
490  // Function operating on a field resulting in a bool scalar.
491  // It can be used to test if a column has an array in the current row.
492  // It can also be used to test if a record contains a field.
494 
495  // Functions operating on any scalar or array resulting in a Double scalar.
496  // A scalar has 1 element and dimensionality 0.
497  // <group>
500  // </group>
501 
502  // Function operating on any scalar or array resulting in a Double array
503  // containing the shape. A scalar has shape [1].
505 
506  // Function resembling the ternary <src>?:</src> construct in C++.
507  // The argument "condition" has to be a Bool value.
508  // If an element in "condition" is True, the corresponding element from
509  // "arg1" is taken, otherwise it is taken from "arg2".
510  // The arguments can be scalars or array or any combination.
511  TableExprNode iif (const TableExprNode& condition,
512  const TableExprNode& arg1,
513  const TableExprNode& arg2);
514 // </group>
515 
516 
517 
518 // <summary>
519 // Handle class for a table column expression tree
520 // </summary>
521 
522 // <use visibility=export>
523 
524 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
525 // </reviewed>
526 
527 // <prerequisite>
528 //# Classes you should understand before using this one.
529 // <li> <linkto class=Table>Table</linkto>
530 // <li> Note 199 describing
531 // <a href="../notes/199.html">
532 // TaQL</a>
533 // </prerequisite>
534 
535 // <etymology>
536 // TableExprNode represents a node in the tree reflecting a
537 // table select expression.
538 // </etymology>
539 
540 // <synopsis>
541 // TableExprNode is the class to store a table select expression,
542 // which allows to select rows from the table. The selected rows form
543 // a table which is a view of the original table.
544 // <p>
545 // TableExprNode is a handle class for the counted referenced class
546 // TableExprNodeRep.
547 // Classes (like TableExprNodePlusXX) derived from TableExprNodeRep
548 // hold the individual
549 // nodes in the expression, i.e. the operators and operands. The nodes
550 // form a binary tree reflecting the expression.
551 // E.g. the expression 2*COLUMN results in the node TableExprNodeTimes
552 // with its children TableExprNodeConst and TableExprNodeColumn.
553 // Constant subexpressions (like 2*3) are evaluated immediately and
554 // only the result is stored as a node.
555 // <p>
556 // There are a few TableExprNode constructors taking a constant scalar or array.
557 // In this way constant value are automatically converted to the
558 // appropriate TableExprNodeConst object.
559 // <p>
560 // The derived classes also reflect the data type of the node.
561 // Data types Bool, Double, DComplex and String are used.
562 // Char, uChar, Short, uShort, Int, uInt and float are converted
563 // to Double and Complex to DComplex.
564 // Binary operators +, -, *, /, %, &, }, ^, ==, >=, >, <, <= and != are
565 // recognized. Also &&, ||, parentheses and unary +, -, ~ and ! are recognized.
566 // For strings the binary operator + can also be used.
567 // The operators have the normal C++ precedence.
568 // Furthermore functions (like sin, max, ceil) can be used in an expression.
569 // <br>Operator() can be used to take a slice from an array.
570 // <p>
571 // The Table function col has to be used to create a TableExprNode
572 // object for a column in the table. The Table
573 // <linkto file="Table.h#keycol">operator()</linkto> can be used
574 // the do the actual selection from the top TableExprNode object.
575 // </synopsis>
576 
577 // <example>
578 // <srcblock>
579 // // Select from table X all rows where column RA<5 and where column
580 // // SWITCH is true.
581 // Table table("X");
582 // Table subtable = table(table.col("RA") < 5 && table.col("SWITCH"));
583 //
584 // // Select from that result all rows where the concatenation of
585 // // the strings in columns STR1 and STR2 is equal to the string
586 // // in keyword STRKEY.
587 // Table subsub = subtable(subtable.col("STR1") + subtable.col("STR2")
588 // == subtable.key("STRKEY"));
589 // </srcblock>
590 // </example>
591 
592 // <motivation>
593 // Having TableExprNode as a handle class makes it possible to
594 // handle temporary objects created by the compiler in a smooth way.
595 // TableExprNode and its derivations allow to store an expression
596 // before actually evaluating it. This also allows the classes to
597 // be used by the table expression parser defined in TableParse and
598 // TableGram.
599 //
600 // For each operator a special derived class is implemented.
601 // Another approach could have been to store the operator as
602 // a flag and switch on that. However, that causes extra overhead
603 // and the C++ virtual function mechanism is the designed for
604 // these purposes.
605 // </motivation>
606 
607 // <todo asof="$DATE:$">
608 //# A List of bugs, limitations, extensions or planned refinements.
609 // <li> add operations on arrays
610 // <li> add selection by comparing with a set of values
611 // </todo>
612 
613 
615 {
616  //# Define the next 2 classes as friends to get the node_p.
617  friend class TableExprNodeRep;
618  friend class TableParse;
619 
620  //# Define the operations we allow.
621  //# Note that the arguments are defined as const. This is necessary
622  //# because the compiler generates temporaries when converting a constant
623  //# to a TableExprNode using the constructors. Temporaries has to be const.
624  //# However, we have to delete created nodes, so lnode_p and rnode_p
625  //# cannot be const. The const arguments are casted to a non-const in
626  //# the function fill which calls the non-const function simplify.
627 
628  // Define all global functions as friends.
629  // <group>
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 operator|| (const TableExprNode& left,
661  const TableExprNode& right);
662  friend TableExprNode near (const TableExprNode& left,
663  const TableExprNode& right);
664  friend TableExprNode near (const TableExprNode& left,
665  const TableExprNode& right,
666  const TableExprNode& tolerance);
667  friend TableExprNode nearAbs (const TableExprNode& left,
668  const TableExprNode& right);
669  friend TableExprNode nearAbs (const TableExprNode& left,
670  const TableExprNode& right,
671  const TableExprNode& tolerance);
672  friend TableExprNode angdist (const TableExprNode& pos1,
673  const TableExprNode& pos2);
674  friend TableExprNode cones (const TableExprNode& sourcePos,
675  const TableExprNode& cones);
676  friend TableExprNode anyCone (const TableExprNode& sourcePos,
677  const TableExprNode& cones);
678  friend TableExprNode findCone (const TableExprNode& sourcePos,
679  const TableExprNode& cones);
680  friend TableExprNode cones (const TableExprNode& sourcePos,
681  const TableExprNode& conePos,
682  const TableExprNode& radii);
683  friend TableExprNode anyCone (const TableExprNode& sourcePos,
684  const TableExprNode& conePos,
685  const TableExprNode& radii);
686  friend TableExprNode findCone (const TableExprNode& sourcePos,
687  const TableExprNode& conePos,
688  const TableExprNode& radii);
689  friend TableExprNode sin (const TableExprNode& node);
690  friend TableExprNode sinh (const TableExprNode& node);
691  friend TableExprNode cos (const TableExprNode& node);
692  friend TableExprNode cosh (const TableExprNode& node);
693  friend TableExprNode exp (const TableExprNode& node);
694  friend TableExprNode log (const TableExprNode& node);
695  friend TableExprNode log10 (const TableExprNode& node);
696  friend TableExprNode pow (const TableExprNode& x,
697  const TableExprNode& exp);
698  friend TableExprNode square (const TableExprNode& node);
699  friend TableExprNode cube (const TableExprNode& node);
700  friend TableExprNode sqrt (const TableExprNode& node);
701  friend TableExprNode norm (const TableExprNode& node);
702  friend TableExprNode asin (const TableExprNode& node);
703  friend TableExprNode acos (const TableExprNode& node);
704  friend TableExprNode atan (const TableExprNode& node);
705  friend TableExprNode atan2 (const TableExprNode& y,
706  const TableExprNode& x);
707  friend TableExprNode tan (const TableExprNode& node);
708  friend TableExprNode tanh (const TableExprNode& node);
709  friend TableExprNode sign (const TableExprNode& node);
710  friend TableExprNode round (const TableExprNode& node);
711  friend TableExprNode ceil (const TableExprNode& node);
712  friend TableExprNode abs (const TableExprNode& node);
713  friend TableExprNode floor (const TableExprNode& node);
714  friend TableExprNode fmod (const TableExprNode& x,
715  const TableExprNode& y);
716  friend TableExprNode strlength (const TableExprNode& node);
717  friend TableExprNode upcase (const TableExprNode& node);
718  friend TableExprNode downcase (const TableExprNode& node);
719  friend TableExprNode capitalize(const TableExprNode& node);
720  friend TableExprNode trim (const TableExprNode& node);
721  friend TableExprNode ltrim (const TableExprNode& node);
722  friend TableExprNode rtrim (const TableExprNode& node);
723  friend TableExprNode substr (const TableExprNode& str,
724  const TableExprNode& pos);
725  friend TableExprNode substr (const TableExprNode& str,
726  const TableExprNode& pos,
727  const TableExprNode& npos);
728  friend TableExprNode replace (const TableExprNode& str,
729  const TableExprNode& patt);
730  friend TableExprNode replace (const TableExprNode& str,
731  const TableExprNode& patt,
732  const TableExprNode& repl);
733  friend TableExprNode regex (const TableExprNode& node);
734  friend TableExprNode pattern (const TableExprNode& node);
735  friend TableExprNode sqlpattern(const TableExprNode& node);
736  friend TableExprNode datetime (const TableExprNode& node);
737  friend TableExprNode mjdtodate (const TableExprNode& node);
738  friend TableExprNode mjd (const TableExprNode& node);
739  friend TableExprNode date (const TableExprNode& node);
740  friend TableExprNode year (const TableExprNode& node);
741  friend TableExprNode month (const TableExprNode& node);
742  friend TableExprNode day (const TableExprNode& node);
743  friend TableExprNode cmonth (const TableExprNode& node);
744  friend TableExprNode weekday (const TableExprNode& node);
745  friend TableExprNode cdow (const TableExprNode& node);
746  friend TableExprNode ctodt (const TableExprNode& node);
747  friend TableExprNode cdate (const TableExprNode& node);
748  friend TableExprNode ctime (const TableExprNode& node);
749  friend TableExprNode week (const TableExprNode& node);
750  friend TableExprNode time (const TableExprNode& node);
751  friend TableExprNode isNaN (const TableExprNode& node);
752  friend TableExprNode isFinite (const TableExprNode& node);
753  friend TableExprNode min (const TableExprNode& a, const TableExprNode& b);
754  friend TableExprNode max (const TableExprNode& a, const TableExprNode& b);
755  friend TableExprNode conj (const TableExprNode& node);
756  friend TableExprNode real (const TableExprNode& node);
757  friend TableExprNode imag (const TableExprNode& node);
758  friend TableExprNode integer (const TableExprNode& node);
759  friend TableExprNode boolean (const TableExprNode& node);
760  friend TableExprNode amplitude (const TableExprNode& node);
761  friend TableExprNode phase (const TableExprNode& node);
762  friend TableExprNode arg (const TableExprNode& node);
764  const TableExprNode& imag);
765  friend TableExprNode formComplex (const TableExprNode& node);
766  friend TableExprNode sum (const TableExprNode& array);
767  friend TableExprNode product (const TableExprNode& array);
768  friend TableExprNode sumSquare (const TableExprNode& array);
769  friend TableExprNode min (const TableExprNode& array);
770  friend TableExprNode max (const TableExprNode& array);
771  friend TableExprNode mean (const TableExprNode& array);
772  friend TableExprNode variance (const TableExprNode& array);
773  friend TableExprNode stddev (const TableExprNode& array);
774  friend TableExprNode avdev (const TableExprNode& array);
775  friend TableExprNode rms (const TableExprNode& array);
776  friend TableExprNode median (const TableExprNode& array);
777  friend TableExprNode fractile (const TableExprNode& array,
778  const TableExprNode& fraction);
779  friend TableExprNode any (const TableExprNode& array);
780  friend TableExprNode all (const TableExprNode& array);
781  friend TableExprNode ntrue (const TableExprNode& array);
782  friend TableExprNode nfalse (const TableExprNode& array);
783  friend TableExprNode sums (const TableExprNode& array,
784  const TableExprNodeSet& collapseAxes);
785  friend TableExprNode products (const TableExprNode& array,
786  const TableExprNodeSet& collapseAxes);
788  const TableExprNodeSet& collapseAxes);
789  friend TableExprNode mins (const TableExprNode& array,
790  const TableExprNodeSet& collapseAxes);
791  friend TableExprNode maxs (const TableExprNode& array,
792  const TableExprNodeSet& collapseAxes);
793  friend TableExprNode means (const TableExprNode& array,
794  const TableExprNodeSet& collapseAxes);
796  const TableExprNodeSet& collapseAxes);
797  friend TableExprNode stddevs (const TableExprNode& array,
798  const TableExprNodeSet& collapseAxes);
799  friend TableExprNode avdevs (const TableExprNode& array,
800  const TableExprNodeSet& collapseAxes);
801  friend TableExprNode rmss (const TableExprNode& array,
802  const TableExprNodeSet& collapseAxes);
803  friend TableExprNode medians (const TableExprNode& array,
804  const TableExprNodeSet& collapseAxes);
806  const TableExprNode& fraction,
807  const TableExprNodeSet& collapseAxes);
808  friend TableExprNode anys (const TableExprNode& array,
809  const TableExprNodeSet& collapseAxes);
810  friend TableExprNode alls (const TableExprNode& array,
811  const TableExprNodeSet& collapseAxes);
812  friend TableExprNode ntrues (const TableExprNode& array,
813  const TableExprNodeSet& collapseAxes);
814  friend TableExprNode nfalses (const TableExprNode& array,
815  const TableExprNodeSet& collapseAxes);
826  friend TableExprNode array (const TableExprNode& values,
827  const TableExprNodeSet& shape);
828  friend TableExprNode marray (const TableExprNode& array,
829  const TableExprNode& mask);
830  friend TableExprNode arrayData (const TableExprNode& array);
831  friend TableExprNode arrayMask (const TableExprNode& array);
833  friend TableExprNode transpose (const TableExprNode& array);
835  const TableExprNodeSet& axes);
836  friend TableExprNode diagonal (const TableExprNode& array);
837  friend TableExprNode diagonal (const TableExprNode& array,
838  const TableExprNode& firstAxis);
839  friend TableExprNode diagonal (const TableExprNode& array,
840  const TableExprNode& firstAxis,
841  const TableExprNode& diag);
842  friend TableExprNode isdefined (const TableExprNode& array);
843  friend TableExprNode nelements (const TableExprNode& array);
844  friend TableExprNode ndim (const TableExprNode& array);
845  friend TableExprNode shape (const TableExprNode& array);
846  friend TableExprNode iif (const TableExprNode& condition,
847  const TableExprNode& arg1,
848  const TableExprNode& arg2);
849  // </group>
850 
851 public:
852  TableExprNode ();
853 
854  // Unary operators on numeric TableExprNode's.
855  // <group>
856  TableExprNode operator+ () const;
857  TableExprNode operator- () const;
858  // </group>
859  // Unary NOT-operator on boolean TableExprNode's.
860  TableExprNode operator! () const;
861  // Unary bitwise negate-operator on integer TableExprNode's.
862  TableExprNode operator~ () const;
863 
864  // Slicing in a node containing an array. It is possible to
865  // address a single pixel or an n-dimensional subarray.
866  // In case of a single pixel the result is a scalar node.
867  // Otherwise the result is an array node with the same dimensionality
868  // as the source.
869  // <br>Note that there exist TableExprNodeSet constructors to
870  // convert an <src>IPosition</src> or <src>Slicer</src> object
871  // automatically to a <src>TableExprNodeSet</src>.
872  // An <src>IPosition</src> addresses a single element and results in
873  // a scalar node, while a <src>Slicer</src> can address multiple
874  // elements and always results in an array node.
876 
877  // The IN operator to test if a value is contained in an array or set.
878  // The array can also be a scalar.
879  // <group>
881  const TaQLStyle& = TaQLStyle(0)) const;
882  TableExprNode in (const TableExprNodeSet& set,
883  const TaQLStyle& = TaQLStyle(0)) const;
884  // </group>
885 
886  // Use a unit for the given TableExprNode.
887  // Note that if a column has a unit, it is automatically set. In that case
888  // this can be used to convert units.
889  TableExprNode useUnit (const Unit& unit) const;
890 
891  // Constructors to convert a constant value to a TableExprNode.
892  // The constructor for char* is also supported to convert a
893  // character-array to a string, since a two step conversion
894  // is not done automatically.
895  // <group>
896  TableExprNode (const Bool& value);
897  TableExprNode (const Int64& value);
898  TableExprNode (const Int& value);
899  TableExprNode (const uInt& value);
900  TableExprNode (const Float& value);
901  TableExprNode (const Double& value);
902  TableExprNode (const Complex& value);
903  TableExprNode (const DComplex& value);
904  TableExprNode (const String& value);
905  TableExprNode (const std::string& value);
906  TableExprNode (const char*);
907  TableExprNode (const Regex& value);
909  TableExprNode (const TaqlRegex& value);
910  TableExprNode (const MVTime& value);
915  TableExprNode (const Array<Int>& value);
935  // </group>
936 
937  // Construct a node from a node representation.
939 
940  // copy constructor (reference semantics).
941  TableExprNode (const TableExprNode&);
942 
943  // Assignment (reference semantics).
945 
946  // The destructor deletes all the underlying TableExprNode objects,
947  ~TableExprNode ();
948 
949  // Does the node contain no actual node?
950  Bool isNull() const
951  { return node_p == 0; }
952 
953  // Do not apply the selection.
956 
957  // Re-create the column object for a selection of rows.
958  // Nothing is done if the node does not represent a column object.
959  void applySelection (const Vector<uInt>& rownrs)
960  { node_p->applySelection (rownrs); }
961 
962  // Get the unit of the expression.
963  const Unit& unit() const
964  { return node_p->unit(); }
965 
966  // Get the data type of the expression.
967  // Currently the only possible values are TpBool, TpInt, TpDouble,
968  // TpDComplex, TpString, and TpOther.
969  // The latter is returned for a date or regex.
970  DataType dataType() const;
971 
972  // Is the expression a scalar?
973  Bool isScalar() const
974  { return (node_p->valueType() == TableExprNodeRep::VTScalar); }
975 
976  // Get the number of rows in the table associated with this expression.
977  // One is returned if the expression is a constant.
978  // Zero is returned if no table is associated with it.
979  uInt nrow() const
980  { return node_p->nrow(); }
981 
982  // Get a value for this node in the given row.
983  // These functions are implemented in the derived classes and
984  // will usually invoke the get in their children and apply the
985  // operator on the resulting values.
986  // <group>
987  void get (const TableExprId& id, Bool& value) const;
988  void get (const TableExprId& id, Int64& value) const;
989  void get (const TableExprId& id, Double& value) const;
990  void get (const TableExprId& id, DComplex& value) const;
991  void get (const TableExprId& id, String& value) const;
992  void get (const TableExprId& id, TaqlRegex& value) const;
993  void get (const TableExprId& id, MVTime& value) const;
994  void get (const TableExprId& id, MArray<Bool>& value) const;
995  void get (const TableExprId& id, MArray<Int64>& value) const;
996  void get (const TableExprId& id, MArray<Double>& value) const;
997  void get (const TableExprId& id, MArray<DComplex>& value) const;
998  void get (const TableExprId& id, MArray<String>& value) const;
999  void get (const TableExprId& id, MArray<MVTime>& value) const;
1000  void get (const TableExprId& id, Array<Bool>& value) const;
1001  void get (const TableExprId& id, Array<Int64>& value) const;
1002  void get (const TableExprId& id, Array<Double>& value) const;
1003  void get (const TableExprId& id, Array<DComplex>& value) const;
1004  void get (const TableExprId& id, Array<String>& value) const;
1005  void get (const TableExprId& id, Array<MVTime>& value) const;
1006  Bool getBool (const TableExprId& id) const;
1007  Int64 getInt (const TableExprId& id) const;
1008  Double getDouble (const TableExprId& id) const;
1009  DComplex getDComplex (const TableExprId& id) const;
1010  String getString (const TableExprId& id) const;
1011  Array<Bool> getArrayBool (const TableExprId& id) const;
1012  Array<Int64> getArrayInt (const TableExprId& id) const;
1013  Array<Double> getArrayDouble (const TableExprId& id) const;
1014  Array<DComplex> getArrayDComplex (const TableExprId& id) const;
1015  Array<String> getArrayString (const TableExprId& id) const;
1016  Array<MVTime> getArrayDate (const TableExprId& id) const;
1017  // Get a value as an array, even it it is a scalar.
1018  // This is useful in case one can give an argument as scalar or array.
1019  // <group>
1020  MArray<Bool> getBoolAS (const TableExprId& id) const;
1021  MArray<Int64> getIntAS (const TableExprId& id) const;
1022  MArray<Double> getDoubleAS (const TableExprId& id) const;
1023  MArray<DComplex> getDComplexAS (const TableExprId& id) const;
1024  MArray<String> getStringAS (const TableExprId& id) const;
1025  MArray<MVTime> getDateAS (const TableExprId& id) const;
1026  // </group>
1027 
1028  // </group>
1029 
1030  // Get the data type for doing a getColumn on the expression.
1031  // This is the data type of the column if the expression
1032  // consists of a single column only.
1033  // Otherwise it is the expression data type as returned by
1034  // function <src>dataType</src>.
1035  DataType getColumnDataType() const;
1036 
1037  // Get the value of the expression evaluated for the entire column.
1038  // The data of function called should match the data type as
1039  // returned by function <src>getColumnDataType</src>.
1040  // <group>
1041  Array<Bool> getColumnBool (const Vector<uInt>& rownrs) const;
1042  Array<uChar> getColumnuChar (const Vector<uInt>& rownrs) const;
1043  Array<Short> getColumnShort (const Vector<uInt>& rownrs) const;
1044  Array<uShort> getColumnuShort (const Vector<uInt>& rownrs) const;
1045  Array<Int> getColumnInt (const Vector<uInt>& rownrs) const;
1046  Array<uInt> getColumnuInt (const Vector<uInt>& rownrs) const;
1047  Array<Float> getColumnFloat (const Vector<uInt>& rownrs) const;
1048  Array<Double> getColumnDouble (const Vector<uInt>& rownrs) const;
1049  Array<Complex> getColumnComplex (const Vector<uInt>& rownrs) const;
1050  Array<DComplex> getColumnDComplex (const Vector<uInt>& rownrs) const;
1051  Array<String> getColumnString (const Vector<uInt>& rownrs) const;
1052  // </group>
1053 
1054  // Show the tree.
1055  void show (ostream&) const;
1056 
1057  // Convert the tree to a number of range vectors which at least
1058  // select the same things.
1059  // This function is very useful to convert the expression to
1060  // some intervals covering the select expression. This can
1061  // be used to do a rough fast selection via an index and do the
1062  // the slower final selection on that much smaller subset.
1063  // The function can only convert direct comparisons of columns
1064  // with constants (via ==, !=, >, >=, < or <=) and their combinations
1065  // using && or ||.
1066  void ranges (Block<TableExprRange>&);
1067 
1068  // Check if tables used in expression have the same number of
1069  // rows as the given table.
1070  Bool checkTableSize (const Table& table, Bool canBeConst) const;
1071 
1072  // Get table. This gets the Table object to which a
1073  // TableExprNode belongs. A TableExprNode belongs to the Table to
1074  // which the column(s) used in an expression belong. Note that
1075  // all columns in an expression have to belong to the same table.
1076  const Table& table() const;
1077 
1078  // Create a column node on behalf of the Table class.
1079  // For builtin data types another type of node is created than
1080  // for other data types.
1081  // isArray indicates if the column should be an array column.
1082  static TableExprNode newColumnNode (const Table& tab,
1083  const String& name,
1084  const Vector<String>& fieldNames);
1085 
1086  // Create a TableExprNodeConst for a table keyword
1087  // (which is handled as a constant).
1088  static TableExprNode newKeyConst (const TableRecord&,
1089  const Vector<String>& fieldNames);
1090 
1091  // Handle all field names except the last one. ALl of them must
1092  // be records. The last record is returned.
1093  // fullName is filled with the full keyword name separated by dots.
1094  static TableRecord* findLastKeyRec (const TableRecord& keyset,
1095  const Vector<String>& fieldNames,
1096  String& fullName);
1097 
1098  // Throw invalid data type exception.
1099  static void throwInvDT (const String& message);
1100 
1101  // Create function node of the given type with the given arguments.
1102  // <group>
1104  const TableExprNodeSet& set,
1105  const Table& table,
1106  const TaQLStyle& = TaQLStyle(0));
1108  const TableExprNode& node);
1110  const TableExprNode& node1,
1111  const TableExprNode& node2);
1113  const TableExprNode& node1,
1114  const TableExprNode& node2,
1115  const TableExprNode& node3);
1117  const TableExprNode& array,
1118  const TableExprNodeSet& axes);
1120  const TableExprNode& array,
1121  const TableExprNode& node,
1122  const TableExprNodeSet& axes);
1123  // </group>
1124 
1125  // Create a user defined function node.
1126  static TableExprNode newUDFNode (const String& name,
1127  const TableExprNodeSet& set,
1128  const Table& table,
1129  const TaQLStyle& = TaQLStyle(0));
1130 
1131  // Create cone function node of the given type with the given arguments.
1132  // <group>
1134  const TableExprNodeSet& set,
1135  uInt origin = 0);
1137  const TableExprNode& node1,
1138  const TableExprNode& node2);
1140  const TableExprNode& node1,
1141  const TableExprNode& node2,
1142  const TableExprNode& node3);
1143  // </group>
1144 
1145  // Create rownumber() function node.
1146  // Origin indicates whether the first row should be zero (for C++ binding)
1147  // or an other value (one for TaQL binding).
1148  static TableExprNode newRownrNode (const Table& table, uInt origin);
1149 
1150  // Create rowid() function node.
1151  // Origin is always 0.
1152  static TableExprNode newRowidNode (const Table& table);
1153 
1154  // Create rand() function node.
1155  static TableExprNode newRandomNode (const Table& table);
1156 
1157  // Create ArrayElement node for the given array with the given index.
1158  // The origin is 0 for C++ and 1 for TaQL.
1159  static TableExprNode newArrayPartNode (const TableExprNode& arrayNode,
1160  const TableExprNodeSet& indices,
1161  const TaQLStyle& = TaQLStyle(0));
1162 
1163  // returns const pointer to the representation-object of it
1164  const TableExprNodeRep* getNodeRep() const;
1165 
1166  // Adapt the unit of the expression to the given unit (if not empty).
1167  void adaptUnit (const Unit&);
1168 
1169 private:
1170  // returns non-const pointer to the representation-object of it
1172 
1173  // convert Block of TableExprNode to PtrBlock of TableExprNodeRep*.
1175  (Block<TableExprNode>& nodes);
1176 
1177  // Construct a new node for the given operation.
1178  // <group>
1179  TableExprNodeRep* newPlus (TableExprNodeRep* right) const;
1180  TableExprNodeRep* newMinus (TableExprNodeRep* right) const;
1181  TableExprNodeRep* newTimes (TableExprNodeRep* right) const;
1185  TableExprNodeRep* newBitOr (TableExprNodeRep* right) const;
1187  TableExprNodeRep* newEQ (TableExprNodeRep* right) const;
1188  TableExprNodeRep* newNE (TableExprNodeRep* right) const;
1189  TableExprNodeRep* newGE (TableExprNodeRep* right) const;
1190  TableExprNodeRep* newGT (TableExprNodeRep* right) const;
1192  const TaQLStyle&) const;
1193  TableExprNodeRep* newOR (TableExprNodeRep* right) const;
1194  TableExprNodeRep* newAND (TableExprNodeRep* right) const;
1195  // </group>
1196 
1197  // The actual (counted referenced) representation of a node.
1199 };
1200 
1201 
1202 
1204  { node_p->ranges (blrange); }
1205 
1206 //# Get the table from which the node is derived.
1207 inline const Table& TableExprNode::table() const
1208  { return node_p->table(); }
1209 
1210 //# Get the value of an expression.
1211 inline void TableExprNode::get (const TableExprId& id, Bool& value) const
1212  { value = node_p->getBool (id); }
1213 inline void TableExprNode::get (const TableExprId& id, Int64& value) const
1214  { value = node_p->getInt (id); }
1215 inline void TableExprNode::get (const TableExprId& id, Double& value) const
1216  { value = node_p->getDouble (id); }
1217 inline void TableExprNode::get (const TableExprId& id, DComplex& value) const
1218  { value = node_p->getDComplex (id); }
1219 inline void TableExprNode::get (const TableExprId& id, String& value) const
1220  { value = node_p->getString (id); }
1221 inline void TableExprNode::get (const TableExprId& id, TaqlRegex& value) const
1222  { value = node_p->getRegex (id); }
1223 inline void TableExprNode::get (const TableExprId& id, MVTime& value) const
1224  { value = node_p->getDate (id); }
1225 inline void TableExprNode::get (const TableExprId& id,
1226  MArray<Bool>& value) const
1227  { value = node_p->getArrayBool (id); }
1228 inline void TableExprNode::get (const TableExprId& id,
1229  MArray<Int64>& value) const
1230  { value = node_p->getArrayInt (id); }
1231 inline void TableExprNode::get (const TableExprId& id,
1232  MArray<Double>& value) const
1233  { value = node_p->getArrayDouble (id); }
1234 inline void TableExprNode::get (const TableExprId& id,
1235  MArray<DComplex>& value) const
1236  { value = node_p->getArrayDComplex (id); }
1237 inline void TableExprNode::get (const TableExprId& id,
1238  MArray<String>& value) const
1239  { value = node_p->getArrayString (id); }
1240 inline void TableExprNode::get (const TableExprId& id,
1241  MArray<MVTime>& value) const
1242  { value = node_p->getArrayDate (id); }
1243 inline void TableExprNode::get (const TableExprId& id,
1244  Array<Bool>& value) const
1245  { value = node_p->getArrayBool (id).array(); }
1246 inline void TableExprNode::get (const TableExprId& id,
1247  Array<Int64>& value) const
1248  { value = node_p->getArrayInt (id).array(); }
1249 inline void TableExprNode::get (const TableExprId& id,
1250  Array<Double>& value) const
1251  { value = node_p->getArrayDouble (id).array(); }
1252 inline void TableExprNode::get (const TableExprId& id,
1253  Array<DComplex>& value) const
1254  { value = node_p->getArrayDComplex (id).array(); }
1255 inline void TableExprNode::get (const TableExprId& id,
1256  Array<String>& value) const
1257  { value = node_p->getArrayString (id).array(); }
1258 inline void TableExprNode::get (const TableExprId& id,
1259  Array<MVTime>& value) const
1260  { value = node_p->getArrayDate (id).array(); }
1261 inline Bool TableExprNode::getBool (const TableExprId& id) const
1262  { return node_p->getBool (id); }
1263 inline Int64 TableExprNode::getInt (const TableExprId& id) const
1264  { return node_p->getInt (id); }
1266  { return node_p->getDouble (id); }
1268  { return node_p->getDComplex (id); }
1270  { return node_p->getString (id); }
1272  { return node_p->getArrayBool (id).array(); }
1274  { return node_p->getArrayInt (id).array(); }
1276  { return node_p->getArrayDouble (id).array(); }
1278  { return node_p->getArrayDComplex (id).array(); }
1280  { return node_p->getArrayString (id).array(); }
1282  { return node_p->getArrayDate (id).array(); }
1284  { return node_p->getBoolAS (id); }
1286  { return node_p->getIntAS (id); }
1288  { return node_p->getDoubleAS (id); }
1290  { return node_p->getDComplexAS (id); }
1292  { return node_p->getStringAS (id); }
1294  { return node_p->getDateAS (id); }
1295 
1297  { return node_p->getColumnBool (rownrs); }
1299  { return node_p->getColumnuChar (rownrs); }
1301  { return node_p->getColumnShort (rownrs); }
1303  { return node_p->getColumnuShort (rownrs); }
1305  { return node_p->getColumnInt (rownrs); }
1307  { return node_p->getColumnuInt (rownrs); }
1309  { return node_p->getColumnFloat (rownrs); }
1311  { return node_p->getColumnDouble (rownrs); }
1313  { return node_p->getColumnComplex (rownrs); }
1315  { return node_p->getColumnDComplex (rownrs); }
1317  { return node_p->getColumnString (rownrs); }
1318 
1319 
1321  const TableExprNode& right)
1322 {
1323  return left.newPlus (right.node_p);
1324 }
1326  const TableExprNode& right)
1327 {
1328  return left.newMinus (right.node_p);
1329 }
1331  const TableExprNode& right)
1332 {
1333  return left.newTimes (right.node_p);
1334 }
1336  const TableExprNode& right)
1337 {
1338  return left.newDivide (right.node_p);
1339 }
1341  const TableExprNode& right)
1342 {
1343  return left.newModulo (right.node_p);
1344 }
1346  const TableExprNode& right)
1347 {
1348  return left.newBitAnd (right.node_p);
1349 }
1351  const TableExprNode& right)
1352 {
1353  return left.newBitOr (right.node_p);
1354 }
1356  const TableExprNode& right)
1357 {
1358  return left.newBitXor (right.node_p);
1359 }
1361  const TableExprNode& right)
1362 {
1363  return left.newEQ (right.node_p);
1364 }
1366  const TableExprNode& right)
1367 {
1368  return left.newNE (right.node_p);
1369 }
1371  const TableExprNode& right)
1372 {
1373  return left.newGT (right.node_p);
1374 }
1376  const TableExprNode& right)
1377 {
1378  return left.newGE (right.node_p);
1379 }
1381  const TableExprNode& right)
1382 {
1383  return right.newGE (left.node_p);
1384 }
1386  const TableExprNode& right)
1387 {
1388  return right.newGT (left.node_p);
1389 }
1391  const TaQLStyle& style) const
1392 {
1393  return newIN (right.node_p, style);
1394 }
1396 {
1397  // C++ indexing is 0-based.
1398  return newArrayPartNode (*this, indices, TaQLStyle(0));
1399 }
1400 
1401 inline TableExprNode near (const TableExprNode& left,
1402  const TableExprNode& right)
1403 {
1405  left, right);
1406 }
1407 inline TableExprNode near (const TableExprNode& left,
1408  const TableExprNode& right,
1409  const TableExprNode& tolerance)
1410 {
1412  left, right, tolerance);
1413 }
1415  const TableExprNode& right)
1416 {
1418  left, right);
1419 }
1421  const TableExprNode& right,
1422  const TableExprNode& tolerance)
1423 {
1425  left, right, tolerance);
1426 }
1428  const TableExprNode& pos2)
1429 {
1431  pos1, pos2);
1432 }
1434  const TableExprNode& pos2)
1435 {
1437  pos1, pos2);
1438 }
1439 inline TableExprNode cones (const TableExprNode& sourcePos,
1440  const TableExprNode& cones)
1441 {
1443  sourcePos, cones);
1444 }
1445 inline TableExprNode anyCone (const TableExprNode& sourcePos,
1446  const TableExprNode& cones)
1447 {
1449  sourcePos, cones);
1450 }
1451 inline TableExprNode findCone (const TableExprNode& sourcePos,
1452  const TableExprNode& cones)
1453 {
1455  sourcePos, cones);
1456 }
1457 inline TableExprNode cones (const TableExprNode& sourcePos,
1458  const TableExprNode& conePos,
1459  const TableExprNode& radii)
1460 {
1462  sourcePos, conePos, radii);
1463 }
1464 inline TableExprNode anyCone (const TableExprNode& sourcePos,
1465  const TableExprNode& conePos,
1466  const TableExprNode& radii)
1467 {
1469  sourcePos, conePos, radii);
1470 }
1471 inline TableExprNode findCone (const TableExprNode& sourcePos,
1472  const TableExprNode& conePos,
1473  const TableExprNode& radii)
1474 {
1476  sourcePos, conePos, radii);
1477 }
1478 inline TableExprNode cos (const TableExprNode& node)
1479 {
1481 }
1482 inline TableExprNode cosh (const TableExprNode& node)
1483 {
1485 }
1486 inline TableExprNode exp (const TableExprNode& node)
1487 {
1489 }
1490 inline TableExprNode log (const TableExprNode& node)
1491 {
1493 }
1494 inline TableExprNode log10 (const TableExprNode& node)
1495 {
1497 }
1498 inline TableExprNode pow (const TableExprNode& x, const TableExprNode& y)
1499 {
1501 }
1502 inline TableExprNode sin (const TableExprNode& node)
1503 {
1505 }
1506 inline TableExprNode sinh (const TableExprNode& node)
1507 {
1509 }
1510 inline TableExprNode square (const TableExprNode& node)
1511 {
1513  node);
1514 }
1515 inline TableExprNode cube (const TableExprNode& node)
1516 {
1518  node);
1519 }
1520 inline TableExprNode sqrt (const TableExprNode& node)
1521 {
1523 }
1524 inline TableExprNode norm (const TableExprNode& node)
1525 {
1527 }
1528 inline TableExprNode acos (const TableExprNode& node)
1529 {
1531 }
1532 inline TableExprNode asin (const TableExprNode& node)
1533 {
1535 }
1536 inline TableExprNode atan (const TableExprNode& node)
1537 {
1539 }
1540 inline TableExprNode atan2 (const TableExprNode& y, const TableExprNode& x)
1541 {
1543 }
1544 inline TableExprNode sign (const TableExprNode& node)
1545 {
1547 }
1548 inline TableExprNode round (const TableExprNode& node)
1549 {
1551 }
1552 inline TableExprNode ceil (const TableExprNode& node)
1553 {
1555 }
1556 inline TableExprNode abs (const TableExprNode& node)
1557 {
1559 }
1560 inline TableExprNode floor (const TableExprNode& node)
1561 {
1563 }
1564 inline TableExprNode fmod (const TableExprNode& x, const TableExprNode& y)
1565 {
1567 }
1568 inline TableExprNode tan (const TableExprNode& node)
1569 {
1571 }
1572 inline TableExprNode tanh (const TableExprNode& node)
1573 {
1575 }
1576 inline TableExprNode min (const TableExprNode& a, const TableExprNode& b)
1577 {
1579 }
1580 inline TableExprNode max (const TableExprNode& a, const TableExprNode& b)
1581 {
1583 }
1584 inline TableExprNode real (const TableExprNode& node)
1585 {
1587 }
1588 inline TableExprNode imag (const TableExprNode& node)
1589 {
1591 }
1593 {
1595 }
1597 {
1599 }
1600 inline TableExprNode conj (const TableExprNode& node)
1601 {
1603 }
1605 {
1607 }
1608 inline TableExprNode arg (const TableExprNode& node)
1609 {
1611 }
1612 inline TableExprNode phase (const TableExprNode& node)
1613 {
1615 }
1617  const TableExprNode& imag)
1618 {
1620  real, imag);
1621 }
1623 {
1625  node);
1626 }
1628 {
1630  node);
1631 }
1632 inline TableExprNode upcase (const TableExprNode& node)
1633 {
1635  node);
1636 }
1638 {
1640  node);
1641 }
1643 {
1645  node);
1646 }
1647 inline TableExprNode regex (const TableExprNode& node)
1648 {
1650 }
1652 {
1654  node);
1655 }
1657 {
1659  node);
1660 }
1662 {
1664  node);
1665 }
1667 {
1669  node);
1670 }
1671 inline TableExprNode mjd (const TableExprNode& node)
1672 {
1674 }
1675 inline TableExprNode date (const TableExprNode& node)
1676 {
1678 }
1679 inline TableExprNode year (const TableExprNode& node)
1680 {
1682 }
1683 inline TableExprNode month (const TableExprNode& node)
1684 {
1686 }
1687 inline TableExprNode day (const TableExprNode& node)
1688 {
1690 }
1691 inline TableExprNode cmonth (const TableExprNode& node)
1692 {
1694  node);
1695 }
1697 {
1699  node);
1700 }
1701 inline TableExprNode cdow (const TableExprNode& node)
1702 {
1704 }
1705 inline TableExprNode ctodt (const TableExprNode& node)
1706 {
1708 }
1709 inline TableExprNode cdate (const TableExprNode& node)
1710 {
1712 }
1713 inline TableExprNode ctime (const TableExprNode& node)
1714 {
1716 }
1717 inline TableExprNode hms (const TableExprNode& node)
1718 {
1720 }
1721 inline TableExprNode dms (const TableExprNode& node)
1722 {
1724 }
1725 inline TableExprNode hdms (const TableExprNode& node)
1726 {
1728 }
1730 {
1732  node);
1733 }
1735  const TableExprNode& format)
1736 {
1738  node, format);
1739 }
1740 inline TableExprNode week (const TableExprNode& node)
1741 {
1743 }
1744 inline TableExprNode time (const TableExprNode& node)
1745 {
1747 }
1748 inline TableExprNode trim (const TableExprNode& node)
1749 {
1751 }
1752 inline TableExprNode ltrim (const TableExprNode& node)
1753 {
1755 }
1756 inline TableExprNode rtrim (const TableExprNode& node)
1757 {
1759 }
1760 inline TableExprNode substr (const TableExprNode& node,
1761  const TableExprNode& pos)
1762 {
1764  node, pos);
1765 }
1766 inline TableExprNode substr (const TableExprNode& node,
1767  const TableExprNode& pos,
1768  const TableExprNode& npos)
1769 {
1771  node, pos, npos);
1772 }
1774  const TableExprNode& patt)
1775 {
1777  node, patt);
1778 }
1780  const TableExprNode& patt,
1781  const TableExprNode& repl)
1782 {
1784  node, patt, repl);
1785 }
1786 inline TableExprNode isNaN (const TableExprNode& node)
1787 {
1789 }
1790 inline TableExprNode isInf (const TableExprNode& node)
1791 {
1793 }
1795 {
1797  node);
1798 }
1799 inline TableExprNode min (const TableExprNode& node)
1800 {
1802  node);
1803 }
1804 inline TableExprNode max (const TableExprNode& node)
1805 {
1807  node);
1808 }
1809 inline TableExprNode sum (const TableExprNode& node)
1810 {
1812  node);
1813 }
1815 {
1817  node);
1818 }
1820 {
1822  node);
1823 }
1824 inline TableExprNode mean (const TableExprNode& node)
1825 {
1827  node);
1828 }
1830 {
1832  node);
1833 }
1834 inline TableExprNode stddev (const TableExprNode& node)
1835 {
1837  node);
1838 }
1839 inline TableExprNode avdev (const TableExprNode& node)
1840 {
1842  node);
1843 }
1844 inline TableExprNode rms (const TableExprNode& node)
1845 {
1847  node);
1848 }
1849 inline TableExprNode median (const TableExprNode& node)
1850 {
1852  node);
1853 }
1855  const TableExprNode& fraction)
1856 {
1858  node, fraction);
1859 }
1860 inline TableExprNode any (const TableExprNode& node)
1861 {
1863 }
1864 inline TableExprNode all (const TableExprNode& node)
1865 {
1867 }
1868 inline TableExprNode ntrue (const TableExprNode& node)
1869 {
1871 }
1872 inline TableExprNode nfalse (const TableExprNode& node)
1873 {
1875 }
1876 inline TableExprNode sums (const TableExprNode& array,
1877  const TableExprNodeSet& axes)
1878 {
1880  array, axes);
1881 }
1882 inline TableExprNode products (const TableExprNode& array,
1883  const TableExprNodeSet& axes)
1884 {
1886  array, axes);
1887 }
1889  const TableExprNodeSet& axes)
1890 {
1892  array, axes);
1893 }
1894 inline TableExprNode mins (const TableExprNode& array,
1895  const TableExprNodeSet& axes)
1896 {
1898  array, axes);
1899 }
1900 inline TableExprNode maxs (const TableExprNode& array,
1901  const TableExprNodeSet& axes)
1902 {
1904  array, axes);
1905 }
1906 inline TableExprNode means (const TableExprNode& array,
1907  const TableExprNodeSet& axes)
1908 {
1910  array, axes);
1911 }
1913  const TableExprNodeSet& axes)
1914 {
1916  array, axes);
1917 }
1918 inline TableExprNode stddevs (const TableExprNode& array,
1919  const TableExprNodeSet& axes)
1920 {
1922  array, axes);
1923 }
1924 inline TableExprNode avdevs (const TableExprNode& array,
1925  const TableExprNodeSet& axes)
1926 {
1928  array, axes);
1929 }
1930 inline TableExprNode rmss (const TableExprNode& array,
1931  const TableExprNodeSet& axes)
1932 {
1934  array, axes);
1935 }
1936 inline TableExprNode medians (const TableExprNode& array,
1937  const TableExprNodeSet& axes)
1938 {
1940  array, axes);
1941 }
1943  const TableExprNode& fraction,
1944  const TableExprNodeSet& axes)
1945 {
1947  array, fraction, axes);
1948 }
1949 inline TableExprNode anys (const TableExprNode& array,
1950  const TableExprNodeSet& axes)
1951 {
1953  array, axes);
1954 }
1955 inline TableExprNode alls (const TableExprNode& array,
1956  const TableExprNodeSet& axes)
1957 {
1959  array, axes);
1960 }
1961 inline TableExprNode ntrues (const TableExprNode& array,
1962  const TableExprNodeSet& axes)
1963 {
1965  array, axes);
1966 }
1967 inline TableExprNode nfalses (const TableExprNode& array,
1968  const TableExprNodeSet& axes)
1969 {
1971  array, axes);
1972 }
1974  const TableExprNodeSet& halfBoxWidth)
1975 {
1977  node, halfBoxWidth);
1978 }
1980  const TableExprNodeSet& halfBoxWidth)
1981 {
1983  node, halfBoxWidth);
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 }
2093 inline TableExprNode array (const TableExprNode& values,
2094  const TableExprNodeSet& shape)
2095 {
2097  values, shape);
2098 }
2099 inline TableExprNode marray (const TableExprNode& array,
2100  const TableExprNode& mask)
2101 {
2103  array, mask);
2104 }
2106 {
2108  array);
2109 }
2111 {
2113  array);
2114 }
2116 {
2118  array);
2119 }
2121 {
2122  // Needs an empty axes argument.
2124  array,
2126 }
2128  const TableExprNodeSet& axes)
2129 {
2131  array, axes);
2132 }
2133 inline TableExprNode diagonal (const TableExprNode& array)
2134 {
2136  array,
2138 }
2140 {
2142 }
2144 {
2146 }
2147 inline TableExprNode ndim (const TableExprNode& node)
2148 {
2150 }
2151 inline TableExprNode shape (const TableExprNode& node)
2152 {
2154 }
2155 inline TableExprNode iif (const TableExprNode& condition,
2156  const TableExprNode& arg1,
2157  const TableExprNode& arg2)
2158 {
2160  condition, arg1, arg2);
2161 }
2162 
2163 
2164 inline void TableExprNode::show (ostream& os) const
2165 {
2166  node_p->show (os, 0);
2167 }
2169 {
2170  return node_p;
2171 }
2173 {
2174  return node_p;
2175 }
2176 
2177 
2178 
2179 } //# NAMESPACE CASACORE - END
2180 
2181 #endif
friend TableExprNode runningMax(const TableExprNode &array)
LatticeExprNode log10(const LatticeExprNode &expr)
friend TableExprNode norm(const TableExprNode &node)
Definition: ExprNode.h:1524
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:1439
friend TableExprNode ceil(const TableExprNode &node)
Definition: ExprNode.h:1552
friend TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1679
Array< String > getArrayString(const TableExprId &id) const
Definition: ExprNode.h:1279
friend TableExprNode operator<(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1385
friend TableExprNode ntrues(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1961
Array< Double > getArrayDouble(const TableExprId &id) const
Definition: ExprNode.h:1275
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:1721
friend TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1683
Class to handle an Array with an optional mask.
Definition: ExprNode.h:54
MArray< Double > getDoubleAS(const TableExprId &id)
TableExprNode boxedStddev(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2057
TableExprNodeRep * newBitOr(TableExprNodeRep *right) const
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:1445
int Int
Definition: aipstype.h:50
TableExprNode transpose(const TableExprNode &array)
Transpose all axes of a (masked) array.
Definition: ExprNode.h:2120
TableExprNodeRep * newOR(TableExprNodeRep *right) const
return angles as dms strings
Definition: ExprFuncNode.h:240
friend TableExprNode sin(const TableExprNode &node)
Transcendental functions that can be applied to essentially all numeric nodes containing scalars or a...
Definition: ExprNode.h:1502
Array< Int64 > getArrayInt(const TableExprId &id) const
Definition: ExprNode.h:1273
TableExprNodeRep * newBitXor(TableExprNodeRep *right) const
TableExprNode alls(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1955
virtual Array< uInt > getColumnuInt(const Vector< uInt > &rownrs)
friend TableExprNode mjdtodate(const TableExprNode &node)
Definition: ExprNode.h:1666
LatticeExprNode log(const LatticeExprNode &expr)
friend TableExprNode runningRms(const TableExprNode &array)
friend TableExprNode cdate(const TableExprNode &node)
Definition: ExprNode.h:1709
friend TableExprNode cosh(const TableExprNode &node)
Definition: ExprNode.h:1482
friend TableExprNode rmss(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1930
LatticeExprNode arg(const LatticeExprNode &expr)
TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1906
TableExprNode runningRms(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2009
friend TableExprNode tanh(const TableExprNode &node)
Definition: ExprNode.h:1572
TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1637
friend TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1906
LatticeExprNode median(const LatticeExprNode &expr)
for Int or Double returning Double
Definition: ExprFuncNode.h:116
friend TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1687
Array< DComplex > getColumnDComplex(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1314
TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1744
for any array returning Bool scalar
Definition: ExprFuncNode.h:197
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)
friend TableExprNode operator &(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1345
for Bool array returning Bool
Definition: ExprFuncNode.h:174
bool operator==(const std11_allocator< T > &, const std11_allocator< T > &)
Definition: Allocator.h:99
Main interface class to a read/write table.
Definition: Table.h:149
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode runningVariance(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1991
const TableExprNodeRep * getNodeRep() const
returns const pointer to the representation-object of it
Definition: ExprNode.h:2168
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
cone search functions, implemented in derived class
Definition: ExprFuncNode.h:255
friend TableExprNode cos(const TableExprNode &node)
Definition: ExprNode.h:1478
friend TableExprNode ndim(const TableExprNode &array)
Definition: ExprNode.h:2147
friend TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1637
T product(const TableVector< T > &tv)
Definition: TabVecMath.h:385
friend TableExprNode any(const TableExprNode &array)
Definition: ExprNode.h:1860
LatticeExprNode imag(const LatticeExprNode &expr)
TableExprNode variances(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1912
friend TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1350
friend TableExprNode datetime(const TableExprNode &node)
Functions for date-values.
Definition: ExprNode.h:1661
MArray< String > getStringAS(const TableExprId &id)
friend TableExprNode variance(const TableExprNode &array)
Definition: ExprNode.h:1829
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:1300
bool operator!=(const std11_allocator< T > &, const std11_allocator< T > &)
Definition: Allocator.h:105
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Definition: ExprNode.h:2093
Class to hold multiple table expression nodes.
Definition: ExprNodeSet.h:306
LatticeExprNode sum(const LatticeExprNode &expr)
MArray< DComplex > getDComplexAS(const TableExprId &id) const
Definition: ExprNode.h:1289
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNodeRep * newTimes(TableExprNodeRep *right) const
TableExprNode operator-() const
TableExprNode weekday(const TableExprNode &node)
Definition: ExprNode.h:1696
Handle class for a table column expression tree.
Definition: ExprNode.h:614
LatticeExprNode operator%(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode atan(const TableExprNode &node)
Definition: ExprNode.h:1536
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
TableExprNode runningAll(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2027
friend TableExprNode fmod(const TableExprNode &x, const TableExprNode &y)
Definition: ExprNode.h:1564
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1612
virtual MVTime getDate(const TableExprId &id)
TableExprNodeRep * newAND(TableExprNodeRep *right) const
friend TableExprNode median(const TableExprNode &array)
Definition: ExprNode.h:1849
friend TableExprNode nelements(const TableExprNode &array)
Functions operating on any scalar or array resulting in a Double scalar.
Definition: ExprNode.h:2143
TableExprNode ltrim(const TableExprNode &node)
Definition: ExprNode.h:1752
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)
friend TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
Definition: ExprNode.h:2099
friend TableExprNode findCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The sourcePos can contain multiple sources.
Definition: ExprNode.h:1451
friend TableExprNode log(const TableExprNode &node)
Definition: ExprNode.h:1490
MArray< String > getStringAS(const TableExprId &id) const
Definition: ExprNode.h:1291
for Int, Double, Complex or String returning Bool
Definition: ExprFuncNode.h:262
LatticeExprNode ntrue(const LatticeExprNode &expr)
friend TableExprNode replace(const TableExprNode &str, const TableExprNode &patt)
Definition: ExprNode.h:1773
virtual Int64 getInt(const TableExprId &id)
friend TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1604
friend TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1651
void show(ostream &) const
Show the tree.
Definition: ExprNode.h:2164
friend TableExprNode abs(const TableExprNode &node)
Definition: ExprNode.h:1556
TableExprNodeRep * getRep()
returns non-const pointer to the representation-object of it
Definition: ExprNode.h:2172
Array< uChar > getColumnuChar(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1298
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:1794
friend TableExprNode operator<=(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1380
TableExprNode mins(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1894
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:1900
angular distance returning radians
Definition: ExprFuncNode.h:252
TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1679
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:1414
friend TableExprNode ctime(const TableExprNode &node)
Definition: ExprNode.h:1713
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:950
friend TableExprNode real(const TableExprNode &node)
The real part of a complex node.
Definition: ExprNode.h:1584
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:1809
friend TableExprNode angdist(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance between positions.
Definition: ExprNode.h:1427
TableExprNode mjd(const TableExprNode &node)
Definition: ExprNode.h:1671
friend TableExprNode substr(const TableExprNode &str, const TableExprNode &pos)
Definition: ExprNode.h:1760
friend TableExprNode runningMedian(const TableExprNode &array)
friend TableExprNode floor(const TableExprNode &node)
Definition: ExprNode.h:1560
friend TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1612
void applySelection(const Vector< uInt > &rownrs)
Re-create the column object for a selection of rows.
Definition: ExprNode.h:959
TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1683
virtual Array< DComplex > getColumnDComplex(const Vector< uInt > &rownrs)
Abstract base class for a node in a table column expression tree.
Definition: ExprNodeRep.h:151
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). ...
TableExprNode operator+() const
Unary operators on numeric TableExprNode&#39;s.
TableExprNode boxedAvdev(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2063
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
Definition: ExprNode.h:2099
TableExprNode runningMax(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1979
TableExprNode strlength(const TableExprNode &node)
String functions on scalars or arrays.
Definition: ExprNode.h:1627
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:2075
friend TableExprNode isNaN(const TableExprNode &node)
Function to test if a scalar or array is NaN (not-a-number).
Definition: ExprNode.h:1786
Array< Bool > getArrayBool(const TableExprId &id) const
Definition: ExprNode.h:1271
LatticeExprNode floor(const LatticeExprNode &expr)
TableExprNode arrayMask(const TableExprNode &array)
Get the mask of a masked array.
Definition: ExprNode.h:2110
MArray< Int64 > getIntAS(const TableExprId &id) const
Definition: ExprNode.h:1285
TableExprNode cones(const TableExprNode &sourcePos, const TableExprNode &cones)
Cone search; test if the position of a source is inside a cone.
Definition: ExprNode.h:1439
TableExprNode boolean(const TableExprNode &node)
Convert numeric or string value to bool (0, no, false, - means false)
Definition: ExprNode.h:1596
friend TableExprNode arrayFlatten(const TableExprNode &array)
Flatten a masked array (get unmasked elements).
Definition: ExprNode.h:2115
DComplex getDComplex(const TableExprId &id) const
Definition: ExprNode.h:1267
friend TableExprNode log10(const TableExprNode &node)
Definition: ExprNode.h:1494
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:1287
ValueType valueType() const
Get the value type.
Definition: ExprNodeRep.h:709
for any array returning Int scalar
Definition: ExprFuncNode.h:202
for any array returning Int array
Definition: ExprFuncNode.h:205
for Int, Double, Bool or String returning Int (using floor)
Definition: ExprFuncNode.h:114
TableExprNode rtrim(const TableExprNode &node)
Definition: ExprNode.h:1756
friend TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1844
MArray< MVTime > getDateAS(const TableExprId &id) const
Definition: ExprNode.h:1293
TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1651
friend TableExprNode operator*(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1330
friend TableExprNode boolean(const TableExprNode &node)
Convert numeric or string value to bool (0, no, false, - means false)
Definition: ExprNode.h:1596
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:1203
virtual Array< Int > getColumnInt(const Vector< uInt > &rownrs)
friend TableExprNode tan(const TableExprNode &node)
Definition: ExprNode.h:1568
Array< String > getColumnString(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1316
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:1296
friend TableExprNode asin(const TableExprNode &node)
Transcendental functions applied to to nodes containing scalars or arrays with double values...
Definition: ExprNode.h:1532
Array< MVTime > getArrayDate(const TableExprId &id) const
Definition: ExprNode.h:1281
virtual MArray< Double > getArrayDouble(const TableExprId &id)
friend TableExprNode stddev(const TableExprNode &array)
Definition: ExprNode.h:1834
friend TableExprNode operator||(const TableExprNode &left, const TableExprNode &right)
friend TableExprNode rtrim(const TableExprNode &node)
Definition: ExprNode.h:1756
friend TableExprNode avdevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1924
const Unit & unit() const
Get the unit of the expression.
Definition: ExprNode.h:963
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:188
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:1592
friend TableExprNode ntrue(const TableExprNode &array)
Definition: ExprNode.h:1868
friend TableExprNode products(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1882
void disableApplySelection()
Do not apply the selection.
Definition: ExprNode.h:954
Float pow(Float f1, Float f2)
Definition: math.h:90
TableExprNodeRep * newNE(TableExprNodeRep *right) const
special function resembling if statement
Definition: ExprFuncNode.h:250
friend TableExprNode exp(const TableExprNode &node)
Definition: ExprNode.h:1486
TableExprNode medians(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1936
friend TableExprNode sqrt(const TableExprNode &node)
Definition: ExprNode.h:1520
TableExprNode sumSquares(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1888
TableExprNodeRep * newIN(TableExprNodeRep *right, const TaQLStyle &) const
TableExprNodeRep * newGT(TableExprNodeRep *right) const
LatticeExprNode tanh(const LatticeExprNode &expr)
friend TableExprNode mjd(const TableExprNode &node)
Definition: ExprNode.h:1671
TableExprNode ntrues(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1961
for Int, Double or DComplex array returning Bool
Definition: ExprFuncNode.h:193
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
TableExprNode fractiles(const TableExprNode &array, const TableExprNode &fraction, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1942
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode boxedAny(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2081
LatticeExprNode avdev(const LatticeExprNode &expr)
friend TableExprNode runningAll(const TableExprNode &array)
TableExprNode isInf(const TableExprNode &node)
Definition: ExprNode.h:1790
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:1894
TableExprNode arrayFlatten(const TableExprNode &array)
Flatten a masked array (get unmasked elements).
Definition: ExprNode.h:2115
TableExprNodeRep * newMinus(TableExprNodeRep *right) const
for Int, Double or DComplex returning Double or Complex
Definition: ExprFuncNode.h:91
TableExprNodeRep * node_p
The actual (counted referenced) representation of a node.
Definition: ExprNode.h:1198
friend TableExprNode arrayData(const TableExprNode &array)
Get the data array of a masked array.
Definition: ExprNode.h:2105
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:1955
friend TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:2151
static TableExprNode newRownrNode(const Table &table, uInt origin)
Create rownumber() function node.
TableExprNodeRep * newBitAnd(TableExprNodeRep *right) const
friend TableExprNode upcase(const TableExprNode &node)
Definition: ExprNode.h:1632
double Double
Definition: aipstype.h:55
TableExprNode cdate(const TableExprNode &node)
Definition: ExprNode.h:1709
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:242
for Bool array returning Int scalar
Definition: ExprFuncNode.h:183
TableExprNode arrayData(const TableExprNode &array)
Get the data array of a masked array.
Definition: ExprNode.h:2105
friend TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1515
TableExprNode trim(const TableExprNode &node)
Definition: ExprNode.h:1748
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:1580
LatticeExprNode operator<=(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode operator!=(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1365
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:1211
friend TableExprNode transpose(const TableExprNode &array)
Transpose all axes of a (masked) array.
Definition: ExprNode.h:2120
Bool isScalar() const
Is the expression a scalar?
Definition: ExprNode.h:973
for Int, Double or Complex array returning the same
Definition: ExprFuncNode.h:131
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:2087
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:1691
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:979
friend TableExprNode operator/(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1335
friend TableExprNode atan2(const TableExprNode &y, const TableExprNode &x)
Definition: ExprNode.h:1540
friend TableExprNode pow(const TableExprNode &x, const TableExprNode &exp)
Definition: ExprNode.h:1498
TableExprNode anys(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1949
TableExprNode boxedMax(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2039
LatticeExprNode sign(const LatticeExprNode &expr)
LatticeExprNode sqrt(const LatticeExprNode &expr)
friend TableExprNode stddevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1918
TableExprNode products(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1882
friend TableExprNode operator%(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1340
friend TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1675
LatticeExprNode tan(const LatticeExprNode &expr)
friend TableExprNode sumSquare(const TableExprNode &array)
Definition: ExprNode.h:1819
for Int or Double returning Int or Double
Definition: ExprFuncNode.h:123
TableExprNode isFinite(const TableExprNode &node)
Function to test if a scalar or array is finite.
Definition: ExprNode.h:1794
friend TableExprNode round(const TableExprNode &node)
Definition: ExprNode.h:1548
friend TableExprNode operator==(const TableExprNode &left, const TableExprNode &right)
Comparison operators.
Definition: ExprNode.h:1360
TableExprNode runningAny(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2021
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:2093
LatticeExprNode atan(const LatticeExprNode &expr)
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:1390
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
TableExprNode upcase(const TableExprNode &node)
Definition: ExprNode.h:1632
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:1515
LatticeExprNode stddev(const LatticeExprNode &expr)
TableExprNode runningMedian(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2015
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:1433
virtual void ranges(Block< TableExprRange > &)
Convert the tree to a number of range vectors which at least select the same things.
friend TableExprNode maxs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1900
for Int, Double or DComplex returning DComplex
Definition: ExprFuncNode.h:129
LatticeExprNode round(const LatticeExprNode &expr)
TableExprNodeRep * newPlus(TableExprNodeRep *right) const
Construct a new node for the given operation.
friend TableExprNode operator>(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1370
float Float
Definition: aipstype.h:54
TableExprNode runningStddev(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1997
friend TableExprNode sqlpattern(const TableExprNode &node)
Definition: ExprNode.h:1656
return angles as hms strings
Definition: ExprFuncNode.h:238
TableExprNode substr(const TableExprNode &str, const TableExprNode &pos)
Definition: ExprNode.h:1760
friend TableExprNode acos(const TableExprNode &node)
Definition: ExprNode.h:1528
const Unit & unit() const
Get the unit.
Definition: ExprNodeRep.h:729
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:1752
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:1261
A drop-in replacement for Block<T*>.
Definition: Block.h:861
TableExprNode sqlpattern(const TableExprNode &node)
Definition: ExprNode.h:1656
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:1445
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:2151
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:1277
static TableExprNode newColumnNode(const Table &tab, const String &name, const Vector< String > &fieldNames)
Create a column node on behalf of the Table class.
friend TableExprNode conj(const TableExprNode &node)
The complex conjugate of a complex node.
Definition: ExprNode.h:1600
Array< Int > getColumnInt(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1304
TableExprNode cmonth(const TableExprNode &node)
Definition: ExprNode.h:1691
TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1350
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:1592
friend TableExprNode week(const TableExprNode &node)
Definition: ExprNode.h:1740
TableExprNode runningMean(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1985
static PtrBlock< TableExprNodeRep * > convertBlockTEN(Block< TableExprNode > &nodes)
convert Block of TableExprNode to PtrBlock of TableExprNodeRep*.
TableExprNode findCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The sourcePos can contain multiple sources.
Definition: ExprNode.h:1451
friend TableExprNode arrayMask(const TableExprNode &array)
Get the mask of a masked array.
Definition: ExprNode.h:2110
friend TableExprNode fractile(const TableExprNode &array, const TableExprNode &fraction)
Definition: ExprNode.h:1854
virtual void disableApplySelection()
Do not apply the selection.
TableExprNode boxedMean(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2045
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:1839
TableExprNode nfalses(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1967
friend TableExprNode strlength(const TableExprNode &node)
String functions on scalars or arrays.
Definition: ExprNode.h:1627
TableExprNode boxedVariance(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2051
friend TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1647
friend TableExprNode weekday(const TableExprNode &node)
Definition: ExprNode.h:1696
TableExprNode angdist(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance between positions.
Definition: ExprNode.h:1427
for Int or Double array returning Int or Double
Definition: ExprFuncNode.h:138
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:2139
TableExprNode boxedRms(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2069
Class to hold values from table grammar parser.
Definition: TableParse.h:108
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:1647
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:1283
TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1687
friend TableExprNode nfalse(const TableExprNode &array)
Definition: ExprNode.h:1872
The identification of a TaQL selection subject.
Definition: TableExprId.h:98
LatticeExprNode asin(const LatticeExprNode &expr)
Array< uShort > getColumnuShort(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1302
friend TableExprNode ctodt(const TableExprNode &node)
Definition: ExprNode.h:1705
TableExprNode cdow(const TableExprNode &node)
Definition: ExprNode.h:1701
TableExprNode boxedMin(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2033
LatticeExprNode mean(const LatticeExprNode &expr)
Array< Double > getColumnDouble(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1310
virtual String getString(const TableExprId &id)
Table & table()
Get table.
Definition: ExprNodeRep.h:741
friend TableExprNode mean(const TableExprNode &array)
Definition: ExprNode.h:1824
TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1844
TableExprNode runningAvdev(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:2003
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:1265
Array< uInt > getColumnuInt(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1306
TableExprNodeRep * newEQ(TableExprNodeRep *right) const
Class to handle a Regex or StringDistance.
Definition: ExprNodeRep.h:75
LatticeExprNode acos(const LatticeExprNode &expr)
TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1510
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:1973
virtual MArray< String > getArrayString(const TableExprId &id)
TableExprNodeRep * newGE(TableExprNodeRep *right) const
friend TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1510
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:1819
TableExprNode capitalize(const TableExprNode &node)
Definition: ExprNode.h:1642
friend TableExprNode nfalses(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1967
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:1701
static TableRecord * findLastKeyRec(const TableRecord &keyset, const Vector< String > &fieldNames, String &fullName)
Handle all field names except the last one.
TableExprNode nearAbs(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1414
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:1312
TableExprNode stddevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1918
TableExprNode datetime(const TableExprNode &node)
Functions for date-values.
Definition: ExprNode.h:1661
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:1345
friend TableExprNode medians(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1936
Class to deal with Levensthein distance of strings.
TableExprNode avdevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1924
MArray< DComplex > getDComplexAS(const TableExprId &id)
TableExprNode mjdtodate(const TableExprNode &node)
Definition: ExprNode.h:1666
friend TableExprNode iif(const TableExprNode &condition, const TableExprNode &arg1, const TableExprNode &arg2)
Function resembling the ternary ?: construct in C++.
Definition: ExprNode.h:2155
friend TableExprNode arg(const TableExprNode &node)
The arg (i.e.
Definition: ExprNode.h:1608
TableExprNode ctodt(const TableExprNode &node)
Definition: ExprNode.h:1705
static void throwInvDT(const String &message)
Throw invalid data type exception.
friend TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1744
virtual DComplex getDComplex(const TableExprId &id)
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:1576
TableExprNodeRep * newDivide(TableExprNodeRep *right) const
LatticeExprNode ceil(const LatticeExprNode &expr)
friend TableExprNode imag(const TableExprNode &node)
The imaginary part of a complex node.
Definition: ExprNode.h:1588
for Int or Double array returning Double
Definition: ExprFuncNode.h:147
String getString(const TableExprId &id) const
Definition: ExprNode.h:1269
Array< Float > getColumnFloat(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1308
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:1930
friend TableExprNode sinh(const TableExprNode &node)
Definition: ExprNode.h:1506
TableExprNode ctime(const TableExprNode &node)
Definition: ExprNode.h:1713
TableExprNode hms(const TableExprNode &node)
Functions for angle-values.
Definition: ExprNode.h:1717
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:1401
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:2133
friend TableExprNode all(const TableExprNode &array)
Definition: ExprNode.h:1864
friend TableExprNode capitalize(const TableExprNode &node)
Definition: ExprNode.h:1642
Int64 getInt(const TableExprId &id) const
Definition: ExprNode.h:1263
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:2133
friend TableExprNode isdefined(const TableExprNode &array)
Function operating on a field resulting in a bool scalar.
Definition: ExprNode.h:2139
friend TableExprNode trim(const TableExprNode &node)
Definition: ExprNode.h:1748
friend TableExprNode anys(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1949
friend TableExprNode operator^(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1355
friend TableExprNode operator>=(const TableExprNode &left, const TableExprNode &right)
Not defined for Bool.
Definition: ExprNode.h:1375
TableExprNode operator()(const TableExprNodeSet &indices)
Slicing in a node containing an array.
Definition: ExprNode.h:1395
TableExprNode sums(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
The partial version of the functions above.
Definition: ExprNode.h:1876
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:1616
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:1942
virtual Array< Short > getColumnShort(const Vector< uInt > &rownrs)
friend TableExprNode sumSquares(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1888
TableExprNode week(const TableExprNode &node)
Definition: ExprNode.h:1740
TableExprNode hdms(const TableExprNode &node)
Definition: ExprNode.h:1725
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:111
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
TableExprNodeRep * newModulo(TableExprNodeRep *right) const
const Table & table() const
Get table.
Definition: ExprNode.h:1207
friend TableExprNode sign(const TableExprNode &node)
Definition: ExprNode.h:1544
friend TableExprNode sums(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
The partial version of the functions above.
Definition: ExprNode.h:1876
TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1675
friend TableExprNode variances(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1912
TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1604
friend TableExprNode product(const TableExprNode &array)
Definition: ExprNode.h:1814