Removed method double[] solve(double[]), because double[] is no longer considered as equivalent to RealVector (use ArrayRealVector instead).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1178071 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e364018316
commit
82ca8bca63
|
@ -17,34 +17,15 @@
|
||||||
|
|
||||||
package org.apache.commons.math.linear;
|
package org.apache.commons.math.linear;
|
||||||
|
|
||||||
import org.apache.commons.math.exception.DimensionMismatchException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface defines a {@link RealLinearOperator} which can be inverted.
|
* This interface defines a {@link RealLinearOperator} which can be inverted.
|
||||||
* Preconditioners typically fall into this category.
|
* Preconditioners typically fall into this category.
|
||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public abstract class InvertibleRealLinearOperator extends RealLinearOperator {
|
public abstract class InvertibleRealLinearOperator extends RealLinearOperator {
|
||||||
/**
|
|
||||||
* Computes the matrix-vector product of the inverse of this instance
|
|
||||||
* with {@code b} and returns the result.
|
|
||||||
*
|
|
||||||
* @param b Right-hand side vector.
|
|
||||||
* @return the left-hand side vector.
|
|
||||||
*/
|
|
||||||
public double[] solve(final double[] b) {
|
|
||||||
if (b.length != getRowDimension()) {
|
|
||||||
throw new DimensionMismatchException(b.length,
|
|
||||||
getRowDimension());
|
|
||||||
}
|
|
||||||
final RealVector x = solve(new ArrayRealVector(b, false));
|
|
||||||
if (x instanceof ArrayRealVector) {
|
|
||||||
return ((ArrayRealVector) x).getDataRef();
|
|
||||||
} else {
|
|
||||||
return x.toArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the matrix-vector product of the inverse of this instance
|
* Computes the matrix-vector product of the inverse of this instance
|
||||||
|
|
Loading…
Reference in New Issue