Loading [MathJax]/extensions/tex2jax.js
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
All
Functions
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
c
d
e
f
g
i
l
m
o
p
r
s
t
u
w
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
+
Macros
_
a
c
d
g
i
m
n
r
s
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
math_ops.h
Go to the documentation of this file.
1
6
#ifndef _MATH_OPS_H_
7
#define _MATH_OPS_H_
8
9
#include <math.h>
10
14
#define min(a,b) ((a)<(b)?(a):(b))
15
18
#define max(a,b) ((a)>(b)?(a):(b))
19
23
#define min3(a,b,c) min(min((a),(b)),min((b),(c)))
24
27
#define max3(a,b,c) max(max((a),(b)),max((b),(c)))
28
32
#define absolute(a) ((a)<0?-(a):(a))
33
37
#define raiseto(x,a) (exp((a)*log(x)))
38
42
#define raiseto_int(y,x,a) \
43
{ \
44
int arraycounter; \
45
y = x; \
46
for (arraycounter=1; arraycounter<a; arraycounter++) { \
47
y *= x; \
48
} \
49
}
50
54
#define sign(a) ((a)<0?-1.0:1.0)
55
56
#endif