NCube Class Template Reference

Class interpolates multi-dimensional data with cubic splines. More...

#include <NIntp.h>

Inherits NIntp< xType, yType >.

Inheritance diagram for NCube:

Inheritance graph
[legend]
List of all members.

Public Member Functions

EndCube< xType, yType > * copyArrayD (EndCube< xType, yType > *array) const
virtual yType * copyArrayY (enum NIntp< xType, yType >::VTYPE vType, yType *array) const
const EndCube< xType, yType > * getArrayD (void) const
virtual int getCount (enum NIntp< xType, yType >::VTYPE vType) const
 NCube (const xType *const *arXn, const yType *arYn, const int *arNn, int nDimen, const EndCube< xType, yType > *arDn)
 NCube (const xType *const *arXn, const yType *arYn, const int *arNn, int nDimen)
 NCube (const NIntp< xType, yType > &ni)
 NCube (const NCube< xType, yType > &ni)
NCube< xType, yType > * reduce (NCube< xType, yType > *&nc, yType *&arYm, xType x0)
 ~NCube (void)

Detailed Description

template<typename xType, typename yType>
class calc::NCube< xType, yType >

Class interpolates multi-dimensional data with cubic splines.

This class implements arrays of single-dimension cubic spline interpolation (calc::Cube) objects for multi-dimensional interpolation tables. All of the data capabilities and restrictions inherent in cubic spline (calc::Cube) objects carry through to multi-dimensional cubic splines.

The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations. In general, the <yType> variables should be the equal or superset of the <xType> variables.

Author
efgeorge
Date
2006/07/18 01:45:34
Revision
1.2
Examples:

example_NIntp.txt.


Constructor & Destructor Documentation

NCube ( const NCube< xType, yType > &  ni  ) 

Copy constructor initializes an n-Dimension spline interpolation object from the specified existing interpolation object.

Parameters:
ni a reference to an n-Dimension spline interpolation object

NCube ( const NIntp< xType, yType > &  ni  ) 

Copy constructor initializes an n-Dimension spline interpolation object from the specified existing interpolation object.

Parameters:
ni a reference to an n-Dimension spline interpolation object

~NCube ( void   ) 

Destructor frees allocated memory.

NCube ( const xType *const *  arXn,
const yType *  arYn,
const int *  arNn,
int  nDimen 
)

Constructor initializes an n-Dimension cubic spline interpolation object using the natural spline requirement.

Parameters:
arXn a pointer to an n-Dimension independent value interpolation array (x units)
arYn a pointer to an n-Dimension dependent value interpolation array (y units)
arNn a pointer to an array containing data counts by dimension for the specified arrays arXn and arYn
nDimen number of dimensions
Remarks:
  • The specified spline table dimension nDimen must be greater than zero.
  • All entries in the data counts by dimension array arNn must be greater than zero, and correspond to the point count of the independent interpolation array arXn.
  • Spline calculations use the natural spline requirement that second derivatives of first and last data points in the spline are set equal to zero.
  • With a natural spline, the first derivative of an end point assumes the slope to the adjacent data point.

NCube ( const xType *const *  arXn,
const yType *  arYn,
const int *  arNn,
int  nDimen,
const EndCube< xType, yType > *  arDn 
)

Constructor initializes an n-Dimension cubic spline interpolation object with the specified derivative identifier object which specifies derivative values of the first and last data points in the spline.

Parameters:
arXn a pointer to an n-Dimension independent value interpolation array (x units)
arYn a pointer to an n-Dimension dependent value interpolation array (y units)
arNn a pointer to an array containing data counts by dimension for the specified arrays arXn and arYn
nDimen number of dimensions
arDn a pointer to an n-Dimension derivative identifier object array
Remarks:
  • The specified spline table dimension nDimen must be greater than zero.
  • All entries in the data counts by dimension array arNn must be greater than zero, and correspond to the point count of the independent interpolation array arXn.


Member Function Documentation

calc::EndCube< xType, yType > * copyArrayD ( EndCube< xType, yType > *  array  )  const

Function copies the object's array which contains derivative identifier objects for each dimension to the specified pointer.

Parameters:
array a pointer to a copy of the object's derivative identifier array
Returns:
the value of the pointer array
Remarks:
  • The number of calc::EndCube objects in the array equals the number of dimensions in the interpolation table.
  • This array was specified with the object's instantiation.
  • If the object is not initialized, a null pointer is returned.

yType * copyArrayY ( enum NIntp< xType, yType >::VTYPE  vType,
yType *  array 
) const [virtual]

Virtual function copies values contained in an identified object array to the specified pointer.

Parameters:
vType variable index indentifying the type of data
array a pointer to a copy of the object's data array (varying units)
Returns:
the value of the pointer array
Remarks:
  • The data count of the object's array identified by vType is returned by a corresponding function call NIntp::getCount().
  • The user-supplied pointer array should have sufficient allocated memory.
  • If the object is not initialized, a null pointer is returned.
  • If the object does not have the variable identified by vType, a null pointer is returned.
  • The units expressed in the values of array vary depending on the the variable index vType.

const EndCube<xType,yType>* getArrayD ( void   )  const

Function returns a pointer to the object's array which contains derivative identifier objects for each dimension.

Returns:
a pointer to the derivative identifier array
Remarks:
  • The number of calc::EndCube objects in the array equals the number of dimensions in the interpolation table.
  • This array was specified with the object's instantiation.

int getCount ( enum NIntp< xType, yType >::VTYPE  vType  )  const [virtual]

Virtual function determines the number of values contained in the object's identified array.

Parameters:
vType variable index indentifying the type of data
Returns:
the data count of the object's array
Remarks:
  • The pointer of the object's array identified by vType is returned by a corresponding function call NIntp::getArrayX() or NIntp::getArrayN().
  • If the object is not initialized, -1 is returned.
  • If the object does not have the variable identified by vType, -1 is returned.

calc::NCube< xType, yType > * reduce ( NCube< xType, yType > *&  nc,
yType *&  arYm,
xType  x0 
)

Function reduces the object's interpolation table by one dimension.

Parameters:
x0 interpolation value to reduce the first dimension at (x units)
nc a pointer reference to an interpolation object to store the calculated data in
arYm a pointer reference to the calculated reduced dimension dependent interpolation array evaluated at x0 (y units)
Returns:
the value of the pointer nc
Remarks:
  • If there is an error in the function execution, the function returns a null pointer.
  • The first dimension is evaluated at the specified value x0.
  • Memory is allocated to the pointers arYm and nc.
  • The interpolation table is stored in the pointer arYm.
  • Reduced object data is stored in the pointer nc.


The documentation for this class was generated from the following files:
Generated on Wed Jul 19 09:24:15 2006 for CalcLib by  doxygen 1.4.7