| IGLib 1.4 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Attributes

# IG::Num::SingularValueDecomposition Class Reference

Singular value decomposition of a matrix. Calculates eigenvectors and eigenvalues of a real matrix.Objects of this class are immutable. Decomposition is calculated at initialization, and the decomposed matrix can not be replaced later. More...

Inheritance diagram for IG::Num::SingularValueDecomposition:
[legend]
Collaboration diagram for IG::Num::SingularValueDecomposition:
[legend]

List of all members.

## Public Member Functions
| SingularValueDecomposition (Matrix_MathNetNumerics A)
| Constructor.
| SingularValueDecomposition (Matrix A)
| Constructor.
void | GetProduct (ref IMatrix product)
| Calculates the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition, and stores it to the specified matrix.
IMatrix | GetProduct ()
| Calculates and returns the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition.
void | Inverse (ref IMatrix inv)
| Calculates inverse of the decomposed matrix represented by the current object, and stores it in the specified matrix.
IMatrix | Inverse ()
| Calculates and returns inverse of the decomposed matrix represented by the current object.
## Protected Member Functions
override MatrixBase_MathNetNumerics | SolveMathNetNumerics (IMatrix righthandSides)
| Solves systems of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form.
override VectorBase_MathNetNumerics | SolveMathNetNumerics (IVector rightHandSides)
| Solves the system of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form.
## Protected Attributes
internal SingularValueDecomposition_MathNetNumerics | Base = null
double | _determinant
bool | _determinantCalculated = false
## Properties
bool | IsNonSingular`[get]`
| Indicates whether the matrix of coefficients of a linear system is nonsingular.
Matrix | LeftSingularVectors`[get]`
| Returns the left singular vectors.
Vector | SingularValues`[get]`
| Returns the singular values.
Matrix | RightSingularVectors`[get]`
| Returns the right singular vectors.
double | Determinant`[get]`
| Returns the determinant.
## Private Attributes
MatrixBase_MathNetNumerics | _inverse

## Detailed Description

Singular value decomposition of a matrix.

Calculates eigenvectors and eigenvalues of a real matrix.

Objects of this class are immutable. Decomposition is calculated at initialization, and the decomposed matrix can not be replaced later.

Suppose M is an m-by-n matrix whose entries are real numbers. Then there exists a factorization of the form M = UΣVT where:

- U is an m-by-m unitary matrix;
- Σ is m-by-n diagonal matrix with nonnegative real numbers on the diagonal;
- VT denotes transpose of V, an n-by-n unitary matrix; Such a factorization is called a singular-value decomposition of M. A common convention is to order the diagonal entries Σ(i,i) in descending order. In this case, the diagonal matrix Σ is uniquely determined by M (though the matrices U and V are not). The diagonal entries of Σ are known as the singular values of M.

$A Igor Feb09;

## Constructor & Destructor Documentation

IG::Num::SingularValueDecomposition::SingularValueDecomposition | ( | Matrix_MathNetNumerics | A | ) | `[inline]`

Constructor.

Parameters:

  A | Matrix to be decomposed.

IG::Num::SingularValueDecomposition::SingularValueDecomposition | ( | Matrix | A | ) | `[inline]`

Constructor.

Parameters:

  A | Matrix to be decomposed.

## Member Function Documentation

void IG::Num::SingularValueDecomposition::GetProduct | ( | ref IMatrix | product | ) | `[inline]`

Calculates the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition, and stores it to the specified matrix.

Parameters:

  product | Matrix where re-calculated product of the decomposed matrix is stored.

Implements IG::Num::ILinearSolver.

IMatrix IG::Num::SingularValueDecomposition::GetProduct | ( |  | ) | `[inline]`

Calculates and returns the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition.

Implements IG::Num::ILinearSolver.

void IG::Num::SingularValueDecomposition::Inverse | ( | ref IMatrix | inv | ) | `[inline]`

Calculates inverse of the decomposed matrix represented by the current object, and stores it in the specified matrix.

Parameters:

  inv | Matrix where calculated inverse is stored.

Implements IG::Num::ILinearSolver.

IMatrix IG::Num::SingularValueDecomposition::Inverse | ( |  | ) | `[inline]`

Calculates and returns inverse of the decomposed matrix represented by the current object.

Implements IG::Num::ILinearSolver.

override MatrixBase_MathNetNumerics IG::Num::SingularValueDecomposition::SolveMathNetNumerics | ( | IMatrix | righthandSides | ) | `[inline, protected, virtual]`

Solves systems of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form.

Parameters:

  righthandSides | Matrix that contains right-hand sides of the linear equations to be solved as its columns.

Returns:
  The Math.Net Numerics matrix whose columns contains solutions to the systems of linear equations whose right-hand sides are specified by yhe righthandSides parameter.

Reimplemented from IG::Num::LinearSolverBase.

override VectorBase_MathNetNumerics IG::Num::SingularValueDecomposition::SolveMathNetNumerics | ( | IVector | rightHandSides | ) | `[inline, protected, virtual]`

Solves the system of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form.

Parameters:

  righthandSides | Vector of right-hand sides of the linear equations to be solved.

Returns:
  The Math.Net Numerics vector whose columns contains solutions to the systems of linear equations whose right-hand sides are specified by yhe righthandSides parameter.

Reimplemented from IG::Num::LinearSolverBase.

## Member Data Documentation

internal SingularValueDecomposition_MathNetNumerics IG::Num::SingularValueDecomposition::Base = null`[protected]`

double IG::Num::SingularValueDecomposition::_determinant`[protected]`

bool IG::Num::SingularValueDecomposition::_determinantCalculated = false`[protected]`

MatrixBase_MathNetNumerics IG::Num::SingularValueDecomposition::_inverse`[private]`

## Property Documentation

bool IG::Num::SingularValueDecomposition::IsNonSingular`[get]`

Indicates whether the matrix of coefficients of a linear system is nonsingular.

Returns:
  `true` if U, and hence A, is nonsingular.

Implements IG::Num::ILinearSolver.

Matrix IG::Num::SingularValueDecomposition::LeftSingularVectors`[get]`

Returns the left singular vectors.

Vector IG::Num::SingularValueDecomposition::SingularValues`[get]`

Returns the singular values.

Matrix IG::Num::SingularValueDecomposition::RightSingularVectors`[get]`

Returns the right singular vectors.

double IG::Num::SingularValueDecomposition::Determinant`[get]`

Returns the determinant.

Returns:
  det(A)

Exceptions:

  System.ArgumentException | Matrix must be square.

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

- MatrixDecompositions.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events