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:
parent
2039cf7825
commit
5d887e468e
|
@ -286,9 +286,5 @@ public class OpenMapRealMatrix extends AbstractRealMatrix implements SparseRealM
|
|||
return row * columnDimension + column;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public MatrixShape getShape() {
|
||||
return MatrixShape.Any;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue