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$
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/casa/Utilities/DataType.h>
39 #include <casacore/casa/BasicSL/Complex.h>
40 
41 namespace casacore { //# NAMESPACE CASACORE - BEGIN
42 
43 //# Forward Declarations
44 class Table;
45 class String;
46 class Regex;
47 class StringDistance;
48 class Unit;
49 class TableRecord;
50 class TableExprNodeSet;
51 template<class T> class Block;
52 template<class T> class Array;
53 class TableExprNode;
54 
55 
56 // Define all global functions operating on a TableExprNode.
57 // <group name=GlobalTableExprNode>
58 
59  //# Define the operations we allow.
60  //# Note that the arguments are defined as const. This is necessary
61  //# because the compiler generates temporaries when converting a constant
62  //# to a TableExprNode using the constructors. Temporaries has to be const.
63  //# However, we have to delete created nodes, so lnode_p and rnode_p
64  //# cannot be const. The const arguments are casted to a non-const in
65  //# the function fill which calls the non-const function simplify.
66 
67  // Arithmetic operators for numeric TableExprNode's.
68  // <group>
69  // + is also defined for strings (means concatenation).
70  TableExprNode operator+ (const TableExprNode& left,
71  const TableExprNode& right);
72  TableExprNode operator- (const TableExprNode& left,
73  const TableExprNode& right);
74  TableExprNode operator* (const TableExprNode& left,
75  const TableExprNode& right);
76  TableExprNode operator/ (const TableExprNode& left,
77  const TableExprNode& right);
78  TableExprNode operator% (const TableExprNode& left,
79  const TableExprNode& right);
80  TableExprNode operator& (const TableExprNode& left,
81  const TableExprNode& right);
82  TableExprNode operator| (const TableExprNode& left,
83  const TableExprNode& right);
84  TableExprNode operator^ (const TableExprNode& left,
85  const TableExprNode& right);
86  // </group>
87 
88  // Comparison operators.
89  // <group>
90  TableExprNode operator== (const TableExprNode& left,
91  const TableExprNode& right);
92  TableExprNode operator!= (const TableExprNode& left,
93  const TableExprNode& right);
94  // Not defined for Bool.
95  // <group>
96  TableExprNode operator>= (const TableExprNode& left,
97  const TableExprNode& right);
98  TableExprNode operator> (const TableExprNode& left,
99  const TableExprNode& right);
100  TableExprNode operator<= (const TableExprNode& left,
101  const TableExprNode& right);
102  TableExprNode operator< (const TableExprNode& left,
103  const TableExprNode& right);
104  // </group>
105  // </group>
106 
107  // Logical operators to combine boolean TableExprNode's.
108  // A null TableExprNode object is ignored, so it is possible to
109  // build up a full expression gradually.
110  // <group>
111  TableExprNode operator&& (const TableExprNode& left,
112  const TableExprNode& right);
113  TableExprNode operator|| (const TableExprNode& left,
114  const TableExprNode& right);
115  // </group>
116 
117  // Functions to return whether a value is "relatively" near another.
118  // Returns <src> tol > abs(val2 - val1)/max(abs(val1),(val2))</src>.
119  // If tol <= 0, returns val1 == val2. If either val is 0.0, takes
120  // care of area around the minimum number that can be represented.
121  // <br>The nearAbs functions return whether a value is "absolutely" near
122  // another. Returns <src> tol > abs(val2 - val1)</src>.
123  // Default tolerance is 1.0e-13.
124  // They operate on scalars and arrays.
125  // <group>
126  TableExprNode near (const TableExprNode& left,
127  const TableExprNode& right);
128  TableExprNode near (const TableExprNode& left,
129  const TableExprNode& right,
130  const TableExprNode& tolerance);
131  TableExprNode nearAbs (const TableExprNode& left,
132  const TableExprNode& right);
133  TableExprNode nearAbs (const TableExprNode& left,
134  const TableExprNode& right,
135  const TableExprNode& tolerance);
136  // </group>
137 
138  // Angular distance between positions.
139  // Both arguments have to be arrays. If both arrays contain 2 values
140  // (ra and dec), the result is a scalar.
141  // Otherwise the arrays have to contain a multiple of 2 values and the
142  // result is a 2-dim array giving the distance of each position in the
143  // first array to each position in the second array.
144  TableExprNode angdist (const TableExprNode& pos1,
145  const TableExprNode& pos2);
146 
147  // Angular distance as above, but only pair-wise enties are used if
148  // both arguments are arrays.
149  TableExprNode angdistx (const TableExprNode& pos1,
150  const TableExprNode& pos2);
151 
152  // Cone search; test if the position of a source is inside a cone.
153  // <br>Argument <src>sourcePos</src> must be a double array
154  // containing two values (ra and dec of source) in radians.
155  // <br>Argument <src>cones</src> must be a double array
156  // specifying the position of the cone centers and radii in radians.
157  // So the array must contain three values (ra,dec,radius)
158  // or a multiple of it.
159  // <group>
160  // The result is a bool array telling for each cone if it contains the
161  // source. If there is only one cone, the result is a scalar.
162  TableExprNode cones (const TableExprNode& sourcePos,
163  const TableExprNode& cones);
164  // The result is always a Bool scalar telling if any cone contains
165  // the source.
166  TableExprNode anyCone (const TableExprNode& sourcePos,
167  const TableExprNode& cones);
168  // The sourcePos can contain multiple sources.
169  // The result is a double array giving the index of the first
170  // cone containing the corresponding source.
171  // If there is one source, the result is a double scalar.
172  TableExprNode findCone (const TableExprNode& sourcePos,
173  const TableExprNode& cones);
174  // </group>
175 
176  // Cone search as above.
177  // However, the cone positions and radii are specified separately
178  // and (virtually) a larger array containing every combination of
179  // position/radius is formed.
180  // <group>
181  TableExprNode cones (const TableExprNode& sourcePos,
182  const TableExprNode& conePos,
183  const TableExprNode& radii);
184  TableExprNode anyCone (const TableExprNode& sourcePos,
185  const TableExprNode& conePos,
186  const TableExprNode& radii);
187  TableExprNode findCone (const TableExprNode& sourcePos,
188  const TableExprNode& conePos,
189  const TableExprNode& radii);
190  // </group>
191 
192  // Transcendental functions that can be applied to essentially all numeric
193  // nodes containing scalars or arrays.
194  // <group>
195  TableExprNode sin (const TableExprNode& node);
196  TableExprNode sinh (const TableExprNode& node);
197  TableExprNode cos (const TableExprNode& node);
198  TableExprNode cosh (const TableExprNode& node);
199  TableExprNode exp (const TableExprNode& node);
200  TableExprNode log (const TableExprNode& node);
201  TableExprNode log10 (const TableExprNode& node);
202  TableExprNode pow (const TableExprNode& x, const TableExprNode& exp);
203  TableExprNode square (const TableExprNode& node);
204  TableExprNode cube (const TableExprNode& node);
205  TableExprNode sqrt (const TableExprNode& node);
206  TableExprNode norm (const TableExprNode& node);
207  // </group>
208 
209  // Transcendental functions applied to to nodes containing scalars or
210  // arrays with double values.
211  // They are invalid for Complex nodes.
212  // <group>
213  TableExprNode asin (const TableExprNode& node);
214  TableExprNode acos (const TableExprNode& node);
215  TableExprNode atan (const TableExprNode& node);
216  TableExprNode atan2 (const TableExprNode& y,
217  const TableExprNode& x);
218  TableExprNode tan (const TableExprNode& node);
219  TableExprNode tanh (const TableExprNode& node);
220  TableExprNode sign (const TableExprNode& node);
221  TableExprNode round (const TableExprNode& node);
222  TableExprNode ceil (const TableExprNode& node);
223  TableExprNode abs (const TableExprNode& node);
224  TableExprNode floor (const TableExprNode& node);
225  TableExprNode fmod (const TableExprNode& x,
226  const TableExprNode& y);
227  // </group>
228 
229  // String functions on scalars or arrays.
230  // <group>
231  TableExprNode strlength (const TableExprNode& node);
232  TableExprNode upcase (const TableExprNode& node);
233  TableExprNode downcase (const TableExprNode& node);
234  TableExprNode capitalize(const TableExprNode& node);
235  TableExprNode trim (const TableExprNode& node);
236  TableExprNode ltrim (const TableExprNode& node);
237  TableExprNode rtrim (const TableExprNode& node);
238  TableExprNode substr (const TableExprNode& str,
239  const TableExprNode& pos);
240  TableExprNode substr (const TableExprNode& str,
241  const TableExprNode& pos,
242  const TableExprNode& npos);
243  TableExprNode replace (const TableExprNode& str,
244  const TableExprNode& patt);
245  TableExprNode replace (const TableExprNode& str,
246  const TableExprNode& patt,
247  const TableExprNode& repl);
248  // </group>
249 
250  // Functions for regular expression matching and
251  // pattern matching. Defined for scalars and arrays.
252  // <br><src>pattern</src> is for a file name like pattern.
253  // <br><src>sqlpattern</src> is for an SQL like pattern.
254  // <group>
255  TableExprNode regex (const TableExprNode& node);
256  TableExprNode pattern (const TableExprNode& node);
257  TableExprNode sqlpattern (const TableExprNode& node);
258  // </group>
259 
260  // Functions for date-values. Defined for scalars and arrays.
261  //# Note, ctod is called ctodt, because Mac OS-X defines a macro
262  //# ctod in param.h
263  // <group>
264  TableExprNode datetime (const TableExprNode& node);
265  TableExprNode mjdtodate (const TableExprNode& node);
266  TableExprNode mjd (const TableExprNode& node);
267  TableExprNode date (const TableExprNode& node);
268  TableExprNode year (const TableExprNode& node);
269  TableExprNode month (const TableExprNode& node);
270  TableExprNode day (const TableExprNode& node);
271  TableExprNode cmonth (const TableExprNode& node);
272  TableExprNode weekday (const TableExprNode& node);
273  TableExprNode cdow (const TableExprNode& node);
274  TableExprNode ctodt (const TableExprNode& node);
275  TableExprNode cdate (const TableExprNode& node);
276  TableExprNode ctime (const TableExprNode& node);
277  TableExprNode week (const TableExprNode& node);
278  TableExprNode time (const TableExprNode& node);
279  // </group>
280 
281  // Functions for angle-values. Defined for scalars and arrays.
282  // dhms converts pairs of values to hms and dms and only works for arrays.
283  // <group>
284  TableExprNode hms (const TableExprNode& node);
285  TableExprNode dms (const TableExprNode& node);
286  TableExprNode hdms (const TableExprNode& node);
287  // </group>
288 
289  // Function to convert any value to a string.
290  // See TaQL note 199 for possible format values.
291  // <group>
292  TableExprNode toString (const TableExprNode& node);
293  TableExprNode toString (const TableExprNode& node,
294  const TableExprNode& format);
295  // </group>
296 
297  // Function to test if a scalar or array is NaN (not-a-number).
298  // It results in a Bool scalar or array.
299  TableExprNode isNaN (const TableExprNode& node);
300 
301  // Function to test if a scalar or array is finite.
302  // It results in a Bool scalar or array.
303  TableExprNode isFinite (const TableExprNode& node);
304 
305  // Minimum or maximum of 2 nodes.
306  // Makes sense for numeric and String values. For Complex values
307  // the norm is compared.
308  // One or both arguments can be scalar or array.
309  // <group>
310  TableExprNode min (const TableExprNode& a, const TableExprNode& b);
311  TableExprNode max (const TableExprNode& a, const TableExprNode& b);
312  // </group>
313 
314  // The complex conjugate of a complex node.
315  // Defined for scalars and arrays.
316  TableExprNode conj (const TableExprNode& node);
317 
318  // The real part of a complex node.
319  // Defined for scalars and arrays.
320  TableExprNode real (const TableExprNode& node);
321 
322  // The imaginary part of a complex node.
323  // Defined for scalars and arrays.
324  TableExprNode imag (const TableExprNode& node);
325 
326  // Convert double to int (using floor).
327  TableExprNode integer (const TableExprNode& node);
328 
329  // The amplitude (i.e. sqrt(re*re + im*im)) of a complex node.
330  // This is a synonym for function abs.
331  // Defined for scalars and arrays.
332  TableExprNode amplitude (const TableExprNode& node);
333 
334  // The phase (i.e. atan2(im, re)) of a complex node.
335  // This is a synonym for function arg.
336  // Defined for scalars and arrays.
337  TableExprNode phase (const TableExprNode& node);
338 
339  // The arg (i.e. atan2(im, re)) of a complex node.
340  // Defined for scalars and arrays.
341  TableExprNode arg (const TableExprNode& node);
342 
343  // Form a complex number from two Doubles.
344  // One or both arguments can be scalar or array.
345  TableExprNode formComplex (const TableExprNode& real,
346  const TableExprNode& imag);
347 
348  // Functions operating on a Double or Complex scalar or array resulting in
349  // a scalar with the same data type.
350  // <group>
351  TableExprNode sum (const TableExprNode& array);
352  TableExprNode product (const TableExprNode& array);
353  TableExprNode sumSquare (const TableExprNode& array);
354  // </group>
355 
356  // Functions operating on a Double scalar or array resulting in
357  // a Double scalar.
358  // <group>
359  TableExprNode min (const TableExprNode& array);
360  TableExprNode max (const TableExprNode& array);
361  TableExprNode mean (const TableExprNode& array);
362  TableExprNode variance (const TableExprNode& array);
363  TableExprNode stddev (const TableExprNode& array);
364  TableExprNode avdev (const TableExprNode& array);
365  TableExprNode rms (const TableExprNode& array);
366  TableExprNode median (const TableExprNode& array);
367  TableExprNode fractile (const TableExprNode& array,
368  const TableExprNode& fraction);
369  // </group>
370 
371  // <group>
372  TableExprNode any (const TableExprNode& array);
373  TableExprNode all (const TableExprNode& array);
374  TableExprNode ntrue (const TableExprNode& array);
375  TableExprNode nfalse (const TableExprNode& array);
376  // </group>
377 
378  // The partial version of the functions above.
379  // They are applied to the array subsets defined by the axes in the set
380  // using the partialXXX functions in ArrayMath.
381  // The axes must be 0-relative.
382  // <group>
383  TableExprNode sums (const TableExprNode& array,
384  const TableExprNodeSet& collapseAxes);
385  TableExprNode products (const TableExprNode& array,
386  const TableExprNodeSet& collapseAxes);
387  TableExprNode sumSquares (const TableExprNode& array,
388  const TableExprNodeSet& collapseAxes);
389  TableExprNode mins (const TableExprNode& array,
390  const TableExprNodeSet& collapseAxes);
391  TableExprNode maxs (const TableExprNode& array,
392  const TableExprNodeSet& collapseAxes);
393  TableExprNode means (const TableExprNode& array,
394  const TableExprNodeSet& collapseAxes);
395  TableExprNode variances (const TableExprNode& array,
396  const TableExprNodeSet& collapseAxes);
397  TableExprNode stddevs (const TableExprNode& array,
398  const TableExprNodeSet& collapseAxes);
399  TableExprNode avdevs (const TableExprNode& array,
400  const TableExprNodeSet& collapseAxes);
401  TableExprNode rmss (const TableExprNode& array,
402  const TableExprNodeSet& collapseAxes);
403  TableExprNode medians (const TableExprNode& array,
404  const TableExprNodeSet& collapseAxes);
405  TableExprNode fractiles (const TableExprNode& array,
406  const TableExprNode& fraction,
407  const TableExprNodeSet& collapseAxes);
408  TableExprNode anys (const TableExprNode& array,
409  const TableExprNodeSet& collapseAxes);
410  TableExprNode alls (const TableExprNode& array,
411  const TableExprNodeSet& collapseAxes);
412  TableExprNode ntrues (const TableExprNode& array,
413  const TableExprNodeSet& collapseAxes);
414  TableExprNode nfalses (const TableExprNode& array,
415  const TableExprNodeSet& collapseAxes);
416  // </group>
417 
418  // Functions operating for each element on a box around that element.
419  // The elements at the edges (where no full box can be made) are set to 0.
420  // <group>
421  TableExprNode runningMin (const TableExprNode& array,
422  const TableExprNodeSet& halfBoxWidth);
423  TableExprNode runningMax (const TableExprNode& array,
424  const TableExprNodeSet& halfBoxWidth);
425  TableExprNode runningMean (const TableExprNode& array,
426  const TableExprNodeSet& halfBoxWidth);
427  TableExprNode runningVariance (const TableExprNode& array,
428  const TableExprNodeSet& halfBoxWidth);
429  TableExprNode runningStddev (const TableExprNode& array,
430  const TableExprNodeSet& halfBoxWidth);
431  TableExprNode runningAvdev (const TableExprNode& array,
432  const TableExprNodeSet& halfBoxWidth);
433  TableExprNode runningRms (const TableExprNode& array,
434  const TableExprNodeSet& halfBoxWidth);
435  TableExprNode runningMedian (const TableExprNode& array,
436  const TableExprNodeSet& halfBoxWidth);
437  TableExprNode runningAny (const TableExprNode& array,
438  const TableExprNodeSet& halfBoxWidth);
439  TableExprNode runningAll (const TableExprNode& array,
440  const TableExprNodeSet& halfBoxWidth);
441  // </group>
442 
443  // Create an array of the given shape and fill it with the values.
444  // The <src>values</src> array is rewound as needed.
445  TableExprNode array (const TableExprNode& values,
446  const TableExprNodeSet& shape);
447 
448  // Transpose all axes of an array.
449  TableExprNode transpose (const TableExprNode& array);
450  // Transpose an array by making the given axes the first axes.
451  TableExprNode transpose (const TableExprNode& array,
452  const TableExprNode& axes);
453 
454  // Function operating on a field resulting in a bool scalar.
455  // It can be used to test if a column has an array in the current row.
456  // It can also be used to test if a record contains a field.
457  TableExprNode isdefined (const TableExprNode& array);
458 
459  // Functions operating on any scalar or array resulting in a Double scalar.
460  // A scalar has 1 element and dimensionality 0.
461  // <group>
462  TableExprNode nelements (const TableExprNode& array);
463  TableExprNode ndim (const TableExprNode& array);
464  // </group>
465 
466  // Function operating on any scalar or array resulting in a Double array
467  // containing the shape. A scalar has shape [1].
468  TableExprNode shape (const TableExprNode& array);
469 
470  // Function resembling the ternary <src>?:</src> construct in C++.
471  // The argument "condition" has to be a Bool value.
472  // If an element in "condition" is True, the corresponding element from
473  // "arg1" is taken, otherwise it is taken from "arg2".
474  // The arguments can be scalars or array or any combination.
475  TableExprNode iif (const TableExprNode& condition,
476  const TableExprNode& arg1,
477  const TableExprNode& arg2);
478 // </group>
479 
480 
481 
482 // <summary>
483 // Handle class for a table column expression tree
484 // </summary>
485 
486 // <use visibility=export>
487 
488 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
489 // </reviewed>
490 
491 // <prerequisite>
492 //# Classes you should understand before using this one.
493 // <li> <linkto class=Table>Table</linkto>
494 // <li> Note 199 describing
495 // <a href="../notes/199.html">
496 // TaQL</a>
497 // </prerequisite>
498 
499 // <etymology>
500 // TableExprNode represents a node in the tree reflecting a
501 // table select expression.
502 // </etymology>
503 
504 // <synopsis>
505 // TableExprNode is the class to store a table select expression,
506 // which allows to select rows from the table. The selected rows form
507 // a table which is a view of the original table.
508 // <p>
509 // TableExprNode is a handle class for the counted referenced class
510 // TableExprNodeRep.
511 // Classes (like TableExprNodePlusXX) derived from TableExprNodeRep
512 // hold the individual
513 // nodes in the expression, i.e. the operators and operands. The nodes
514 // form a binary tree reflecting the expression.
515 // E.g. the expression 2*COLUMN results in the node TableExprNodeTimes
516 // with its children TableExprNodeConst and TableExprNodeColumn.
517 // Constant subexpressions (like 2*3) are evaluated immediately and
518 // only the result is stored as a node.
519 // <p>
520 // There are a few TableExprNode constructors taking a constant scalar or array.
521 // In this way constant value are automatically converted to the
522 // appropriate TableExprNodeConst object.
523 // <p>
524 // The derived classes also reflect the data type of the node.
525 // Data types Bool, Double, DComplex and String are used.
526 // Char, uChar, Short, uShort, Int, uInt and float are converted
527 // to Double and Complex to DComplex.
528 // Binary operators +, -, *, /, %, &, }, ^, ==, >=, >, <, <= and != are
529 // recognized. Also &&, ||, parentheses and unary +, -, ~ and ! are recognized.
530 // For strings the binary operator + can also be used.
531 // The operators have the normal C++ precedence.
532 // Furthermore functions (like sin, max, ceil) can be used in an expression.
533 // <br>Operator() can be used to take a slice from an array.
534 // <p>
535 // The Table function col has to be used to create a TableExprNode
536 // object for a column in the table. The Table
537 // <linkto file="Table.h#keycol">operator()</linkto> can be used
538 // the do the actual selection from the top TableExprNode object.
539 // </synopsis>
540 
541 // <example>
542 // <srcblock>
543 // // Select from table X all rows where column RA<5 and where column
544 // // SWITCH is true.
545 // Table table("X");
546 // Table subtable = table(table.col("RA") < 5 && table.col("SWITCH"));
547 //
548 // // Select from that result all rows where the concatenation of
549 // // the strings in columns STR1 and STR2 is equal to the string
550 // // in keyword STRKEY.
551 // Table subsub = subtable(subtable.col("STR1") + subtable.col("STR2")
552 // == subtable.key("STRKEY"));
553 // </srcblock>
554 // </example>
555 
556 // <motivation>
557 // Having TableExprNode as a handle class makes it possible to
558 // handle temporary objects created by the compiler in a smooth way.
559 // TableExprNode and its derivations allow to store an expression
560 // before actually evaluating it. This also allows the classes to
561 // be used by the table expression parser defined in TableParse and
562 // TableGram.
563 //
564 // For each operator a special derived class is implemented.
565 // Another approach could have been to store the operator as
566 // a flag and switch on that. However, that causes extra overhead
567 // and the C++ virtual function mechanism is the designed for
568 // these purposes.
569 // </motivation>
570 
571 // <todo asof="$DATE:$">
572 //# A List of bugs, limitations, extensions or planned refinements.
573 // <li> add operations on arrays
574 // <li> add selection by comparing with a set of values
575 // </todo>
576 
577 
579 {
580  //# Define the next 2 classes as friends to get the node_p.
581  friend class TableExprNodeRep;
582  friend class TableParse;
583 
584  //# Define the operations we allow.
585  //# Note that the arguments are defined as const. This is necessary
586  //# because the compiler generates temporaries when converting a constant
587  //# to a TableExprNode using the constructors. Temporaries has to be const.
588  //# However, we have to delete created nodes, so lnode_p and rnode_p
589  //# cannot be const. The const arguments are casted to a non-const in
590  //# the function fill which calls the non-const function simplify.
591 
592  // Define all global functions as friends.
593  // <group>
594  friend TableExprNode operator+ (const TableExprNode& left,
595  const TableExprNode& right);
596  friend TableExprNode operator- (const TableExprNode& left,
597  const TableExprNode& right);
598  friend TableExprNode operator* (const TableExprNode& left,
599  const TableExprNode& right);
600  friend TableExprNode operator/ (const TableExprNode& left,
601  const TableExprNode& right);
602  friend TableExprNode operator% (const TableExprNode& left,
603  const TableExprNode& right);
604  friend TableExprNode operator& (const TableExprNode& left,
605  const TableExprNode& right);
606  friend TableExprNode operator| (const TableExprNode& left,
607  const TableExprNode& right);
608  friend TableExprNode operator^ (const TableExprNode& left,
609  const TableExprNode& right);
610  friend TableExprNode operator== (const TableExprNode& left,
611  const TableExprNode& right);
612  friend TableExprNode operator!= (const TableExprNode& left,
613  const TableExprNode& right);
614  friend TableExprNode operator>= (const TableExprNode& left,
615  const TableExprNode& right);
616  friend TableExprNode operator> (const TableExprNode& left,
617  const TableExprNode& right);
618  friend TableExprNode operator<= (const TableExprNode& left,
619  const TableExprNode& right);
620  friend TableExprNode operator< (const TableExprNode& left,
621  const TableExprNode& right);
622  friend TableExprNode operator&& (const TableExprNode& left,
623  const TableExprNode& right);
624  friend TableExprNode operator|| (const TableExprNode& left,
625  const TableExprNode& right);
626  friend TableExprNode near (const TableExprNode& left,
627  const TableExprNode& right);
628  friend TableExprNode near (const TableExprNode& left,
629  const TableExprNode& right,
630  const TableExprNode& tolerance);
631  friend TableExprNode nearAbs (const TableExprNode& left,
632  const TableExprNode& right);
633  friend TableExprNode nearAbs (const TableExprNode& left,
634  const TableExprNode& right,
635  const TableExprNode& tolerance);
636  friend TableExprNode angdist (const TableExprNode& pos1,
637  const TableExprNode& pos2);
638  friend TableExprNode cones (const TableExprNode& sourcePos,
639  const TableExprNode& cones);
640  friend TableExprNode anyCone (const TableExprNode& sourcePos,
641  const TableExprNode& cones);
642  friend TableExprNode findCone (const TableExprNode& sourcePos,
643  const TableExprNode& cones);
644  friend TableExprNode cones (const TableExprNode& sourcePos,
645  const TableExprNode& conePos,
646  const TableExprNode& radii);
647  friend TableExprNode anyCone (const TableExprNode& sourcePos,
648  const TableExprNode& conePos,
649  const TableExprNode& radii);
650  friend TableExprNode findCone (const TableExprNode& sourcePos,
651  const TableExprNode& conePos,
652  const TableExprNode& radii);
653  friend TableExprNode sin (const TableExprNode& node);
654  friend TableExprNode sinh (const TableExprNode& node);
655  friend TableExprNode cos (const TableExprNode& node);
656  friend TableExprNode cosh (const TableExprNode& node);
657  friend TableExprNode exp (const TableExprNode& node);
658  friend TableExprNode log (const TableExprNode& node);
659  friend TableExprNode log10 (const TableExprNode& node);
660  friend TableExprNode pow (const TableExprNode& x,
661  const TableExprNode& exp);
662  friend TableExprNode square (const TableExprNode& node);
663  friend TableExprNode cube (const TableExprNode& node);
664  friend TableExprNode sqrt (const TableExprNode& node);
665  friend TableExprNode norm (const TableExprNode& node);
666  friend TableExprNode asin (const TableExprNode& node);
667  friend TableExprNode acos (const TableExprNode& node);
668  friend TableExprNode atan (const TableExprNode& node);
669  friend TableExprNode atan2 (const TableExprNode& y,
670  const TableExprNode& x);
671  friend TableExprNode tan (const TableExprNode& node);
672  friend TableExprNode tanh (const TableExprNode& node);
673  friend TableExprNode sign (const TableExprNode& node);
674  friend TableExprNode round (const TableExprNode& node);
675  friend TableExprNode ceil (const TableExprNode& node);
676  friend TableExprNode abs (const TableExprNode& node);
677  friend TableExprNode floor (const TableExprNode& node);
678  friend TableExprNode fmod (const TableExprNode& x,
679  const TableExprNode& y);
680  friend TableExprNode strlength (const TableExprNode& node);
681  friend TableExprNode upcase (const TableExprNode& node);
682  friend TableExprNode downcase (const TableExprNode& node);
683  friend TableExprNode capitalize(const TableExprNode& node);
684  friend TableExprNode trim (const TableExprNode& node);
685  friend TableExprNode ltrim (const TableExprNode& node);
686  friend TableExprNode rtrim (const TableExprNode& node);
687  friend TableExprNode substr (const TableExprNode& str,
688  const TableExprNode& pos);
689  friend TableExprNode substr (const TableExprNode& str,
690  const TableExprNode& pos,
691  const TableExprNode& npos);
692  friend TableExprNode replace (const TableExprNode& str,
693  const TableExprNode& patt);
694  friend TableExprNode replace (const TableExprNode& str,
695  const TableExprNode& patt,
696  const TableExprNode& repl);
697  friend TableExprNode regex (const TableExprNode& node);
698  friend TableExprNode pattern (const TableExprNode& node);
699  friend TableExprNode sqlpattern(const TableExprNode& node);
700  friend TableExprNode datetime (const TableExprNode& node);
701  friend TableExprNode mjdtodate (const TableExprNode& node);
702  friend TableExprNode mjd (const TableExprNode& node);
703  friend TableExprNode date (const TableExprNode& node);
704  friend TableExprNode year (const TableExprNode& node);
705  friend TableExprNode month (const TableExprNode& node);
706  friend TableExprNode day (const TableExprNode& node);
707  friend TableExprNode cmonth (const TableExprNode& node);
708  friend TableExprNode weekday (const TableExprNode& node);
709  friend TableExprNode cdow (const TableExprNode& node);
710  friend TableExprNode ctodt (const TableExprNode& node);
711  friend TableExprNode cdate (const TableExprNode& node);
712  friend TableExprNode ctime (const TableExprNode& node);
713  friend TableExprNode week (const TableExprNode& node);
714  friend TableExprNode time (const TableExprNode& node);
715  friend TableExprNode isNaN (const TableExprNode& node);
716  friend TableExprNode isFinite (const TableExprNode& node);
717  friend TableExprNode min (const TableExprNode& a, const TableExprNode& b);
718  friend TableExprNode max (const TableExprNode& a, const TableExprNode& b);
719  friend TableExprNode conj (const TableExprNode& node);
720  friend TableExprNode real (const TableExprNode& node);
721  friend TableExprNode imag (const TableExprNode& node);
722  friend TableExprNode amplitude (const TableExprNode& node);
723  friend TableExprNode phase (const TableExprNode& node);
724  friend TableExprNode arg (const TableExprNode& node);
726  const TableExprNode& imag);
727  friend TableExprNode sum (const TableExprNode& array);
728  friend TableExprNode product (const TableExprNode& array);
729  friend TableExprNode sumSquare (const TableExprNode& array);
730  friend TableExprNode min (const TableExprNode& array);
731  friend TableExprNode max (const TableExprNode& array);
732  friend TableExprNode mean (const TableExprNode& array);
733  friend TableExprNode variance (const TableExprNode& array);
734  friend TableExprNode stddev (const TableExprNode& array);
735  friend TableExprNode avdev (const TableExprNode& array);
736  friend TableExprNode rms (const TableExprNode& array);
737  friend TableExprNode median (const TableExprNode& array);
738  friend TableExprNode fractile (const TableExprNode& array,
739  const TableExprNode& fraction);
740  friend TableExprNode any (const TableExprNode& array);
741  friend TableExprNode all (const TableExprNode& array);
742  friend TableExprNode ntrue (const TableExprNode& array);
743  friend TableExprNode nfalse (const TableExprNode& array);
744  friend TableExprNode sums (const TableExprNode& array,
745  const TableExprNodeSet& collapseAxes);
746  friend TableExprNode products (const TableExprNode& array,
747  const TableExprNodeSet& collapseAxes);
749  const TableExprNodeSet& collapseAxes);
750  friend TableExprNode mins (const TableExprNode& array,
751  const TableExprNodeSet& collapseAxes);
752  friend TableExprNode maxs (const TableExprNode& array,
753  const TableExprNodeSet& collapseAxes);
754  friend TableExprNode means (const TableExprNode& array,
755  const TableExprNodeSet& collapseAxes);
757  const TableExprNodeSet& collapseAxes);
758  friend TableExprNode stddevs (const TableExprNode& array,
759  const TableExprNodeSet& collapseAxes);
760  friend TableExprNode avdevs (const TableExprNode& array,
761  const TableExprNodeSet& collapseAxes);
762  friend TableExprNode rmss (const TableExprNode& array,
763  const TableExprNodeSet& collapseAxes);
764  friend TableExprNode medians (const TableExprNode& array,
765  const TableExprNodeSet& collapseAxes);
767  const TableExprNode& fraction,
768  const TableExprNodeSet& collapseAxes);
769  friend TableExprNode anys (const TableExprNode& array,
770  const TableExprNodeSet& collapseAxes);
771  friend TableExprNode alls (const TableExprNode& array,
772  const TableExprNodeSet& collapseAxes);
773  friend TableExprNode ntrues (const TableExprNode& array,
774  const TableExprNodeSet& collapseAxes);
775  friend TableExprNode nfalses (const TableExprNode& array,
776  const TableExprNodeSet& collapseAxes);
787  friend TableExprNode array (const TableExprNode& values,
788  const TableExprNodeSet& shape);
789  friend TableExprNode transpose (const TableExprNode& array);
791  const TableExprNode& axes);
792  friend TableExprNode isdefined (const TableExprNode& array);
793  friend TableExprNode nelements (const TableExprNode& array);
794  friend TableExprNode ndim (const TableExprNode& array);
795  friend TableExprNode shape (const TableExprNode& array);
796  friend TableExprNode iif (const TableExprNode& condition,
797  const TableExprNode& arg1,
798  const TableExprNode& arg2);
799  // </group>
800 
801 public:
802  TableExprNode ();
803 
804  // Unary operators on numeric TableExprNode's.
805  // <group>
806  TableExprNode operator+ () const;
807  TableExprNode operator- () const;
808  // </group>
809  // Unary NOT-operator on boolean TableExprNode's.
810  TableExprNode operator! () const;
811  // Unary bitwise negate-operator on integer TableExprNode's.
812  TableExprNode operator~ () const;
813 
814  // Slicing in a node containing an array. It is possible to
815  // address a single pixel or an n-dimensional subarray.
816  // In case of a single pixel the result is a scalar node.
817  // Otherwise the result is an array node with the same dimensionality
818  // as the source.
819  // <br>Note that there exist TableExprNodeSet constructors to
820  // convert an <src>IPosition</src> or <src>Slicer</src> object
821  // automatically to a <src>TableExprNodeSet</src>.
822  // An <src>IPosition</src> addresses a single element and results in
823  // a scalar node, while a <src>Slicer</src> can address multiple
824  // elements and always results in an array node.
826 
827  // The IN operator to test if a value is contained in an array or set.
828  // The array can also be a scalar.
829  // <group>
831  const TaQLStyle& = TaQLStyle(0)) const;
832  TableExprNode in (const TableExprNodeSet& set,
833  const TaQLStyle& = TaQLStyle(0)) const;
834  // </group>
835 
836  // Use a unit for the given TableExprNode.
837  // Note that if a column has a unit, it is automatically set. In that case
838  // this can be used to convert units.
839  TableExprNode useUnit (const Unit& unit) const;
840 
841  // Constructors to convert a constant value to a TableExprNode.
842  // The constructor for char* is also supported to convert a
843  // character-array to a string, since a two step conversion
844  // is not done automatically.
845  // <group>
846  TableExprNode (const Bool& value);
847  TableExprNode (const Int64& value);
848  TableExprNode (const Int& value);
849  TableExprNode (const uInt& value);
850  TableExprNode (const Float& value);
851  TableExprNode (const Double& value);
852  TableExprNode (const Complex& value);
853  TableExprNode (const DComplex& value);
854  TableExprNode (const String& value);
855  TableExprNode (const std::string& value);
856  TableExprNode (const char*);
857  TableExprNode (const Regex& value);
859  TableExprNode (const TaqlRegex& value);
860  TableExprNode (const MVTime& value);
865  TableExprNode (const Array<Int>& value);
873  // </group>
874 
875  // Construct a node from a node representation.
877 
878  // copy constructor (reference semantics).
879  TableExprNode (const TableExprNode&);
880 
881  // Assignment (reference semantics).
883 
884  // The destructor deletes all the underlying TableExprNode objects,
885  ~TableExprNode ();
886 
887  // Does the node contain no actual node?
888  Bool isNull() const
889  { return node_p == 0; }
890 
891  // Re-create the column object for a selection of rows.
892  // Nothing is done if the node does not represent a column object.
893  void applySelection (const Vector<uInt>& rownrs)
894  { node_p->applySelection (rownrs); }
895 
896  // Get the unit of the expression.
897  const Unit& unit() const
898  { return node_p->unit(); }
899 
900  // Get the data type of the expression.
901  // Currently the only possible values are TpBool, TpInt, TpDouble,
902  // TpDComplex, TpString, and TpOther.
903  // The latter is returned for a date or regex.
904  DataType dataType() const;
905 
906  // Is the expression a scalar?
907  Bool isScalar() const
908  { return (node_p->valueType() == TableExprNodeRep::VTScalar); }
909 
910  // Get the number of rows in the table associated with this expression.
911  // One is returned if the expression is a constant.
912  // Zero is returned if no table is associated with it.
913  uInt nrow() const
914  { return node_p->nrow(); }
915 
916  // Is the result value defined?
917  // Normally it is, but not for a column with an undefined value.
918  Bool isResultDefined (const TableExprId& id) const
919  { return node_p->isDefined (id); }
920 
921  // Get a value for this node in the given row.
922  // These functions are implemented in the derived classes and
923  // will usually invoke the get in their children and apply the
924  // operator on the resulting values.
925  // <group>
926  void get (const TableExprId& id, Bool& value) const;
927  void get (const TableExprId& id, Int64& value) const;
928  void get (const TableExprId& id, Double& value) const;
929  void get (const TableExprId& id, DComplex& value) const;
930  void get (const TableExprId& id, String& value) const;
931  void get (const TableExprId& id, TaqlRegex& value) const;
932  void get (const TableExprId& id, MVTime& value) const;
933  void get (const TableExprId& id, Array<Bool>& value) const;
934  void get (const TableExprId& id, Array<Int64>& value) const;
935  void get (const TableExprId& id, Array<Double>& value) const;
936  void get (const TableExprId& id, Array<DComplex>& value) const;
937  void get (const TableExprId& id, Array<String>& value) const;
938  void get (const TableExprId& id, Array<MVTime>& value) const;
939  Bool getBool (const TableExprId& id) const;
940  Int64 getInt (const TableExprId& id) const;
941  Double getDouble (const TableExprId& id) const;
942  DComplex getDComplex (const TableExprId& id) const;
943  String getString (const TableExprId& id) const;
944  Array<Bool> getArrayBool (const TableExprId& id) const;
945  Array<Int64> getArrayInt (const TableExprId& id) const;
946  Array<Double> getArrayDouble (const TableExprId& id) const;
947  Array<DComplex> getArrayDComplex (const TableExprId& id) const;
948  Array<String> getArrayString (const TableExprId& id) const;
949  // Get a value as an array, even it it is a scalar.
950  // This is useful in case one can give an argument as scalar or array.
951  // <group>
952  Array<Bool> getBoolAS (const TableExprId& id) const;
953  Array<Int64> getIntAS (const TableExprId& id) const;
954  Array<Double> getDoubleAS (const TableExprId& id) const;
955  Array<DComplex> getDComplexAS (const TableExprId& id) const;
956  Array<String> getStringAS (const TableExprId& id) const;
957  // </group>
958 
959  // </group>
960 
961  // Get the data type for doing a getColumn on the expression.
962  // This is the data type of the column if the expression
963  // consists of a single column only.
964  // Otherwise it is the expression data type as returned by
965  // function <src>dataType</src>.
966  DataType getColumnDataType() const;
967 
968  // Get the value of the expression evaluated for the entire column.
969  // The data of function called should match the data type as
970  // returned by function <src>getColumnDataType</src>.
971  // <group>
972  Array<Bool> getColumnBool (const Vector<uInt>& rownrs) const;
973  Array<uChar> getColumnuChar (const Vector<uInt>& rownrs) const;
974  Array<Short> getColumnShort (const Vector<uInt>& rownrs) const;
975  Array<uShort> getColumnuShort (const Vector<uInt>& rownrs) const;
976  Array<Int> getColumnInt (const Vector<uInt>& rownrs) const;
977  Array<uInt> getColumnuInt (const Vector<uInt>& rownrs) const;
978  Array<Float> getColumnFloat (const Vector<uInt>& rownrs) const;
979  Array<Double> getColumnDouble (const Vector<uInt>& rownrs) const;
980  Array<Complex> getColumnComplex (const Vector<uInt>& rownrs) const;
981  Array<DComplex> getColumnDComplex (const Vector<uInt>& rownrs) const;
982  Array<String> getColumnString (const Vector<uInt>& rownrs) const;
983  // </group>
984 
985  // Show the tree.
986  void show (ostream&) const;
987 
988  // Convert the tree to a number of range vectors which at least
989  // select the same things.
990  // This function is very useful to convert the expression to
991  // some intervals covering the select expression. This can
992  // be used to do a rough fast selection via an index and do the
993  // the slower final selection on that much smaller subset.
994  // The function can only convert direct comparisons of columns
995  // with constants (via ==, !=, >, >=, < or <=) and their combinations
996  // using && or ||.
998 
999  // Check if tables used in expression have the same number of
1000  // rows as the given table.
1001  Bool checkTableSize (const Table& table, Bool canBeConst) const;
1002 
1003  // Get table. This gets the Table object to which a
1004  // TableExprNode belongs. A TableExprNode belongs to the Table to
1005  // which the column(s) used in an expression belong. Note that
1006  // all columns in an expression have to belong to the same table.
1007  const Table& table() const;
1008 
1009  // Create a column node on behalf of the Table class.
1010  // For builtin data types another type of node is created than
1011  // for other data types.
1012  // isArray indicates if the column should be an array column.
1013  static TableExprNode newColumnNode (const Table& tab,
1014  const String& name,
1015  const Vector<String>& fieldNames);
1016 
1017  // Create a TableExprNodeConst for a table keyword
1018  // (which is handled as a constant).
1019  static TableExprNode newKeyConst (const TableRecord&,
1020  const Vector<String>& fieldNames);
1021 
1022  // Throw invalid data type exception.
1023  static void throwInvDT (const String& message);
1024 
1025  // Create function node of the given type with the given arguments.
1026  // <group>
1028  const TableExprNodeSet& set,
1029  const Table& table,
1030  const TaQLStyle& = TaQLStyle(0));
1032  const TableExprNode& node);
1034  const TableExprNode& node1,
1035  const TableExprNode& node2);
1037  const TableExprNode& node1,
1038  const TableExprNode& node2,
1039  const TableExprNode& node3);
1041  const TableExprNode& array,
1042  const TableExprNodeSet& axes);
1044  const TableExprNode& array,
1045  const TableExprNode& node,
1046  const TableExprNodeSet& axes);
1047  // </group>
1048 
1049  // Create a user defined function node.
1050  static TableExprNode newUDFNode (const String& name,
1051  const TableExprNodeSet& set,
1052  const Table& table,
1053  const TaQLStyle& = TaQLStyle(0));
1054 
1055  // Create cone function node of the given type with the given arguments.
1056  // <group>
1058  const TableExprNodeSet& set,
1059  uInt origin = 0);
1061  const TableExprNode& node1,
1062  const TableExprNode& node2);
1064  const TableExprNode& node1,
1065  const TableExprNode& node2,
1066  const TableExprNode& node3);
1067  // </group>
1068 
1069  // Create rownumber() function node.
1070  // Origin indicates whether the first row should be zero (for C++ binding)
1071  // or an other value (one for TaQL binding).
1072  static TableExprNode newRownrNode (const Table& table, uInt origin);
1073 
1074  // Create rowid() function node.
1075  // Origin is always 0.
1076  static TableExprNode newRowidNode (const Table& table);
1077 
1078  // Create rand() function node.
1079  static TableExprNode newRandomNode (const Table& table);
1080 
1081  // Create ArrayElement node for the given array with the given index.
1082  // The origin is 0 for C++ and 1 for TaQL.
1083  static TableExprNode newArrayPartNode (const TableExprNode& arrayNode,
1084  const TableExprNodeSet& indices,
1085  const TaQLStyle& = TaQLStyle(0));
1086 
1087  // returns const pointer to the representation-object of it
1088  const TableExprNodeRep* getNodeRep() const;
1089 
1090  // Adapt the unit of the expression to the given unit (if not empty).
1091  void adaptUnit (const Unit&);
1092 
1093 private:
1094  // returns non-const pointer to the representation-object of it
1096 
1097  // convert Block of TableExprNode to PtrBlock of TableExprNodeRep*.
1099  (Block<TableExprNode>& nodes);
1100 
1101  // Construct a new node for the given operation.
1102  // <group>
1103  TableExprNodeRep* newPlus (TableExprNodeRep* right) const;
1104  TableExprNodeRep* newMinus (TableExprNodeRep* right) const;
1105  TableExprNodeRep* newTimes (TableExprNodeRep* right) const;
1109  TableExprNodeRep* newBitOr (TableExprNodeRep* right) const;
1111  TableExprNodeRep* newEQ (TableExprNodeRep* right) const;
1112  TableExprNodeRep* newNE (TableExprNodeRep* right) const;
1113  TableExprNodeRep* newGE (TableExprNodeRep* right) const;
1114  TableExprNodeRep* newGT (TableExprNodeRep* right) const;
1116  const TaQLStyle&) const;
1117  TableExprNodeRep* newOR (TableExprNodeRep* right) const;
1118  TableExprNodeRep* newAND (TableExprNodeRep* right) const;
1119  // </group>
1120 
1121  // The actual (counted referenced) representation of a node.
1123 };
1124 
1125 
1126 
1128  { node_p->ranges (blrange); }
1129 
1130 //# Get the table from which the node is derived.
1131 inline const Table& TableExprNode::table() const
1132  { return node_p->table(); }
1133 
1134 //# Get the value of an expression.
1135 inline void TableExprNode::get (const TableExprId& id, Bool& value) const
1136  { value = node_p->getBool (id); }
1137 inline void TableExprNode::get (const TableExprId& id, Int64& value) const
1138  { value = node_p->getInt (id); }
1139 inline void TableExprNode::get (const TableExprId& id, Double& value) const
1140  { value = node_p->getDouble (id); }
1141 inline void TableExprNode::get (const TableExprId& id, DComplex& value) const
1142  { value = node_p->getDComplex (id); }
1143 inline void TableExprNode::get (const TableExprId& id, String& value) const
1144  { value = node_p->getString (id); }
1145 inline void TableExprNode::get (const TableExprId& id, TaqlRegex& value) const
1146  { value = node_p->getRegex (id); }
1147 inline void TableExprNode::get (const TableExprId& id, MVTime& value) const
1148  { value = node_p->getDate (id); }
1149 inline void TableExprNode::get (const TableExprId& id,
1150  Array<Bool>& value) const
1151  { value = node_p->getArrayBool (id); }
1152 inline void TableExprNode::get (const TableExprId& id,
1153  Array<Int64>& value) const
1154  { value = node_p->getArrayInt (id); }
1155 inline void TableExprNode::get (const TableExprId& id,
1156  Array<Double>& value) const
1157  { value = node_p->getArrayDouble (id); }
1158 inline void TableExprNode::get (const TableExprId& id,
1159  Array<DComplex>& value) const
1160  { value = node_p->getArrayDComplex (id); }
1161 inline void TableExprNode::get (const TableExprId& id,
1162  Array<String>& value) const
1163  { value = node_p->getArrayString (id); }
1164 inline void TableExprNode::get (const TableExprId& id,
1165  Array<MVTime>& value) const
1166  { value = node_p->getArrayDate (id); }
1167 inline Bool TableExprNode::getBool (const TableExprId& id) const
1168  { return node_p->getBool (id); }
1169 inline Int64 TableExprNode::getInt (const TableExprId& id) const
1170  { return node_p->getInt (id); }
1172  { return node_p->getDouble (id); }
1174  { return node_p->getDComplex (id); }
1176  { return node_p->getString (id); }
1178  { return node_p->getArrayBool (id); }
1180  { return node_p->getArrayInt (id); }
1182  { return node_p->getArrayDouble (id); }
1184  { return node_p->getArrayDComplex (id); }
1186  { return node_p->getArrayString (id); }
1188  { return node_p->getBoolAS (id); }
1190  { return node_p->getIntAS (id); }
1192  { return node_p->getDoubleAS (id); }
1194  { return node_p->getDComplexAS (id); }
1196  { return node_p->getStringAS (id); }
1197 
1199  { return node_p->getColumnBool (rownrs); }
1201  { return node_p->getColumnuChar (rownrs); }
1203  { return node_p->getColumnShort (rownrs); }
1205  { return node_p->getColumnuShort (rownrs); }
1207  { return node_p->getColumnInt (rownrs); }
1209  { return node_p->getColumnuInt (rownrs); }
1211  { return node_p->getColumnFloat (rownrs); }
1213  { return node_p->getColumnDouble (rownrs); }
1215  { return node_p->getColumnComplex (rownrs); }
1217  { return node_p->getColumnDComplex (rownrs); }
1219  { return node_p->getColumnString (rownrs); }
1220 
1221 
1223  const TableExprNode& right)
1224 {
1225  return left.newPlus (right.node_p);
1226 }
1228  const TableExprNode& right)
1229 {
1230  return left.newMinus (right.node_p);
1231 }
1233  const TableExprNode& right)
1234 {
1235  return left.newTimes (right.node_p);
1236 }
1238  const TableExprNode& right)
1239 {
1240  return left.newDivide (right.node_p);
1241 }
1243  const TableExprNode& right)
1244 {
1245  return left.newModulo (right.node_p);
1246 }
1248  const TableExprNode& right)
1249 {
1250  return left.newBitAnd (right.node_p);
1251 }
1253  const TableExprNode& right)
1254 {
1255  return left.newBitOr (right.node_p);
1256 }
1258  const TableExprNode& right)
1259 {
1260  return left.newBitXor (right.node_p);
1261 }
1263  const TableExprNode& right)
1264 {
1265  return left.newEQ (right.node_p);
1266 }
1268  const TableExprNode& right)
1269 {
1270  return left.newNE (right.node_p);
1271 }
1273  const TableExprNode& right)
1274 {
1275  return left.newGT (right.node_p);
1276 }
1278  const TableExprNode& right)
1279 {
1280  return left.newGE (right.node_p);
1281 }
1283  const TableExprNode& right)
1284 {
1285  return right.newGE (left.node_p);
1286 }
1288  const TableExprNode& right)
1289 {
1290  return right.newGT (left.node_p);
1291 }
1293  const TaQLStyle& style) const
1294 {
1295  return newIN (right.node_p, style);
1296 }
1298 {
1299  // C++ indexing is 0-based.
1300  return newArrayPartNode (*this, indices, TaQLStyle(0));
1301 }
1302 
1303 inline TableExprNode near (const TableExprNode& left,
1304  const TableExprNode& right)
1305 {
1307  left, right);
1308 }
1309 inline TableExprNode near (const TableExprNode& left,
1310  const TableExprNode& right,
1311  const TableExprNode& tolerance)
1312 {
1314  left, right, tolerance);
1315 }
1317  const TableExprNode& right)
1318 {
1320  left, right);
1321 }
1323  const TableExprNode& right,
1324  const TableExprNode& tolerance)
1325 {
1327  left, right, tolerance);
1328 }
1330  const TableExprNode& pos2)
1331 {
1333  pos1, pos2);
1334 }
1336  const TableExprNode& pos2)
1337 {
1339  pos1, pos2);
1340 }
1341 inline TableExprNode cones (const TableExprNode& sourcePos,
1342  const TableExprNode& cones)
1343 {
1345  sourcePos, cones);
1346 }
1347 inline TableExprNode anyCone (const TableExprNode& sourcePos,
1348  const TableExprNode& cones)
1349 {
1351  sourcePos, cones);
1352 }
1353 inline TableExprNode findCone (const TableExprNode& sourcePos,
1354  const TableExprNode& cones)
1355 {
1357  sourcePos, cones);
1358 }
1359 inline TableExprNode cones (const TableExprNode& sourcePos,
1360  const TableExprNode& conePos,
1361  const TableExprNode& radii)
1362 {
1364  sourcePos, conePos, radii);
1365 }
1366 inline TableExprNode anyCone (const TableExprNode& sourcePos,
1367  const TableExprNode& conePos,
1368  const TableExprNode& radii)
1369 {
1371  sourcePos, conePos, radii);
1372 }
1373 inline TableExprNode findCone (const TableExprNode& sourcePos,
1374  const TableExprNode& conePos,
1375  const TableExprNode& radii)
1376 {
1378  sourcePos, conePos, radii);
1379 }
1380 inline TableExprNode cos (const TableExprNode& node)
1381 {
1383 }
1384 inline TableExprNode cosh (const TableExprNode& node)
1385 {
1387 }
1388 inline TableExprNode exp (const TableExprNode& node)
1389 {
1391 }
1392 inline TableExprNode log (const TableExprNode& node)
1393 {
1395 }
1396 inline TableExprNode log10 (const TableExprNode& node)
1397 {
1399 }
1400 inline TableExprNode pow (const TableExprNode& x, const TableExprNode& y)
1401 {
1403 }
1404 inline TableExprNode sin (const TableExprNode& node)
1405 {
1407 }
1408 inline TableExprNode sinh (const TableExprNode& node)
1409 {
1411 }
1412 inline TableExprNode square (const TableExprNode& node)
1413 {
1415  node);
1416 }
1417 inline TableExprNode cube (const TableExprNode& node)
1418 {
1420  node);
1421 }
1422 inline TableExprNode sqrt (const TableExprNode& node)
1423 {
1425 }
1426 inline TableExprNode norm (const TableExprNode& node)
1427 {
1429 }
1430 inline TableExprNode acos (const TableExprNode& node)
1431 {
1433 }
1434 inline TableExprNode asin (const TableExprNode& node)
1435 {
1437 }
1438 inline TableExprNode atan (const TableExprNode& node)
1439 {
1441 }
1442 inline TableExprNode atan2 (const TableExprNode& y, const TableExprNode& x)
1443 {
1445 }
1446 inline TableExprNode sign (const TableExprNode& node)
1447 {
1449 }
1450 inline TableExprNode round (const TableExprNode& node)
1451 {
1453 }
1454 inline TableExprNode ceil (const TableExprNode& node)
1455 {
1457 }
1458 inline TableExprNode abs (const TableExprNode& node)
1459 {
1461 }
1462 inline TableExprNode floor (const TableExprNode& node)
1463 {
1465 }
1466 inline TableExprNode fmod (const TableExprNode& x, const TableExprNode& y)
1467 {
1469 }
1470 inline TableExprNode tan (const TableExprNode& node)
1471 {
1473 }
1474 inline TableExprNode tanh (const TableExprNode& node)
1475 {
1477 }
1478 inline TableExprNode min (const TableExprNode& a, const TableExprNode& b)
1479 {
1481 }
1482 inline TableExprNode max (const TableExprNode& a, const TableExprNode& b)
1483 {
1485 }
1486 inline TableExprNode real (const TableExprNode& node)
1487 {
1489 }
1490 inline TableExprNode imag (const TableExprNode& node)
1491 {
1493 }
1495 {
1497 }
1498 inline TableExprNode conj (const TableExprNode& node)
1499 {
1501 }
1503 {
1505 }
1506 inline TableExprNode arg (const TableExprNode& node)
1507 {
1509 }
1510 inline TableExprNode phase (const TableExprNode& node)
1511 {
1513 }
1515  const TableExprNode& imag)
1516 {
1518  real, imag);
1519 }
1521 {
1523  node);
1524 }
1525 inline TableExprNode upcase (const TableExprNode& node)
1526 {
1528  node);
1529 }
1531 {
1533  node);
1534 }
1536 {
1538  node);
1539 }
1540 inline TableExprNode regex (const TableExprNode& node)
1541 {
1543 }
1545 {
1547  node);
1548 }
1550 {
1552  node);
1553 }
1555 {
1557  node);
1558 }
1560 {
1562  node);
1563 }
1564 inline TableExprNode mjd (const TableExprNode& node)
1565 {
1567 }
1568 inline TableExprNode date (const TableExprNode& node)
1569 {
1571 }
1572 inline TableExprNode year (const TableExprNode& node)
1573 {
1575 }
1576 inline TableExprNode month (const TableExprNode& node)
1577 {
1579 }
1580 inline TableExprNode day (const TableExprNode& node)
1581 {
1583 }
1584 inline TableExprNode cmonth (const TableExprNode& node)
1585 {
1587  node);
1588 }
1590 {
1592  node);
1593 }
1594 inline TableExprNode cdow (const TableExprNode& node)
1595 {
1597 }
1598 inline TableExprNode ctodt (const TableExprNode& node)
1599 {
1601 }
1602 inline TableExprNode cdate (const TableExprNode& node)
1603 {
1605 }
1606 inline TableExprNode ctime (const TableExprNode& node)
1607 {
1609 }
1610 inline TableExprNode hms (const TableExprNode& node)
1611 {
1613 }
1614 inline TableExprNode dms (const TableExprNode& node)
1615 {
1617 }
1618 inline TableExprNode hdms (const TableExprNode& node)
1619 {
1621 }
1623 {
1625  node);
1626 }
1628  const TableExprNode& format)
1629 {
1631  node, format);
1632 }
1633 inline TableExprNode week (const TableExprNode& node)
1634 {
1636 }
1637 inline TableExprNode time (const TableExprNode& node)
1638 {
1640 }
1641 inline TableExprNode trim (const TableExprNode& node)
1642 {
1644 }
1645 inline TableExprNode ltrim (const TableExprNode& node)
1646 {
1648 }
1649 inline TableExprNode rtrim (const TableExprNode& node)
1650 {
1652 }
1653 inline TableExprNode substr (const TableExprNode& node,
1654  const TableExprNode& pos)
1655 {
1657  node, pos);
1658 }
1659 inline TableExprNode substr (const TableExprNode& node,
1660  const TableExprNode& pos,
1661  const TableExprNode& npos)
1662 {
1664  node, pos, npos);
1665 }
1667  const TableExprNode& patt)
1668 {
1670  node, patt);
1671 }
1673  const TableExprNode& patt,
1674  const TableExprNode& repl)
1675 {
1677  node, patt, repl);
1678 }
1679 inline TableExprNode isNaN (const TableExprNode& node)
1680 {
1682 }
1683 inline TableExprNode isInf (const TableExprNode& node)
1684 {
1686 }
1688 {
1690  node);
1691 }
1692 inline TableExprNode min (const TableExprNode& node)
1693 {
1695  node);
1696 }
1697 inline TableExprNode max (const TableExprNode& node)
1698 {
1700  node);
1701 }
1702 inline TableExprNode sum (const TableExprNode& node)
1703 {
1705  node);
1706 }
1708 {
1710  node);
1711 }
1713 {
1715  node);
1716 }
1717 inline TableExprNode mean (const TableExprNode& node)
1718 {
1720  node);
1721 }
1723 {
1725  node);
1726 }
1727 inline TableExprNode stddev (const TableExprNode& node)
1728 {
1730  node);
1731 }
1732 inline TableExprNode avdev (const TableExprNode& node)
1733 {
1735  node);
1736 }
1737 inline TableExprNode rms (const TableExprNode& node)
1738 {
1740  node);
1741 }
1742 inline TableExprNode median (const TableExprNode& node)
1743 {
1745  node);
1746 }
1748  const TableExprNode& fraction)
1749 {
1751  node, fraction);
1752 }
1753 inline TableExprNode any (const TableExprNode& node)
1754 {
1756 }
1757 inline TableExprNode all (const TableExprNode& node)
1758 {
1760 }
1761 inline TableExprNode ntrue (const TableExprNode& node)
1762 {
1764 }
1765 inline TableExprNode nfalse (const TableExprNode& node)
1766 {
1768 }
1769 inline TableExprNode sums (const TableExprNode& array,
1770  const TableExprNodeSet& axes)
1771 {
1773  array, axes);
1774 }
1775 inline TableExprNode products (const TableExprNode& array,
1776  const TableExprNodeSet& axes)
1777 {
1779  array, axes);
1780 }
1782  const TableExprNodeSet& axes)
1783 {
1785  array, axes);
1786 }
1787 inline TableExprNode mins (const TableExprNode& array,
1788  const TableExprNodeSet& axes)
1789 {
1791  array, axes);
1792 }
1793 inline TableExprNode maxs (const TableExprNode& array,
1794  const TableExprNodeSet& axes)
1795 {
1797  array, axes);
1798 }
1799 inline TableExprNode means (const TableExprNode& array,
1800  const TableExprNodeSet& axes)
1801 {
1803  array, axes);
1804 }
1806  const TableExprNodeSet& axes)
1807 {
1809  array, axes);
1810 }
1811 inline TableExprNode stddevs (const TableExprNode& array,
1812  const TableExprNodeSet& axes)
1813 {
1815  array, axes);
1816 }
1817 inline TableExprNode avdevs (const TableExprNode& array,
1818  const TableExprNodeSet& axes)
1819 {
1821  array, axes);
1822 }
1823 inline TableExprNode rmss (const TableExprNode& array,
1824  const TableExprNodeSet& axes)
1825 {
1827  array, axes);
1828 }
1829 inline TableExprNode medians (const TableExprNode& array,
1830  const TableExprNodeSet& axes)
1831 {
1833  array, axes);
1834 }
1836  const TableExprNode& fraction,
1837  const TableExprNodeSet& axes)
1838 {
1840  array, fraction, axes);
1841 }
1842 inline TableExprNode anys (const TableExprNode& array,
1843  const TableExprNodeSet& axes)
1844 {
1846  array, axes);
1847 }
1848 inline TableExprNode alls (const TableExprNode& array,
1849  const TableExprNodeSet& axes)
1850 {
1852  array, axes);
1853 }
1854 inline TableExprNode ntrues (const TableExprNode& array,
1855  const TableExprNodeSet& axes)
1856 {
1858  array, axes);
1859 }
1860 inline TableExprNode nfalses (const TableExprNode& array,
1861  const TableExprNodeSet& axes)
1862 {
1864  array, axes);
1865 }
1867  const TableExprNodeSet& halfBoxWidth)
1868 {
1870  node, halfBoxWidth);
1871 }
1873  const TableExprNodeSet& halfBoxWidth)
1874 {
1876  node, halfBoxWidth);
1877 }
1879  const TableExprNodeSet& halfBoxWidth)
1880 {
1882  node, halfBoxWidth);
1883 }
1885  const TableExprNodeSet& halfBoxWidth)
1886 {
1888  node, halfBoxWidth);
1889 }
1891  const TableExprNodeSet& halfBoxWidth)
1892 {
1894  node, halfBoxWidth);
1895 }
1897  const TableExprNodeSet& halfBoxWidth)
1898 {
1900  node, halfBoxWidth);
1901 }
1903  const TableExprNodeSet& halfBoxWidth)
1904 {
1906  node, halfBoxWidth);
1907 }
1909  const TableExprNodeSet& halfBoxWidth)
1910 {
1912  node, halfBoxWidth);
1913 }
1915  const TableExprNodeSet& halfBoxWidth)
1916 {
1918  node, halfBoxWidth);
1919 }
1921  const TableExprNodeSet& halfBoxWidth)
1922 {
1924  node, halfBoxWidth);
1925 }
1927  const TableExprNodeSet& halfBoxWidth)
1928 {
1930  node, halfBoxWidth);
1931 }
1933  const TableExprNodeSet& halfBoxWidth)
1934 {
1936  node, halfBoxWidth);
1937 }
1939  const TableExprNodeSet& halfBoxWidth)
1940 {
1942  node, halfBoxWidth);
1943 }
1945  const TableExprNodeSet& halfBoxWidth)
1946 {
1948  node, halfBoxWidth);
1949 }
1951  const TableExprNodeSet& halfBoxWidth)
1952 {
1954  node, halfBoxWidth);
1955 }
1957  const TableExprNodeSet& halfBoxWidth)
1958 {
1960  node, halfBoxWidth);
1961 }
1963  const TableExprNodeSet& halfBoxWidth)
1964 {
1966  node, halfBoxWidth);
1967 }
1969  const TableExprNodeSet& halfBoxWidth)
1970 {
1972  node, halfBoxWidth);
1973 }
1975  const TableExprNodeSet& halfBoxWidth)
1976 {
1978  node, halfBoxWidth);
1979 }
1981  const TableExprNodeSet& halfBoxWidth)
1982 {
1984  node, halfBoxWidth);
1985 }
1986 inline TableExprNode array (const TableExprNode& values,
1987  const TableExprNodeSet& shape)
1988 {
1990  values, shape);
1991 }
1993 {
1995  array);
1996 }
1998  const TableExprNodeSet& axes)
1999 {
2001  array, axes);
2002 }
2004 {
2006 }
2008 {
2010 }
2011 inline TableExprNode ndim (const TableExprNode& node)
2012 {
2014 }
2015 inline TableExprNode shape (const TableExprNode& node)
2016 {
2018 }
2019 inline TableExprNode iif (const TableExprNode& condition,
2020  const TableExprNode& arg1,
2021  const TableExprNode& arg2)
2022 {
2024  condition, arg1, arg2);
2025 }
2026 
2027 
2028 inline void TableExprNode::show (ostream& os) const
2029 {
2030  node_p->show (os, 0);
2031 }
2033 {
2034  return node_p;
2035 }
2037 {
2038  return node_p;
2039 }
2040 
2041 
2042 
2043 } //# NAMESPACE CASACORE - END
2044 
2045 #endif
friend TableExprNode runningMax(const TableExprNode &array)
Array< Int64 > getIntAS(const TableExprId &id) const
Definition: ExprNode.h:1189
LatticeExprNode log10(const LatticeExprNode &expr)
friend TableExprNode norm(const TableExprNode &node)
Definition: ExprNode.h:1426
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:1341
friend TableExprNode ceil(const TableExprNode &node)
Definition: ExprNode.h:1454
friend TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1572
virtual Bool isDefined(const TableExprId &id)
Is the value in the given row defined? The default implementation returns True.
Array< String > getArrayString(const TableExprId &id) const
Definition: ExprNode.h:1185
friend TableExprNode operator<(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1287
friend TableExprNode ntrues(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1854
Array< Double > getArrayDouble(const TableExprId &id) const
Definition: ExprNode.h:1181
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
virtual Array< String > getArrayString(const TableExprId &id)
TableExprNode dms(const TableExprNode &node)
Definition: ExprNode.h:1614
friend TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1576
TableExprNode boxedStddev(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1950
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:1347
int Int
Definition: aipstype.h:47
TableExprNode transpose(const TableExprNode &array)
Transpose all axes of an array.
Definition: ExprNode.h:1992
TableExprNodeRep * newOR(TableExprNodeRep *right) const
return angles as dms strings
Definition: ExprFuncNode.h:236
friend TableExprNode sin(const TableExprNode &node)
Transcendental functions that can be applied to essentially all numeric nodes containing scalars or a...
Definition: ExprNode.h:1404
Array< Int64 > getArrayInt(const TableExprId &id) const
Definition: ExprNode.h:1179
TableExprNodeRep * newBitXor(TableExprNodeRep *right) const
TableExprNode alls(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1848
virtual Array< uInt > getColumnuInt(const Vector< uInt > &rownrs)
friend TableExprNode mjdtodate(const TableExprNode &node)
Definition: ExprNode.h:1559
Array< DComplex > getDComplexAS(const TableExprId &id)
LatticeExprNode log(const LatticeExprNode &expr)
friend TableExprNode runningRms(const TableExprNode &array)
friend TableExprNode cdate(const TableExprNode &node)
Definition: ExprNode.h:1602
friend TableExprNode cosh(const TableExprNode &node)
Definition: ExprNode.h:1384
friend TableExprNode rmss(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1823
LatticeExprNode arg(const LatticeExprNode &expr)
TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1799
TableExprNode runningRms(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1902
friend TableExprNode tanh(const TableExprNode &node)
Definition: ExprNode.h:1474
TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1530
friend TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1799
LatticeExprNode median(const LatticeExprNode &expr)
for Int or Double returning Double
Definition: ExprFuncNode.h:116
friend TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1580
Array< DComplex > getColumnDComplex(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1216
TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1637
for any array returning Bool scalar
Definition: ExprFuncNode.h:196
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:1247
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:1884
const TableExprNodeRep * getNodeRep() const
returns const pointer to the representation-object of it
Definition: ExprNode.h:2032
other functions, implemented in derived class
Definition: ExprFuncNode.h:251
friend TableExprNode cos(const TableExprNode &node)
Definition: ExprNode.h:1380
friend TableExprNode ndim(const TableExprNode &array)
Definition: ExprNode.h:2011
friend TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1530
T product(const TableVector< T > &tv)
Definition: TabVecMath.h:385
friend TableExprNode any(const TableExprNode &array)
Definition: ExprNode.h:1753
virtual Array< MVTime > getArrayDate(const TableExprId &id)
LatticeExprNode imag(const LatticeExprNode &expr)
TableExprNode variances(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1805
Bool isResultDefined(const TableExprId &id) const
Is the result value defined? Normally it is, but not for a column with an undefined value...
Definition: ExprNode.h:918
friend TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1252
friend TableExprNode datetime(const TableExprNode &node)
Functions for date-values.
Definition: ExprNode.h:1554
friend TableExprNode variance(const TableExprNode &array)
Definition: ExprNode.h:1722
Array< Short > getColumnShort(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1202
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:1986
Class to hold multiple table expression nodes.
Definition: ExprNodeSet.h:305
LatticeExprNode sum(const LatticeExprNode &expr)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNodeRep * newTimes(TableExprNodeRep *right) const
TableExprNode operator-() const
TableExprNode weekday(const TableExprNode &node)
Definition: ExprNode.h:1589
Handle class for a table column expression tree.
Definition: ExprNode.h:578
LatticeExprNode operator%(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode atan(const TableExprNode &node)
Definition: ExprNode.h:1438
TableExprNode runningAll(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1920
friend TableExprNode fmod(const TableExprNode &x, const TableExprNode &y)
Definition: ExprNode.h:1466
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1510
virtual MVTime getDate(const TableExprId &id)
TableExprNodeRep * newAND(TableExprNodeRep *right) const
friend TableExprNode median(const TableExprNode &array)
Definition: ExprNode.h:1742
friend TableExprNode nelements(const TableExprNode &array)
Functions operating on any scalar or array resulting in a Double scalar.
Definition: ExprNode.h:2007
TableExprNode ltrim(const TableExprNode &node)
Definition: ExprNode.h:1645
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 findCone(const TableExprNode &sourcePos, const TableExprNode &cones)
The sourcePos can contain multiple sources.
Definition: ExprNode.h:1353
friend TableExprNode log(const TableExprNode &node)
Definition: ExprNode.h:1392
LatticeExprNode ntrue(const LatticeExprNode &expr)
friend TableExprNode replace(const TableExprNode &str, const TableExprNode &patt)
Definition: ExprNode.h:1666
virtual Int64 getInt(const TableExprId &id)
friend TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1502
friend TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1544
void show(ostream &) const
Show the tree.
Definition: ExprNode.h:2028
friend TableExprNode abs(const TableExprNode &node)
Definition: ExprNode.h:1458
TableExprNodeRep * getRep()
returns non-const pointer to the representation-object of it
Definition: ExprNode.h:2036
Array< uChar > getColumnuChar(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1200
Array< Double > getDoubleAS(const TableExprId &id)
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:1687
friend TableExprNode operator<=(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1282
TableExprNode mins(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1787
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:1793
angular distance returning radians
Definition: ExprFuncNode.h:248
TableExprNode year(const TableExprNode &node)
Definition: ExprNode.h:1572
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:1316
friend TableExprNode ctime(const TableExprNode &node)
Definition: ExprNode.h:1606
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:888
friend TableExprNode real(const TableExprNode &node)
The real part of a complex node.
Definition: ExprNode.h:1486
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:1702
friend TableExprNode angdist(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance between positions.
Definition: ExprNode.h:1329
TableExprNode mjd(const TableExprNode &node)
Definition: ExprNode.h:1564
Array< String > getStringAS(const TableExprId &id) const
Definition: ExprNode.h:1195
friend TableExprNode substr(const TableExprNode &str, const TableExprNode &pos)
Definition: ExprNode.h:1653
friend TableExprNode runningMedian(const TableExprNode &array)
friend TableExprNode floor(const TableExprNode &node)
Definition: ExprNode.h:1462
friend TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1510
void applySelection(const Vector< uInt > &rownrs)
Re-create the column object for a selection of rows.
Definition: ExprNode.h:893
TableExprNode month(const TableExprNode &node)
Definition: ExprNode.h:1576
virtual Array< DComplex > getColumnDComplex(const Vector< uInt > &rownrs)
Abstract base class for a node in a table column expression tree.
Definition: ExprNodeRep.h:150
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:1956
TableExprNode runningMax(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1872
TableExprNode strlength(const TableExprNode &node)
String functions on scalars or arrays.
Definition: ExprNode.h:1520
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:1968
friend TableExprNode isNaN(const TableExprNode &node)
Function to test if a scalar or array is NaN (not-a-number).
Definition: ExprNode.h:1679
Array< Bool > getArrayBool(const TableExprId &id) const
Definition: ExprNode.h:1177
LatticeExprNode floor(const LatticeExprNode &expr)
TableExprNode cones(const TableExprNode &sourcePos, const TableExprNode &cones)
Cone search; test if the position of a source is inside a cone.
Definition: ExprNode.h:1341
virtual Array< Double > getArrayDouble(const TableExprId &id)
DComplex getDComplex(const TableExprId &id) const
Definition: ExprNode.h:1173
friend TableExprNode log10(const TableExprNode &node)
Definition: ExprNode.h:1396
static TableExprNode newRowidNode(const Table &table)
Create rowid() function node.
LatticeExprNode cos(const LatticeExprNode &expr)
ValueType valueType() const
Get the value type.
Definition: ExprNodeRep.h:702
for any array returning Int scalar
Definition: ExprFuncNode.h:198
for any array returning Int array
Definition: ExprFuncNode.h:201
for Int or Double returning Int (using floor)
Definition: ExprFuncNode.h:114
TableExprNode rtrim(const TableExprNode &node)
Definition: ExprNode.h:1649
friend TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1737
TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1544
friend TableExprNode operator*(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1232
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.
Array< DComplex > getDComplexAS(const TableExprId &id) const
Definition: ExprNode.h:1193
void ranges(Block< TableExprRange > &)
Convert the tree to a number of range vectors which at least select the same things.
Definition: ExprNode.h:1127
virtual Array< Int > getColumnInt(const Vector< uInt > &rownrs)
friend TableExprNode tan(const TableExprNode &node)
Definition: ExprNode.h:1470
Array< String > getColumnString(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1218
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:1198
Array< String > getStringAS(const TableExprId &id)
friend TableExprNode asin(const TableExprNode &node)
Transcendental functions applied to to nodes containing scalars or arrays with double values...
Definition: ExprNode.h:1434
friend TableExprNode stddev(const TableExprNode &array)
Definition: ExprNode.h:1727
friend TableExprNode operator||(const TableExprNode &left, const TableExprNode &right)
friend TableExprNode rtrim(const TableExprNode &node)
Definition: ExprNode.h:1649
friend TableExprNode avdevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1817
const Unit & unit() const
Get the unit of the expression.
Definition: ExprNode.h:897
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 ntrue(const TableExprNode &array)
Definition: ExprNode.h:1761
friend TableExprNode products(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1775
Float pow(Float f1, Float f2)
Definition: math.h:90
TableExprNodeRep * newNE(TableExprNodeRep *right) const
special function resembling if statement
Definition: ExprFuncNode.h:246
friend TableExprNode exp(const TableExprNode &node)
Definition: ExprNode.h:1388
TableExprNode medians(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1829
friend TableExprNode sqrt(const TableExprNode &node)
Definition: ExprNode.h:1422
TableExprNode sumSquares(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1781
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:1564
TableExprNode ntrues(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1854
for Int, Double or DComplex array returning Bool
Definition: ExprFuncNode.h:192
TableExprNode fractiles(const TableExprNode &array, const TableExprNode &fraction, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1835
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode boxedAny(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1974
LatticeExprNode avdev(const LatticeExprNode &expr)
friend TableExprNode runningAll(const TableExprNode &array)
TableExprNode isInf(const TableExprNode &node)
Definition: ExprNode.h:1683
friend TableExprNode mins(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1787
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:1122
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:1848
friend TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:2015
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:1525
double Double
Definition: aipstype.h:52
TableExprNode cdate(const TableExprNode &node)
Definition: ExprNode.h:1602
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:238
for Bool array returning Int scalar
Definition: ExprFuncNode.h:183
friend TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1417
TableExprNode trim(const TableExprNode &node)
Definition: ExprNode.h:1641
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:1482
LatticeExprNode operator<=(const LatticeExprNode &left, const LatticeExprNode &right)
friend TableExprNode operator!=(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1267
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:1135
friend TableExprNode transpose(const TableExprNode &array)
Transpose all axes of an array.
Definition: ExprNode.h:1992
Bool isScalar() const
Is the expression a scalar?
Definition: ExprNode.h:907
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:1980
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:1584
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:913
friend TableExprNode operator/(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1237
friend TableExprNode atan2(const TableExprNode &y, const TableExprNode &x)
Definition: ExprNode.h:1442
friend TableExprNode pow(const TableExprNode &x, const TableExprNode &exp)
Definition: ExprNode.h:1400
TableExprNode anys(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1842
TableExprNode boxedMax(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1932
LatticeExprNode sign(const LatticeExprNode &expr)
LatticeExprNode sqrt(const LatticeExprNode &expr)
friend TableExprNode stddevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1811
TableExprNode products(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1775
friend TableExprNode operator%(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1242
friend TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1568
LatticeExprNode tan(const LatticeExprNode &expr)
friend TableExprNode sumSquare(const TableExprNode &array)
Definition: ExprNode.h:1712
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:1687
friend TableExprNode round(const TableExprNode &node)
Definition: ExprNode.h:1450
friend TableExprNode operator==(const TableExprNode &left, const TableExprNode &right)
Comparison operators.
Definition: ExprNode.h:1262
TableExprNode runningAny(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1914
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:1986
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:1292
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:39
TableExprNode upcase(const TableExprNode &node)
Definition: ExprNode.h:1525
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:1417
LatticeExprNode stddev(const LatticeExprNode &expr)
TableExprNode runningMedian(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1908
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:1335
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:1793
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:1272
float Float
Definition: aipstype.h:51
TableExprNode runningStddev(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1890
friend TableExprNode sqlpattern(const TableExprNode &node)
Definition: ExprNode.h:1549
return angles as hms strings
Definition: ExprFuncNode.h:234
TableExprNode substr(const TableExprNode &str, const TableExprNode &pos)
Definition: ExprNode.h:1653
friend TableExprNode acos(const TableExprNode &node)
Definition: ExprNode.h:1430
const Unit & unit() const
Get the unit.
Definition: ExprNodeRep.h:722
friend TableExprNode runningAvdev(const TableExprNode &array)
Array< Bool > getBoolAS(const TableExprId &id)
Get a value as an array, even it it is a scalar.
virtual void show(ostream &, uInt indent) const
Show the expression tree.
friend TableExprNode ltrim(const TableExprNode &node)
Definition: ExprNode.h:1645
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:1167
A drop-in replacement for Block<T*>.
Definition: Block.h:861
TableExprNode sqlpattern(const TableExprNode &node)
Definition: ExprNode.h:1549
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:1347
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:2015
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:1183
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:1498
Array< Int > getColumnInt(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1206
TableExprNode cmonth(const TableExprNode &node)
Definition: ExprNode.h:1584
TableExprNode operator|(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1252
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 to int (using floor).
Definition: ExprNode.h:1494
friend TableExprNode week(const TableExprNode &node)
Definition: ExprNode.h:1633
TableExprNode runningMean(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1878
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:1353
friend TableExprNode fractile(const TableExprNode &array, const TableExprNode &fraction)
Definition: ExprNode.h:1747
TableExprNode boxedMean(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1938
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:1732
TableExprNode nfalses(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1860
friend TableExprNode strlength(const TableExprNode &node)
String functions on scalars or arrays.
Definition: ExprNode.h:1520
TableExprNode boxedVariance(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1944
friend TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1540
friend TableExprNode weekday(const TableExprNode &node)
Definition: ExprNode.h:1589
TableExprNode angdist(const TableExprNode &pos1, const TableExprNode &pos2)
Angular distance between positions.
Definition: ExprNode.h:1329
for Int or Double array returning Int or Double
Definition: ExprFuncNode.h:138
TableExprNode isdefined(const TableExprNode &array)
Function operating on a field resulting in a bool scalar.
Definition: ExprNode.h:2003
TableExprNode boxedRms(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1962
Class to hold values from table grammar parser.
Definition: TableParse.h:107
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:1540
LatticeExprNode fmod(const LatticeExprNode &left, const LatticeExprNode &right)
TableExprNode day(const TableExprNode &node)
Definition: ExprNode.h:1580
friend TableExprNode nfalse(const TableExprNode &array)
Definition: ExprNode.h:1765
virtual Array< Int64 > getArrayInt(const TableExprId &id)
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:1204
friend TableExprNode ctodt(const TableExprNode &node)
Definition: ExprNode.h:1598
TableExprNode cdow(const TableExprNode &node)
Definition: ExprNode.h:1594
TableExprNode boxedMin(const TableExprNode &node, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1926
LatticeExprNode mean(const LatticeExprNode &expr)
Array< Double > getColumnDouble(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1212
virtual String getString(const TableExprId &id)
Table & table()
Get table.
Definition: ExprNodeRep.h:734
friend TableExprNode mean(const TableExprNode &array)
Definition: ExprNode.h:1717
TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1737
TableExprNode runningAvdev(const TableExprNode &array, const TableExprNodeSet &halfBoxWidth)
Definition: ExprNode.h:1896
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:1171
Array< uInt > getColumnuInt(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1208
TableExprNodeRep * newEQ(TableExprNodeRep *right) const
Class to handle a Regex or StringDistance.
Definition: ExprNodeRep.h:74
virtual Array< DComplex > getArrayDComplex(const TableExprId &id)
LatticeExprNode acos(const LatticeExprNode &expr)
TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1412
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:1866
TableExprNodeRep * newGE(TableExprNodeRep *right) const
friend TableExprNode square(const TableExprNode &node)
Definition: ExprNode.h:1412
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:1712
TableExprNode capitalize(const TableExprNode &node)
Definition: ExprNode.h:1535
friend TableExprNode nfalses(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1860
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:1594
TableExprNode nearAbs(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1316
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:1214
TableExprNode stddevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1811
TableExprNode datetime(const TableExprNode &node)
Functions for date-values.
Definition: ExprNode.h:1554
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:1247
friend TableExprNode medians(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1829
Class to deal with Levensthein distance of strings.
TableExprNode avdevs(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1817
TableExprNode mjdtodate(const TableExprNode &node)
Definition: ExprNode.h:1559
friend TableExprNode iif(const TableExprNode &condition, const TableExprNode &arg1, const TableExprNode &arg2)
Function resembling the ternary ?: construct in C++.
Definition: ExprNode.h:2019
friend TableExprNode arg(const TableExprNode &node)
The arg (i.e.
Definition: ExprNode.h:1506
Array< Double > getDoubleAS(const TableExprId &id) const
Definition: ExprNode.h:1191
TableExprNode ctodt(const TableExprNode &node)
Definition: ExprNode.h:1598
static void throwInvDT(const String &message)
Throw invalid data type exception.
friend TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1637
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:1478
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:1490
for Int or Double array returning Double
Definition: ExprFuncNode.h:147
String getString(const TableExprId &id) const
Definition: ExprNode.h:1175
Array< Float > getColumnFloat(const Vector< uInt > &rownrs) const
Definition: ExprNode.h:1210
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:1823
friend TableExprNode sinh(const TableExprNode &node)
Definition: ExprNode.h:1408
TableExprNode ctime(const TableExprNode &node)
Definition: ExprNode.h:1606
TableExprNode hms(const TableExprNode &node)
Functions for angle-values.
Definition: ExprNode.h:1610
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:1303
friend TableExprNode all(const TableExprNode &array)
Definition: ExprNode.h:1757
friend TableExprNode capitalize(const TableExprNode &node)
Definition: ExprNode.h:1535
Array< Bool > getBoolAS(const TableExprId &id) const
Get a value as an array, even it it is a scalar.
Definition: ExprNode.h:1187
Int64 getInt(const TableExprId &id) const
Definition: ExprNode.h:1169
friend TableExprNode isdefined(const TableExprNode &array)
Function operating on a field resulting in a bool scalar.
Definition: ExprNode.h:2003
friend TableExprNode trim(const TableExprNode &node)
Definition: ExprNode.h:1641
friend TableExprNode anys(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1842
friend TableExprNode operator^(const TableExprNode &left, const TableExprNode &right)
Definition: ExprNode.h:1257
friend TableExprNode operator>=(const TableExprNode &left, const TableExprNode &right)
Not defined for Bool.
Definition: ExprNode.h:1277
Array< Int64 > getIntAS(const TableExprId &id)
TableExprNode operator()(const TableExprNodeSet &indices)
Slicing in a node containing an array.
Definition: ExprNode.h:1297
TableExprNode sums(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
The partial version of the functions above.
Definition: ExprNode.h:1769
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:1514
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:1835
virtual Array< Short > getColumnShort(const Vector< uInt > &rownrs)
friend TableExprNode sumSquares(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1781
TableExprNode week(const TableExprNode &node)
Definition: ExprNode.h:1633
TableExprNode hdms(const TableExprNode &node)
Definition: ExprNode.h:1618
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 or DComplex 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:48
TableExprNodeRep * newModulo(TableExprNodeRep *right) const
virtual Array< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
const Table & table() const
Get table.
Definition: ExprNode.h:1131
friend TableExprNode sign(const TableExprNode &node)
Definition: ExprNode.h:1446
friend TableExprNode sums(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
The partial version of the functions above.
Definition: ExprNode.h:1769
TableExprNode date(const TableExprNode &node)
Definition: ExprNode.h:1568
friend TableExprNode variances(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
Definition: ExprNode.h:1805
TableExprNode amplitude(const TableExprNode &node)
The amplitude (i.e.
Definition: ExprNode.h:1502
friend TableExprNode product(const TableExprNode &array)
Definition: ExprNode.h:1707