Changeset 1158 for XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.cpp
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.cpp
r642 r1158 23 23 double CScalarVarExprNode::reduce() const 24 24 { 25 if (!CVariable::has(varId)) 26 ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 25 // $missing_value will be replaced with NaN 26 if (varId == "missing_value") 27 { 28 return std::numeric_limits<double>::quiet_NaN(); 29 } 30 else 31 { 32 if (!CVariable::has(varId)) 33 ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 27 34 28 return CVariable::get(varId)->getData<double>(); 35 return CVariable::get(varId)->getData<double>(); 36 } 29 37 } 30 38 … … 59 67 return op(child1->reduce(), child2->reduce()); 60 68 } 69 70 71 CScalarTernaryOpExprNode::CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3) 72 : child1(child1) 73 , opId(opId) 74 , child2(child2) 75 , child3(child3) 76 { 77 if (!child1 || !child2 || !child3) 78 ERROR("CScalarTernaryOpExprNode::CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3)", 79 "Impossible to create the new expression node, an invalid child node was provided."); 80 } 81 82 double CScalarTernaryOpExprNode::reduce() const 83 { 84 COperatorExpr::functionScalarScalarScalar op = operatorExpr.getOpScalarScalarScalar(opId); 85 return op(child1->reduce(), child2->reduce(), child3->reduce()); 86 } 61 87 }
Note: See TracChangeset
for help on using the changeset viewer.