Admin Production ni-theme
Current Publication

SymEigenValueVector

LabWindows/CVI

SymEigenValueVector

Advanced Analysis Library Only

AnalysisLibErrType SymEigenValueVector (void *inputMatrix, ssize_t matrixSize, int outputChoice, double eigenvalues[], void *eigenvectors);

Purpose

Calculates the eigenvalues λ and the corresponding eigenvectors x of a real, symmetric square input matrix A. The following formula defines the eigenvalues and the corresponding eigenvectors:

Ax = λx

The eigenvalues and the eigenvectors are all real-valued.

The outputChoice parameter determines what to calculate. Depending on your application, you can choose to calculate just the eigenvalues or to calculate both the eigenvalues and the eigenvectors.

The eigenValues output parameter is a 1D, real array of matrixSize elements.

The eigenVectors output parameter is a matrixSize-by-matrixSize real matrix (2D array). Each ith column of this matrix is the eigenvector that corresponds to the ith component of the eigenValues. Each eigenvector is normalized so that its largest component equals one.

The function does not check the symmetry of the input matrix. To use the function correctly, you must ensure the input matrix is symmetric.

Parameters

Input
Name Type Description
inputMatrix void * Input symmetric square matrix.
matrixSize ssize_t Number of elements in one dimension of the input matrix.
outputChoice int Specifies if the function computes eigenvectors. Pass one of the following values:

  • 0: compute only the eigenvalues of inputMatrix.
  • 1: compute both eigenvalues and eigenvectors of inputMatrix.
Output
Name Type Description
eigenvalues double [] Resulting eigenvalues of the input matrix.
eigenvectors void * Resulting eigenvectors of the input matrix, as an array of doubles.

If outputChoice is eigenvalues only, you can pass NULL for this parameter.

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 5.0 and later