Record Class QR
java.lang.Object
java.lang.Record
smile.tensor.QR
- Record Components:
qr
- the QR decomposition.tau
- the scalar factors of the elementary reflectors.
- All Implemented Interfaces:
Serializable
The 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 such that A = Q*R.
The QR decomposition always exists, even if the matrix does not have full rank. The primary use of the QR decomposition is in the least squares solution of non-square systems of simultaneous linear equations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Q()
Returns the orthogonal factor.qr()
Returns the value of theqr
record component.R()
Returns the upper triangular factor.solve
(double[] b) Solves the least squares min || B - A*X ||.solve
(float[] b) Solves the least squares min || B - A*X ||.void
solve
(DenseMatrix B) Solves the least squares min || B - A*X ||.tau()
Returns the value of thetau
record component.Returns the Cholesky decomposition of A'A.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toCholesky
Returns the Cholesky decomposition of A'A.- Returns:
- the Cholesky decomposition of A'A.
-
R
-
Q
-
solve
Solves the least squares min || B - A*X ||.- Parameters:
b
- the right hand side of overdetermined linear system.- Returns:
- the solution vector.
- Throws:
RuntimeException
- when the matrix is rank deficient.
-
solve
Solves the least squares min || B - A*X ||.- Parameters:
b
- the right hand side of overdetermined linear system.- Returns:
- the solution vector.
- Throws:
RuntimeException
- when the matrix is rank deficient.
-
solve
Solves the least squares min || B - A*X ||.- Parameters:
B
- the right hand side of overdetermined linear system. B will be overwritten with the solution matrix on output.- Throws:
RuntimeException
- when the matrix is rank deficient.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
qr
-
tau
-