HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
math_ops.h File Reference

Contains macros for common mathematical functions. More...

#include <math.h>

Go to the source code of this file.

Macros

#define min(a, b)   ((a)<(b)?(a):(b))
 
#define max(a, b)   ((a)>(b)?(a):(b))
 
#define min3(a, b, c)   min(min((a),(b)),min((b),(c)))
 
#define max3(a, b, c)   max(max((a),(b)),max((b),(c)))
 
#define absolute(a)   ((a)<0?-(a):(a))
 
#define raiseto(x, a)   (exp((a)*log(x)))
 
#define raiseto_int(y, x, a)
 
#define sign(a)   ((a)<0?-1.0:1.0)
 

Detailed Description

Contains macros for common mathematical functions.

Author
Debojyoti Ghosh

Definition in file math_ops.h.

Macro Definition Documentation

#define min (   a,
 
)    ((a)<(b)?(a):(b))

Minimum of two numbers

Definition at line 14 of file math_ops.h.

#define max (   a,
 
)    ((a)>(b)?(a):(b))

Maximum of two numbers

Definition at line 18 of file math_ops.h.

#define min3 (   a,
  b,
 
)    min(min((a),(b)),min((b),(c)))

Minimum of three numbers

Definition at line 23 of file math_ops.h.

#define max3 (   a,
  b,
 
)    max(max((a),(b)),max((b),(c)))

Maximum of three numbers

Definition at line 27 of file math_ops.h.

#define absolute (   a)    ((a)<0?-(a):(a))

Absolute value

Definition at line 32 of file math_ops.h.

#define raiseto (   x,
 
)    (exp((a)*log(x)))

Raise to a power: y = x^a

Definition at line 37 of file math_ops.h.

#define raiseto_int (   y,
  x,
 
)
Value:
{ \
int arraycounter; \
y = x; \
for (arraycounter=1; arraycounter<a; arraycounter++) { \
y *= x; \
} \
}

Raise to a power (int only): y = x^a

Definition at line 42 of file math_ops.h.

#define sign (   a)    ((a)<0?-1.0:1.0)

Returns the sign of the argument

Definition at line 54 of file math_ops.h.