Interface QR<N extends Comparable<N>>
- All Superinterfaces:
DeterminantTask<N>, InverterTask<N>, InvertibleFactor<N>, MatrixDecomposition<N>, MatrixDecomposition.Determinant<N>, MatrixDecomposition.EconomySize<N>, MatrixDecomposition.Ordered<N>, MatrixDecomposition.RankRevealing<N>, MatrixDecomposition.Solver<N>, MatrixDecomposition.Updatable<N>, MatrixTask<N>, Provider2D, Provider2D.Determinant<N>, Provider2D.Inverse<Optional<MatrixStore<N>>>, Provider2D.Rank, Provider2D.Solution<Optional<MatrixStore<N>>>, SolverTask<N>, Structure1D, Structure2D
- All Known Implementing Classes:
DenseQR, DenseQR.C128, DenseQR.H256, DenseQR.Q128, DenseQR.R064, DenseQR.R128, RawQR
- [Q] is an orthogonal matrix (orthonormal columns). It has the same number of rows as [this].
- [R] is a right (upper) triangular matrix. It has the same number of columns as [this].
- [this] = [Q][R]
You create instances of (some subclass of) this class by calling one of the static factory methods:
Q128, C128,
invalid reference
#PRIMITIVE
invalid reference
#make(Access2D)
The QR decompostion always exists, even if the matrix does not have full column rank, so the compute method will never fail. The primary use of the QR decomposition is in the least squares solution of overdetermined systems of simultaneous linear equations. This will fail if the matrix does not have full column rank. The rank must be equal to the number of columns.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface InvertibleFactor
InvertibleFactor.IdentityFactor<N>Nested classes/interfaces inherited from interface MatrixDecomposition
MatrixDecomposition.Determinant<N>, MatrixDecomposition.EconomySize<N>, MatrixDecomposition.Hermitian<N>, MatrixDecomposition.Ordered<N>, MatrixDecomposition.Pivoting<N>, MatrixDecomposition.RankRevealing<N>, MatrixDecomposition.Solver<N>, MatrixDecomposition.Updatable<N>, MatrixDecomposition.Values<N>Nested classes/interfaces inherited from interface Provider2D
Provider2D.Condition, Provider2D.Determinant<N>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N>Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallbackNested classes/interfaces inherited from interface Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S,B>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QR.Factory<ComplexNumber> static final QR.Factory<Quaternion> static final QR.Factory<RationalNumber> static final QR.Factory<Double> static final QR.Factory<Quadruple> Fields inherited from interface MatrixDecomposition
TYPICAL -
Method Summary
Modifier and TypeMethodDescriptionstatic <N extends Comparable<N>>
booleanequals(MatrixStore<N> matrix, QR<N> decomposition, NumberContext context) default voidftran(PhysicalStore<N> arg) Forward-transformationgetQ()getR()default booleanThis is a property of the algorithm/implementation, not the data.default MatrixStore<N> default booleanupdateColumn(int columnIndex, Access1D.Collectable<N, ? super TransformableRegion<N>> newColumn) Updates the decomposition when a column in the original matrix is replaced.Methods inherited from interface DeterminantTask
calculateDeterminantMethods inherited from interface InverterTask
invert, invert, preallocateMethods inherited from interface InvertibleFactor
btran, btran, ftranMethods inherited from interface MatrixDecomposition
decompose, isComputed, resetMethods inherited from interface MatrixDecomposition.Determinant
getDeterminant, toDeterminantProviderMethods inherited from interface MatrixDecomposition.EconomySize
isFullSizeMethods inherited from interface MatrixDecomposition.RankRevealing
countSignificant, getRank, getRankThreshold, isFullRankMethods inherited from interface MatrixDecomposition.Solver
compute, getInverse, getInverse, getSolution, getSolution, invert, isSolvable, preallocate, solve, toInverseProvider, toSolutionProviderMethods inherited from interface SolverTask
preallocate, preallocate, solve, solveMethods inherited from interface Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getColDim, getMaxDim, getMinDim, getRowDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
Field Details
-
C128
-
H256
-
Q128
-
R064
-
R128
-
-
Method Details
-
equals
static <N extends Comparable<N>> boolean equals(MatrixStore<N> matrix, QR<N> decomposition, NumberContext context) -
ftran
Description copied from interface:InvertibleFactorForward-transformationSolve [A][x] = [b] by transforming [b] into [x] in-place.
- Specified by:
ftranin interfaceInvertibleFactor<N extends Comparable<N>>- Parameters:
arg- [b] transformed into [x]
-
getQ
MatrixStore<N> getQ() -
getR
MatrixStore<N> getR() -
isOrdered
default boolean isOrdered()Description copied from interface:MatrixDecomposition.OrderedThis is a property of the algorithm/implementation, not the data. Typically relevant forSingularValue,Eigenvalueor anyMatrixDecomposition.RankRevealingdecomposition.- Specified by:
isOrderedin interfaceMatrixDecomposition.Ordered<N extends Comparable<N>>- Returns:
- true if the rows/columns of the returned matrix factors are guaranteed some specific order; false if there is no such guarantee.
-
reconstruct
- Specified by:
reconstructin interfaceMatrixDecomposition<N extends Comparable<N>>
-
updateColumn
default boolean updateColumn(int columnIndex, Access1D.Collectable<N, ? super TransformableRegion<N>> newColumn) Description copied from interface:MatrixDecomposition.UpdatableUpdates the decomposition when a column in the original matrix is replaced.This method can only be called after an initial decomposition has been calculated.
If the updatable decomposition is a
MatrixDecomposition.Solverthen this method should only return true ifMatrixDecomposition.Solver.isSolvable()is true after the update.- Specified by:
updateColumnin interfaceMatrixDecomposition.Updatable<N extends Comparable<N>>- Parameters:
columnIndex- The index of the column, in the original matrix, to replacenewColumn- The new column values- Returns:
- true if update was successful, false if not.
-