Admin Production ni-theme
Current Publication

PolyEv1D

LabWindows/CVI

PolyEv1D

Advanced Analysis Library Only

AnalysisLibErrType PolyEv1D (double inputArray[], ssize_t numberOfElements, double coefficientsArray[], int numberOfCoefficients, double outputArray[]);

Purpose

Performs a polynomial evaluation on the input array. PolyEv1D obtains the ith element of the output array using the following formula:

where i is the array index, k is numCoefficients, p is the coefficient index, and coef is coefArray.

The size of coefArray must be greater than or equal to the order of the polynomial plus 1.

PolyEv1D can perform the operation in place; that is, the input and output arrays can be the same.

The following example uses the PolyEv1D function.

double inputData[10], polyData[10], coefficientArray[5];
double multiplier, additiveConstant;
int numElements, initialValue, finalValue;
AnalysisLibErrType status;

// Generate coefficient array using the Ramp function to
// use in the evaluation of the input data
numElements = 5;
initialValue = 1.0;
finalValue = 5.0;
Ramp(numElements, initialValue, finalValue, coefficientArray);

// Generate an array of random numbers
status = Uniform (10, 17, inputData);

status = PolyEv1D(inputData, 10, coefficientArray, numElements, polyData);

Parameters

Input
Name Type Description
inputArray double [] Input array used as the basis for the polynomial evaluation.
numberOfElements ssize_t Number of elements used in the polynomial evaluation of the input array.
coefficientsArray double [] The array that contains the coefficients 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 double [] Polynomially evaluated array.

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