Advanced Analysis Library Only
AnalysisLibErrType CxEigenValueVector (void *inputMatrix, int matrixSize, int matrixType, int outputChoice, ComplexNum eigenValues[], void *eigenVectors);
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 column of this matrix is the eigenvector that corresponds to the
component of the eigenValues. Each eigenvector is normalized so that its largest component equals one.
Input | ||
Name | Type | Description |
inputMatrix | numeric array | 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 | integer | Number of elements in one dimension of the input matrix. |
matrixType | integer | The type of the input matrix. Pass 0 for general matrix; 1 for Hermitian matrix. Choose the matrix type correctly because it significantly affects the speed of computation. |
outputChoice | integer | Pass 0 for eigenvalues only; 1 for both eigenvalues and eigenvectors. |
Output | ||
Name | Type | Description |
eigenValues | ComplexNum array | Result eigenvalues of the input matrix. The following C typedef statement defines the ComplexNum structure: typedef struct { double real; double imaginary; } ComplexNum; |
eigenVectors | numeric array | 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; |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |