Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Vector and Matrix Library User's Guide»Matrix Decompositions»The Symmetric Indefinite Decomposition

The Symmetric Indefinite Decomposition

Extreme Optimization Numerical Libraries for .NET Professional

The symmetric indefinite decomposition or Bunch-Kaufman decomposition is defined for symmetric matrices that may not be positive definite. It expresses a matrix as the product of a lower triangular matrix, a block diagonal matrix, and the transpose of the triangular matrix.

The symmetric indefinite decomposition algorithm exploits the special structure of symmetric matrices. As a result, it is about twice as fast as the LU decomposition. Moreover, the decomposition is fairly stable, so it is suitable for use in a broader range of problems.

Working with symmetric indefinite decompositions

The symmetric indefinite decomposition is implemented by the SymmetricIndefiniteDecompositionT class. It has no constructors. Instead, it is created by calling the GetSymmetricIndefiniteDecomposition method on the matrix. This method has two overloads. The first overload has no arguments. The second overload takes a Boolean value that specifies whether the contents of the matrix may be overwritten by the decomposition. The default is .

C#
VB
C++
F#
Copy
var A = Matrix.CreateSymmetric(4, new double[] {
    4.16,-3.12, 0.56,-0.10,
    0   ,-5.03,-0.83, 1.18,
    0   , 0   , 0.76, 0.34,
    0   , 0   , 0   , 1.18
}, MatrixTriangle.Upper, MatrixElementOrder.RowMajor);
var ldlt = A.GetSymmetricIndefiniteDecomposition();
Dim A = Matrix.CreateSymmetric(4, New Double() {
    4.16, -3.12, 0.56, -0.1,
    0, -5.03, -0.83, 1.18,
    0, 0, 0.76, 0.34,
    0, 0, 0, 1.18
}, MatrixTriangle.Upper, MatrixElementOrder.RowMajor)
Dim ldlt = A.GetSymmetricIndefiniteDecomposition()
'

No code example is currently available or this language may not be supported.

let A = Matrix.CreateSymmetric(4,
         [|
            4.16;-3.12; 0.56;-0.10;
            0.0 ;-5.03;-0.83; 1.18;
            0.0 ; 0.0 ; 0.76; 0.34;
            0.0 ; 0.0 ; 0.0 ; 1.18
        |], MatrixTriangle.Upper, MatrixElementOrder.RowMajor)
let ldlt = A.GetSymmetricIndefiniteDecomposition()

The Decompose method performs the actual decomposition. This method copies the matrix if necessary. It then calls the appropriate LAPACK routine to perform the actual decomposition. This method is called by other methods as needed. You will rarely need to call it explicitly.

Once the decomposition is computed, a number of operations can be performed in much less time. You can repeatedly solve a system of linear equations with different right-hand sides. You can also calculate the determinant and the inverse of the base matrix:

C#
VB
C++
F#
Copy
var b = Matrix.Create(4, 2, new double[] {
    8.70,-13.35, 1.89,-4.14,
    8.30,  2.13, 1.61, 5.00
}, MatrixElementOrder.ColumnMajor);
var x = ldlt.Solve(b);
var invA = ldlt.GetInverse();
var detA = ldlt.GetDeterminant();
Dim b = Matrix.Create(4, 2, New Double() {
    8.7, -13.35, 1.89, -4.14,
    8.3, 2.13, 1.61, 5.0
}, MatrixElementOrder.ColumnMajor)
Dim x = ldlt.Solve(b)
Dim invA = ldlt.GetInverse()
Dim detA = ldlt.GetDeterminant()
'

No code example is currently available or this language may not be supported.

let b = Matrix.Create(4, 2,
         [|
            8.70;-13.35; 1.89;-4.14;
            8.30;  2.13; 1.61; 5.00
        |], MatrixElementOrder.ColumnMajor)
let x = ldlt.Solve(b)
let invA = ldlt.GetInverse()
let detA = ldlt.GetDeterminant()

The LowerTriangularFactor property returns a TriangularMatrixT containing the lower triangular matrix, G, of the decomposition. There is no property to obtain the block diagonal matrix.

C#
VB
C++
F#
Copy
var L = ldlt.LowerTriangularFactor;
var LT = ldlt.UpperTriangularFactor;
Dim L = ldlt.LowerTriangularFactor
Dim LT = ldlt.UpperTriangularFactor
'

No code example is currently available or this language may not be supported.

let L = ldlt.LowerTriangularFactor
let LT = ldlt.UpperTriangularFactor

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.