Admin Production ni-theme
Current Publication

CxMatrixBalance

LabWindows/CVI

CxMatrixBalance

Advanced Analysis Library Only

AnalysisLibErrType CxMatrixBalance (void *inputMatrix, ssize_t matrixSize, int method, ssize_t *indexLow, ssize_t *indexHigh, double scale[], void *balancedMatrix);

Purpose

Balances a general complex matrix so that its eigenvectors can be computed more accurately. If you want more accurate eigenvectors for an unsymmetric complex matrix, complete the following steps:

  1. Call CxMatrixBalance to balance the original matrix.
  2. Call CxEigenValueVector to get the eigenvectors of the balanced matrix.
  3. Call CxEigenVBack to back-transform the eigenvectors of the balanced matrix to the eigenvectors of the original matrix.

Parameters

Input
Name Type Description
inputMatrix void * The matrix to balance.
matrixSize ssize_t The order of inputMatrix.
method int Specifies how to balance inputMatrix. method must be one of the following values:
  • NONE (0): inputMatrix is neither permuted nor scaled, but indexLow, indexHigh, and scale get their values as follows: indexLow = 0, indexHigh = matrixSize - 1, scale[i] = 1, i = 0, matrixSize - 1, ...
  • PERMUTED (1): inputMatrix is permuted but not scaled.
  • SCALED (2): inputMatrix is scaled but not permuted.
  • PERMUTED_SCALED (3): inputMatrix is both permuted and scaled.
Output
Name Type Description
indexLow ssize_t The lower index that records the permutation information. The values indexLow and indexHigh are such that on output, balancedMatrix[i,j] is 0 if i > j and (i <= j < indexLow or indexHigh < i <= matrixSize - 1).
indexHigh ssize_t The upper index that records the permutation information.
scale double [] The scale information, whose size is matrixSize.
balancedMatrix void * The balanced matrix. In place operation is supported. That is, you can call the function with balancedMatrix = NULL or balancedMatrix = inputMatrix so that the balanced matrix overwrites inputMatrix directly.

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