IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
DotNetMatrix.QRDecomposition Class Reference

QR Decomposition. 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. More...

+ Inheritance diagram for DotNetMatrix.QRDecomposition:
+ Collaboration diagram for DotNetMatrix.QRDecomposition:

Public Member Functions

 QRDecomposition (GeneralMatrix A)
 QR Decomposition, computed by Householder reflections. More...
 
virtual GeneralMatrix Solve (GeneralMatrix B)
 Least squares solution of A*X = B More...
 
 QRDecomposition (GeneralMatrix A)
 QR Decomposition, computed by Householder reflections. More...
 
virtual GeneralMatrix Solve (GeneralMatrix B)
 Least squares solution of A*X = B More...
 

Properties

virtual bool FullRank [get]
 Is the matrix full rank? More...
 
virtual GeneralMatrix H [get]
 Return the Householder vectors More...
 
virtual GeneralMatrix R [get]
 Return the upper triangular factor More...
 
virtual GeneralMatrix Q [get]
 Generate and return the (economy-sized) orthogonal factor More...
 

Private Member Functions

void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 
void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 

Private Attributes

double[][] QR
 Array for internal storage of decomposition. internal array storage. More...
 
int m
 Row and column dimensions. column dimension. row dimension. More...
 
int n
 
double[] Rdiag
 Array for internal storage of diagonal of R. diagonal of R. More...
 

Detailed Description

QR Decomposition. 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 decompostion 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 IsFullRank() returns false.

Constructor & Destructor Documentation

DotNetMatrix.QRDecomposition.QRDecomposition ( GeneralMatrix  A)
inline

QR Decomposition, computed by Householder reflections.

Parameters
ARectangular matrix
Returns
Structure to access R and the Householder vectors and compute Q.

References DotNetMatrix.GeneralMatrix.ArrayCopy, DotNetMatrix.GeneralMatrix.ColumnDimension, DotNetMatrix.QRDecomposition.m, DotNetMatrix.QRDecomposition.n, and DotNetMatrix.GeneralMatrix.RowDimension.

DotNetMatrix.QRDecomposition.QRDecomposition ( GeneralMatrix  A)
inline

QR Decomposition, computed by Householder reflections.

Parameters
ARectangular matrix
Returns
Structure to access R and the Householder vectors and compute Q.

References DotNetMatrix.GeneralMatrix.ArrayCopy, DotNetMatrix.GeneralMatrix.ColumnDimension, DotNetMatrix.QRDecomposition.m, DotNetMatrix.QRDecomposition.n, and DotNetMatrix.GeneralMatrix.RowDimension.

Member Function Documentation

virtual GeneralMatrix DotNetMatrix.QRDecomposition.Solve ( GeneralMatrix  B)
inlinevirtual

Least squares solution of A*X = B

Parameters
BA Matrix with as many rows as A and any number of columns.
Returns
X that minimizes the two norm of Q*R*X-B.
Exceptions
System.ArgumentExceptionMatrix row dimensions must agree.
System.SystemExceptionMatrix is rank deficient.

References DotNetMatrix.GeneralMatrix.ArrayCopy, DotNetMatrix.GeneralMatrix.ColumnDimension, DotNetMatrix.QRDecomposition.FullRank, DotNetMatrix.GeneralMatrix.GetMatrix(), DotNetMatrix.QRDecomposition.m, DotNetMatrix.QRDecomposition.n, and DotNetMatrix.GeneralMatrix.RowDimension.

void ISerializable. DotNetMatrix.QRDecomposition.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inlineprivate
virtual GeneralMatrix DotNetMatrix.QRDecomposition.Solve ( GeneralMatrix  B)
inlinevirtual

Least squares solution of A*X = B

Parameters
BA Matrix with as many rows as A and any number of columns.
Returns
X that minimizes the two norm of Q*R*X-B.
Exceptions
System.ArgumentExceptionMatrix row dimensions must agree.
System.SystemExceptionMatrix is rank deficient.

References DotNetMatrix.GeneralMatrix.ArrayCopy, DotNetMatrix.GeneralMatrix.ColumnDimension, DotNetMatrix.QRDecomposition.FullRank, DotNetMatrix.GeneralMatrix.GetMatrix(), DotNetMatrix.QRDecomposition.m, DotNetMatrix.QRDecomposition.n, and DotNetMatrix.GeneralMatrix.RowDimension.

void ISerializable. DotNetMatrix.QRDecomposition.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inlineprivate

Member Data Documentation

double [][] DotNetMatrix.QRDecomposition.QR
private

Array for internal storage of decomposition. internal array storage.

int DotNetMatrix.QRDecomposition.m
private

Row and column dimensions. column dimension. row dimension.

Referenced by DotNetMatrix.QRDecomposition.QRDecomposition(), and DotNetMatrix.QRDecomposition.Solve().

int DotNetMatrix.QRDecomposition.n
private
double [] DotNetMatrix.QRDecomposition.Rdiag
private

Array for internal storage of diagonal of R. diagonal of R.

Property Documentation

bool DotNetMatrix.QRDecomposition.FullRank
get

Is the matrix full rank?

Returns
true if R, and hence A, has full rank.

Referenced by DotNetMatrix.QRDecomposition.Solve().

GeneralMatrix DotNetMatrix.QRDecomposition.H
get

Return the Householder vectors

Returns
Lower trapezoidal matrix whose columns define the reflections
GeneralMatrix DotNetMatrix.QRDecomposition.R
get

Return the upper triangular factor

Returns
R

Referenced by DotNetMatrix.test.TestMatrix.Main(), and DotNetMatrix.examples.MagicSquareExample.Main().

GeneralMatrix DotNetMatrix.QRDecomposition.Q
get

Generate and return the (economy-sized) orthogonal factor

Returns
Q

Referenced by DotNetMatrix.test.TestMatrix.Main(), and DotNetMatrix.examples.MagicSquareExample.Main().


The documentation for this class was generated from the following file: