From 5d887e468ee38112c96fb2809ae5ab6b96625b83 Mon Sep 17 00:00:00 2001 From: William Barker Date: Fri, 22 May 2009 02:33:12 +0000 Subject: [PATCH] I've made SparseRealVector and SparseRealMatrix to be empty marker interfaces. I've left OpenMapRealVector.getSparcity, since I'd like to use it for benchmarking, and it doesn't hurt anyone else now. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@777356 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/math/linear/OpenMapRealMatrix.java | 4 ---- .../apache/commons/math/linear/OpenMapRealVector.java | 5 ++++- .../apache/commons/math/linear/SparseRealMatrix.java | 11 ----------- .../apache/commons/math/linear/SparseRealVector.java | 6 ------ 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/java/org/apache/commons/math/linear/OpenMapRealMatrix.java b/src/java/org/apache/commons/math/linear/OpenMapRealMatrix.java index e5f708f26..be79fc7ee 100644 --- a/src/java/org/apache/commons/math/linear/OpenMapRealMatrix.java +++ b/src/java/org/apache/commons/math/linear/OpenMapRealMatrix.java @@ -286,9 +286,5 @@ public class OpenMapRealMatrix extends AbstractRealMatrix implements SparseRealM return row * columnDimension + column; } - /** {@inheritDoc} */ - public MatrixShape getShape() { - return MatrixShape.Any; - } } diff --git a/src/java/org/apache/commons/math/linear/OpenMapRealVector.java b/src/java/org/apache/commons/math/linear/OpenMapRealVector.java index d2a403f1c..683b68224 100644 --- a/src/java/org/apache/commons/math/linear/OpenMapRealVector.java +++ b/src/java/org/apache/commons/math/linear/OpenMapRealVector.java @@ -1297,7 +1297,10 @@ public class OpenMapRealVector implements SparseRealVector { return true; } - /** {@inheritDoc} */ + /** + * + * @return the percentage of none zero elements as a decimal percent. + */ public double getSparcity() { return (double)entries.size()/(double)getDimension(); } diff --git a/src/java/org/apache/commons/math/linear/SparseRealMatrix.java b/src/java/org/apache/commons/math/linear/SparseRealMatrix.java index 80697ad82..122805b19 100644 --- a/src/java/org/apache/commons/math/linear/SparseRealMatrix.java +++ b/src/java/org/apache/commons/math/linear/SparseRealMatrix.java @@ -25,16 +25,5 @@ package org.apache.commons.math.linear; * */ public interface SparseRealMatrix extends RealMatrix { - - /** - * Type to identify the shape of the matrix - */ - public static enum MatrixShape {Any}; - - /** - * - * @return the shape of the matrix - */ - MatrixShape getShape(); } diff --git a/src/java/org/apache/commons/math/linear/SparseRealVector.java b/src/java/org/apache/commons/math/linear/SparseRealVector.java index e7d82ccc3..aa3c27ca5 100644 --- a/src/java/org/apache/commons/math/linear/SparseRealVector.java +++ b/src/java/org/apache/commons/math/linear/SparseRealVector.java @@ -24,10 +24,4 @@ package org.apache.commons.math.linear; */ public interface SparseRealVector extends RealVector { - /** - * - * @return the percentage of none zero elements as a decimal percent. - */ - double getSparcity (); - }