ExprNode.h

Go to the documentation of this file.
00001 //# ExprNode.h: Handle class for a table column expression tree
00002 //# Copyright (C) 1994,1995,1996,1997,1998,2000,2001,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef TABLES_EXPRNODE_H
00029 #define TABLES_EXPRNODE_H
00030 
00031 //# Includes
00032 #include <casa/aips.h>
00033 #include <tables/Tables/ExprNodeRep.h>
00034 #include <tables/Tables/ExprRange.h>
00035 #include <tables/Tables/ExprFuncNode.h>
00036 #include <tables/Tables/ExprConeNode.h>
00037 #include <tables/Tables/TaQLStyle.h>
00038 #include <casa/Utilities/DataType.h>
00039 #include <casa/BasicSL/Complex.h>
00040 #include <casa/Utilities/Regex.h>
00041 
00042 namespace casa { //# NAMESPACE CASA - BEGIN
00043 
00044 //# Forward Declarations
00045 class Table;
00046 class String;
00047 class Unit;
00048 class TableRecord;
00049 class TableExprNodeSet;
00050 template<class T> class Block;
00051 template<class T> class Array;
00052 class TableExprNode;
00053 
00054 
00055 // Define all global functions operating on a TableExprNode.
00056 // <group name=GlobalTableExprNode>
00057 
00058   //# Define the operations we allow.
00059   //# Note that the arguments are defined as const. This is necessary
00060   //# because the compiler generates temporaries when converting a constant
00061   //# to a TableExprNode using the constructors. Temporaries has to be const.
00062   //# However, we have to delete created nodes, so lnode_p and rnode_p
00063   //# cannot be const. The const arguments are casted to a non-const in
00064   //# the function fill which calls the non-const function simplify.
00065 
00066   // Arithmetic operators for numeric TableExprNode's.
00067   // <group>
00068     // + is also defined for strings (means concatenation).
00069     TableExprNode operator+ (const TableExprNode& left,
00070                              const TableExprNode& right);
00071     TableExprNode operator- (const TableExprNode& left,
00072                              const TableExprNode& right);
00073     TableExprNode operator* (const TableExprNode& left,
00074                              const TableExprNode& right);
00075     TableExprNode operator/ (const TableExprNode& left,
00076                              const TableExprNode& right);
00077     TableExprNode operator% (const TableExprNode& left,
00078                              const TableExprNode& right);
00079     TableExprNode operator^ (const TableExprNode& left,
00080                              const TableExprNode& right);
00081   // </group>
00082 
00083   // Comparison operators.
00084   // <group>
00085     TableExprNode operator== (const TableExprNode& left,
00086                               const TableExprNode& right);
00087     TableExprNode operator!= (const TableExprNode& left,
00088                               const TableExprNode& right);
00089     // Not defined for Bool.
00090     // <group>
00091     TableExprNode operator>= (const TableExprNode& left,
00092                               const TableExprNode& right);
00093     TableExprNode operator>  (const TableExprNode& left,
00094                               const TableExprNode& right);
00095     TableExprNode operator<= (const TableExprNode& left, 
00096                               const TableExprNode& right);
00097     TableExprNode operator<  (const TableExprNode& left,
00098                               const TableExprNode& right);
00099     // </group>
00100   // </group>
00101 
00102   // Logical operators to combine boolean TableExprNode's.
00103   // <group>
00104     TableExprNode operator&& (const TableExprNode& left,
00105                               const TableExprNode& right);
00106     TableExprNode operator|| (const TableExprNode& left,
00107                               const TableExprNode& right);
00108   // </group>
00109 
00110   // Functions to return whether a value is "relatively" near another.
00111   // Returns <src> tol > abs(val2 - val1)/max(abs(val1),(val2))</src>. 
00112   // If tol <= 0, returns val1 == val2. If either val is 0.0, takes
00113   // care of area around the minimum number that can be represented.
00114   // <br>The nearAbs functions return whether a value is "absolutely" near
00115   // another. Returns <src> tol > abs(val2 - val1)</src>.
00116   // Default tolerance is 1.0e-13.
00117   // They operate on scalars and arrays.
00118   // <group>
00119     TableExprNode near    (const TableExprNode& left,
00120                            const TableExprNode& right);
00121     TableExprNode near    (const TableExprNode& left,
00122                            const TableExprNode& right,
00123                            const TableExprNode& tolerance);
00124     TableExprNode nearAbs (const TableExprNode& left,
00125                            const TableExprNode& right);
00126     TableExprNode nearAbs (const TableExprNode& left,
00127                            const TableExprNode& right,
00128                            const TableExprNode& tolerance);
00129   // </group>
00130 
00131   // Cone search; test if the position of a source is inside a cone.
00132   // <br>Argument <src>sourcePos</src> must be a double array
00133   // containing two values (ra and dec of source) in radians.
00134   // <br>Argument <src>cones</src> must be a double array
00135   // specifying the position of the cone centers and radii in radians.
00136   // So the array must contain three values (ra,dec,radius)
00137   // or a multiple of it.
00138   // <group>
00139     // The result is a bool array telling for each cone if it contains the
00140     // source. If there is only one cone, the result is a scalar.
00141     TableExprNode cones (const TableExprNode& sourcePos,
00142                          const TableExprNode& cones);
00143     // The result is always a Bool scalar telling if any cone contains
00144     // the source.
00145     TableExprNode anyCone (const TableExprNode& sourcePos,
00146                            const TableExprNode& cones);
00147     // The sourcePos can contain multiple sources.
00148     // The result is a double array giving the index of the first
00149     // cone containing the corresponding source.
00150     // If there is one source, the result is a double scalar.
00151     TableExprNode findCone (const TableExprNode& sourcePos,
00152                             const TableExprNode& cones);
00153   // </group>
00154 
00155   // Cone search as above.
00156   // However, the cone positions and radii are specified separately
00157   // and (virtually) a larger array containing every combination of
00158   // position/radius is formed.
00159   // <group>
00160     TableExprNode cones (const TableExprNode& sourcePos,
00161                          const TableExprNode& conePos,
00162                          const TableExprNode& radii);
00163     TableExprNode anyCone (const TableExprNode& sourcePos,
00164                            const TableExprNode& conePos,
00165                            const TableExprNode& radii);
00166     TableExprNode findCone (const TableExprNode& sourcePos,
00167                             const TableExprNode& conePos,
00168                             const TableExprNode& radii);
00169   // </group>
00170 
00171   // Transcendental functions that can be applied to essentially all numeric
00172   // nodes containing scalars or arrays.
00173   // <group>
00174     TableExprNode sin    (const TableExprNode& node);
00175     TableExprNode sinh   (const TableExprNode& node);
00176     TableExprNode cos    (const TableExprNode& node);
00177     TableExprNode cosh   (const TableExprNode& node);
00178     TableExprNode exp    (const TableExprNode& node);
00179     TableExprNode log    (const TableExprNode& node);
00180     TableExprNode log10  (const TableExprNode& node);
00181     TableExprNode pow    (const TableExprNode& x,
00182                           const TableExprNode& y);
00183     TableExprNode square (const TableExprNode& node);
00184     TableExprNode sqrt   (const TableExprNode& node);
00185     TableExprNode norm   (const TableExprNode& node);
00186   // </group>
00187 
00188   // Transcendental functions applied to to nodes containing scalars or
00189   // arrays with double values.
00190   // They are invalid for Complex nodes.
00191   // <group>
00192     TableExprNode asin  (const TableExprNode& node);
00193     TableExprNode acos  (const TableExprNode& node);
00194     TableExprNode atan  (const TableExprNode& node);
00195     TableExprNode atan2 (const TableExprNode& y,
00196                          const TableExprNode& x);
00197     TableExprNode tan   (const TableExprNode& node);
00198     TableExprNode tanh  (const TableExprNode& node);
00199     TableExprNode sign  (const TableExprNode& node);
00200     TableExprNode round (const TableExprNode& node);
00201     TableExprNode ceil  (const TableExprNode& node);
00202     TableExprNode abs   (const TableExprNode& node);
00203     TableExprNode floor (const TableExprNode& node);
00204     TableExprNode fmod  (const TableExprNode& x,
00205                          const TableExprNode& y);
00206   // </group>
00207 
00208   // String functions on scalars or arrays.
00209   // <group>
00210     TableExprNode strlength (const TableExprNode& node);
00211     TableExprNode upcase    (const TableExprNode& node);
00212     TableExprNode downcase  (const TableExprNode& node);
00213     TableExprNode trim      (const TableExprNode& node);
00214   // </group>
00215 
00216   // Functions for regular expression matching and 
00217   // pattern matching. Defined for scalars and arrays.
00218   // <br><src>pattern</src> is for a file name like pattern.
00219   // <br><src>sqlpattern</src> is for an SQL like pattern.
00220   // <group>
00221     TableExprNode regex      (const TableExprNode& node);
00222     TableExprNode pattern    (const TableExprNode& node);
00223     TableExprNode sqlpattern (const TableExprNode& node);
00224   // </group>
00225 
00226   // Functions for date-values. Defined for scalars and arrays.
00227   // <group>
00228     TableExprNode datetime  (const TableExprNode& node);
00229     TableExprNode mjdtodate (const TableExprNode& node);
00230     TableExprNode mjd       (const TableExprNode& node);
00231     TableExprNode date      (const TableExprNode& node);
00232     TableExprNode year      (const TableExprNode& node);
00233     TableExprNode month     (const TableExprNode& node);
00234     TableExprNode day       (const TableExprNode& node);
00235     TableExprNode cmonth    (const TableExprNode& node);
00236     TableExprNode weekday   (const TableExprNode& node);
00237     TableExprNode cdow      (const TableExprNode& node);
00238     TableExprNode week      (const TableExprNode& node);
00239     TableExprNode time      (const TableExprNode& node);
00240   // </group>
00241 
00242   // Function to test if a scalar or array is NaN (not-a-number).
00243   // It results in a Bool scalar or array.
00244     TableExprNode isNaN (const TableExprNode& node);
00245 
00246   // Minimum or maximum of 2 nodes.
00247   // Makes sense for numeric and String values. For Complex values
00248   // the norm is compared.
00249   // One or both arguments can be scalar or array.
00250   // <group>
00251     TableExprNode min (const TableExprNode& a, const TableExprNode& b);
00252     TableExprNode max (const TableExprNode& a, const TableExprNode& b);
00253   // </group>
00254 
00255   // The complex conjugate of a complex node.
00256   // Defined for scalars and arrays.
00257     TableExprNode conj (const TableExprNode& node);
00258 
00259   // The real part of a complex node.
00260   // Defined for scalars and arrays.
00261     TableExprNode real (const TableExprNode& node);
00262 
00263   // The imaginary part of a complex node.
00264   // Defined for scalars and arrays.
00265     TableExprNode imag (const TableExprNode& node);
00266 
00267   // The amplitude (i.e. sqrt(re*re + im*im)) of a complex node.
00268   // This is a synonym for function abs.
00269   // Defined for scalars and arrays.
00270     TableExprNode amplitude (const TableExprNode& node);
00271 
00272   // The phase (i.e. atan2(im, re)) of a complex node.
00273   // This is a synonym for function arg.
00274   // Defined for scalars and arrays.
00275     TableExprNode phase (const TableExprNode& node);
00276 
00277   // The arg (i.e. atan2(im, re)) of a complex node.
00278   // Defined for scalars and arrays.
00279     TableExprNode arg (const TableExprNode& node);
00280 
00281   // Form a complex number from two Doubles.
00282   // One or both arguments can be scalar or array.
00283     TableExprNode formComplex (const TableExprNode& real,
00284                                const TableExprNode& imag);
00285 
00286   // Functions operating on a Double or Complex scalar or array resulting in
00287   // a scalar with the same data type.
00288   // <group>
00289     TableExprNode sum (const TableExprNode& array);
00290     TableExprNode product (const TableExprNode& array);
00291     TableExprNode sumSquare (const TableExprNode& array);
00292   // </group>
00293 
00294   // Functions operating on a Double scalar or array resulting in
00295   // a Double scalar.
00296   // <group>
00297     TableExprNode min (const TableExprNode& array);
00298     TableExprNode max (const TableExprNode& array);
00299     TableExprNode mean (const TableExprNode& array);
00300     TableExprNode variance (const TableExprNode& array);
00301     TableExprNode stddev (const TableExprNode& array);
00302     TableExprNode avdev (const TableExprNode& array);
00303     TableExprNode rms (const TableExprNode& array);
00304     TableExprNode median (const TableExprNode& array);
00305     TableExprNode fractile (const TableExprNode& array,
00306                             const TableExprNode& fraction);
00307   // </group>
00308 
00309   // <group>
00310     TableExprNode any (const TableExprNode& array);
00311     TableExprNode all (const TableExprNode& array);
00312     TableExprNode ntrue (const TableExprNode& array);
00313     TableExprNode nfalse (const TableExprNode& array);
00314   // </group>
00315 
00316   // The partial version of the functions above.
00317   // They are applied to the array subsets defined by the axes in the set
00318   // using the partialXXX functions in ArrayMath.
00319   // The axes must be 0-relative.
00320   // <group>
00321     TableExprNode sums (const TableExprNode& array,
00322                         const TableExprNodeSet& collapseAxes);
00323     TableExprNode products (const TableExprNode& array,
00324                             const TableExprNodeSet& collapseAxes);
00325     TableExprNode sumSquares (const TableExprNode& array,
00326                               const TableExprNodeSet& collapseAxes);
00327     TableExprNode mins (const TableExprNode& array,
00328                         const TableExprNodeSet& collapseAxes);
00329     TableExprNode maxs (const TableExprNode& array,
00330                         const TableExprNodeSet& collapseAxes);
00331     TableExprNode means (const TableExprNode& array,
00332                          const TableExprNodeSet& collapseAxes);
00333     TableExprNode variances (const TableExprNode& array,
00334                              const TableExprNodeSet& collapseAxes);
00335     TableExprNode stddevs (const TableExprNode& array,
00336                            const TableExprNodeSet& collapseAxes);
00337     TableExprNode avdevs (const TableExprNode& array,
00338                           const TableExprNodeSet& collapseAxes);
00339     TableExprNode rmss (const TableExprNode& array,
00340                         const TableExprNodeSet& collapseAxes);
00341     TableExprNode medians (const TableExprNode& array,
00342                            const TableExprNodeSet& collapseAxes);
00343     TableExprNode fractiles (const TableExprNode& array,
00344                              const TableExprNode& fraction,
00345                              const TableExprNodeSet& collapseAxes);
00346     TableExprNode anys (const TableExprNode& array,
00347                         const TableExprNodeSet& collapseAxes);
00348     TableExprNode alls (const TableExprNode& array,
00349                         const TableExprNodeSet& collapseAxes);
00350     TableExprNode ntrues (const TableExprNode& array,
00351                           const TableExprNodeSet& collapseAxes);
00352     TableExprNode nfalses (const TableExprNode& array,
00353                            const TableExprNodeSet& collapseAxes);
00354   // </group>
00355 
00356   // Functions operating for each element on a box around that element.
00357   // The elements at the edges (where no full box can be made) are set to 0.
00358   // <group>
00359     TableExprNode runningMin (const TableExprNode& array,
00360                               const TableExprNodeSet& halfBoxWidth);
00361     TableExprNode runningMax (const TableExprNode& array,
00362                               const TableExprNodeSet& halfBoxWidth);
00363     TableExprNode runningMean (const TableExprNode& array,
00364                                const TableExprNodeSet& halfBoxWidth);
00365     TableExprNode runningVariance (const TableExprNode& array,
00366                                    const TableExprNodeSet& halfBoxWidth);
00367     TableExprNode runningStddev (const TableExprNode& array,
00368                                  const TableExprNodeSet& halfBoxWidth);
00369     TableExprNode runningAvdev (const TableExprNode& array,
00370                                 const TableExprNodeSet& halfBoxWidth);
00371     TableExprNode runningRms (const TableExprNode& array,
00372                               const TableExprNodeSet& halfBoxWidth);
00373     TableExprNode runningMedian (const TableExprNode& array,
00374                                  const TableExprNodeSet& halfBoxWidth);
00375     TableExprNode runningAny (const TableExprNode& array,
00376                               const TableExprNodeSet& halfBoxWidth);
00377     TableExprNode runningAll (const TableExprNode& array,
00378                               const TableExprNodeSet& halfBoxWidth);
00379   // </group>
00380 
00381   // Create an array of the given shape and fill it with the values.
00382   // The <src>values</src> array is rewound as needed.
00383     TableExprNode array (const TableExprNode& values,
00384                          const TableExprNodeSet& shape);
00385 
00386   // Function operating on a field resulting in a bool scalar.
00387   // It can be used to test if a column has an array in the current row.
00388   // It can also be used to test if a record contains a field.
00389     TableExprNode isdefined (const TableExprNode& array);
00390 
00391   // Functions operating on any scalar or array resulting in a Double scalar.
00392   // A scalar has 1 element and dimensionality 1.
00393   // <group>
00394     TableExprNode nelements (const TableExprNode& array);
00395     TableExprNode ndim (const TableExprNode& array);
00396   // </group>
00397 
00398   // Function operating on any scalar or array resulting in a Double array
00399   // containing the shape. A scalar has shape [1].
00400     TableExprNode shape (const TableExprNode& array);
00401 
00402   // Function resembling the ternary <src>?:</src> construct in C++.
00403   // The argument "condition" has to be a Bool value.
00404   // If an element in "condition" is True, the corresponding element from
00405   // "arg1" is taken, otherwise it is taken from "arg2".
00406   // The arguments can be scalars or array or any combination.
00407     TableExprNode iif (const TableExprNode& condition,
00408                        const TableExprNode& arg1,
00409                        const TableExprNode& arg2);
00410 // </group>
00411 
00412 
00413 
00414 // <summary>
00415 // Handle class for a table column expression tree
00416 // </summary>
00417 
00418 // <use visibility=export>
00419 
00420 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
00421 // </reviewed>
00422 
00423 // <prerequisite>
00424 //# Classes you should understand before using this one.
00425 //   <li> <linkto class=Table>Table</linkto>
00426 //   <li> Note 199 describing <a href="../../../notes/199/199.html">TaQL</a>
00427 // </prerequisite>
00428 
00429 // <etymology>
00430 // TableExprNode represents a node in the tree reflecting a
00431 // table select expression.
00432 // </etymology>
00433 
00434 // <synopsis> 
00435 // TableExprNode is the class to store a table select expression,
00436 // which allows to select rows from the table. The selected rows form
00437 // a table which is a view of the original table.
00438 // <p>
00439 // TableExprNode is a handle class for the counted referenced class
00440 // TableExprNodeRep.
00441 // Classes (like TableExprNodePlusXX) derived from TableExprNodeRep
00442 // hold the individual
00443 // nodes in the expression, i.e. the operators and operands. The nodes
00444 // form a binary tree reflecting the expression.
00445 // E.g. the expression 2*COLUMN results in the node TableExprNodeTimes
00446 // with its children TableExprNodeConst and TableExprNodeColumn.
00447 // Constant subexpressions (like 2*3) are evaluated immediately and
00448 // only the result is stored as a node.
00449 // <p>
00450 // There are a few TableExprNode constructors taking a constant scalar or array.
00451 // In this way constant value are automatically converted to the
00452 // appropriate TableExprNodeConst object.
00453 // <p>
00454 // The derived classes also reflect the data type of the node.
00455 // Data types Bool, Double, DComplex and String are used.
00456 // Char, uChar, Short, uShort, Int, uInt and float are converted 
00457 // to Double and Complex to DComplex.
00458 // Binary operators +, -, *, /, ==, >=, >, <, <= and != are recognized.
00459 // Also &&, ||, parentheses and unary +, - and ! are recognized.
00460 // For strings the binary operator + can also be used.
00461 // The operators have the normal C++ precedence.
00462 // Furthermore functions (like sin, max, ceil) can be used in an expression.
00463 // <br>Operator() can be used to take a slice from an array.
00464 // <p>
00465 // The Table function col has to be used to create a TableExprNode
00466 // object for a column in the table. The Table
00467 // <linkto file="Table.h#keycol">operator()</linkto> can be used
00468 // the do the actual selection from the top TableExprNode object.
00469 // </synopsis> 
00470 
00471 // <example>
00472 // <srcblock>
00473 //   // Select from table X all rows where column RA<5 and where column
00474 //   // SWITCH is true.
00475 //   Table table("X");
00476 //   Table subtable = table(table.col("RA") < 5 && table.col("SWITCH"));
00477 //
00478 //   // Select from that result all rows where the concatenation of
00479 //   // the strings in columns STR1 and STR2 is equal to the string
00480 //   // in keyword STRKEY.
00481 //   Table subsub = subtable(subtable.col("STR1") + subtable.col("STR2")
00482 //                           == subtable.key("STRKEY"));
00483 // </srcblock>
00484 // </example>
00485 
00486 // <motivation>
00487 // Having TableExprNode as a handle class makes it possible to
00488 // handle temporary objects created by the compiler in a smooth way.
00489 // TableExprNode and its derivations allow to store an expression
00490 // before actually evaluating it. This also allows the classes to
00491 // be used by the table expression parser defined in TableParse and
00492 // TableGram.
00493 //
00494 // For each operator a special derived class is implemented.
00495 // Another approach could have been to store the operator as
00496 // a flag and switch on that. However, that causes extra overhead
00497 // and the C++ virtual function mechanism is the designed for
00498 // these purposes.
00499 // </motivation>
00500 
00501 // <todo asof="$DATE:$">
00502 //# A List of bugs, limitations, extensions or planned refinements.
00503 //   <li> add operations on arrays
00504 //   <li> add selection by comparing with a set of values
00505 // </todo>
00506 
00507 
00508 class TableExprNode
00509 {
00510     //# Define the next 2 classes as friends to get the node_p.
00511     friend class TableExprNodeRep;
00512     friend class TableParse;
00513 
00514     //# Define the operations we allow.
00515     //# Note that the arguments are defined as const. This is necessary
00516     //# because the compiler generates temporaries when converting a constant
00517     //# to a TableExprNode using the constructors. Temporaries has to be const.
00518     //# However, we have to delete created nodes, so lnode_p and rnode_p
00519     //# cannot be const. The const arguments are casted to a non-const in
00520     //# the function fill which calls the non-const function simplify.
00521 
00522     // Define all global functions as friends.
00523     // <group>
00524     friend TableExprNode operator+ (const TableExprNode& left,
00525                                     const TableExprNode& right);
00526     friend TableExprNode operator- (const TableExprNode& left,
00527                                     const TableExprNode& right);
00528     friend TableExprNode operator* (const TableExprNode& left,
00529                                     const TableExprNode& right);
00530     friend TableExprNode operator/ (const TableExprNode& left,
00531                                     const TableExprNode& right);
00532     friend TableExprNode operator% (const TableExprNode& left,
00533                                     const TableExprNode& right);
00534     friend TableExprNode operator^ (const TableExprNode& left,
00535                                     const TableExprNode& right);
00536     friend TableExprNode operator== (const TableExprNode& left,
00537                                      const TableExprNode& right);
00538     friend TableExprNode operator!= (const TableExprNode& left,
00539                                      const TableExprNode& right);
00540     friend TableExprNode operator>= (const TableExprNode& left,
00541                                      const TableExprNode& right);
00542     friend TableExprNode operator>  (const TableExprNode& left,
00543                                      const TableExprNode& right);
00544     friend TableExprNode operator<= (const TableExprNode& left, 
00545                                      const TableExprNode& right);
00546     friend TableExprNode operator<  (const TableExprNode& left,
00547                                      const TableExprNode& right);
00548     friend TableExprNode operator&& (const TableExprNode& left,
00549                                      const TableExprNode& right);
00550     friend TableExprNode operator|| (const TableExprNode& left,
00551                                      const TableExprNode& right);
00552     friend TableExprNode near    (const TableExprNode& left,
00553                                   const TableExprNode& right);
00554     friend TableExprNode near    (const TableExprNode& left,
00555                                   const TableExprNode& right,
00556                                   const TableExprNode& tolerance);
00557     friend TableExprNode nearAbs (const TableExprNode& left,
00558                                   const TableExprNode& right);
00559     friend TableExprNode nearAbs (const TableExprNode& left,
00560                                   const TableExprNode& right,
00561                                   const TableExprNode& tolerance);
00562     friend TableExprNode cones (const TableExprNode& sourcePos,
00563                                 const TableExprNode& cones);
00564     friend TableExprNode anyCone (const TableExprNode& sourcePos,
00565                                   const TableExprNode& cones);
00566     friend TableExprNode findCone (const TableExprNode& sourcePos,
00567                                    const TableExprNode& cones);
00568     friend TableExprNode cones (const TableExprNode& sourcePos,
00569                                 const TableExprNode& conePos,
00570                                 const TableExprNode& radii);
00571     friend TableExprNode anyCone (const TableExprNode& sourcePos,
00572                                   const TableExprNode& conePos,
00573                                   const TableExprNode& radii);
00574     friend TableExprNode findCone (const TableExprNode& sourcePos,
00575                                    const TableExprNode& conePos,
00576                                    const TableExprNode& radii);
00577     friend TableExprNode sin    (const TableExprNode& node);
00578     friend TableExprNode sinh   (const TableExprNode& node);
00579     friend TableExprNode cos    (const TableExprNode& node);
00580     friend TableExprNode cosh   (const TableExprNode& node);
00581     friend TableExprNode exp    (const TableExprNode& node);
00582     friend TableExprNode log    (const TableExprNode& node);
00583     friend TableExprNode log10  (const TableExprNode& node);
00584     friend TableExprNode pow    (const TableExprNode& x,
00585                                  const TableExprNode& y);
00586     friend TableExprNode square (const TableExprNode& node);
00587     friend TableExprNode sqrt   (const TableExprNode& node);
00588     friend TableExprNode norm   (const TableExprNode& node);
00589     friend TableExprNode asin  (const TableExprNode& node);
00590     friend TableExprNode acos  (const TableExprNode& node);
00591     friend TableExprNode atan  (const TableExprNode& node);
00592     friend TableExprNode atan2 (const TableExprNode& y,
00593                                 const TableExprNode& x);
00594     friend TableExprNode tan   (const TableExprNode& node);
00595     friend TableExprNode tanh  (const TableExprNode& node);
00596     friend TableExprNode sign  (const TableExprNode& node);
00597     friend TableExprNode round (const TableExprNode& node);
00598     friend TableExprNode ceil  (const TableExprNode& node);
00599     friend TableExprNode abs   (const TableExprNode& node);
00600     friend TableExprNode floor (const TableExprNode& node);
00601     friend TableExprNode fmod  (const TableExprNode& x,
00602                                 const TableExprNode& y);
00603     friend TableExprNode strlength (const TableExprNode& node);
00604     friend TableExprNode upcase    (const TableExprNode& node);
00605     friend TableExprNode downcase  (const TableExprNode& node);
00606     friend TableExprNode trim      (const TableExprNode& node);
00607     friend TableExprNode regex      (const TableExprNode& node);
00608     friend TableExprNode pattern    (const TableExprNode& node);
00609     friend TableExprNode sqlpattern (const TableExprNode& node);
00610     friend TableExprNode datetime  (const TableExprNode& node);
00611     friend TableExprNode mjdtodate (const TableExprNode& node);
00612     friend TableExprNode mjd       (const TableExprNode& node);
00613     friend TableExprNode date      (const TableExprNode& node);
00614     friend TableExprNode year      (const TableExprNode& node);
00615     friend TableExprNode month     (const TableExprNode& node);
00616     friend TableExprNode day       (const TableExprNode& node);
00617     friend TableExprNode cmonth    (const TableExprNode& node);
00618     friend TableExprNode weekday   (const TableExprNode& node);
00619     friend TableExprNode cdow      (const TableExprNode& node);
00620     friend TableExprNode week      (const TableExprNode& node);
00621     friend TableExprNode time      (const TableExprNode& node);
00622     friend TableExprNode isNaN (const TableExprNode& node);
00623     friend TableExprNode min (const TableExprNode& a, const TableExprNode& b);
00624     friend TableExprNode max (const TableExprNode& a, const TableExprNode& b);
00625     friend TableExprNode conj (const TableExprNode& node);
00626     friend TableExprNode real (const TableExprNode& node);
00627     friend TableExprNode imag (const TableExprNode& node);
00628     friend TableExprNode amplitude (const TableExprNode& node);
00629     friend TableExprNode phase (const TableExprNode& node);
00630     friend TableExprNode arg (const TableExprNode& node);
00631     friend TableExprNode formComplex (const TableExprNode& real,
00632                                       const TableExprNode& imag);
00633     friend TableExprNode sum (const TableExprNode& array);
00634     friend TableExprNode product (const TableExprNode& array);
00635     friend TableExprNode sumSquare (const TableExprNode& array);
00636     friend TableExprNode min (const TableExprNode& array);
00637     friend TableExprNode max (const TableExprNode& array);
00638     friend TableExprNode mean (const TableExprNode& array);
00639     friend TableExprNode variance (const TableExprNode& array);
00640     friend TableExprNode stddev (const TableExprNode& array);
00641     friend TableExprNode avdev (const TableExprNode& array);
00642     friend TableExprNode rms (const TableExprNode& array);
00643     friend TableExprNode median (const TableExprNode& array);
00644     friend TableExprNode fractile (const TableExprNode& array,
00645                                    const TableExprNode& fraction);
00646     friend TableExprNode any (const TableExprNode& array);
00647     friend TableExprNode all (const TableExprNode& array);
00648     friend TableExprNode ntrue (const TableExprNode& array);
00649     friend TableExprNode nfalse (const TableExprNode& array);
00650     friend TableExprNode sums (const TableExprNode& array,
00651                                const TableExprNodeSet& collapseAxes);
00652     friend TableExprNode products (const TableExprNode& array,
00653                                    const TableExprNodeSet& collapseAxes);
00654     friend TableExprNode sumSquares (const TableExprNode& array,
00655                                      const TableExprNodeSet& collapseAxes);
00656     friend TableExprNode mins (const TableExprNode& array,
00657                                const TableExprNodeSet& collapseAxes);
00658     friend TableExprNode maxs (const TableExprNode& array,
00659                                const TableExprNodeSet& collapseAxes);
00660     friend TableExprNode means (const TableExprNode& array,
00661                                 const TableExprNodeSet& collapseAxes);
00662     friend TableExprNode variances (const TableExprNode& array,
00663                                     const TableExprNodeSet& collapseAxes);
00664     friend TableExprNode stddevs (const TableExprNode& array,
00665                                   const TableExprNodeSet& collapseAxes);
00666     friend TableExprNode avdevs (const TableExprNode& array,
00667                                  const TableExprNodeSet& collapseAxes);
00668     friend TableExprNode rmss (const TableExprNode& array,
00669                                const TableExprNodeSet& collapseAxes);
00670     friend TableExprNode medians (const TableExprNode& array,
00671                                   const TableExprNodeSet& collapseAxes);
00672     friend TableExprNode fractiles (const TableExprNode& array,
00673                                     const TableExprNode& fraction,
00674                                     const TableExprNodeSet& collapseAxes);
00675     friend TableExprNode anys (const TableExprNode& array,
00676                                const TableExprNodeSet& collapseAxes);
00677     friend TableExprNode alls (const TableExprNode& array,
00678                                const TableExprNodeSet& collapseAxes);
00679     friend TableExprNode ntrues (const TableExprNode& array,
00680                                  const TableExprNodeSet& collapseAxes);
00681     friend TableExprNode nfalses (const TableExprNode& array,
00682                                   const TableExprNodeSet& collapseAxes);
00683     friend TableExprNode runningMin (const TableExprNode& array);
00684     friend TableExprNode runningMax (const TableExprNode& array);
00685     friend TableExprNode runningMean (const TableExprNode& array);
00686     friend TableExprNode runningVariance (const TableExprNode& array);
00687     friend TableExprNode runningStddev (const TableExprNode& array);
00688     friend TableExprNode runningAvdev (const TableExprNode& array);
00689     friend TableExprNode runningRms (const TableExprNode& array);
00690     friend TableExprNode runningMedian (const TableExprNode& array);
00691     friend TableExprNode runningAny (const TableExprNode& array);
00692     friend TableExprNode runningAll (const TableExprNode& array);
00693     friend TableExprNode array (const TableExprNode& values,
00694                                 const TableExprNodeSet& shape);
00695     friend TableExprNode isdefined (const TableExprNode& array);
00696     friend TableExprNode nelements (const TableExprNode& array);
00697     friend TableExprNode ndim (const TableExprNode& array);
00698     friend TableExprNode shape (const TableExprNode& array);
00699     friend TableExprNode iif (const TableExprNode& condition,
00700                               const TableExprNode& arg1,
00701                               const TableExprNode& arg2);
00702     // </group>
00703 
00704 public:
00705     TableExprNode ();
00706 
00707     // Unary operators on numeric TableExprNode's.
00708     // <group>
00709     TableExprNode operator+ () const;
00710     TableExprNode operator- () const;
00711     // </group>
00712     // Unary NOT-operator on boolean TableExprNode's.
00713     TableExprNode operator! () const;
00714 
00715     // Slicing in a node containing an array. It is possible to
00716     // address a single pixel or an n-dimensional subarray.
00717     // In case of a single pixel the result is a scalar node.
00718     // Otherwise the result is an array node with the same dimensionality
00719     // as the source.
00720     // <br>Note that there exist TableExprNodeSet constructors to
00721     // convert an <src>IPosition</src> or <src>Slicer</src> object
00722     // automatically to a <src>TableExprNodeSet</src>.
00723     // An <src>IPosition</src> addresses a single element and results in
00724     // a scalar node, while a <src>Slicer</src> can address multiple
00725     // elements and always results in an array node.
00726     TableExprNode operator() (const TableExprNodeSet& indices);
00727 
00728     // The IN operator to test if a value is contained in an array or set.
00729     // The array can also be a scalar.
00730     // <group>
00731     TableExprNode in (const TableExprNode& array) const;
00732     TableExprNode in (const TableExprNodeSet& set) const;
00733     // </group>
00734 
00735     // Use a unit for the given TableExprNode.
00736     // Note that if a column has a unit, it is automatically set. In that case
00737     // this can be used to convert units.
00738     TableExprNode useUnit (const Unit& unit) const;
00739 
00740     // Constructors to convert a constant value to a TableExprNode.
00741     // The constructor for char* is also supported to convert a
00742     // character-array to a string, since a two step conversion
00743     // is not done automatically.
00744     // <group>
00745     TableExprNode (const Bool& value);
00746     TableExprNode (const Int& value);
00747     TableExprNode (const uInt& value);
00748     TableExprNode (const Float& value);
00749     TableExprNode (const Double& value);
00750     TableExprNode (const Complex& value);
00751     TableExprNode (const DComplex& value);
00752     TableExprNode (const String& value);
00753     TableExprNode (const char*);
00754     TableExprNode (const Regex& value);
00755     TableExprNode (const MVTime& value);
00756     TableExprNode (const Array<Bool>& value);
00757     TableExprNode (const Array<uChar>& value);
00758     TableExprNode (const Array<Short>& value);
00759     TableExprNode (const Array<uShort>& value);
00760     TableExprNode (const Array<Int>& value);
00761     TableExprNode (const Array<uInt>& value);
00762     TableExprNode (const Array<Float>& value);
00763     TableExprNode (const Array<Double>& value);
00764     TableExprNode (const Array<Complex>& value);
00765     TableExprNode (const Array<DComplex>& value);
00766     TableExprNode (const Array<String>& value);
00767     TableExprNode (const Array<MVTime>& value);
00768     // </group>
00769 
00770     // Construct a node from a node representation.
00771     TableExprNode (TableExprNodeRep*);
00772 
00773     // copy constructor (reference semantics).
00774     TableExprNode (const TableExprNode&);
00775 
00776     // Assignment (reference semantics).
00777     TableExprNode& operator= (const TableExprNode&);
00778 
00779     // The destructor deletes all the underlying TableExprNode objects,
00780     ~TableExprNode ();
00781 
00782     // Does the node contain no actual node?
00783     Bool isNull() const
00784       { return node_p == 0; }
00785 
00786     // Get the unit of the expression.
00787     const Unit& unit() const
00788       { return node_p->unit(); }
00789 
00790     // Get the data type of the expression.
00791     // Currently the only possible values are TpBool, TpDouble,
00792     // TpDComplex and TpString.
00793     // An expression is thrown if the result is not a scalar of one
00794     // of those types.
00795     DataType dataType() const;
00796 
00797     // Is the expression a scalar?
00798     Bool isScalar() const
00799       { return (node_p->valueType() == TableExprNodeRep::VTScalar); }
00800 
00801     // Get the number of rows in the table associated with this expression.
00802     // One is returned if the expression is a constant.
00803     // Zero is returned if no table is associated with it.
00804     uInt nrow() const
00805       { return node_p->nrow(); }
00806 
00807     // Get a value for this node in the given row.
00808     // These functions are implemented in the derived classes and
00809     // will usually invoke the get in their children and apply the
00810     // operator on the resulting values.
00811     // <group>
00812     void get (const TableExprId& id, Bool& value) const;
00813     void get (const TableExprId& id, Double& value) const;
00814     void get (const TableExprId& id, DComplex& value) const;
00815     void get (const TableExprId& id, String& value) const;
00816     void get (const TableExprId& id, Regex& value) const;
00817     void get (const TableExprId& id, MVTime& value) const;
00818     void get (const TableExprId& id, Array<Bool>& value) const;
00819     void get (const TableExprId& id, Array<Double>& value) const;
00820     void get (const TableExprId& id, Array<DComplex>& value) const;
00821     void get (const TableExprId& id, Array<String>& value) const;
00822     void get (const TableExprId& id, Array<MVTime>& value) const;
00823     Bool     getBool     (const TableExprId& id) const;
00824     Double   getDouble   (const TableExprId& id) const;
00825     DComplex getDComplex (const TableExprId& id) const;
00826     String   getString   (const TableExprId& id) const;
00827     Array<Bool>     getArrayBool     (const TableExprId& id) const;
00828     Array<Double>   getArrayDouble   (const TableExprId& id) const;
00829     Array<DComplex> getArrayDComplex (const TableExprId& id) const;
00830     Array<String>   getArrayString   (const TableExprId& id) const;
00831     // </group>
00832 
00833     // Get the data type for doing a getColumn on the expression.
00834     // This is the data type of the column when the expression
00835     // consists of a single column only.
00836     // Otherwise it is the expression data type as returned by
00837     // function <src>dataType</src>.
00838     DataType getColumnDataType() const;
00839 
00840     // Get the value of the expression evaluated for the entire column.
00841     // The data of function called should match the data type as
00842     // returned by function <src>getColumnDataType</src>.
00843     // <group>
00844     Array<Bool>     getColumnBool() const;
00845     Array<uChar>    getColumnuChar() const;
00846     Array<Short>    getColumnShort() const;
00847     Array<uShort>   getColumnuShort() const;
00848     Array<Int>      getColumnInt() const;
00849     Array<uInt>     getColumnuInt() const;
00850     Array<Float>    getColumnFloat() const;
00851     Array<Double>   getColumnDouble() const;
00852     Array<Complex>  getColumnComplex() const;
00853     Array<DComplex> getColumnDComplex() const;
00854     Array<String>   getColumnString() const;
00855     // </group>
00856 
00857     // Show the tree.
00858     void show (ostream&) const;
00859 
00860     // Convert the tree to a number of range vectors which at least
00861     // select the same things.
00862     // This function is very useful to convert the expression to
00863     // some intervals covering the select expression. This can
00864     // be used to do a rough fast selection via an index and do the
00865     // the slower final selection on that much smaller subset.
00866     // The function can only convert direct comparisons of columns
00867     // with constants (via ==, !=, >, >=, < or <=) and their combinations
00868     // using && or ||.
00869     void ranges (Block<TableExprRange>&);
00870 
00871     // Check if the table used in the expression matches the given
00872     // Table. This is used by the Table selection to check if it is correct.
00873     Bool checkTable (const Table& table) const;
00874 
00875     // Same as checkTable, but the given table only needs to have the
00876     // same description as the table in the expression. This is used by
00877     // sorting/updating which parse the expression with the original table,
00878     // but have to operate on the output of the selection process.
00879     // If the tables are different, the table pointers in the expression
00880     // are replaced.
00881     // If <src>canbeConst==True</src>, the expression can be constant,
00882     // thus does not need a table column in it.
00883     Bool checkReplaceTable (const Table& table, Bool canBeConst=False) const;
00884 
00885     // Get table. This gets the Table object to which a
00886     // TableExprNode belongs. A TableExprNode belongs to the Table to
00887     // which the column(s) used in an expression belong. Note that
00888     // all columns in an expression have to belong to the same table.
00889     const Table& table() const;
00890 
00891     // Create a column node on behalf of the Table class.
00892     // For builtin data types another type of node is created than
00893     // for other data types.
00894     // isArray indicates if the column should be an array column.
00895     static TableExprNode newColumnNode (const Table& tab,
00896                                         const String& name,
00897                                         const Vector<String>& fieldNames);
00898 
00899     // Create a TableExprNodeConst for a table keyword
00900     // (which is handled as a constant).
00901     static TableExprNode newKeyConst (const TableRecord&,
00902                                       const Vector<String>& fieldNames);
00903 
00904     // Throw invalid data type exception.
00905     // <group>
00906     static void throwInvDT();
00907     static void throwInvDT (const String& message);
00908     // </group>
00909 
00910     // Create function node of the given type with the given arguments.
00911     // <group>
00912     static TableExprNode newFunctionNode (TableExprFuncNode::FunctionType,
00913                                           const TableExprNodeSet& set,
00914                                           const Table& table,
00915                                           const TaQLStyle& = TaQLStyle(0));
00916     static TableExprNode newFunctionNode (TableExprFuncNode::FunctionType,
00917                                           const TableExprNode& node);
00918     static TableExprNode newFunctionNode (TableExprFuncNode::FunctionType,
00919                                           const TableExprNode& node1,
00920                                           const TableExprNode& node2);
00921     static TableExprNode newFunctionNode (TableExprFuncNode::FunctionType,
00922                                           const TableExprNode& node1,
00923                                           const TableExprNode& node2,
00924                                           const TableExprNode& node3);
00925     static TableExprNode newFunctionNode (TableExprFuncNode::FunctionType,
00926                                           const TableExprNode& array,
00927                                           const TableExprNodeSet& axes);
00928     static TableExprNode newFunctionNode (TableExprFuncNode::FunctionType,
00929                                           const TableExprNode& array,
00930                                           const TableExprNode& node,
00931                                           const TableExprNodeSet& axes);
00932     // </group>
00933 
00934     // Create cone function node of the given type with the given arguments.
00935     // <group>
00936     static TableExprNode newConeNode (TableExprFuncNode::FunctionType,
00937                                       const TableExprNodeSet& set,
00938                                       uInt origin = 0);
00939     static TableExprNode newConeNode (TableExprFuncNode::FunctionType,
00940                                       const TableExprNode& node1,
00941                                       const TableExprNode& node2);
00942     static TableExprNode newConeNode (TableExprFuncNode::FunctionType,
00943                                       const TableExprNode& node1,
00944                                       const TableExprNode& node2,
00945                                       const TableExprNode& node3);
00946     // </group>
00947 
00948     // Create rownumber() function node.
00949     // Origin indicates whether the first row should be zero (for C++ binding)
00950     // or an other value (one for TaQL binding).
00951     static TableExprNode newRownrNode (const Table& table, uInt origin);
00952 
00953     // Create rowid() function node.
00954     // Origin is always 0.
00955     static TableExprNode newRowidNode (const Table& table);
00956 
00957     // Create rand() function node.
00958     static TableExprNode newRandomNode (const Table& table);
00959 
00960     // Create ArrayElement node for the given array with the given index.
00961     // The origin is 0 for C++ and 1 for TaQL.
00962     static TableExprNode newArrayPartNode (const TableExprNode& arrayNode,
00963                                            const TableExprNodeSet& indices,
00964                                            const TaQLStyle& = TaQLStyle(0));
00965  
00966     // returns pointer to the representation-object of it
00967     const TableExprNodeRep* getNodeRep() const;
00968 
00969     // Adapt the unit of the expression to the given unit (if not empty).
00970     void adaptUnit (const Unit&);
00971 
00972 private:
00973     // returns pointer to the representation-object of it
00974     TableExprNodeRep* getRep();
00975 
00976     // convert Block of TableExprNode to PtrBlock of TableExprNodeRep*.
00977     static PtrBlock<TableExprNodeRep*> convertBlockTEN
00978                                              (Block<TableExprNode>& nodes);
00979 
00980     // Construct a new node for the given operation.
00981     // <group>
00982     TableExprNodeRep* newPlus   (TableExprNodeRep* right) const;
00983     TableExprNodeRep* newMinus  (TableExprNodeRep* right) const;
00984     TableExprNodeRep* newTimes  (TableExprNodeRep* right) const;
00985     TableExprNodeRep* newDivide (TableExprNodeRep* right) const;
00986     TableExprNodeRep* newModulo (TableExprNodeRep* right) const;
00987     TableExprNodeRep* newEQ     (TableExprNodeRep* right) const;
00988     TableExprNodeRep* newNE     (TableExprNodeRep* right) const;
00989     TableExprNodeRep* newGE     (TableExprNodeRep* right) const;
00990     TableExprNodeRep* newGT     (TableExprNodeRep* right) const;
00991     TableExprNodeRep* newIN     (TableExprNodeRep* right) const;
00992     TableExprNodeRep* newOR     (TableExprNodeRep* right) const;
00993     TableExprNodeRep* newAND    (TableExprNodeRep* right) const;
00994     // </group>
00995 
00996     // The actual (counted referenced) representation of a node.
00997     TableExprNodeRep* node_p;
00998 };
00999 
01000 
01001 
01002 inline void TableExprNode::ranges (Block<TableExprRange>& blrange)
01003     { node_p->ranges (blrange); }
01004 
01005 //# Get the table from which the node is derived.
01006 inline const Table& TableExprNode::table() const
01007     { return node_p->table(); }
01008 
01009 //# Get the value of an expression.
01010 inline void TableExprNode::get (const TableExprId& id, Bool& value) const
01011     { value = node_p->getBool (id); }
01012 inline void TableExprNode::get (const TableExprId& id, Double& value) const
01013     { value = node_p->getDouble (id); }
01014 inline void TableExprNode::get (const TableExprId& id, DComplex& value) const
01015     { value = node_p->getDComplex (id); }
01016 inline void TableExprNode::get (const TableExprId& id, String& value) const
01017     { value = node_p->getString (id); }
01018 inline void TableExprNode::get (const TableExprId& id, Regex& value) const
01019     { value = node_p->getRegex (id); }
01020 inline void TableExprNode::get (const TableExprId& id, MVTime& value) const
01021     { value = node_p->getDate (id); }
01022 inline void TableExprNode::get (const TableExprId& id,
01023                                 Array<Bool>& value) const
01024     { value = node_p->getArrayBool (id); }
01025 inline void TableExprNode::get (const TableExprId& id,
01026                                 Array<Double>& value) const
01027     { value = node_p->getArrayDouble (id); }
01028 inline void TableExprNode::get (const TableExprId& id,
01029                                 Array<DComplex>& value) const
01030     { value = node_p->getArrayDComplex (id); }
01031 inline void TableExprNode::get (const TableExprId& id,
01032                                 Array<String>& value) const
01033     { value = node_p->getArrayString (id); }
01034 inline void TableExprNode::get (const TableExprId& id,
01035                                 Array<MVTime>& value) const
01036     { value = node_p->getArrayDate (id); }
01037 inline Bool TableExprNode::getBool (const TableExprId& id) const
01038     { return node_p->getBool (id); }
01039 inline Double TableExprNode::getDouble (const TableExprId& id) const
01040     { return node_p->getDouble (id); }
01041 inline DComplex TableExprNode::getDComplex (const TableExprId& id) const
01042     { return node_p->getDComplex (id); }
01043 inline String TableExprNode::getString (const TableExprId& id) const
01044     { return node_p->getString (id); }
01045 inline Array<Bool> TableExprNode::getArrayBool (const TableExprId& id) const
01046     { return node_p->getArrayBool (id); }
01047 inline Array<Double> TableExprNode::getArrayDouble (const TableExprId& id) const
01048     { return node_p->getArrayDouble (id); }
01049 inline Array<DComplex> TableExprNode::getArrayDComplex (const TableExprId& id) const
01050     { return node_p->getArrayDComplex (id); }
01051 inline Array<String> TableExprNode::getArrayString (const TableExprId& id) const
01052     { return node_p->getArrayString (id); }
01053 
01054 inline Array<Bool>      TableExprNode::getColumnBool() const
01055     { return node_p->getColumnBool(); }
01056 inline Array<uChar>     TableExprNode::getColumnuChar() const
01057     { return node_p->getColumnuChar(); }
01058 inline Array<Short>     TableExprNode::getColumnShort() const
01059     { return node_p->getColumnShort(); }
01060 inline Array<uShort>    TableExprNode::getColumnuShort() const
01061     { return node_p->getColumnuShort(); }
01062 inline Array<Int>       TableExprNode::getColumnInt() const
01063     { return node_p->getColumnInt(); }
01064 inline Array<uInt>      TableExprNode::getColumnuInt() const
01065     { return node_p->getColumnuInt(); }
01066 inline Array<Float>     TableExprNode::getColumnFloat() const
01067     { return node_p->getColumnFloat(); }
01068 inline Array<Double>    TableExprNode::getColumnDouble() const
01069     { return node_p->getColumnDouble(); }
01070 inline Array<Complex>   TableExprNode::getColumnComplex() const
01071     { return node_p->getColumnComplex(); }
01072 inline Array<DComplex>  TableExprNode::getColumnDComplex() const
01073     { return node_p->getColumnDComplex(); }
01074 inline Array<String>    TableExprNode::getColumnString() const
01075     { return node_p->getColumnString(); }
01076 
01077 
01078 inline TableExprNode operator+ (const TableExprNode& left,
01079                                 const TableExprNode& right)
01080 {
01081     return left.newPlus (right.node_p);
01082 }
01083 inline TableExprNode operator- (const TableExprNode& left,
01084                                 const TableExprNode& right)
01085 {
01086     return left.newMinus (right.node_p);
01087 }
01088 inline TableExprNode operator* (const TableExprNode& left,
01089                                 const TableExprNode& right)
01090 {
01091     return left.newTimes (right.node_p);
01092 }
01093 inline TableExprNode operator/ (const TableExprNode& left,
01094                                 const TableExprNode& right)
01095 {
01096     return left.newDivide (right.node_p);
01097 }
01098 inline TableExprNode operator% (const TableExprNode& left,
01099                                 const TableExprNode& right)
01100 {
01101     return left.newModulo (right.node_p);
01102 }
01103 inline TableExprNode operator^ (const TableExprNode& left,
01104                                 const TableExprNode& right)
01105 {
01106     return pow(left, right);
01107 }
01108 inline TableExprNode operator== (const TableExprNode& left,
01109                                  const TableExprNode& right)
01110 {
01111     return left.newEQ (right.node_p);
01112 }
01113 inline TableExprNode operator!= (const TableExprNode& left,
01114                                  const TableExprNode& right)
01115 {
01116     return left.newNE (right.node_p);
01117 }
01118 inline TableExprNode operator> (const TableExprNode& left,
01119                                 const TableExprNode& right)
01120 {
01121     return left.newGT (right.node_p);
01122 }
01123 inline TableExprNode operator>= (const TableExprNode& left,
01124                                  const TableExprNode& right)
01125 {
01126     return left.newGE (right.node_p);
01127 }
01128 inline TableExprNode operator<= (const TableExprNode& left,
01129                                  const TableExprNode& right)
01130 {
01131     return right.newGE (left.node_p);
01132 }
01133 inline TableExprNode operator< (const TableExprNode& left,
01134                                 const TableExprNode& right)
01135 {
01136     return right.newGT (left.node_p);
01137 }
01138 inline TableExprNode TableExprNode::in (const TableExprNode& right) const
01139 {
01140     return newIN (right.node_p);
01141 }
01142 inline TableExprNode operator&& (const TableExprNode& left,
01143                                  const TableExprNode& right)
01144 {
01145     return left.newAND (right.node_p);
01146 }
01147 inline TableExprNode operator|| (const TableExprNode& left,
01148                                  const TableExprNode& right)
01149 {
01150     return left.newOR (right.node_p);
01151 }
01152 inline TableExprNode TableExprNode::operator() (const TableExprNodeSet& indices)
01153 {
01154     // C++ indexing is 0-based.
01155     return newArrayPartNode (*this, indices, 0);
01156 }
01157 
01158 inline TableExprNode near (const TableExprNode& left,
01159                            const TableExprNode& right)
01160 {
01161     return TableExprNode::newFunctionNode (TableExprFuncNode::near2FUNC,
01162                                            left, right);
01163 }
01164 inline TableExprNode near (const TableExprNode& left,
01165                            const TableExprNode& right,
01166                            const TableExprNode& tolerance)
01167 {
01168     return TableExprNode::newFunctionNode (TableExprFuncNode::near3FUNC,
01169                                            left, right, tolerance);
01170 }
01171 inline TableExprNode nearAbs (const TableExprNode& left,
01172                               const TableExprNode& right)
01173 {
01174     return TableExprNode::newFunctionNode (TableExprFuncNode::nearabs2FUNC,
01175                                            left, right);
01176 }
01177 inline TableExprNode nearAbs (const TableExprNode& left,
01178                               const TableExprNode& right,
01179                               const TableExprNode& tolerance)
01180 {
01181     return TableExprNode::newFunctionNode (TableExprFuncNode::nearabs3FUNC,
01182                                            left, right, tolerance);
01183 }
01184 inline TableExprNode cones (const TableExprNode& sourcePos,
01185                             const TableExprNode& cones)
01186 {
01187     return TableExprNode::newConeNode (TableExprFuncNode::conesFUNC,
01188                                        sourcePos, cones);
01189 }
01190 inline TableExprNode anyCone (const TableExprNode& sourcePos,
01191                               const TableExprNode& cones)
01192 {
01193     return TableExprNode::newConeNode (TableExprFuncNode::anyconeFUNC,
01194                                        sourcePos, cones);
01195 }
01196 inline TableExprNode findCone (const TableExprNode& sourcePos,
01197                                const TableExprNode& cones)
01198 {
01199     return TableExprNode::newConeNode (TableExprFuncNode::findconeFUNC,
01200                                        sourcePos, cones);
01201 }
01202 inline TableExprNode cones (const TableExprNode& sourcePos,
01203                             const TableExprNode& conePos,
01204                             const TableExprNode& radii)
01205 {
01206     return TableExprNode::newConeNode (TableExprFuncNode::cones3FUNC,
01207                                        sourcePos, conePos, radii);
01208 }
01209 inline TableExprNode anyCone (const TableExprNode& sourcePos,
01210                               const TableExprNode& conePos,
01211                               const TableExprNode& radii)
01212 {
01213     return TableExprNode::newConeNode (TableExprFuncNode::anycone3FUNC,
01214                                        sourcePos, conePos, radii);
01215 }
01216 inline TableExprNode findCone (const TableExprNode& sourcePos,
01217                                const TableExprNode& conePos,
01218                                const TableExprNode& radii)
01219 {
01220     return TableExprNode::newConeNode (TableExprFuncNode::findcone3FUNC,
01221                                        sourcePos, conePos, radii);
01222 }
01223 inline TableExprNode cos (const TableExprNode& node)
01224 {
01225     return TableExprNode::newFunctionNode (TableExprFuncNode::cosFUNC, node);
01226 }
01227 inline TableExprNode cosh (const TableExprNode& node)
01228 {
01229     return TableExprNode::newFunctionNode (TableExprFuncNode::coshFUNC, node);
01230 }
01231 inline TableExprNode exp (const TableExprNode& node)
01232 {
01233     return TableExprNode::newFunctionNode (TableExprFuncNode::expFUNC, node);
01234 }
01235 inline TableExprNode log (const TableExprNode& node)
01236 {
01237     return TableExprNode::newFunctionNode (TableExprFuncNode::logFUNC, node);
01238 }
01239 inline TableExprNode log10 (const TableExprNode& node)
01240 {
01241     return TableExprNode::newFunctionNode (TableExprFuncNode::log10FUNC, node);
01242 }
01243 inline TableExprNode pow (const TableExprNode& x, const TableExprNode& y)
01244 {
01245     return TableExprNode::newFunctionNode (TableExprFuncNode::powFUNC, x, y);
01246 }
01247 inline TableExprNode sin (const TableExprNode& node)
01248 {
01249     return TableExprNode::newFunctionNode (TableExprFuncNode::sinFUNC, node);
01250 }
01251 inline TableExprNode sinh (const TableExprNode& node)
01252 {
01253     return TableExprNode::newFunctionNode (TableExprFuncNode::sinhFUNC, node);
01254 }
01255 inline TableExprNode square (const TableExprNode& node)
01256 {
01257     return TableExprNode::newFunctionNode (TableExprFuncNode::squareFUNC,
01258                                            node);
01259 }
01260 inline TableExprNode sqrt (const TableExprNode& node)
01261 {
01262     return TableExprNode::newFunctionNode (TableExprFuncNode::sqrtFUNC, node);
01263 }
01264 inline TableExprNode norm (const TableExprNode& node)
01265 {
01266     return TableExprNode::newFunctionNode (TableExprFuncNode::normFUNC, node);
01267 }
01268 inline TableExprNode acos (const TableExprNode& node)
01269 {
01270     return TableExprNode::newFunctionNode (TableExprFuncNode::acosFUNC, node);
01271 }
01272 inline TableExprNode asin (const TableExprNode& node)
01273 {
01274     return TableExprNode::newFunctionNode (TableExprFuncNode::asinFUNC, node);
01275 }
01276 inline TableExprNode atan (const TableExprNode& node)
01277 {
01278     return TableExprNode::newFunctionNode (TableExprFuncNode::atanFUNC, node);
01279 }
01280 inline TableExprNode atan2 (const TableExprNode& y, const TableExprNode& x)
01281 {
01282     return TableExprNode::newFunctionNode (TableExprFuncNode::atan2FUNC, y, x);
01283 }
01284 inline TableExprNode sign (const TableExprNode& node)
01285 {
01286     return TableExprNode::newFunctionNode (TableExprFuncNode::signFUNC, node);
01287 }
01288 inline TableExprNode round (const TableExprNode& node)
01289 {
01290     return TableExprNode::newFunctionNode (TableExprFuncNode::roundFUNC, node);
01291 }
01292 inline TableExprNode ceil (const TableExprNode& node)
01293 {
01294     return TableExprNode::newFunctionNode (TableExprFuncNode::ceilFUNC, node);
01295 }
01296 inline TableExprNode abs (const TableExprNode& node)
01297 {
01298     return TableExprNode::newFunctionNode (TableExprFuncNode::absFUNC, node);
01299 }
01300 inline TableExprNode floor (const TableExprNode& node)
01301 {
01302     return TableExprNode::newFunctionNode (TableExprFuncNode::floorFUNC, node);
01303 }
01304 inline TableExprNode fmod (const TableExprNode& x, const TableExprNode& y)
01305 {
01306     return TableExprNode::newFunctionNode (TableExprFuncNode::fmodFUNC, x, y);
01307 }
01308 inline TableExprNode tan (const TableExprNode& node)
01309 {
01310     return TableExprNode::newFunctionNode (TableExprFuncNode::tanFUNC, node);
01311 }
01312 inline TableExprNode tanh (const TableExprNode& node)
01313 {
01314     return TableExprNode::newFunctionNode (TableExprFuncNode::tanhFUNC, node);
01315 }
01316 inline TableExprNode min (const TableExprNode& a, const TableExprNode& b)
01317 {
01318     return TableExprNode::newFunctionNode (TableExprFuncNode::minFUNC, a, b);
01319 }
01320 inline TableExprNode max (const TableExprNode& a, const TableExprNode& b)
01321 {
01322     return TableExprNode::newFunctionNode (TableExprFuncNode::maxFUNC, a, b);
01323 }
01324 inline TableExprNode real (const TableExprNode& node)
01325 {
01326     return TableExprNode::newFunctionNode (TableExprFuncNode::realFUNC, node);
01327 }
01328 inline TableExprNode imag (const TableExprNode& node)
01329 {
01330     return TableExprNode::newFunctionNode (TableExprFuncNode::imagFUNC, node);
01331 }
01332 inline TableExprNode conj (const TableExprNode& node)
01333 {
01334     return TableExprNode::newFunctionNode (TableExprFuncNode::conjFUNC, node);
01335 }
01336 inline TableExprNode amplitude (const TableExprNode& node)
01337 {
01338     return TableExprNode::newFunctionNode (TableExprFuncNode::absFUNC, node);
01339 }
01340 inline TableExprNode arg (const TableExprNode& node)
01341 {
01342     return TableExprNode::newFunctionNode (TableExprFuncNode::argFUNC, node);
01343 }
01344 inline TableExprNode phase (const TableExprNode& node)
01345 {
01346     return TableExprNode::newFunctionNode (TableExprFuncNode::argFUNC, node);
01347 }
01348 inline TableExprNode formComplex (const TableExprNode& real,
01349                                   const TableExprNode& imag)
01350 {
01351     return TableExprNode::newFunctionNode (TableExprFuncNode::complexFUNC,
01352                                            real, imag);
01353 }
01354 inline TableExprNode strlength (const TableExprNode& node)
01355 {
01356     return TableExprNode::newFunctionNode (TableExprFuncNode::strlengthFUNC,
01357                                            node);
01358 }
01359 inline TableExprNode upcase (const TableExprNode& node)
01360 {
01361     return TableExprNode::newFunctionNode (TableExprFuncNode::upcaseFUNC,
01362                                            node);
01363 }
01364 inline TableExprNode downcase (const TableExprNode& node)
01365 {
01366     return TableExprNode::newFunctionNode (TableExprFuncNode::downcaseFUNC,
01367                                            node);
01368 }
01369 inline TableExprNode regex (const TableExprNode& node)
01370 {
01371     return TableExprNode::newFunctionNode (TableExprFuncNode::regexFUNC, node);
01372 }
01373 inline TableExprNode pattern (const TableExprNode& node)
01374 {
01375     return TableExprNode::newFunctionNode (TableExprFuncNode::patternFUNC,
01376                                            node);
01377 }
01378 inline TableExprNode sqlpattern (const TableExprNode& node)
01379 {
01380     return TableExprNode::newFunctionNode (TableExprFuncNode::sqlpatternFUNC,
01381                                            node);
01382 }
01383 inline TableExprNode datetime (const TableExprNode& node)
01384 {
01385     return TableExprNode::newFunctionNode (TableExprFuncNode::datetimeFUNC,
01386                                            node);
01387 }
01388 inline TableExprNode mjdtodate (const TableExprNode& node)
01389 {
01390     return TableExprNode::newFunctionNode (TableExprFuncNode::mjdtodateFUNC,
01391                                            node);
01392 }
01393 inline TableExprNode mjd (const TableExprNode& node)
01394 {
01395     return TableExprNode::newFunctionNode (TableExprFuncNode::mjdFUNC, node);
01396 }
01397 inline TableExprNode date (const TableExprNode& node)
01398 {
01399     return TableExprNode::newFunctionNode (TableExprFuncNode::dateFUNC, node);
01400 }
01401 inline TableExprNode year (const TableExprNode& node)
01402 {
01403     return TableExprNode::newFunctionNode (TableExprFuncNode::yearFUNC, node);
01404 }
01405 inline TableExprNode month (const TableExprNode& node)
01406 {
01407     return TableExprNode::newFunctionNode (TableExprFuncNode::monthFUNC, node);
01408 }
01409 inline TableExprNode day (const TableExprNode& node)
01410 {
01411     return TableExprNode::newFunctionNode (TableExprFuncNode::dayFUNC, node);
01412 }
01413 inline TableExprNode cmonth (const TableExprNode& node)
01414 {
01415     return TableExprNode::newFunctionNode (TableExprFuncNode::cmonthFUNC,
01416                                            node);
01417 }
01418 inline TableExprNode weekday (const TableExprNode& node)
01419 {
01420     return TableExprNode::newFunctionNode (TableExprFuncNode::weekdayFUNC,
01421                                            node);
01422 }
01423 inline TableExprNode cdow (const TableExprNode& node)
01424 {
01425     return TableExprNode::newFunctionNode (TableExprFuncNode::cdowFUNC, node);
01426 }
01427 inline TableExprNode week (const TableExprNode& node)
01428 {
01429     return TableExprNode::newFunctionNode (TableExprFuncNode::weekFUNC, node);
01430 }
01431 inline TableExprNode time (const TableExprNode& node)
01432 {
01433     return TableExprNode::newFunctionNode (TableExprFuncNode::timeFUNC, node);
01434 }
01435 inline TableExprNode trim (const TableExprNode& node)
01436 {
01437     return TableExprNode::newFunctionNode (TableExprFuncNode::trimFUNC, node);
01438 }
01439 inline TableExprNode isNaN (const TableExprNode& node)
01440 {
01441     return TableExprNode::newFunctionNode (TableExprFuncNode::isnanFUNC, node);
01442 }
01443 inline TableExprNode min (const TableExprNode& node)
01444 {
01445     return TableExprNode::newFunctionNode (TableExprFuncNode::arrminFUNC,
01446                                            node);
01447 }
01448 inline TableExprNode max (const TableExprNode& node)
01449 {
01450     return TableExprNode::newFunctionNode (TableExprFuncNode::arrmaxFUNC,
01451                                            node);
01452 }
01453 inline TableExprNode sum (const TableExprNode& node)
01454 {
01455     return TableExprNode::newFunctionNode (TableExprFuncNode::arrsumFUNC,
01456                                            node);
01457 }
01458 inline TableExprNode product (const TableExprNode& node)
01459 {
01460     return TableExprNode::newFunctionNode (TableExprFuncNode::arrproductFUNC,
01461                                            node);
01462 }
01463 inline TableExprNode sumSquare (const TableExprNode& node)
01464 {
01465     return TableExprNode::newFunctionNode (TableExprFuncNode::arrsumsqrFUNC,
01466                                            node);
01467 }
01468 inline TableExprNode mean (const TableExprNode& node)
01469 {
01470     return TableExprNode::newFunctionNode (TableExprFuncNode::arrmeanFUNC,
01471                                            node);
01472 }
01473 inline TableExprNode variance (const TableExprNode& node)
01474 {
01475     return TableExprNode::newFunctionNode (TableExprFuncNode::arrvarianceFUNC,
01476                                            node);
01477 }
01478 inline TableExprNode stddev (const TableExprNode& node)
01479 {
01480     return TableExprNode::newFunctionNode (TableExprFuncNode::arrstddevFUNC,
01481                                            node);
01482 }
01483 inline TableExprNode avdev (const TableExprNode& node)
01484 {
01485     return TableExprNode::newFunctionNode (TableExprFuncNode::arravdevFUNC,
01486                                            node);
01487 }
01488 inline TableExprNode rms (const TableExprNode& node)
01489 {
01490     return TableExprNode::newFunctionNode (TableExprFuncNode::arrrmsFUNC,
01491                                            node);
01492 }
01493 inline TableExprNode median (const TableExprNode& node)
01494 {
01495     return TableExprNode::newFunctionNode (TableExprFuncNode::arrmedianFUNC,
01496                                            node);
01497 }
01498 inline TableExprNode fractile (const TableExprNode& node,
01499                                const TableExprNode& fraction)
01500 {
01501     return TableExprNode::newFunctionNode (TableExprFuncNode::arrfractileFUNC,
01502                                            node, fraction);
01503 }
01504 inline TableExprNode any (const TableExprNode& node)
01505 {
01506     return TableExprNode::newFunctionNode (TableExprFuncNode::anyFUNC, node);
01507 }
01508 inline TableExprNode all (const TableExprNode& node)
01509 {
01510     return TableExprNode::newFunctionNode (TableExprFuncNode::allFUNC, node);
01511 }
01512 inline TableExprNode ntrue (const TableExprNode& node)
01513 {
01514     return TableExprNode::newFunctionNode (TableExprFuncNode::ntrueFUNC, node);
01515 }
01516 inline TableExprNode nfalse (const TableExprNode& node)
01517 {
01518     return TableExprNode::newFunctionNode (TableExprFuncNode::nfalseFUNC, node);
01519 }
01520 inline TableExprNode sums (const TableExprNode& array,
01521                            const TableExprNodeSet& axes)
01522 {
01523     return TableExprNode::newFunctionNode (TableExprFuncNode::arrsumsFUNC,
01524                                            array, axes);
01525 }
01526 inline TableExprNode products (const TableExprNode& array,
01527                                const TableExprNodeSet& axes)
01528 {
01529     return TableExprNode::newFunctionNode (TableExprFuncNode::arrproductsFUNC,
01530                                            array, axes);
01531 }
01532 inline TableExprNode sumSquares (const TableExprNode& array,
01533                                  const TableExprNodeSet& axes)
01534 {
01535     return TableExprNode::newFunctionNode (TableExprFuncNode::arrsumsqrsFUNC,
01536                                            array, axes);
01537 }
01538 inline TableExprNode mins (const TableExprNode& array,
01539                            const TableExprNodeSet& axes)
01540 {
01541     return TableExprNode::newFunctionNode (TableExprFuncNode::arrminsFUNC,
01542                                            array, axes);
01543 }
01544 inline TableExprNode maxs (const TableExprNode& array,
01545                            const TableExprNodeSet& axes)
01546 {
01547     return TableExprNode::newFunctionNode (TableExprFuncNode::arrmaxsFUNC,
01548                                            array, axes);
01549 }
01550 inline TableExprNode means (const TableExprNode& array,
01551                             const TableExprNodeSet& axes)
01552 {
01553     return TableExprNode::newFunctionNode (TableExprFuncNode::arrmeansFUNC,
01554                                            array, axes);
01555 }
01556 inline TableExprNode variances (const TableExprNode& array,
01557                                 const TableExprNodeSet& axes)
01558 {
01559     return TableExprNode::newFunctionNode (TableExprFuncNode::arrvariancesFUNC,
01560                                            array, axes);
01561 }
01562 inline TableExprNode stddevs (const TableExprNode& array,
01563                               const TableExprNodeSet& axes)
01564 {
01565     return TableExprNode::newFunctionNode (TableExprFuncNode::arrstddevsFUNC,
01566                                            array, axes);
01567 }
01568 inline TableExprNode avdevs (const TableExprNode& array,
01569                              const TableExprNodeSet& axes)
01570 {
01571     return TableExprNode::newFunctionNode (TableExprFuncNode::arravdevsFUNC,
01572                                            array, axes);
01573 }
01574 inline TableExprNode rmss (const TableExprNode& array,
01575                            const TableExprNodeSet& axes)
01576 {
01577     return TableExprNode::newFunctionNode (TableExprFuncNode::arrrmssFUNC,
01578                                            array, axes);
01579 }
01580 inline TableExprNode medians (const TableExprNode& array,
01581                               const TableExprNodeSet& axes)
01582 {
01583     return TableExprNode::newFunctionNode (TableExprFuncNode::arrmediansFUNC,
01584                                            array, axes);
01585 }
01586 inline TableExprNode fractiles (const TableExprNode& array,
01587                                 const TableExprNode& fraction,
01588                                 const TableExprNodeSet& axes)
01589 {
01590     return TableExprNode::newFunctionNode (TableExprFuncNode::arrfractilesFUNC,
01591                                            array, fraction, axes);
01592 }
01593 inline TableExprNode anys (const TableExprNode& array,
01594                            const TableExprNodeSet& axes)
01595 {
01596     return TableExprNode::newFunctionNode (TableExprFuncNode::anysFUNC,
01597                                            array, axes);
01598 }
01599 inline TableExprNode alls (const TableExprNode& array,
01600                            const TableExprNodeSet& axes)
01601 {
01602     return TableExprNode::newFunctionNode (TableExprFuncNode::allsFUNC,
01603                                            array, axes);
01604 }
01605 inline TableExprNode ntrues (const TableExprNode& array,
01606                              const TableExprNodeSet& axes)
01607 {
01608     return TableExprNode::newFunctionNode (TableExprFuncNode::ntruesFUNC,
01609                                            array, axes);
01610 }
01611 inline TableExprNode nfalses (const TableExprNode& array,
01612                               const TableExprNodeSet& axes)
01613 {
01614     return TableExprNode::newFunctionNode (TableExprFuncNode::nfalsesFUNC,
01615                                            array, axes);
01616 }
01617 inline TableExprNode runningMin (const TableExprNode& node,
01618                                  const TableExprNodeSet& halfBoxWidth)
01619 {
01620     return TableExprNode::newFunctionNode (TableExprFuncNode::runminFUNC,
01621                                            node, halfBoxWidth);
01622 }
01623 inline TableExprNode runningMax (const TableExprNode& node,
01624                                  const TableExprNodeSet& halfBoxWidth)
01625 {
01626     return TableExprNode::newFunctionNode (TableExprFuncNode::runmaxFUNC,
01627                                            node, halfBoxWidth);
01628 }
01629 inline TableExprNode runningMean (const TableExprNode& node,
01630                                   const TableExprNodeSet& halfBoxWidth)
01631 {
01632     return TableExprNode::newFunctionNode (TableExprFuncNode::runmeanFUNC,
01633                                            node, halfBoxWidth);
01634 }
01635 inline TableExprNode runningVariance (const TableExprNode& node,
01636                                       const TableExprNodeSet& halfBoxWidth)
01637 {
01638     return TableExprNode::newFunctionNode (TableExprFuncNode::runvarianceFUNC,
01639                                            node, halfBoxWidth);
01640 }
01641 inline TableExprNode runningStddev (const TableExprNode& node,
01642                                     const TableExprNodeSet& halfBoxWidth)
01643 {
01644     return TableExprNode::newFunctionNode (TableExprFuncNode::runstddevFUNC,
01645                                            node, halfBoxWidth);
01646 }
01647 inline TableExprNode runningAvdev (const TableExprNode& node,
01648                                    const TableExprNodeSet& halfBoxWidth)
01649 {
01650     return TableExprNode::newFunctionNode (TableExprFuncNode::runavdevFUNC,
01651                                            node, halfBoxWidth);
01652 }
01653 inline TableExprNode runningRms (const TableExprNode& node,
01654                                  const TableExprNodeSet& halfBoxWidth)
01655 {
01656     return TableExprNode::newFunctionNode (TableExprFuncNode::runrmsFUNC,
01657                                            node, halfBoxWidth);
01658 }
01659 inline TableExprNode runningMedian (const TableExprNode& node,
01660                                     const TableExprNodeSet& halfBoxWidth)
01661 {
01662     return TableExprNode::newFunctionNode (TableExprFuncNode::runmedianFUNC,
01663                                            node, halfBoxWidth);
01664 }
01665 inline TableExprNode runningAny (const TableExprNode& node,
01666                                  const TableExprNodeSet& halfBoxWidth)
01667 {
01668     return TableExprNode::newFunctionNode (TableExprFuncNode::runanyFUNC,
01669                                            node, halfBoxWidth);
01670 }
01671 inline TableExprNode runningAll (const TableExprNode& node,
01672                                  const TableExprNodeSet& halfBoxWidth)
01673 {
01674     return TableExprNode::newFunctionNode (TableExprFuncNode::runallFUNC,
01675                                            node, halfBoxWidth);
01676 }
01677 inline TableExprNode array (const TableExprNode& values,
01678                             const TableExprNodeSet& shape)
01679 {
01680     return TableExprNode::newFunctionNode (TableExprFuncNode::arrayFUNC,
01681                                            values, shape);
01682 }
01683 inline TableExprNode isdefined (const TableExprNode& node)
01684 {
01685     return TableExprNode::newFunctionNode (TableExprFuncNode::isdefFUNC, node);
01686 }
01687 inline TableExprNode nelements (const TableExprNode& node)
01688 {
01689     return TableExprNode::newFunctionNode (TableExprFuncNode::nelemFUNC, node);
01690 }
01691 inline TableExprNode ndim (const TableExprNode& node)
01692 {
01693     return TableExprNode::newFunctionNode (TableExprFuncNode::ndimFUNC, node);
01694 }
01695 inline TableExprNode shape (const TableExprNode& node)
01696 {
01697     return TableExprNode::newFunctionNode (TableExprFuncNode::shapeFUNC, node);
01698 }
01699 inline TableExprNode iif (const TableExprNode& condition,
01700                           const TableExprNode& arg1,
01701                           const TableExprNode& arg2)
01702 {
01703     return TableExprNode::newFunctionNode (TableExprFuncNode::iifFUNC,
01704                                            condition, arg1, arg2);
01705 }
01706 
01707 
01708 inline void TableExprNode::show (ostream& os) const
01709 {
01710     node_p->show (os, 0);
01711 }
01712 inline const TableExprNodeRep* TableExprNode::getNodeRep() const
01713 {
01714     return node_p;
01715 }
01716 inline TableExprNodeRep* TableExprNode::getRep()
01717 {
01718     return node_p;
01719 }
01720 
01721 
01722 
01723 } //# NAMESPACE CASA - END
01724 
01725 #endif

Generated on Mon Sep 1 22:36:20 2008 for NRAOCASA by  doxygen 1.5.1