Generated by DocFX

Class QrDecomposition

QR decomposition for a rectangular matrix.

Inheritance
System.Object
QrDecomposition
Implements
ISolverMatrixDecomposition<System.Double>
Namespace: ISynergy.Framework.Mathematics.Decompositions
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public sealed class QrDecomposition : ICloneable, ISolverMatrixDecomposition<double>
Remarks

For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q * R.

The QR decomposition always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if FullRank returns false.

Constructors

View Source

QrDecomposition(Double[,], Boolean, Boolean, Boolean)

Constructs a QR decomposition.

Declaration
public QrDecomposition(double[, ] value, bool transpose = false, bool economy = true, bool inPlace = false)
Parameters
Type Name Description
System.Double[,] value

The matrix A to be decomposed.

System.Boolean transpose

True if the decomposition should be performed on the transpose of A rather than A itself, false otherwise. Default is false.

System.Boolean economy

True to perform the economy decomposition, where only .the information needed to solve linear systems is computed. If set to false, the full QR decomposition will be computed.

System.Boolean inPlace

True if the decomposition should be done in place, overriding the given matrix value. Default is false.

Properties

View Source

Diagonal

Returns the diagonal of R.

Declaration
public double[] Diagonal { get; }
Property Value
Type Description
System.Double[]
View Source

FullRank

Shows if the matrix A is of full rank.

Declaration
public bool FullRank { get; }
Property Value
Type Description
System.Boolean

The value is true if R, and hence A, has full rank.

View Source

OrthogonalFactor

Returns the (economy-size) orthogonal factor Q.

Declaration
public double[, ] OrthogonalFactor { get; }
Property Value
Type Description
System.Double[,]
View Source

UpperTriangularFactor

Returns the upper triangular factor R.

Declaration
public double[, ] UpperTriangularFactor { get; }
Property Value
Type Description
System.Double[,]

Methods

View Source

Clone()

Creates a new object that is a copy of the current instance.

Declaration
public object Clone()
Returns
Type Description
System.Object

A new object that is a copy of this instance.

View Source

GetInformationMatrix()

Computes (Xt * X)^1 (the inverse of the covariance matrix). This matrix can be used to determine standard errors for the coefficients when solving a linear set of equations through any of the methods.

Declaration
public double[, ] GetInformationMatrix()
Returns
Type Description
System.Double[,]
View Source

Inverse()

Least squares solution of A * X = I

Declaration
public double[, ] Inverse()
Returns
Type Description
System.Double[,]
View Source

Reverse()

Reverses the decomposition, reconstructing the original matrix X.

Declaration
public double[, ] Reverse()
Returns
Type Description
System.Double[,]
View Source

Solve(Double[])

Least squares solution of A * X = B

Declaration
public double[] Solve(double[] value)
Parameters
Type Name Description
System.Double[] value

Right-hand-side matrix with as many rows as A and any number of columns.

Returns
Type Description
System.Double[]

A matrix that minimized the two norm of Q * R * X - B.

Exceptions
Type Condition
System.ArgumentException

Matrix row dimensions must be the same.

System.InvalidOperationException

Matrix is rank deficient.

View Source

Solve(Double[,])

Least squares solution of A * X = B

Declaration
public double[, ] Solve(double[, ] value)
Parameters
Type Name Description
System.Double[,] value

Right-hand-side matrix with as many rows as A and any number of columns.

Returns
Type Description
System.Double[,]

A matrix that minimized the two norm of Q * R * X - B.

Exceptions
Type Condition
System.ArgumentException

Matrix row dimensions must be the same.

System.InvalidOperationException

Matrix is rank deficient.

View Source

SolveTranspose(Double[,])

Least squares solution of X * A = B

Declaration
public double[, ] SolveTranspose(double[, ] value)
Parameters
Type Name Description
System.Double[,] value

Right-hand-side matrix with as many columns as A and any number of rows.

Returns
Type Description
System.Double[,]

A matrix that minimized the two norm of X * Q * R - B.

Exceptions
Type Condition
System.ArgumentException

Matrix column dimensions must be the same.

System.InvalidOperationException

Matrix is rank deficient.

Implements

ISolverMatrixDecomposition<T>

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)