LinEv2D
AnalysisLibErrType LinEv2D (void *inputArray, ssize_t numberOfRows, ssize_t numberOfColumns, double multiplier, double additiveConstant, void *outputArray);
Purpose
Performs a linear evaluation of a 2D array. LinEv2D obtains the (i, j)th element of the output array using the following formula:
yi, j = (a × xi, j) + b
LinEv2D can perform the operation in place; that is, the input and output arrays can be the same.
The following example uses the LinEv2D function.
double inputData[10][10], linearData[10][10];
double multiplier, additiveConstant;
int i, j, numRows, numCols;
AnalysisLibErrType status;
numRows = 10;
numCols = 10;
multiplier = 0.5;
additiveConstant = 1;
/* 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 < 10; i++)
inputData[i][j] = Random(0.0, 1.0);
status = LinEv2D(inputData, numRows, numCols, multiplier, additiveConstant, linearData);
Parameters
Input | ||
Name | Type | Description |
inputArray | void * | Input array to use as the basis for the linear evaluation. This array must be an array of doubles. |
numberOfRows | ssize_t | Number of rows used in the linear evaluation of the input array. |
numberOfColumns | ssize_t | Number of columns used in the linear evaluation of the input array. |
multiplier | double | Multiplicative constant used in the linear evaluation of the input array. Default Value: 1.0. |
additiveConstant | double | Additive constant used in the linear evalution of the input array. Default Value: 0.0. |
Output | ||
Name | Type | Description |
outputArray | void * | Linear evaluation of the input array in 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: Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later