Skip to content
Snippets Groups Projects
Commit 614eaea7 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

prefix all the xmath functions with "x_" : some of these are defined
in the new C++ math lib with the same names
parent 07047d67
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -20,7 +20,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/gmsh/MathEval/scanner.cpp,v 1.1 2004-05-12 02:02:21 geuzaine Exp $
* $Header: /cvsroot/gmsh/MathEval/scanner.cpp,v 1.2 2004-05-12 18:14:20 geuzaine Exp $
*/
#define FLEX_SCANNER
......@@ -28,6 +28,7 @@
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
#include <unistd.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
......@@ -41,7 +42,6 @@
#ifdef __cplusplus
#include <stdlib.h>
#include <unistd.h>
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
......@@ -616,7 +616,7 @@ YY_MALLOC_DECL
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
#line 50 "scanner.l"
......@@ -1182,6 +1182,7 @@ register char *yy_bp;
#endif /* ifndef YY_NO_UNPUT */
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
......@@ -1253,7 +1254,7 @@ static int input()
return c;
}
#endif /* YY_NO_INPUT */
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
......@@ -1364,11 +1365,6 @@ YY_BUFFER_STATE b;
}
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
......
......@@ -43,9 +43,10 @@ symbol_table_create(int length)
static char *names[] = {"Exp", "Log", "Sqrt", "Sin", "Cos", "Tan", "Ctan",
"Asin", "Acos", "Atan", "Actan", "Sinh", "Cosh", "Tanh",
"Ctanh", "Asinh", "Acosh", "Atanh", "Actanh", "Fabs" };
static double (*functions[]) (double) = { exp, log, sqrt, sin, cos, tan, ctan,
asin, acos, atan, actan, sinh, cosh, tanh,
ctanh, asinh, acosh, atanh, actanh, fabs};
static double (*functions[]) (double) = { exp, log, sqrt, sin, cos, tan, x_ctan,
asin, acos, atan, x_actan, sinh, cosh, tanh,
x_ctanh, x_asinh, x_acosh, x_atanh, x_actanh,
fabs};
unsigned int i;
/*
......
......@@ -21,9 +21,10 @@
/* This file was modified for inclusion in Gmsh */
#include "xmath.h"
#include <math.h>
double
ctan(double x)
x_ctan(double x)
{
/*
* Calculate cotangent value.
......@@ -32,7 +33,7 @@ ctan(double x)
}
double
actan(double x)
x_actan(double x)
{
/*
* Calculate inverse cotangent value.
......@@ -41,7 +42,7 @@ actan(double x)
}
double
ctanh(double x)
x_ctanh(double x)
{
/*
* Calculate hyperbolic cotangent value.
......@@ -50,7 +51,7 @@ ctanh(double x)
}
double
asinh(double x)
x_asinh(double x)
{
/*
* Calculate inverse hyperbolic sine value using relation between
......@@ -60,7 +61,7 @@ asinh(double x)
}
double
acosh(double x)
x_acosh(double x)
{
/*
* Calculate inverse hyperbolic cosine value using relation between
......@@ -70,7 +71,7 @@ acosh(double x)
}
double
atanh(double x)
x_atanh(double x)
{
/*
* Calculate inverse hyperbolic tangent value using relation between
......@@ -80,7 +81,7 @@ atanh(double x)
}
double
actanh(double x)
x_actanh(double x)
{
/*
* Calculate inverse hyperbolic cotangent value.
......
......@@ -23,27 +23,12 @@
#ifndef XMATH_H
#define XMATH_H
#include <math.h>
/* Calculate cotangent of value x. */
double ctan(double x);
/* Calculate inverse cotangent of value x. */
double actan(double x);
/* Calculate hyperbolical cotangent of value x. */
double ctanh(double x);
/* Calculate inverse hyperbolical sine of value x. */
double asinh(double x);
/* Calculate inverse hyperbolical cosine of value x. */
double acosh(double x);
/* Calculate inverse hyperbolical tangent of value x. */
double atanh(double x);
/* Calculate inverse hyperbolical cotangent of value x. */
double actanh(double x);
double x_ctan(double x);
double x_actan(double x);
double x_ctanh(double x);
double x_asinh(double x);
double x_acosh(double x);
double x_atanh(double x);
double x_actanh(double x);
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment