Permalink
Browse files

refactoring.

  • Loading branch information...
1 parent ab11ed3 commit ee5df3243f6829f8f278dfe9e3b958c8039ce360 @kuzuha committed Jan 2, 2012
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/Plann/Hash/LSH.pm
  2. +1 −1 t/usual/hash/lsh.t
@@ -21,7 +21,7 @@ use Math::Trig qw( pi );
Create a new Plann::HASH::LSH object with random matrix.
-C<< Plann::Hash::LSH->new(matrix => $random_matrix) :Plann::Hash::LSH >>
+C<< Plann::Hash::LSH->new($random_matrix) :Plann::Hash::LSH >>
=head4 Parameters
@@ -111,3 +111,7 @@ sub random_matrix {
sub _random_normal {
sqrt(-2.0*log(rand()))*cos(2*pi*rand());
}
+
+sub BUILDARGS {
+ { matrix => $_[1] };
+}
View
@@ -14,7 +14,7 @@ is($matrix->[2], 10);
#
# constructors and accessors
#
-my $lsh = Plann::Hash::LSH->new(matrix => $matrix);
+my $lsh = Plann::Hash::LSH->new($matrix);
is($lsh->matrix, $matrix);
#

0 comments on commit ee5df32

Please sign in to comment.