From 881e5114bf91582b0df8de61968c7ab08061fb97 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sat, 25 Apr 2009 19:39:38 +0000 Subject: [PATCH] added javadoc git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@768591 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/math/linear/SparseRealVector.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/java/org/apache/commons/math/linear/SparseRealVector.java b/src/java/org/apache/commons/math/linear/SparseRealVector.java index fe444bfee..1f962e135 100644 --- a/src/java/org/apache/commons/math/linear/SparseRealVector.java +++ b/src/java/org/apache/commons/math/linear/SparseRealVector.java @@ -467,6 +467,14 @@ public class SparseRealVector implements RealVector { return entries.get(index); } + /** + * Distance between two vectors. + *

This method computes the distance consistent with + * L1 norm, i.e. the sum of the absolute values of + * elements differences.

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