Data Structures | |
struct | VCPolynom2D2D |
2D->2D Polynomial Representation More... | |
Functions | |
I32 | vc_poly2d2d_allocate (VCPolynom2D2D *poly, I32 orderX, I32 orderY, I32 orderRestrictedIff1) |
Allocates memory for a VCPolynom2D2D structure. More... | |
void | vc_poly2d2d_free (VCPolynom2D2D *poly) |
Frees a previously allocated VCPolynom2D2D structure. More... | |
I32 | vc_poly2d2d_map (F64 xIn, F64 yIn, F64 *xOut, F64 *yOut, VCPolynom2D2D *poly) |
Calculates a result using a VCPolynom2D2D structure. More... | |
I32 | vc_poly2d2d_copy (VCPolynom2D2D *polyFrom, VCPolynom2D2D *polyTo) |
Copies a VCPolynom2D2D structure. More... | |
void | vc_poly2d2d_print (VCPolynom2D2D *poly, I32 indentation) |
Prints out a VCPolynom2D2D struct. More... | |
I32 | vc_poly2d2d_load_and_allocate_from_ini (VCPolynom2D2D *poly, char *filename, I8 tiCompatibleIff1) |
Reads and allocates a VCPolynom2D2D struct from an INI file. More... | |
I32 | vc_poly2d2d_store_as_ini (char *filename, VCPolynom2D2D *poly, I8 tiCompatibleIff1) |
Stores VCPolynom2D2D struct values as INI file. More... | |
I32 | vc_poly2d2d_pow_to_idx (I32 *idx, I32 powX, I32 powY, VCPolynom2D2D *poly, I32 polyYIf1ElseX) |
Returns the index number of the coeffX or coeffY of specific powers. More... | |
I32 | vc_poly2d2d_idx_to_pow (I32 *powX, I32 *powY, I32 idx, VCPolynom2D2D *poly, I32 polyYIf1ElseX) |
Returns the powers represented by the index of the coeffX or coeffY VCPolynom2D2D structure. More... | |
I32 | vc_poly2d2d_total_cnt_coeff (I32 *cntCoeffX, I32 *cntCoeffY, VCPolynom2D2D *poly) |
Returns the number of values at the coeffX or coeffY array. More... | |
struct VCPolynom2D2D |
This struct represents a polynomial of order [N,M] 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 polynomials output values X and Y are post-transformed to the result XOutput and YOutput 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 | orderX |
Maximum order in polynomial for calculating X(x,y). |
I32 | orderY |
Maximum order in polynomial for calculating Y(x,y). |
F64 * | coeffX |
Coefficients of polynomial for calculating X(x,y). |
F64 * | coeffY |
Coefficients of polynomial for calculating Y(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 | offsXOut |
Offset for Output Value X Component. |
F64 | offsYOut |
Offset for Output Value Y Component. |
F64 | scaleXOut |
Scale Factor for Output Value X Component. |
F64 | scaleYOut |
Scale Factor for Output Value Y Component. |
I32 vc_poly2d2d_allocate | ( | VCPolynom2D2D * | poly, |
I32 | orderX, | ||
I32 | orderY, | ||
I32 | orderRestrictedIff1 | ||
) |
The function allocates memory for a VCPolynom2D2D structure.
poly | The polynom struct with internals to be allocated. |
orderX,orderY | The maximum order of the polynom ![]() ![]() |
orderRestrictedIff1 | Selects which type of coefficients are available, see VCPolynom2D2D for an explanation. |
ERR_NONE | on Success. |
ERR_PARAM | if orderX or orderY are malformed. |
ERR_MEMORY | if memory allocation fails. |
void vc_poly2d2d_free | ( | VCPolynom2D2D * | poly | ) |
The function frees a previously allocated VCPolynom2D2D structure.
poly | The polynom struct to be freed. |
The function calculates a result using a VCPolynom2D2D structure.
poly | The polynom struct with internals to be allocated. |
xIn,yIn | Input Values ![]() ![]() |
xOut,yOut | Output Values ![]() ![]() |
ERR_NONE | on Success. |
ERR_SINGULAR | if transformInIff1 is 1 and scaleX/YIn is 0. |
I32 vc_poly2d2d_copy | ( | VCPolynom2D2D * | polyFrom, |
VCPolynom2D2D * | polyTo | ||
) |
The function copies a VCPolynom2D2D 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_poly2d2d_print | ( | VCPolynom2D2D * | poly, |
I32 | indentation | ||
) |
This function prints out a VCPolynom2D2D struct.
poly | The polynom struct. |
I32 vc_poly2d2d_load_and_allocate_from_ini | ( | VCPolynom2D2D * | poly, |
char * | filename, | ||
I8 | tiCompatibleIff1 | ||
) |
This function reads and allocates a VCPolynom2D2D struct from an INI file.
filename | The input INI file. |
poly | The unallocated output polynom struct, on success it is allocated, free with vc_poly2d2d_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_poly2d2d_store_as_ini | ( | char * | filename, |
VCPolynom2D2D * | poly, | ||
I8 | tiCompatibleIff1 | ||
) |
This function stores VCPolynom2D2D 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 (-10 + 100 * vcmenu_store_values_in_file()). |
I32 vc_poly2d2d_pow_to_idx | ( | I32 * | idx, |
I32 | powX, | ||
I32 | powY, | ||
VCPolynom2D2D * | poly, | ||
I32 | polyYIf1ElseX | ||
) |
If the powers and
for the coeffX or coeffY is given, this function determines the index idx of the coeffX or coeffY. The function vc_poly2d2d_idx_to_pow() is reverse.
idx | Output Index for estimating powers for. |
powX,powY | Input Powers ![]() |
poly | The polynom struct. |
ERR_PARAM | if orderX or orderY are malformed. |
I32 vc_poly2d2d_idx_to_pow | ( | I32 * | powX, |
I32 * | powY, | ||
I32 | idx, | ||
VCPolynom2D2D * | poly, | ||
I32 | coeffYIff1 | ||
) |
If an index idx for the coeffX or coeffY is given, this function determines the powers of the and
variables. The function vc_poly2d2d_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_poly2d2d_total_cnt_coeff | ( | I32 * | cntCoeffX, |
I32 * | cntCoeffY, | ||
VCPolynom2D2D * | poly | ||
) |
This function returns the number of values at the coeffX or coeffY array.
cntCoeffX,cntCoeffY | Output number, if not needed, set to NULL. |
poly | The polynom struct. |