Data Structures | |
struct | VCPolynom2D1D |
2D->1D Polynomial Representation More... | |
Functions | |
I32 | vc_poly2d1d_allocate (VCPolynom2D1D *poly, I32 order, I32 orderRestrictedIff1) |
Allocates memory for a VCPolynom2D1D structure. More... | |
void | vc_poly2d1d_free (VCPolynom2D1D *poly) |
Frees a previously allocated VCPolynom2D1D structure. More... | |
I32 | vc_poly2d1d_map (F64 xIn, F64 yIn, F64 *zOut, VCPolynom2D1D *poly) |
Calculates a result using a VCPolynom2D1D structure. More... | |
I32 | vc_poly2d1d_copy (VCPolynom2D1D *polyFrom, VCPolynom2D1D *polyTo) |
Copies a VCPolynom2D1D structure. More... | |
void | vc_poly2d1d_print (VCPolynom2D1D *poly, I32 indentation) |
Prints out a VCPolynom2D1D struct. More... | |
I32 | vc_poly2d1d_load_and_allocate_from_ini (VCPolynom2D1D *poly, char *filename, I8 tiCompatibleIff1) |
Reads and allocates a VCPolynom2D1D struct from an INI file. More... | |
I32 | vc_poly2d1d_store_as_ini (char *filename, VCPolynom2D1D *poly, I8 tiCompatibleIff1) |
Stores VCPolynom2D1D struct values as INI file. More... | |
I32 | vc_poly2d1d_pow_to_idx (I32 *idx, I32 powX, I32 powY, VCPolynom2D1D *poly) |
Returns the index number of the coeff of specific powers. More... | |
I32 | vc_poly2d1d_idx_to_pow (I32 *powX, I32 *powY, I32 idx, VCPolynom2D1D *poly) |
Returns the powers represented by the index of the coeff VCPolynom2D1D structure. More... | |
I32 | vc_poly2d1d_total_cnt_coeff (I32 *cntCoeff, VCPolynom2D1D *poly) |
Returns the number of values at the coeff array. More... | |
struct VCPolynom2D1D |
This struct represents a polynomial of order N defined as follows:
if 1 != orderRestrictedIff1:
if 1 == orderRestrictedIff1
, using and
:
Due to numerical stability at the polynomial estimation, there may be transforms which are additionally done instead of inherently at the polynomial itself:
If the value of transformInIff1
is 1, the polynomials input values x and y are calculated from given xInput and yInput as pre-transform by the following formula:
Likewise if the value of transformOutIff1
is 1, the polynomial's output value Z is post-transformed to the result ZOutput by the following formula:
Data Fields | ||
---|---|---|
I32 | orderRestrictedIff1 |
If 1, per coefficient sum of orders of x and y is smaller or equals orderX or orderY, see description. |
I32 | order |
Maximum order in polynomial for calculating Z(x,y). |
F64 * | coeff |
Coefficients of polynomial for calculating X(x,y). |
I32 | transformInIff1 |
If 1, prior to application of the input value to the polynomial it is transformed: in = (in - offsIn) / scaleIn. |
F64 | offsXIn |
Offset for Input Value X Component. |
F64 | offsYIn |
Offset for Input Value Y Component. |
F64 | scaleXIn |
Scale Factor for Input Value X Component. |
F64 | scaleYIn |
Scale Factor for Input Value Y Component. |
I32 | transformOutIff1 |
If 1, after mapping through the polynomial the output value is transformed: out = (out * scaleOut) + offsOut. |
F64 | offsZOut |
Offset for Output Value. |
F64 | scaleZOut |
Scale Factor for Output Value. |
I32 vc_poly2d1d_allocate | ( | VCPolynom2D1D * | poly, |
I32 | order, | ||
I32 | orderRestrictedIff1 | ||
) |
The function allocates memory for a VCPolynom2D1D structure.
poly | The polynom struct with internals to be allocated. |
order | The maximum order of the polynom ![]() |
orderRestrictedIff1 | Selects which type of coefficients are available, see VCPolynom2D1D for an explanation. |
ERR_NONE | on Success. |
ERR_PARAM | if order is malformed. |
ERR_MEMORY | if memory allocation fails. |
void vc_poly2d1d_free | ( | VCPolynom2D1D * | poly | ) |
The function frees a previously allocated VCPolynom2D1D structure.
poly | The polynom struct to be freed. |
I32 vc_poly2d1d_map | ( | F64 | xIn, |
F64 | yIn, | ||
F64 * | zOut, | ||
VCPolynom2D1D * | poly | ||
) |
The function calculates a result using a VCPolynom2D1D structure.
poly | The polynom struct with internals to be allocated. |
xIn,yIn | Input Values ![]() ![]() |
zOut | Output Value ![]() |
ERR_NONE | on Success. |
ERR_SINGULAR | if transformInIff1 is 1 and scaleX/YIn is 0. |
I32 vc_poly2d1d_copy | ( | VCPolynom2D1D * | polyFrom, |
VCPolynom2D1D * | polyTo | ||
) |
The function copies a VCPolynom2D1D structure to another.
polyFrom | The polynom struct with internals to be copied from. |
polyTo | The polynom struct with internals to be copied to. |
ERR_NONE | on Success. |
ERR_INCONS | if order differs. |
ERR_MEMORY | if any polynomial is not allocated. |
void vc_poly2d1d_print | ( | VCPolynom2D1D * | poly, |
I32 | indentation | ||
) |
This function prints out a VCPolynom2D1D struct.
poly | The polynom struct. |
I32 vc_poly2d1d_load_and_allocate_from_ini | ( | VCPolynom2D1D * | poly, |
char * | filename, | ||
I8 | tiCompatibleIff1 | ||
) |
This function reads and allocates a VCPolynom2D1D struct from an INI file.
filename | The input INI file. |
poly | The unallocated output polynom struct, on success it is allocated, free with vc_poly2d1d_free(). |
tiCompatibleIff1 | Use the same value at writing: If set to 1, the ini file can be interchanged between ARM and TI. On TI based platforms, this value has to be 1. |
ERR_NONE | on Success. |
<0 | on Error, especially ERR_FIO if file reading fails, either by missing entries, or by opening. |
I32 vc_poly2d1d_store_as_ini | ( | char * | filename, |
VCPolynom2D1D * | poly, | ||
I8 | tiCompatibleIff1 | ||
) |
This function stores VCPolynom2D1D struct values as INI file.
filename | The output INI file. |
poly | The polynom struct. |
tiCompatibleIff1 | Use the same value at reading: If set to 1, the ini file can be interchanged between ARM and TI. On TI based platforms, this value has to be 1. |
ERR_NONE | on Success. |
<0 | on Error, especially (-32 + 100 * vcmenu_store_values_in_file()). |
I32 vc_poly2d1d_pow_to_idx | ( | I32 * | idx, |
I32 | powX, | ||
I32 | powY, | ||
VCPolynom2D1D * | poly | ||
) |
If the powers and
for the coeff is given, this function determines the index idx of the coeff. The function vc_poly2d1d_idx_to_pow() is reverse.
idx | Output Index for estimating powers for. |
powX,powY | Input Powers ![]() |
poly | The polynom struct. |
ERR_PARAM | if order is malformed. |
I32 vc_poly2d1d_idx_to_pow | ( | I32 * | powX, |
I32 * | powY, | ||
I32 | idx, | ||
VCPolynom2D1D * | poly | ||
) |
If an index idx for the coeff is given, this function determines the powers of the and
variables. The function vc_poly2d1d_pow_to_idx() is reverse.
powX,powY | Output Powers ![]() |
idx | Input Index for estimating powers for. |
poly | The polynom struct. |
ERR_NONE | on Success. |
I32 vc_poly2d1d_total_cnt_coeff | ( | I32 * | cntCoeff, |
VCPolynom2D1D * | poly | ||
) |
This function returns the number of values at the coeff array.
cntCoeff | Output number, if not needed, set to NULL. |
poly | The polynom struct. |