# GenEigenValueVector

Advanced Analysis Library Only

AnalysisLibErrType GenEigenValueVector (void *inputMatrix, int matrixSize, int outputChoice, ComplexNum eigenValues[], void *eigenVectors);

## Purpose

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

Ax = λx

Although the input matrix is real, the eigenvalues and the eigenvectors can be complex if the matrix is not symmetric.

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, complex array of matrixSize elements. The input matrix can have complex eigenvalues if it is not symmetric.

The eigenVectors output parameter is an matrixSize-by-matrixSize, complex matrix (2D array). 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. The input matrix can have complex eigenvectors if it is not symmetric.

## Parameters

Input
Name | Type | Description
inputMatrix | numeric array | Input square matrix. This matrix must be an array of doubles. This matrix will be overwritten; you must make a copy of the input matrix if you want to use it later.
matrixSize | integer | Number of elements in one dimension of the input matrix.
outputChoice | integer | The output type. Pass 0 for eigenvalues only; 1 for both eigenvalues and eigenvectors.
Output
Name | Type | Description
eigenValues | ComplexNum array | Resulting eigenvalues of the input matrix. The following C typedef statement defines the ComplexNum structure: typedef struct { double real; double imaginary; } ComplexNum;
eigenVectors | ComplexNum | Resulting eigenvectors of the input matrix. You can pass NULL if outputChoice is 0.

## 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.