NWH Aerodynamics
Search Results for

    Show / Hide Table of Contents

    Class SymmetricEigenSolver

    Solves for eigenvalues and eigenvectors of 3x3 symmetric matrices. Uses the Symmetric QR Algorithm with Householder tridiagonalization and Wilkinson shift.

    Inheritance
    object
    SymmetricEigenSolver
    Namespace: NWH.Aerodynamics.Airfoils
    Assembly: NWH.Aerodynamics.dll
    Syntax
    public class SymmetricEigenSolver
    Remarks

    Port of WildMagic5 Wm5SymmetricEigensolverGTE class from geometrictools.com. Implementation based on Algorithm 8.2.3 (Symmetric QR Algorithm) from "Matrix Computations, 2nd edition" by Golub and Van Loan. Decomposes matrix A into Q^TAQ = D where D is diagonal (eigenvalues) and Q is orthogonal (eigenvectors).

    Constructors

    | Edit this page View Source

    SymmetricEigenSolver(int, int)

    Creates a new eigensolver for NxN symmetric matrices.

    Declaration
    public SymmetricEigenSolver(int size, int maxIterations)
    Parameters
    Type Name Description
    int size

    Matrix dimension (N). Must be greater than 1.

    int maxIterations

    Maximum number of QR iterations allowed for convergence.

    Remarks

    Matrix input is stored in row-major order. Computes orthogonal matrix Q and diagonal matrix D such that Q^TAQ = D, where D contains eigenvalues and Q columns contain eigenvectors.

    Fields

    | Edit this page View Source

    NO_CONVERGENCE

    Declaration
    public const int NO_CONVERGENCE = 2147483647
    Field Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetEigenvalue(int)

    Declaration
    public double GetEigenvalue(int c)
    Parameters
    Type Name Description
    int c
    Returns
    Type Description
    double
    | Edit this page View Source

    GetEigenvalues()

    Declaration
    public double[] GetEigenvalues()
    Returns
    Type Description
    double[]
    | Edit this page View Source

    GetEigenvalues(double[])

    Retrieves the computed eigenvalues.

    Declaration
    public void GetEigenvalues(double[] eigenvalues)
    Parameters
    Type Name Description
    double[] eigenvalues

    Output array to receive eigenvalues. Must have size elements.

    Remarks

    If sorting was requested in Solve(), eigenvalues will be returned in sorted order.

    | Edit this page View Source

    GetEigenvector(int)

    Declaration
    public double[] GetEigenvector(int c)
    Parameters
    Type Name Description
    int c
    Returns
    Type Description
    double[]
    | Edit this page View Source

    GetEigenvector(int, double[])

    Computes a single eigenvector corresponding to the specified eigenvalue index. More efficient than GetEigenvectors when only a subset of eigenvectors is needed.

    Declaration
    public void GetEigenvector(int c, double[] eigenvector)
    Parameters
    Type Name Description
    int c

    Index of the eigenvector to compute (0 to size-1).

    double[] eigenvector

    Output array to receive the eigenvector. Must have size elements.

    | Edit this page View Source

    GetEigenvectors()

    Declaration
    public double[] GetEigenvectors()
    Returns
    Type Description
    double[]
    | Edit this page View Source

    GetEigenvectors(double[])

    Computes the orthogonal eigenvector matrix Q.

    Declaration
    public void GetEigenvectors(double[] eigenvectors)
    Parameters
    Type Name Description
    double[] eigenvectors

    Output array to receive eigenvectors in row-major order. Must have size*size elements.

    Remarks

    Each column of the output matrix Q represents an eigenvector. The eigenvectors satisfy Q^TAQ = D where D is the diagonal eigenvalue matrix.

    | Edit this page View Source

    IsRotation()

    Declaration
    public bool IsRotation()
    Returns
    Type Description
    bool
    | Edit this page View Source

    Solve(double[], SortType)

    Solves for eigenvalues and eigenvectors of the given symmetric matrix.

    Declaration
    public int Solve(double[] input, SymmetricEigenSolver.SortType eSort)
    Parameters
    Type Name Description
    double[] input

    Input matrix in row-major order with size*size elements.

    SymmetricEigenSolver.SortType eSort

    Sort order for eigenvalues (Decreasing, NoSorting, or Increasing).

    Returns
    Type Description
    int

    Number of iterations until convergence, or NO_CONVERGENCE if failed to converge.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics