diff --git a/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java b/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java index a36f9b2d0..86654a6a5 100644 --- a/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java +++ b/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java @@ -815,8 +815,18 @@ public class OpenMapRealVector extends AbstractRealVector implements SparseRealV /** * * @return the percentage of none zero elements as a decimal percent. + * @deprecated Use the correctly spelled {@link #getSparsity()} */ + @Deprecated public double getSparcity() { + return getSparsity(); + } + + /** + * + * @return the percentage of none zero elements as a decimal percent. + */ + public double getSparsity() { return (double)entries.size()/(double)getDimension(); }