Table Of Contents

Matrix Balance (G Dataflow)

Version:
    Last Modified: December 4, 2016

    Balances a general matrix to improve the accuracy of computed eigenvalues and eigenvectors.

    Programming Patterns

    Use the Back Transform Eigenvectors node after balancing a matrix with the Matrix Balance node and computing the eigenvectors of the balanced matrix with the Eigenvalues and Vectors node. Use the outputs of the Matrix Balance node and the Eigenvalues and Vectors node as the inputs of the Back Transform Eigenvectors node.

    connector_pane_image
    datatype_icon

    matrix

    A real general matrix.

    This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

    datatype_icon

    job

    Type of matrix balance operation to perform.

    Name Value Description
    Neither Permuted nor Scaled 0 The node neither permutes nor scales the matrix.
    Permuted but not Scaled 1 The node permutes but does not scale the matrix.
    Scaled but not Permuted 2 The node scales but does not permute the matrix.
    Both Permuted and Scaled 3 The node permutes and scales the matrix.

    Default: Both Permuted and Scaled

    datatype_icon

    error in

    Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

    Default: No error

    datatype_icon

    balanced matrix

    The balanced matrix containing the same eigenvalues as the input matrix.

    datatype_icon

    index low

    The form of the balanced matrix.

    If job is Neither Permuted nor Scaled or Scaled but not Permuted, this output equals 0.

    Algorithm for Defining the Form of the Balanced Matrix

    balanced matrix(i,j) = 0 if i > j and 0 ≤ j < index low.

    datatype_icon

    index high

    The form of the balanced matrix.

    If job is Neither Permuted nor Scaled or Scaled but not Permuted, this output equals n - 1.

    Algorithm for Defining the Form of the Balanced Matrix

    balanced matrix(i,j) = 0 if i > j and index high < in - 1.

    datatype_icon

    error out

    Error information. The node produces this output according to standard error behavior.

    datatype_icon

    scale

    Details about the permutations and scaling factors.

    Algorithm for Calculating scale

    If pj is the index of the row and column interchanged with row and column j, and dj is the scaling factor used to balance row and column j, the following equations define how this node computes the values of this output.

    scale j = p j for j = 0 , 1 , ... , i l o w 1 , i h i g h + 1 , ... , n 1
    scale j = d j for j = i l o w , i l o w + 1 , ... , i h i g h

    where ilow is the output index low and ihigh is the output index high.

    Improving the Accuracy of Eigenvalues and Eigenvectors

    You can use one or both of the following similarity transformations to balance a matrix A and improve the accuracy of computed eigenvalues and eigenvectors:

    • Permute matrix A to block upper triangular form.
    • Scale matrix A' to reduce the norm of matrix A'22.

    Permuting Matrix A

    The following expression defines the permutation of matrix A to block upper triangular form.

    P A P T = A = [ A 11 A 12 A 13 0 A 22 A 23 0 0 A 33 ]

    where

    • P is a permutation matrix
    • A'11 and A'33 are upper triangular
    • PT is the transpose of matrix P

    The diagonal elements of A'11 and A'33 are eigenvalues of A. The central diagonal block A'22 starts from column(row) input index low and ends in column(row) input index high of A'. If no suitable permutation of A exists, the following conditions are true:

    • A'22 is the whole of A.
    • index low = 0.
    • index high = n - 1.

    Scaling Matrix A'

    The following expression defines the scaling of matrix A' to reduce the norm of matrix A'22.

    A = D 1 A D = [ I 0 0 0 D 22 1 0 0 0 I ] [ A 11 A 12 A 13 0 A 22 A 23 0 0 A 33 ] [ I 0 0 0 D 22 0 0 0 I ] = [ A 11 A 12 A 13 0 A 22 A 23 0 0 A 33 ]

    so that ||A"22|| < ||A'22||, which reduces the effect of rounding errors on the accuracy of computed eigenvalues and eigenvectors.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA:


    Recently Viewed Topics