Ignore:
Timestamp:
06/06/17 17:58:16 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.cpp

    r642 r1158  
    2323  double CScalarVarExprNode::reduce() const 
    2424  { 
    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."); 
    2734 
    28     return CVariable::get(varId)->getData<double>(); 
     35      return CVariable::get(varId)->getData<double>(); 
     36    } 
    2937  } 
    3038 
     
    5967    return op(child1->reduce(), child2->reduce()); 
    6068  } 
     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  } 
    6187} 
Note: See TracChangeset for help on using the changeset viewer.