Chrono::Engine C++ API
Public Member Functions
chrono::ChFunction_Poly Class Reference

#include <ChFunction_Poly.h>

Inheritance diagram for chrono::ChFunction_Poly:
Inheritance graph
[legend]
Collaboration diagram for chrono::ChFunction_Poly:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void Copy (ChFunction_Poly *source)
ChFunctionnew_Duplicate ()
void Set_coeff (double m_coeff, int m_ind)
void Set_order (int m_order)
double Get_coeff (int m_ind)
int Get_order ()
double Get_y (double x)
double Get_y_dx (double x)
double Get_y_dxdx (double x)
int Get_Type ()
int MakeOptVariableTree (ChList< chjs_propdata > *mtree)
void StreamOUT (ChStreamOutAscii &mstream)
void StreamIN (ChStreamInBinary &mstream)
void StreamOUT (ChStreamOutBinary &mstream)

Detailed Description

POLYNOMIAL FUNCTION: y = a + bx + cx^2 + dx^3 + ...


Member Function Documentation

int chrono::ChFunction_Poly::Get_Type ( ) [virtual]

Each class inherited from the ChFunction class must return an unique integer identifier with the virtual function Get_type(). This is useful for fast run-time downcasting etc.

Reimplemented from chrono::ChFunction.

double chrono::ChFunction_Poly::Get_y ( double  x) [virtual]

Returns the y value of the function, at position x. (For this base class, it will be a constant value y=C).

Implements chrono::ChFunction.

double chrono::ChFunction_Poly::Get_y_dx ( double  x) [virtual]

Returns the dy/dx derivative of the function, at position x. Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get dy/dx only from the Get_y() function. (however, if the analytical derivative is known, it may better to implement a custom method).

Reimplemented from chrono::ChFunction.

double chrono::ChFunction_Poly::Get_y_dxdx ( double  x) [virtual]

Returns the ddy/dxdx double derivative of the function, at position x. Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get ddy/dxdx only from the Get_y() function. (however, if the analytical derivative is known, it may be better to implement a custom method).

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Poly::StreamIN ( ChStreamInBinary mstream) [virtual]

Method to allow deserializing a persistent binary archive (ex: a file) into transient data.

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Poly::StreamOUT ( ChStreamOutAscii mstream) [virtual]

Method to allow serialization of transient data in ascii, as a readable item, for example "chrono::GetLog() << myobject;"

Reimplemented from chrono::ChFunction.

void chrono::ChFunction_Poly::StreamOUT ( ChStreamOutBinary mstream) [virtual]

Method to allow serializing transient data into a persistent binary archive (ex: a file).

Reimplemented from chrono::ChFunction.