rasdaman complete source
qtbinaryfunc.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 #ifndef _QTBINARYFUNC_
24 #define _QTBINARYFUNC_
25 
26 #ifndef CPPSTDLIB
27 #include <ospace/string.h> // STL<ToolKit>
28 #else
29 #include <string>
30 #endif
31 
33 #include "raslib/sinterval.hh"
34 #include "raslib/minterval.hh"
35 #include <vector>
36 /*************************************************************
37  *
38  *
39  * COMMENTS:
40  * - why is this "binary"? they all have just one MDD!
41  *
42  ************************************************************/
43 
44 //@ManMemo: Module: {\bf qlparser}
45 
46 /*@Doc:
47 
48  The class represents a shift operation on MDD objects.
49 
50 */
51 
52 class QtShift : public QtBinaryOperation
53 {
54 public:
56  QtShift( QtOperation* mddOp, QtOperation* pointOp );
57 
59  virtual bool isCommutative() const;
60 
62  QtData* evaluate( QtDataList* inputList );
66  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
68 
70  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
71 
73  inline virtual const QtNodeType getNodeType() const;
74 
76  virtual void optimizeLoad( QtTrimList* trimList );
77 
79  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
80 
81 private:
83  static const QtNodeType nodeType;
84 };
85 
86 
87 
88 //@ManMemo: Module: {\bf qlparser}
89 
90 /*@Doc:
91 
92  The class represents an extend operation on MDD objects.
93 
94 */
95 
97 {
98 public:
100  QtExtend( QtOperation* mddOp, QtOperation* mintervalOp );
105  virtual bool isCommutative() const;
107 
109  QtData* evaluate( QtDataList* inputList );
113  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
115 
117  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
118 
120  inline virtual const QtNodeType getNodeType() const;
121 
123  virtual void optimizeLoad( QtTrimList* trimList );
124 
126  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
127 
128 private:
142  void extendGetCornerTiles( r_Minterval outerDomain, r_Minterval innerDomain, r_Dimension currentDim, r_Dimension maxDim, r_Minterval currentInterval, vector<r_Minterval>* cornerList );
143 
145  static const QtNodeType nodeType;
146 };
147 
148 
149 
150 //@ManMemo: Module: {\bf qlparser}
151 
152 /*@Doc:
153 
154  The class represents a scale operation on MDD objects.
155 
156 */
157 
159 {
160 public:
162  QtScale( QtOperation* mddOp, QtOperation* pointOp );
163 
165  virtual bool isCommutative() const;
166 
168  QtData* evaluate( QtDataList* inputList );
172  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
174 
176  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
177 
179  inline virtual const QtNodeType getNodeType() const;
180 
182  virtual void optimizeLoad( QtTrimList* trimList );
183 
185  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
186 
188  virtual int scaleDomain( const r_Minterval& areaOp, const r_Point& origin1, const r_Point& origin2, const vector<double>& scaleFactors, r_Minterval &areaScaled );
189 
191  virtual int scaleDomain( const r_Minterval& areaOp, const vector<double>& scaleFactors, r_Minterval &areaScaled );
192 
193 private:
195  static const QtNodeType nodeType;
196 };
197 
198 #include "qlparser/qtbinaryfunc.icc"
199 
200 #endif
201 
QtScale(QtOperation *mddOp, QtOperation *pointOp)
constructor getting the two operands
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
std::vector< QtTrimElement * > QtTrimList
list of QtTrimData structures
Definition: qtnode.hh:88
Definition: qtnode.hh:463
virtual const QtNodeType getNodeType() const
method for identification of nodes
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
virtual bool isCommutative() const
returns FALSE saying that the operation IS NOT commutative
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
virtual void optimizeLoad(QtTrimList *trimList)
optimizing load access
Definition: qtdata.hh:83
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
Definition: qtbinaryfunc.hh:52
QtChildType
Definition: qtnode.hh:186
QtNodeType
Definition: qtnode.hh:93
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
Definition: qtnode.hh:394
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
virtual bool isCommutative() const
returns FALSE saying that the operation IS NOT commutative
QtShift(QtOperation *mddOp, QtOperation *pointOp)
constructor getting the two operands
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
virtual const QtNodeType getNodeType() const
method for identification of nodes
Definition: qtbinaryoperation.hh:52
virtual const QtNodeType getNodeType() const
method for identification of nodes
Definition: qtbinaryfunc.hh:96
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
virtual void optimizeLoad(QtTrimList *trimList)
optimizing load access
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
Definition: qtbinaryfunc.hh:158
virtual bool isCommutative() const
returns FALSE saying that the operation IS NOT commutative
Definition: qtoperation.hh:57
QtExtend(QtOperation *mddOp, QtOperation *mintervalOp)
constructor getting the two operands
virtual int scaleDomain(const r_Minterval &areaOp, const r_Point &origin1, const r_Point &origin2, const vector< double > &scaleFactors, r_Minterval &areaScaled)
scale domains - initial version
Definition: qtnode.hh:190
virtual void optimizeLoad(QtTrimList *trimList)
optimizing load access
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression