mirror of
https://github.com/apache/commons-math.git
synced 2025-02-06 01:59:13 +00:00
Reuse is one word :).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1097918 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
556576e645
commit
ec198897ee
@ -277,7 +277,7 @@ public class CholeskyDecompositionImpl implements CholeskyDecomposition {
|
|||||||
* <p>The A matrix is implicit, it is provided by the underlying
|
* <p>The A matrix is implicit, it is provided by the underlying
|
||||||
* decomposition algorithm.</p>
|
* decomposition algorithm.</p>
|
||||||
* @param b right-hand side of the equation A × X = B
|
* @param b right-hand side of the equation A × X = B
|
||||||
* @param reUseB if true, the b array will be reused and returned,
|
* @param reuseB if true, the b array will be reused and returned,
|
||||||
* instead of being copied
|
* instead of being copied
|
||||||
* @return a matrix X that minimizes the two norm of A × X - B
|
* @return a matrix X that minimizes the two norm of A × X - B
|
||||||
* @throws org.apache.commons.math.exception.DimensionMismatchException
|
* @throws org.apache.commons.math.exception.DimensionMismatchException
|
||||||
@ -285,7 +285,7 @@ public class CholeskyDecompositionImpl implements CholeskyDecomposition {
|
|||||||
* @throws SingularMatrixException
|
* @throws SingularMatrixException
|
||||||
* if the decomposed matrix is singular.
|
* if the decomposed matrix is singular.
|
||||||
*/
|
*/
|
||||||
private double[][] solve(double[][] b, boolean reUseB) {
|
private double[][] solve(double[][] b, boolean reuseB) {
|
||||||
final int m = lTData.length;
|
final int m = lTData.length;
|
||||||
if (b.length != m) {
|
if (b.length != m) {
|
||||||
throw new DimensionMismatchException(b.length, m);
|
throw new DimensionMismatchException(b.length, m);
|
||||||
@ -293,7 +293,7 @@ public class CholeskyDecompositionImpl implements CholeskyDecomposition {
|
|||||||
|
|
||||||
final int nColB = b[0].length;
|
final int nColB = b[0].length;
|
||||||
final double[][] x;
|
final double[][] x;
|
||||||
if (reUseB) {
|
if (reuseB) {
|
||||||
x = b;
|
x = b;
|
||||||
} else {
|
} else {
|
||||||
x = new double[b.length][nColB];
|
x = new double[b.length][nColB];
|
||||||
|
@ -342,7 +342,7 @@ public class EigenDecompositionImpl implements EigenDecomposition {
|
|||||||
* <p>The A matrix is implicit, it is provided by the underlying
|
* <p>The A matrix is implicit, it is provided by the underlying
|
||||||
* decomposition algorithm.</p>
|
* decomposition algorithm.</p>
|
||||||
* @param b right-hand side of the equation A × X = B
|
* @param b right-hand side of the equation A × X = B
|
||||||
* @param reUseB if true, the b array will be reused and returned,
|
* @param reuseB if true, the b array will be reused and returned,
|
||||||
* instead of being copied
|
* instead of being copied
|
||||||
* @return a matrix X that minimizes the two norm of A × X - B
|
* @return a matrix X that minimizes the two norm of A × X - B
|
||||||
* @throws org.apache.commons.math.exception.DimensionMismatchException
|
* @throws org.apache.commons.math.exception.DimensionMismatchException
|
||||||
@ -350,7 +350,7 @@ public class EigenDecompositionImpl implements EigenDecomposition {
|
|||||||
* @throws SingularMatrixException
|
* @throws SingularMatrixException
|
||||||
* if the decomposed matrix is singular.
|
* if the decomposed matrix is singular.
|
||||||
*/
|
*/
|
||||||
private double[][] solve(double[][] b, boolean reUseB) {
|
private double[][] solve(double[][] b, boolean reuseB) {
|
||||||
|
|
||||||
if (!isNonSingular()) {
|
if (!isNonSingular()) {
|
||||||
throw new SingularMatrixException();
|
throw new SingularMatrixException();
|
||||||
@ -363,7 +363,7 @@ public class EigenDecompositionImpl implements EigenDecomposition {
|
|||||||
|
|
||||||
final int nColB = b[0].length;
|
final int nColB = b[0].length;
|
||||||
final double[][] bp;
|
final double[][] bp;
|
||||||
if (reUseB) {
|
if (reuseB) {
|
||||||
bp = b;
|
bp = b;
|
||||||
} else {
|
} else {
|
||||||
bp = new double[m][nColB];
|
bp = new double[m][nColB];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user