PolyEv2D
Advanced Analysis Library Only
AnalysisLibErrType PolyEv2D (void *inputArray, ssize_t numberOfRows, ssize_t numberOfColumns, double coefficientsArray[], int numberOfCoefficients, void *outputArray);
Purpose
Performs a polynomial evaluation on a 2D input array. PolyEv2D obtains the (i, j)th element of the output array using the following formula:

where i is the array row index, j is the array column index, numberOfCoefficients is numCoefficients, p is the coefficient index, and coefficientsArray is coefArray.
The size of the coefficients array must be greater than or equal to the order of the polynomial + 1. PolyEv2D can perform the operation in place; that is, the input and output arrays can be the same.
The following example uses the PolyEv2D function.
double inputData[5][10], polyData[5][10];
double coefArray[5];
int i, j, numRows, numCols, numCoefficients;
AnalysisLibErrType status;
numRows = 2;
numCols = 3;
numCoefficients = 5;
/* Generate coefficient array {1, 2, 3, 4, 5} using the Ramp function. */
status = Ramp (5, 1.0, 5.0, coefArray);
/* Use a For loop to generate a 2D array of random numbers between 0.0 and 1.0 */
for (j = 0; j < 10; j++)
for (i = 0; i < 5; i++)
inputData[i][j] = Random(0.0, 1.0);
status = PolyEv2D(inputData, numRows, numCols, coefArray, numCoefficients, polyData);
Parameters
Input | ||
Name | Type | Description |
inputArray | void * | Input array used as the basis for the polynomial evaluation. This matrix must be an array of doubles. |
numberOfRows | ssize_t | Number of rows used in the polynomial evaluation of the input array. |
numberOfColumns | ssize_t | Number of columns used in the polynomial evaluation of the input array. |
coefficientsArray | double [] | Coefficients array used in the polynomial evaluation of the input array. If there are k coefficients, the order of the polynomial is k – 1. |
numberOfCoefficients | int | Number of coefficients used in the polynomial evaluation. This parameter does not specify the polynomial order. The polynomial order is numCoefficients – 1. Default Value: 1. |
Output | ||
Name | Type | Description |
outputArray | void * | Polynomially evaluated array, as an array of doubles. |
Return Value
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |
Additional Information
Library: Advanced Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later