![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <cpg-network/cpg-function-polynomial.h> CpgFunctionPolynomialPiece; CpgFunctionPolynomialClass; CpgFunctionPolynomial; CpgFunctionPolynomial * cpg_function_polynomial_new (gchar const *name); CpgFunctionPolynomialPiece * cpg_function_polynomial_piece_new (gdouble begin, gdouble end, gdouble *coefficients, guint num_coefficients); void cpg_function_polynomial_add (CpgFunctionPolynomial *function, CpgFunctionPolynomialPiece *piece); void cpg_function_polynomial_remove (CpgFunctionPolynomial *function, CpgFunctionPolynomialPiece *piece); void cpg_function_polynomial_clear (CpgFunctionPolynomial *function); GSList * cpg_function_polynomial_get_pieces (CpgFunctionPolynomial *function); gdouble cpg_function_polynomial_piece_get_begin (CpgFunctionPolynomialPiece *piece); gdouble cpg_function_polynomial_piece_get_end (CpgFunctionPolynomialPiece *piece); void cpg_function_polynomial_piece_set_begin (CpgFunctionPolynomialPiece *piece, gdouble begin); void cpg_function_polynomial_piece_set_end (CpgFunctionPolynomialPiece *piece, gdouble end); gdouble * cpg_function_polynomial_piece_get_coefficients (CpgFunctionPolynomialPiece *piece, guint *num); void cpg_function_polynomial_piece_set_coefficients (CpgFunctionPolynomialPiece *piece, gdouble *coefficients, guint num);
This class provides a specialized custom user function which defines and evaluates piecewise polynomials. The piece polynomials can be specified in terms of the interval in which they are evaluated and the polynomial coefficients. Note that each polynomial will be evaluated on the normalized interval 0 to 1.
In addition, you can automatically evaluate the Nth derivative of the polynomial by use of the optional second argument of the function.
typedef struct { CpgFunctionClass parent_class; } CpgFunctionPolynomialClass;
CpgFunctionPolynomial * cpg_function_polynomial_new (gchar const *name);
Create a new polynomial function. This is a special kind of user function which calculates a piecewise polynomial. The function can be called with one mandatory argument, which is the point at which to evaluate the piecewise polynomial (t: [0, 1]). The second argument is optional and determines the order of derivation of the polynomial (default being 0).
|
The function name |
Returns : |
A CpgFunctionPolynomial |
CpgFunctionPolynomialPiece * cpg_function_polynomial_piece_new (gdouble begin, gdouble end, gdouble *coefficients, guint num_coefficients);
Create a new polynomial to be used in a piecewise polynomial function. The coefficients are specified from high to low order.
|
The polynomial interval begin |
|
The polynomial interval end |
|
The coefficients |
|
The number of coefficients provided in coefficients
|
Returns : |
A CpgFunctionPolynomialPiece |
void cpg_function_polynomial_add (CpgFunctionPolynomial *function, CpgFunctionPolynomialPiece *piece);
Add a polynomial piece.
|
A CpgFunctionPolynomial |
|
A CpgFunctionPolynomialPiece |
void cpg_function_polynomial_remove (CpgFunctionPolynomial *function, CpgFunctionPolynomialPiece *piece);
Remove a polynomial piece.
|
A CpgFunctionPolynomial |
|
A CpgFunctionPolynomialPiece |
void cpg_function_polynomial_clear (CpgFunctionPolynomial *function);
Remove all the polynomial pieces.
|
A CpgFunctionPolynomial |
GSList * cpg_function_polynomial_get_pieces (CpgFunctionPolynomial *function);
Get a list of the polynomials which make up the function. This returns the internally used list which should not be modified or freed.
|
A CpgFunctionPolynomial |
Returns : |
A GSList of CpgFunctionPolynomialPiece |
gdouble cpg_function_polynomial_piece_get_begin (CpgFunctionPolynomialPiece *piece);
Get the interval begin of the polynomial.
|
A CpgFunctionPolynomialPiece |
Returns : |
the interval begin of the polynomial |
gdouble cpg_function_polynomial_piece_get_end (CpgFunctionPolynomialPiece *piece);
Get the interval end of the polynomial.
|
A CpgFunctionPolynomialPiece |
Returns : |
the interval end of the polynomial |
void cpg_function_polynomial_piece_set_begin (CpgFunctionPolynomialPiece *piece, gdouble begin);
Set the interval begin of the polynomial.
|
A CpgFunctionPolynomialPiece |
|
the interval begin of the polynomial |
void cpg_function_polynomial_piece_set_end (CpgFunctionPolynomialPiece *piece, gdouble end);
Set the interval end of the polynomial.
|
A CpgFunctionPolynomialPiece |
|
the interval end of the polynomial |
gdouble * cpg_function_polynomial_piece_get_coefficients (CpgFunctionPolynomialPiece *piece, guint *num);
Get the polynomial coefficients. The order of the coefficients is from high to low
|
A CpgFunctionPolynomialPiece |
|
Return value for the number of coefficients |
Returns : |
the polynomial coefficients |
void cpg_function_polynomial_piece_set_coefficients (CpgFunctionPolynomialPiece *piece, gdouble *coefficients, guint num);
Set the coefficients of the polynomial. The order of the coefficients is from high to low.
|
A CpgFunctionPolynomialPiece |
|
The polynomial coefficients |
|
The number of coefficients provided in coefficients
|