Permalink
Browse files

More documentation. Modified some testing code in lsh.py routine.

  • Loading branch information...
1 parent b7ddd34 commit 41c01c9a3a606ceeb305e9410b0af70971421ef7 @MalcolmSlaney MalcolmSlaney committed Sep 29, 2011
Showing with 453 additions and 15 deletions.
  1. +23 −0 CalculateMPLSHParameters.m
  2. +386 −0 doc/classes.html
  3. +5 −0 doc/index.html
  4. +39 −15 lsh.py
View
@@ -543,3 +543,26 @@
% function c = choose(n, k)
% Works for vectors of n
c = factorial(n) ./ (factorial(k) .* factorial(n-k));
+
+%%
+function normed = NormalizePDF(y,x)
+
+x = [2*x(1)-x(2) x(:)' 2*x(end)-x(end-1)];
+dx = (x(3:end)-x(1:end-2))/2;
+area = dx .* y;
+normed = y/sum(area);
+
+
+if 0
+ t1 = 0:.1:pi;
+ y1 = sin(t1);
+ t2 = 0:.24:pi;
+ y2 = sin(t2);
+ n1 = NormalizePDF(y1, t1);
+ n2 = NormalizePDF(y2, t2);
+ clf; hold on
+ plot(t1, n1);
+ plot(t2, n2);
+ hold off
+end
+
Oops, something went wrong.

0 comments on commit 41c01c9

Please sign in to comment.