Top Description Fields Constructors Methods
org.apache.commons.math3.linear

pack-priv Class BiDiagonalTransformer

extends Object
Class Inheritance
Imports
org.apache.commons.math3.util.FastMath

Class transforming any matrix to bi-diagonal shape.

Any m × n matrix A can be written as the product of three matrices: A = U × B × VT with U an m × m orthogonal matrix, B an m × n bi-diagonal matrix (lower diagonal if m < n, upper diagonal otherwise), and V an n × n orthogonal matrix.

Transformation to bi-diagonal shape is often not a goal by itself, but it is an intermediate step in more general decomposition algorithms like Singular Value Decomposition. This class is therefore intended for internal use by the library and is not public. As a consequence of this explicitly limited scope, many methods directly returns references to internal arrays, not copies.

Since
2.0

Field Summary

Modifier and TypeField and Description
private RealMatrix
cachedB

Cached value of B.

private RealMatrix
cachedU

Cached value of U.

private RealMatrix
cachedV

Cached value of V.

private final double[][]
householderVectors

Householder vectors.

private final double[]
main

Main diagonal.

private final double[]
secondary

Secondary diagonal.

Constructor Summary

AccessConstructor and Description
pack-priv
BiDiagonalTransformer(RealMatrix
the matrix to transform.
matrix
)

Build the transformation to bi-diagonal shape of a matrix.

Method Summary

Modifier and TypeMethod and Description
public RealMatrix

Returns:

the B matrix
getB
()

Returns the bi-diagonal matrix B of the transform.

pack-priv double[][]

Returns:

the main diagonal elements of the B matrix
getHouseholderVectorsRef
()

Get the Householder vectors of the transform.

pack-priv double[]

Returns:

the main diagonal elements of the B matrix
getMainDiagonalRef
()

Get the main diagonal elements of the matrix B of the transform.

pack-priv double[]

Returns:

the secondary diagonal elements of the B matrix
getSecondaryDiagonalRef
()

Get the secondary diagonal elements of the matrix B of the transform.

public RealMatrix

Returns:

the U matrix
getU
()

Returns the matrix U of the transform.

public RealMatrix

Returns:

the V matrix
getV
()

Returns the matrix V of the transform.

pack-priv boolean

Returns:

true if the matrix is transformed to upper bi-diagonal
isUpperBiDiagonal
()

Check if the matrix is transformed to upper bi-diagonal.

private void
transformToLowerBiDiagonal()

Transform original matrix to lower bi-diagonal form.

private void
transformToUpperBiDiagonal()

Transform original matrix to upper bi-diagonal form.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedBback to summary
private RealMatrix cachedB

Cached value of B.

cachedUback to summary
private RealMatrix cachedU

Cached value of U.

cachedVback to summary
private RealMatrix cachedV

Cached value of V.

householderVectorsback to summary
private final double[][] householderVectors

Householder vectors.

mainback to summary
private final double[] main

Main diagonal.

secondaryback to summary
private final double[] secondary

Secondary diagonal.

Constructor Detail

BiDiagonalTransformerback to summary
pack-priv BiDiagonalTransformer(RealMatrix matrix)

Build the transformation to bi-diagonal shape of a matrix.

Parameters
matrix:RealMatrix

the matrix to transform.

Method Detail

getBback to summary
public RealMatrix getB()

Returns the bi-diagonal matrix B of the transform.

Returns:RealMatrix

the B matrix

getHouseholderVectorsRefback to summary
pack-priv double[][] getHouseholderVectorsRef()

Get the Householder vectors of the transform.

Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.

Returns:double[][]

the main diagonal elements of the B matrix

getMainDiagonalRefback to summary
pack-priv double[] getMainDiagonalRef()

Get the main diagonal elements of the matrix B of the transform.

Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.

Returns:double[]

the main diagonal elements of the B matrix

getSecondaryDiagonalRefback to summary
pack-priv double[] getSecondaryDiagonalRef()

Get the secondary diagonal elements of the matrix B of the transform.

Note that since this class is only intended for internal use, it returns directly a reference to its internal arrays, not a copy.

Returns:double[]

the secondary diagonal elements of the B matrix

getUback to summary
public RealMatrix getU()

Returns the matrix U of the transform.

U is an orthogonal matrix, i.e. its transpose is also its inverse.

Returns:RealMatrix

the U matrix

getVback to summary
public RealMatrix getV()

Returns the matrix V of the transform.

V is an orthogonal matrix, i.e. its transpose is also its inverse.

Returns:RealMatrix

the V matrix

isUpperBiDiagonalback to summary
pack-priv boolean isUpperBiDiagonal()

Check if the matrix is transformed to upper bi-diagonal.

Returns:boolean

true if the matrix is transformed to upper bi-diagonal

transformToLowerBiDiagonalback to summary
private void transformToLowerBiDiagonal()

Transform original matrix to lower bi-diagonal form.

Transformation is done using alternate Householder transforms on rows and columns.

transformToUpperBiDiagonalback to summary
private void transformToUpperBiDiagonal()

Transform original matrix to upper bi-diagonal form.

Transformation is done using alternate Householder transforms on columns and rows.