HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
math.tools.c File Reference

functions that don't depend upon any global things More...

#include "decs.h"
Include dependency graph for math.tools.c:

Go to the source code of this file.

Macros

#define DO_ASSERTS   0
 
#define max_interp_order   6
 

Functions

FTYPE interpn (int order, FTYPE x_eval, FTYPE x1, FTYPE f1, FTYPE x2, FTYPE f2, FTYPE x3, FTYPE f3, FTYPE x4, FTYPE f4, FTYPE x5, FTYPE f5, FTYPE x6, FTYPE f6)
 Description: Constructs a second-order polynomial interpolating the set of points {x#, f#}, #=1..3 and evaluates it at the point x. More...
 
FTYPE roundprecision (FTYPE value, int precision)
 round to a certain precision in base 10 to avoid round off errors More...
 
void interpfun (int interptype, int numpoints, int i, FTYPE pos, FTYPE *xfun, FTYPE *fun, FTYPE *answer)
 to use generically (e.g. More...
 

Detailed Description

functions that don't depend upon any global things

Definition in file math.tools.c.

Macro Definition Documentation

#define DO_ASSERTS   0

Definition at line 10 of file math.tools.c.

#define max_interp_order   6

Function Documentation

void interpfun ( int  interptype,
int  numpoints,
int  i,
FTYPE  pos,
FTYPE xfun,
FTYPE fun,
FTYPE answer 
)

to use generically (e.g.

for parabolic interpolation), call like: interpfun(QUADRATICTYPE,3,1,realposition,array from 0 of positions, array from 0 of values, output of answer);

Definition at line 91 of file math.tools.c.

FTYPE interpn ( int  order,
FTYPE  x_eval,
FTYPE  x1,
FTYPE  f1,
FTYPE  x2,
FTYPE  f2,
FTYPE  x3,
FTYPE  f3,
FTYPE  x4,
FTYPE  f4,
FTYPE  x5,
FTYPE  f5,
FTYPE  x6,
FTYPE  f6 
)

Description: Constructs a second-order polynomial interpolating the set of points {x#, f#}, #=1..3 and evaluates it at the point x.

Interpolation is performed using the standard Lagrange method. Arguments: x_eval – abscissa of a point where an interpolated value is to be evaluated x1, x2, x3 – set of abscissas; should all be different; can come in any order f1, f2, f3 – set of function values at the above abscissas, i.e. f# = f( x# ), # = 1..3

Definition at line 20 of file math.tools.c.

FTYPE roundprecision ( FTYPE  value,
int  precision 
)

round to a certain precision in base 10 to avoid round off errors

Definition at line 73 of file math.tools.c.