public class HouseholderInPlace extends Object
U()
, and
Vt()
respectively.Modifier and Type | Class and Description |
---|---|
static class |
HouseholderInPlace.Householder |
Constructor and Description |
---|
HouseholderInPlace(int nRows,
int nCols)
Creates an instance that transforms an identity matrix with the given dimension.
|
HouseholderInPlace(Matrix A)
Creates an instance that transforms the given matrix A.
|
HouseholderInPlace(Matrix A,
double epsilon)
Creates an instance that transforms the given matrix A.
|
Modifier and Type | Method and Description |
---|---|
HouseholderInPlace.Householder |
generateAndReflectColumns(int firstColumnIndex,
int lastColumnIndex,
int firstEntryIndex,
int lastEntryIndex)
Reflects a range of sub-columns with a Householder generated by the first column in the
range.
|
HouseholderInPlace.Householder |
generateAndReflectRows(int firstRowIndex,
int lastRowIndex,
int firstEntryIndex,
int lastEntryIndex)
Reflects a range of sub-rows with a Householder generated by the first row in the range.
|
HouseholderInPlace.Householder |
generateLeftHouseholder(int columnIndex,
int firstEntryIndex,
int lastEntryIndex)
Generates a left Householder from a sub-column of the underlying matrix, in order to zero out
entries (except the first entry) of the sub-column.
|
HouseholderInPlace.Householder |
generateRightHouseholder(int rowIndex,
int firstEntryIndex,
int lastEntryIndex)
Generates a right Householder from a sub-row of the underlying matrix, in order to zero out
entries (except the first entry) of the sub-row.
|
double |
get(int i,
int j)
Gets the value of an entry at (i,j) in the transformed matrix.
|
List<HouseholderInPlace.Householder> |
getLeftHouseholders()
Gets all the accumulated left Householders.
|
List<HouseholderInPlace.Householder> |
getRightHouseholders()
Gets all the accumulated right Householders.
|
Matrix |
getTransformedMatrix()
Gets the final matrix transformed by all the Householder transformations.
|
void |
reflect(HouseholderInPlace.Householder H,
int fromColumn,
int toColumn)
Reflects (or left transform) a range of columns in the underlying matrix with a given
Householder.
|
void |
rightReflect(HouseholderInPlace.Householder H,
int fromRow,
int toRow)
Reflects (or right transform) a range of rows in the underlying matrix with a given
Householder.
|
Matrix |
U()
Gets the accumulated Householder reflections applied to A.
|
Matrix |
Vt()
Gets the inverse (or transpose) of accumulated Householder right-reflections applied to A.
|
public HouseholderInPlace(Matrix A)
A
- the matrix to be transformedpublic HouseholderInPlace(Matrix A, double epsilon)
A
- the matrix to be transformedepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0public HouseholderInPlace(int nRows, int nCols)
nRows
- the number of rows of the identity matrixnCols
- the number of columns of the identity matrixpublic HouseholderInPlace.Householder generateAndReflectColumns(int firstColumnIndex, int lastColumnIndex, int firstEntryIndex, int lastEntryIndex)
firstColumnIndex
- the column index of the first sub-columnlastColumnIndex
- the column index of the last sub-columnfirstEntryIndex
- the row index of the first entry of the sub-columnslastEntryIndex
- the row index of the last entry of the sub-columnspublic HouseholderInPlace.Householder generateLeftHouseholder(int columnIndex, int firstEntryIndex, int lastEntryIndex)
columnIndex
- the column index of the sub-columnfirstEntryIndex
- the row index of the first entry of the sub-columnlastEntryIndex
- the row index of the last entry of the sub-columnpublic void reflect(HouseholderInPlace.Householder H, int fromColumn, int toColumn)
H
- the HouseholderfromColumn
- the column index of the first columntoColumn
- the column index of the last columnpublic HouseholderInPlace.Householder generateAndReflectRows(int firstRowIndex, int lastRowIndex, int firstEntryIndex, int lastEntryIndex)
firstRowIndex
- the row index of the first sub-rowlastRowIndex
- the row index of the last sub-rowfirstEntryIndex
- the column index of the first entry of the sub-rowslastEntryIndex
- the column index of the last entry of the sub-rowspublic HouseholderInPlace.Householder generateRightHouseholder(int rowIndex, int firstEntryIndex, int lastEntryIndex)
rowIndex
- the row index of the sub-rowfirstEntryIndex
- the column index of the first entry of the sub-rowlastEntryIndex
- the column index of the last entry of the sub-rowpublic void rightReflect(HouseholderInPlace.Householder H, int fromRow, int toRow)
H
- the HouseholderfromRow
- the row index of the first rowtoRow
- the row index of the last rowpublic Matrix getTransformedMatrix()
public double get(int i, int j)
i
- the row indexj
- the column indexpublic Matrix U()
public Matrix Vt()
public List<HouseholderInPlace.Householder> getLeftHouseholders()
public List<HouseholderInPlace.Householder> getRightHouseholders()
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.