Package de.labathome.trustconstr.matrix
Record Class QRResult
java.lang.Object
java.lang.Record
de.labathome.trustconstr.matrix.QRResult
QR factorisation of a tall-or-square matrix
A (m x n with m >= n):
A = Q R with Q (m x n) having orthonormal columns and
R (n x n) upper triangular.-
Constructor Summary
ConstructorsConstructorDescriptionQRResult(DenseMatrix Q, DenseMatrix R) Creates an instance of aQRResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Q()Returns the value of theQrecord component.R()Returns the value of theRrecord component.solve(DenseMatrix rhs) Least-squares solve: returns then x pmatrixxthat minimises||A x - rhs||_2, whereA = Q Rwas the original input.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
QRResult
Creates an instance of aQRResultrecord class.- Parameters:
Q- the value for theQrecord componentR- the value for theRrecord component
-
-
Method Details
-
solve
Least-squares solve: returns then x pmatrixxthat minimises||A x - rhs||_2, whereA = Q Rwas the original input. Computesx = R^-^1 Q^T rhs.- Parameters:
rhs- right-hand side (m x p)- Returns:
- least-squares solution (
n x p)
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
Q
Returns the value of theQrecord component.- Returns:
- the value of the
Qrecord component
-
R
Returns the value of theRrecord component.- Returns:
- the value of the
Rrecord component
-