itablefunct Class Reference

#include <itablefunct.h>

List of all members.

Public Member Functions

long compare (itablefunct &tf)
void copy (itablefunct &tf)
long getval (double temp)
 itablefunct ()
void print (FILE *out)
void read (XFILE *in)
void read_prop (FILE *in)
 ~itablefunct ()

Public Attributes

long asize
 number of function values
double * x
 array of time values
long * y
 array of function values

Detailed Description

This file declares the class of tablefunct, which implements various types of interpolation. The values for interpolation are given by the table.

Definition at line 12 of file itablefunct.h.


Constructor & Destructor Documentation

itablefunct (  ) 

The constructor defines arrays for interpolation. Parameters:

Parameters:
asize is the size of vectors x, y
x is the vector where time values are stored
y is the vector where the function values are stored

10.2.2006, JK, TKo

Definition at line 24 of file itablefunct.cpp.

References asize, x, and y.

~itablefunct (  ) 

The destructor deallocates the memory where the vectors x, y are stored Parameters:

10.2.2006, JK, TKo

Definition at line 37 of file itablefunct.cpp.

References x, and y.


Member Function Documentation

long compare ( itablefunct tf  ) 

The function compares all data from subroutine argument with the actual object

Parameters:
tf - object of tablefunct for comparison
Return values:
0 - objects are identical
1 - objects differs

TKo, 09.2010

Definition at line 194 of file itablefunct.cpp.

References asize, x, and y.

Referenced by gfunct::compare().

void copy ( itablefunct tf  ) 

The function copies all data from subroutine argument to the actual object.

Parameters:
tf - object of tablefunct for comparison
Returns:
The function returns copy of the actual object in the parameter tf.

JK, 15.11.2008

Definition at line 161 of file itablefunct.cpp.

References asize, x, and y.

Referenced by gfunct::copy().

long getval ( double  temp  ) 

The function returns the interpolated value at exact point (temp) by linear interpolation, if the point lies out of the range, extrapolation from the limit intervals takes effect.

Parameters:

Parameters:
temp is x-coordinate, where the function value will be found

10.20.2006, JK, TKo TKo+JK 4.7.2013 changed evaluation of piecewise const function from (x_i; x_{i+1}> => y[i+1] to <x_i; x_{i+1}) => y[i]

Definition at line 129 of file itablefunct.cpp.

References asize, x, and y.

Referenced by gfunct::getval_long().

void print ( FILE *  out  ) 

The function writes input parameters (asize, x, y) for interpolation

Parameters:

Parameters:
out - output file

10.2. 2006, JK, TKo

Definition at line 83 of file itablefunct.cpp.

References asize, x, and y.

Referenced by gfunct::print().

void read ( XFILE in  ) 

function reads data

Example:

function is equal to y1 for x from -infinity to x less than x1 function is equal to y2 for x from x1 to x less than x2 function is equal to y3 for x from x2 to x less than x3 function is equal to y4 for x from x3 to infinity

asize is equal to 4 for this example

Parameters:
in is input file

10.2.2006, JK, TKo

Definition at line 61 of file itablefunct.cpp.

References asize, x, xfscanf(), and y.

Referenced by gfunct::read().

void read_prop ( FILE *  in  ) 

Parameters:

Parameters:
in is input file

10.2.2006, TKo

Definition at line 101 of file itablefunct.cpp.

References asize, getdouble(), getlong(), x, and y.

Referenced by gfunct::read_prop().


Member Data Documentation

long asize

number of function values

Definition at line 28 of file itablefunct.h.

Referenced by compare(), copy(), getval(), itablefunct(), print(), read(), and read_prop().

double* x

array of time values

Definition at line 30 of file itablefunct.h.

Referenced by compare(), copy(), getval(), itablefunct(), print(), read(), read_prop(), and ~itablefunct().

long* y

array of function values

Definition at line 32 of file itablefunct.h.

Referenced by compare(), copy(), getval(), itablefunct(), print(), read(), read_prop(), and ~itablefunct().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2