EndCube Class Template Reference

Class template supports end point derivative identification for cubic splines. More...

#include <Intp.h>

Inherits Base.

Inheritance diagram for EndCube:

Inheritance graph
[legend]
List of all members.

Public Types

 DDY = 0
enum  DTYPE { DDY = 0, DY, DTYPE_CNT }
 DTYPE_CNT
 DY

Public Member Functions

 EndCube (const EndCube &dc)
 EndCube (yType yDLo, enum EndCube< xType, yType >::DTYPE eDLo, yType yDHi, enum EndCube< xType, yType >::DTYPE eDHi)
 EndCube (void)
yType getDerivative (enum Base::BOUND iBnd) const
enum EndCube< xType, yType
>::DTYPE 
getType (enum Base::BOUND iBnd) const
bool operator!= (const EndCube &dc) const
bool operator== (const EndCube &dc) const
void setDerivative (yType yDeriv, enum EndCube< xType, yType >::DTYPE dType, enum Base::BOUND iBnd)
 ~EndCube (void)

Friends

std::ostream & operator<< (std::ostream &ostr, const EndCube &ec)

Detailed Description

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

Class template supports end point derivative identification for cubic splines.

This class creates a software interface for defining independent data in the interplation of tabular data with cubic splines. Cubic spline interpolation is implemented in the class calc::Cube. When tabulated data is supplied for cubic splines, two additional derivative end point values must be supplied to fully define the spline coefficients.

The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. These independent variables are not used explicitly in this class, but are required to interface with other classes in interpolation calculations. The declaration typename <yType> specifies the form of derivative 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/19 13:21:43
Revision
1.3
Examples:

example_NIntp.txt.


Member Enumeration Documentation

enum DTYPE

Enumeration indicates the type of end point derivative for spline calculations.

Enumerator:
DDY  value is the second derivative of the end point (y/x2 units)
DY  value is the first derivative of the end point (y/x units)
DTYPE_CNT  enumeration count


Constructor & Destructor Documentation

EndCube ( void   ) 

Constructor initializes a derivative identifier object.

Remarks:
  • By default, derivative values are initialized to the natural spline requirement.
  • With a natural spline, the first derivative of the end point assumes the slope to the adjacent data point.

EndCube ( yType  yDLo,
enum EndCube< xType, yType >::DTYPE  eDLo,
yType  yDHi,
enum EndCube< xType, yType >::DTYPE  eDHi 
)

Constructor initializes a derivative identifier object to the specified derivative values and derivative types.

Parameters:
yDLo derivative value to assign to a dimension lower bound (variable units) <yType>
eDLo derivative type to assign to a dimension lower bound
  • eDLo = EndCube::DY (yDLo contains a first derivative value (y/x units))
  • eDLo = EndCube::DDY (yDLo contains a second derivative value (y/x2 units))
yDHi derivative value to assign to a dimension upper bound (variable units) <yType>
eDHi derivative type to assign to a dimension upper bound
  • eDhi = EndCube::DY (yDHi contains a first derivative value (y/x units))
  • eDhi = EndCube::DDY (yDHi contains a second derivative value (y/x2 units))
Remarks:
  • For the natural spline requirement, the derivative value should be 0; the derivative type should be EndCube::DDY.
  • With a natural spline, the first derivative of the end point assumes the slope to the adjacent data point.

EndCube ( const EndCube< xType, yType > &  dc  ) 

Copy constructor initializes a derivative identifier object from the specified existing derivative identifier object.

Parameters:
dc a reference to a derivative identifier object

~EndCube ( void   ) 

Destructor is a place holder, no dynamic memory is allocated.


Member Function Documentation

yType getDerivative ( enum Base::BOUND  iBnd  )  const

Function retrieves the lower / upper end point derivative value from a derivative identifier object.

Parameters:
iBnd boundary index
Returns:
the boundary derivative value of the spline dimension (variable units) <yType>
Remarks:
The units of the derivative value depends on the parameter value returned by EndCube::getType():

enum EndCube< xType, yType >::DTYPE getType ( enum Base::BOUND  iBnd  )  const

Function retrieves a derivative type of the lower / upper end point from a derivative identifier object.

Parameters:
iBnd boundary index
Returns:
the derivative type of the spline dimension lower bound
  • EndCube::DY (the stored derivative is a first derivative value)
  • EndCube::DDY (the stored derivative is a second derivative value)

bool operator!= ( const EndCube< xType, yType > &  dc  )  const

Function overloads the inequality operator !=. The function compares two derivative identifier objects.

Parameters:
dc reference to a derivative identifier object to compare
Returns:
equality status flag
  • false (derivative identifier objects are equal)
  • true (derivative identifier objects are not equal)
Remarks:
To determine object inequality, the complete memory span of each object is tested.

bool operator== ( const EndCube< xType, yType > &  dc  )  const

Function overloads the equality operator ==. The function compares two derivative identifier objects.

Parameters:
dc reference to a derivative identifier object to compare
Returns:
equality status flag
  • false (derivative identifier objects are not equal)
  • true (derivative identifier objects are equal)
Remarks:
To determine object equality, the complete memory span of each object is tested.

void setDerivative ( yType  yDeriv,
enum EndCube< xType, yType >::DTYPE  dType,
enum Base::BOUND  iBnd 
)

Function assigns lower / upper bound derivative data to a derivative identifier object.

Parameters:
yDeriv derivative value to assign to a spline dimension bound end point (variable units) <yType>
dType derivative flag to assign to a spline dimension end point
  • dType = EndCube::DY (yDeriv contains a first derivative value)
  • dType = EndCube::DDY (yDeriv contains a second derivative value)
iBnd boundary index
Remarks:
  • For the natural spline requirement, the derivative value should be 0; the derivative type should be EndCube::DDY.
  • With a natural spline, the first derivative of the end point assumes the slope to the adjacent data point.
  • The units of the derivative value yDeriv depend on the type parameter:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ostr,
const EndCube< xType, yType > &  ec 
) [friend]

Function overloads the bitwise left shift operator <<. The function prints defining object parameters to the specified stream.

Parameters:
ostr a reference to a stream
ec a reference to a derivative identifier object
Returns:
a reference to the stream
Remarks:
The derivative values and indentification enumerators are output separated by commas: 0.5,0,-0.1,1. The lower bound value and enumerator of the object data set precedes the upper bound value and enumerator. The enumeration EndCube::DTYPE is a two value enumeration with a value 0 indicating a second derivative and 1 indicating a first derivative value.


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