Skip to content

Commit

Permalink
semiLinear as inline function:
Browse files Browse the repository at this point in the history
  • Loading branch information
vruge authored and OpenModelica-Hudson committed Mar 16, 2016
1 parent 87f4bb3 commit df9f302
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions SimulationRuntime/c/openmodelica.h
Expand Up @@ -151,8 +151,7 @@ struct type_desc_s {

/* Special Modelica builtin functions*/
#define smooth(P,EXP) (EXP)
#define semiLinear(x,positiveSlope,negativeSlope) (x>=0?(positiveSlope)*(x):(negativeSlope)*(x))

static inline modelica_real semiLinear(const modelica_real x,const modelica_real positiveSlope, const modelica_real negativeSlope){return x*((x>=0)? positiveSlope : negativeSlope);}
/* sign function */
static inline int sign(double v)
{
Expand Down

0 comments on commit df9f302

Please sign in to comment.