TTable
Description:
The TTable class is used to generate a lookup table to approximate
a function g(x).
The source code:
table.h
table.cc
Usage:
#include "table.h"
double g(double x);
TVector v(1000);
Creating a lookup table
TTable t( g, -1.0, 1.0, 1000 ); -
Creates a lookup table t that approximates the function g. The function g is
sampled 1000 times within the interval [-1.0, 1.0] to generate the table.
TTable t( v, -1.0, 1.0); -
Creates a lookup table t that approximates a function in the range [-1.0, 1.0].
The TVector v contains equally spaced samples of the function to be approximated
within the specified range.
TTable(is); -
Creates a lookup table and reads the table from the istream is
Look up operation
y = t(x); Looks up table to approximate y = g(x)
Saving and retrieving the object
SaveState(os, x); Save state of the table on ostream os.
LoadState(is, x); Retrieve state of the table from istream is.
Copyright (c) 1994 Leslie Picardo
(picardo@alpha.ces.cwru.edu)
All rights reserved