Ignore:
Timestamp:
01/10/17 13:53:02 (7 years ago)
Author:
mhnguyen
Message:

Adding new operator for expression: Not Equal, NE, /=

Test
+) On Curie
+) Okie

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/parse_expr/operator_expr.hpp

    r728 r1019  
    4343      opScalarScalar[string("le")] = le_ss; 
    4444      opScalarScalar[string("ge")] = ge_ss; 
     45      opScalarScalar[string("ne")] = ne_ss; 
    4546 
    4647      opField[string("neg")] = neg_f; 
     
    6364      opFieldField[string("le")] = le_ff; 
    6465      opFieldField[string("ge")] = ge_ff; 
     66      opFieldField[string("ne")] = ne_ff; 
    6567 
    6668      opFieldScalar[string("add")] = add_fs; 
     
    7476      opFieldScalar[string("le")] = le_fs; 
    7577      opFieldScalar[string("ge")] = ge_fs; 
     78      opFieldScalar[string("ne")] = ne_fs; 
    7679 
    7780      opScalarField[string("add")] = add_sf; 
     
    8487      opScalarField[string("le")] = le_sf; 
    8588      opScalarField[string("ge")] = ge_sf; 
     89      opScalarField[string("ne")] = ne_sf; 
    8690    } 
    8791 
     
    160164    static inline double le_ss(double x, double y)    { return x <= y; } 
    161165    static inline double ge_ss(double x, double y)    { return x >= y; } 
     166    static inline double ne_ss(double x, double y)    { return x != y; } 
    162167 
    163168    static inline CArray<double,1> neg_f(const CArray<double,1>& x)   { return Array<double,1>(-x); } 
     
    180185    static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); } 
    181186    static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); } 
     187    static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y)    { return Array<double,1>(x != y); } 
    182188 
    183189    static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(x + y); } 
     
    191197    static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x <= y); } 
    192198    static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x >= y); } 
     199    static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x != y); } 
    193200 
    194201    static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x + y); } 
     
    201208    static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); } 
    202209    static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); } 
     210    static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x != y); } 
    203211  }; 
    204212 
Note: See TracChangeset for help on using the changeset viewer.