Changeset 1545 for XIOS/dev/branch_openmp/src/parse_expr
- Timestamp:
- 06/18/18 20:32:55 (6 years ago)
- Location:
- XIOS/dev/branch_openmp/src/parse_expr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/parse_expr/filter_expr_node.cpp
r1038 r1545 11 11 { /* Nothing to do */ } 12 12 13 boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const14 { 15 boost::shared_ptr<COutputPin> outputPin;13 std::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 14 { 15 std::shared_ptr<COutputPin> outputPin; 16 16 17 17 if (fieldId == "this") … … 21 21 CField* field = CField::get(fieldId); 22 22 if (field == &thisField) 23 ERROR(" boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",23 ERROR("std::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 24 24 << "The field " << fieldId << " has an invalid reference to itself. " 25 25 << "Use the keyword \"this\" if you want to reference the input data sent to this field."); … … 29 29 } 30 30 else 31 ERROR(" boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",31 ERROR("std::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 32 32 << "The field " << fieldId << " does not exist."); 33 33 … … 39 39 { /* Nothing to do */ } 40 40 41 boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const42 { 43 boost::shared_ptr<COutputPin> outputPin;41 std::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 42 { 43 std::shared_ptr<COutputPin> outputPin; 44 44 45 45 if (fieldId == "this") … … 49 49 CField* field = CField::get(fieldId); 50 50 if (field == &thisField) 51 ERROR(" boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",51 ERROR("std::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 52 52 << "The field " << fieldId << " has an invalid reference to itself. " 53 53 << "Use the keyword \"this\" if you want to reference the input data sent to this field."); … … 57 57 } 58 58 else 59 ERROR(" boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",59 ERROR("std::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 60 60 << "The field " << fieldId << " does not exist."); 61 61 … … 72 72 } 73 73 74 boost::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const75 { 76 boost::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId));74 std::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 75 { 76 std::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId)); 77 77 child->reduce(gc, thisField)->connectOutput(filter, 0); 78 78 return filter; … … 89 89 } 90 90 91 boost::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const92 { 93 boost::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce()));91 std::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 92 { 93 std::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce())); 94 94 child2->reduce(gc, thisField)->connectOutput(filter, 0); 95 95 return filter; … … 106 106 } 107 107 108 boost::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const109 { 110 boost::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce()));108 std::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 109 { 110 std::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce())); 111 111 child1->reduce(gc, thisField)->connectOutput(filter, 0); 112 112 return filter; … … 123 123 } 124 124 125 boost::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const126 { 127 boost::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId));125 std::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 126 { 127 std::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId)); 128 128 child1->reduce(gc, thisField)->connectOutput(filter, 0); 129 129 child2->reduce(gc, thisField)->connectOutput(filter, 1); … … 145 145 } 146 146 147 boost::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const148 { 149 boost::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce()));147 std::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 148 { 149 std::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 150 150 child3->reduce(gc, thisField)->connectOutput(filter, 0); 151 151 return filter; … … 164 164 } 165 165 166 boost::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const167 { 168 boost::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce()));166 std::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 167 { 168 std::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 169 169 child2->reduce(gc, thisField)->connectOutput(filter, 0); 170 170 return filter; … … 183 183 } 184 184 185 boost::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const186 { 187 boost::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce()));185 std::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 186 { 187 std::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); 188 188 child2->reduce(gc, thisField)->connectOutput(filter, 0); 189 189 child3->reduce(gc, thisField)->connectOutput(filter, 1); … … 204 204 } 205 205 206 boost::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const207 { 208 boost::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce()));206 std::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 207 { 208 std::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 209 209 child1->reduce(gc, thisField)->connectOutput(filter, 0); 210 210 return filter; … … 224 224 } 225 225 226 boost::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const227 { 228 boost::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce()));226 std::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 227 { 228 std::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); 229 229 child1->reduce(gc, thisField)->connectOutput(filter, 0); 230 230 child3->reduce(gc, thisField)->connectOutput(filter, 1); … … 245 245 } 246 246 247 boost::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const248 { 249 boost::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce()));247 std::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 248 { 249 std::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); 250 250 child1->reduce(gc, thisField)->connectOutput(filter, 0); 251 251 child2->reduce(gc, thisField)->connectOutput(filter, 1); … … 265 265 } 266 266 267 boost::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const268 { 269 boost::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId));267 std::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 268 { 269 std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); 270 270 child1->reduce(gc, thisField)->connectOutput(filter, 0); 271 271 child2->reduce(gc, thisField)->connectOutput(filter, 1); -
XIOS/dev/branch_openmp/src/parse_expr/filter_expr_node.hpp
r1038 r1545 3 3 4 4 #include <string> 5 #include <boost/shared_ptr.hpp>6 5 #include <boost/smart_ptr/scoped_ptr.hpp> 7 6 #include "scalar_expr_node.hpp" … … 26 25 * \return the output pin of the filter producing the result of the expression 27 26 */ 28 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const = 0;27 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const = 0; 29 28 }; 30 29 … … 43 42 CFilterFieldExprNode(const std::string& fieldId); 44 43 45 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;44 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 46 45 47 46 private: … … 64 63 CFilterTemporalFieldExprNode(const std::string& fieldId); 65 64 66 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;65 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 67 66 68 67 private: … … 87 86 CFilterUnaryOpExprNode(const std::string& opId, IFilterExprNode* child); 88 87 89 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;88 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 90 89 91 90 private: … … 112 111 CFilterScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2); 113 112 114 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;113 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 115 114 116 115 private: … … 138 137 CFilterFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2); 139 138 140 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;139 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 141 140 142 141 private: … … 163 162 CFilterFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2); 164 163 165 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;164 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 166 165 167 166 private: … … 191 190 CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 192 191 193 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;192 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 194 193 195 194 private: … … 220 219 CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 221 220 222 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;221 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 223 222 224 223 private: … … 249 248 CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 250 249 251 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;250 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 252 251 253 252 private: … … 279 278 CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3); 280 279 281 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;280 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 282 281 283 282 private: … … 308 307 CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 309 308 310 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;309 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 311 310 312 311 private: … … 336 335 CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 337 336 338 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;337 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 339 338 340 339 private: … … 365 364 CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 366 365 367 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const;366 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 368 367 369 368 private: -
XIOS/dev/branch_openmp/src/parse_expr/operator_expr.hpp
r1482 r1545 254 254 static inline double div_ss(double x, double y) { return x / y; } 255 255 static inline double pow_ss(double x, double y) { return std::pow(x,y); } 256 256 257 static inline double eq_ss(double x, double y) // specific check for NaN 257 258 { … … 350 351 else return Array<double,1>(x == y); 351 352 } 352 353 353 static inline CArray<double,1> lt_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x < y); } 354 354 static inline CArray<double,1> gt_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x > y); } … … 367 367 else return Array<double,1>(x != y); 368 368 } 369 370 371 372 369 static inline double cond_sss(double x, double y, double z) { return (x==0) ? z : y ; } 373 370
Note: See TracChangeset
for help on using the changeset viewer.