Skip to content

Commit

Permalink
MathematicaCompat.h: Remove Fortran support
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Sep 6, 2013
1 parent b701a31 commit d05753c
Showing 1 changed file with 8 additions and 27 deletions.
Expand Up @@ -2,20 +2,11 @@
#define Power(x, y) (pow(x,y))
#define Sqrt(x) (sqrt(x))


#ifdef KRANC_C
# define Abs(x) (fabs(x))
# define Min(x, y) (fmin(x,y))
# define Min3(x, y, z) (fmin(fmin((x), (y)), (z)))
# define Max(x, y) (fmax(x,y))
# define IfThen(x,y,z) ((x) ? (y) : (z))
#else
# define Abs(x) (abs(x))
# define IntAbs(x) (abs(x))
# define Min(x, y) (min(x,y))
# define Max(x, y) (max(x,y))
# define IfThen(x,y,z) ((x)*(y) + (1-(x))*(z))
#endif
#define Abs(x) (fabs(x))
#define Min(x, y) (fmin(x,y))
#define Min3(x, y, z) (fmin(fmin((x), (y)), (z)))
#define Max(x, y) (fmax(x,y))
#define IfThen(x,y,z) ((x) ? (y) : (z))

#define Exp(x) (exp(x))
#define Log(x) (log(x))
Expand Down Expand Up @@ -43,23 +34,13 @@

#define Sign(x) (sgn(x))

#ifdef KRANC_C
# define ToReal(x) ((CCTK_REAL)(x))
#else
# define ToReal(x) (real((x),kind(khalf)))
#endif
#define ToReal(x) ((CCTK_REAL)(x))

#define MinMod(x, y) ((x) * (y) < 0 ? 0 : (fabs((x)) < fabs((y)) ? (x) : (y)))

#define VanLeer(x, y) ((x) * (y) < 0 ? 0 : (Min3(2*fabs(x),2*fabs(y),0.5*(fabs(x)+fabs(y)))*Sign((x)+(y))))

#ifdef KRANC_C
# define E M_E
# define Pi M_PI

#else
# define E 2.71828182845904523536029d0
# define Pi 3.14159265358979323846264d0
#endif
#define E M_E
#define Pi M_PI

#define StepFunction(x) ((x)>0)

0 comments on commit d05753c

Please sign in to comment.