Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

mathfunc.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include "include/mathfunc.h"

Functions

void emptyFIT (FIT *fit)
void initFIT (FIT *fit)
int writeFIT (FIT *fit, char *filename)
int setmemFIT (FIT *fit, int voiNr)
void printFIT (FIT *fit)
int readFIT (char *filename, FIT *fit)
int functionformatFIT (int type, char *str)
int functionnameFIT (int type, char *str)
int evalFIT (FitVOI *r, double x, double *y)
int evaltacFIT (FitVOI *r, double *x, double *y, int dataNr)
int ievalFIT (FitVOI *r, double x, double *yi)
int ievaltacFIT (FitVOI *r, double *x, double *yi, int dataNr)
int devalFIT (FitVOI *r, double x, double *yd)
int devaltacFIT (FitVOI *r, double *x, double *yd, int dataNr)

Function Documentation

int devalFIT FitVOI r,
double  x,
double *  yd
 

Evaluates yd=Df(x).

Returns:
Returns 0, if ok.
Parameters:
r  Fit parameters of a single region
x  Time where to evaluate the derivative of the function
yd  The derivative of the function is returned here

int devaltacFIT FitVOI r,
double *  x,
double *  yd,
int  dataNr
 

Evaluates an array yd[i]=Df(x[i]).

Returns:
Returns 0, if ok.
Parameters:
r  Fit parameters of a single region
x  Times where to evaluate the function derivatives
yd  Array for the function derivatives
dataNr  Nr of (x,yd) data

void emptyFIT FIT fit  ) 
 

Free memory allocated for FIT. All contents are cleared.

int evalFIT FitVOI r,
double  x,
double *  y
 

Evaluate y=f(x).

Returns:
Returns 0, if ok.
Parameters:
r  Fit parameters of a single region
x  Time where to evaluate the function
y  The value of the function is returned here

int evaltacFIT FitVOI r,
double *  x,
double *  y,
int  dataNr
 

Evaluates an array y[i]=f(x[i]).

Returns:
Returns 0, if ok.
Parameters:
r  Fit parameters of a single region
x  Times where to evaluate the function
y  Array for the function values
dataNr  Nr of (x,y) data

int functionformatFIT int  type,
char *  str
 

Copies the description of a function type to the specified string which must have space for >=128 characters.

Parameters:
type  The number of function
str  Representation of the format of the function

int functionnameFIT int  type,
char *  str
 

Copies the name of the function to the specified string which must have space for >=128 characters.

Parameters:
type  The number of function
str  Name of the function

int ievalFIT FitVOI r,
double  x,
double *  yi
 

Evaluates yi=Integral of f(x) between 0 and x.

Returns:
Returns 0, if ok.
Parameters:
r  Fit parameters of a single region
x  Time where to evaluate integral of the function
yi  The integral value of the function is returned here

int ievaltacFIT FitVOI r,
double *  x,
double *  yi,
int  dataNr
 

Evaluate an array yi[i]=Integral of f(x[i]) between 0 and x.

Returns:
Returns 0, if ok.
Parameters:
r  Fit parameters of a single region
x  Times where to evaluate the function integrals
yi  Array for the function integral values
dataNr  Nr of (x,yi) data

void initFIT FIT fit  ) 
 

Initiate FIT structure. Call this once before first use.

void printFIT FIT fit  ) 
 

Print to stdout the contents of FIT data structure. Mainly for testing purposes.

int readFIT char *  filename,
FIT fit
 

Read FIT file contents to the specified data structure, emptying its old contents.

Returns:
In case of an error, >0 is returned, and a description is written in fiterrmsg.

int setmemFIT FIT fit,
int  voiNr
 

Allocate memory for FIT data. Any previous contents are destroyed.

int writeFIT FIT fit,
char *  filename
 

Write function parameters in FIT into specified file. If necessary, a backup file (*%) is created. In case of an error, >0 is returned, and a description is written in fiterrmsg.


Generated on Fri Jan 21 16:17:41 2005 for libPET by  doxygen 1.4.1