Package de.labathome.trustconstr.matrix
Record Class CholResult
java.lang.Object
java.lang.Record
de.labathome.trustconstr.matrix.CholResult
Cholesky factorisation of a symmetric positive-definite matrix.
factor holds the LAPACK dpotrf output verbatim -- the upper
(if upper) or lower triangle stores the Cholesky factor; the other
triangle is unspecified. Reuse the captured factor for repeated solves
via solve(DenseMatrix) (one dpotrs call, no re-factoring).-
Constructor Summary
ConstructorsConstructorDescriptionCholResult(double[] factor, int n, boolean upper) Creates an instance of aCholResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.double[]factor()Returns the value of thefactorrecord component.final inthashCode()Returns a hash code value for this object.intn()Returns the value of thenrecord component.solve(DenseMatrix rhs) final StringtoString()Returns a string representation of this record class.booleanupper()Returns the value of theupperrecord component.
-
Constructor Details
-
CholResult
public CholResult(double[] factor, int n, boolean upper) Creates an instance of aCholResultrecord class.- Parameters:
factor- the value for thefactorrecord componentn- the value for thenrecord componentupper- the value for theupperrecord component
-
-
Method Details
-
solve
SolveA x = rhswhereAis the original SPD matrix factored intofactor(). Multiple right-hand sides supported via the column count ofrhs. Does not modifyfactor().- Parameters:
rhs- right-hand side (n x nrhs); must have the same row count as the factored matrix- Returns:
- the solution
x(n x nrhs)
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
factor
public double[] factor()Returns the value of thefactorrecord component.- Returns:
- the value of the
factorrecord component
-
n
public int n()Returns the value of thenrecord component.- Returns:
- the value of the
nrecord component
-
upper
public boolean upper()Returns the value of theupperrecord component.- Returns:
- the value of the
upperrecord component
-