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
This commit is contained in:
William Barker 2009-05-22 02:33:12 +00:00
parent 2039cf7825
commit 5d887e468e
4 changed files with 4 additions and 22 deletions

View File

@ -286,9 +286,5 @@ public class OpenMapRealMatrix extends AbstractRealMatrix implements SparseRealM
return row * columnDimension + column;
}
/** {@inheritDoc} */
public MatrixShape getShape() {
return MatrixShape.Any;
}
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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 ();
}