SGInterpTable Class Reference

A class that provids a simple linear 2d interpolation lookup table. More...

#include <interpolater.hxx>

Inheritance diagram for SGInterpTable:
SGReferenced

List of all members.

Public Member Functions

 SGInterpTable ()
 Constructor.
 SGInterpTable (const SGPropertyNode *interpolation)
 Constructor.
 SGInterpTable (const string &file)
 Constructor.
void addEntry (double ind, double dep)
 Add an entry to the table, extending the table's length.
double interpolate (double x) const
 Given an x value, linearly interpolate the y value from the table.
 ~SGInterpTable ()
 Destructor.

Detailed Description

A class that provids a simple linear 2d interpolation lookup table.

The actual table is expected to be loaded from a file. The independant variable must be strictly ascending. The dependent variable can be anything.

Definition at line 53 of file interpolater.hxx.


Constructor & Destructor Documentation

SGInterpTable::SGInterpTable (  ) 

Constructor.

Creates a new, empty table.

Definition at line 44 of file interpolater.cxx.

SGInterpTable::SGInterpTable ( const SGPropertyNode interpolation  ) 

Constructor.

Loads the interpolation table from an interpolation property node.

Parameters:
interpolation property node having entry children

Definition at line 48 of file interpolater.cxx.

SGInterpTable::SGInterpTable ( const string &  file  ) 

Constructor.

Loads the interpolation table from the specified file.

Parameters:
file name of interpolation file

Definition at line 60 of file interpolater.cxx.


Member Function Documentation

void SGInterpTable::addEntry ( double  ind,
double  dep 
)

Add an entry to the table, extending the table's length.

Parameters:
ind The independent variable.
dep The dependent variable.

Definition at line 81 of file interpolater.cxx.

double SGInterpTable::interpolate ( double  x  )  const

Given an x value, linearly interpolate the y value from the table.

Parameters:
x independent variable
Returns:
interpolated dependent variable

Definition at line 87 of file interpolater.cxx.


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

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1