![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
#define CPG_FUNCTION_POLYNOMIAL_CONST (obj) struct CpgFunctionPolynomial; struct CpgFunctionPolynomialClass; CpgFunctionPolynomial * cpg_function_polynomial_new (const gchar *name
); gboolean cpg_function_polynomial_add (CpgFunctionPolynomial *function
,CpgFunctionPolynomialPiece *piece
); gboolean cpg_function_polynomial_remove (CpgFunctionPolynomial *function
,CpgFunctionPolynomialPiece *piece
); void cpg_function_polynomial_clear_pieces (CpgFunctionPolynomial *function
); const GSList * cpg_function_polynomial_get_pieces (CpgFunctionPolynomial *function
); CpgFunctionPolynomialPrivate;
CpgFunctionPolynomial implements CpgUsable, CpgAnnotatable, CpgLayoutable and CpgTaggable.
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.
#define CPG_FUNCTION_POLYNOMIAL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CPG_TYPE_FUNCTION_POLYNOMIAL, CpgFunctionPolynomial const))
struct CpgFunctionPolynomialClass { /* signals */ void (*piece_added) (CpgFunctionPolynomial *polynomial, CpgFunctionPolynomialPiece *piece); void (*piece_removed) (CpgFunctionPolynomial *polynomial, CpgFunctionPolynomialPiece *piece); };
CpgFunctionPolynomial * cpg_function_polynomial_new (const gchar *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 |
gboolean cpg_function_polynomial_add (CpgFunctionPolynomial *function
,CpgFunctionPolynomialPiece *piece
);
Add a polynomial piece.
|
A CpgFunctionPolynomial |
|
A CpgFunctionPolynomialPiece |
Returns : |
TRUE if the piece could be successfully added, FALSE otherwise |
gboolean cpg_function_polynomial_remove (CpgFunctionPolynomial *function
,CpgFunctionPolynomialPiece *piece
);
Remove a polynomial piece.
|
A CpgFunctionPolynomial |
|
A CpgFunctionPolynomialPiece |
Returns : |
TRUE if the piece could be successfully removed, FALSE otherwise |
void cpg_function_polynomial_clear_pieces
(CpgFunctionPolynomial *function
);
Remove all the polynomial pieces.
|
A CpgFunctionPolynomial |
const 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. [element-type CpgFunctionPolynomialPiece][transfer none] |
"piece-added"
signalvoid user_function (CpgFunctionPolynomial *object,
CpgFunctionPolynomialPiece *piece,
gpointer user_data) : Run Last
Emitted when a new CpgFunctionPolynomialPiece is added to the piecewise polynomial function.
|
a CpgFunctionPolynomial |
|
a CpgFunctionPolynomialPiece |
|
user data set when the signal handler was connected. |
"piece-removed"
signalvoid user_function (CpgFunctionPolynomial *object,
CpgFunctionPolynomialPiece *piece,
gpointer user_data) : Run Last
Emitted when a CpgFunctionPolynomialPiece is removed from the piecewise polynomial function.
|
a CpgFunctionPolynomial |
|
a CpgFunctionPolynomialPiece |
|
user data set when the signal handler was connected. |