Admin Production ni-theme
Current Publication

CxEigenValueVector

LabWindows/CVI

CxEigenValueVector

Advanced Analysis Library Only

AnalysisLibErrType CxEigenValueVector (void *inputMatrix, ssize_t matrixSize, int matrixType, int outputChoice, NIComplexNumber eigenvalues[], void *eigenvectors);

Purpose

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

Ax = λx

The matrixType parameter indicates the type of the input matrix. The input matrix can be a general or a Hermitian matrix.

The outputChoice parameter determines what CxEigenValueVector calculates. 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 array of matrixSize complex numbers. The eigenVectors output parameter is a matrixSize-by-matrixSize, complex matrix (2D array) that contains the eigenvectors of the input matrix. 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.

Parameters

Input
Name Type Description
inputMatrix void * Input complex, square matrix. This matrix will be overwritten; you must make a copy of the input matrix if you want to use it later. This matrix must be an array of ComplexNum.

The following C typedef statement defines the ComplexNum structure:

typedef struct {

double real;

double imaginary;

} ComplexNum;

matrixSize ssize_t Number of elements in one dimension of the input matrix.
matrixType int The type of the input matrix.

Pass 0 for a general matrix; 1 for a Hermitian matrix. Choose the matrix type correctly because it significantly affects the speed of computation.
outputChoice int Specifies whether the function computes eigenvectors. Pass 0 to compute only eigenvalues, and pass 1 to compute both eigenvalues and eigenvectors.
Output
Name Type Description
eigenvalues NIComplexNumber [] Result eigenvalues of the input matrix. This matrix is an array of ComplexNum.

The following C typedef statement defines the ComplexNum structure:

typedef struct {

double real;

double imaginary;

} ComplexNum;

eigenvectors void * Result eigenvectors of the input matrix. You can pass NULL if outputChoice is 0. This matrix is an array of ComplexNum.

The following C typedef statement defines the ComplexNum structure:

typedef struct {

double real;

double imaginary;

} ComplexNum;

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