Advanced Analysis Library Only
AnalysisLibErrType PolyEv2D (void *inputArray, int numberRows, int numberColumns, double coefArray[], int numCoefficients, void *outputArray);
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, k is numCoefficients, p is the coefficient index, and coef 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.
/* Perform a polynomial evaluation of a 2D array, let the Ramp function
generate the coefficients {1, 2, 3, 4, 5} and find the polynomial evaluation of the
array. */
double x[5][10], y[5][10], a[5];
double first, last;
int n, m, k;
n = 5;
k = 5;
m = 10;
first = 1.0;
last = 5.0;
Ramp (k, first, last, a);
PolyEv2D (x, n, m, a, k, y);
Input | ||
Name | Type | Description |
inputArray | numeric array | Input array used as the basis for the polynomial evaluation. This matrix must be an array of doubles. |
numberRows | integer | Number of rows used in the polynomial evaluation of the input array. |
numberColumns | integer | Number of columns used in the polynomial evaluation of the input array. |
coefArray | double-precision array | Coefficients array used in the polynomial evaluation of the input array. If there are k coefficients, the order of the polynomial is k – 1. |
numCoefficients | integer | 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 | numeric array | Polynomially evaluated array, as an array of doubles. |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |