added javadoc

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@768591 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2009-04-25 19:39:38 +00:00
parent 97bbb9cf25
commit 881e5114bf
1 changed files with 8 additions and 0 deletions

View File

@ -467,6 +467,14 @@ public class SparseRealVector implements RealVector {
return entries.get(index);
}
/**
* Distance between two vectors.
* <p>This method computes the distance consistent with
* L<sub>1</sub> norm, i.e. the sum of the absolute values of
* elements differences.</p>
* @param v vector to which distance is requested
* @return distance between two vectors.
*/
public double getL1Distance(SparseRealVector v) {
double max = 0;
Iterator iter = entries.iterator();