Stephan Conrad > Algorithm-KNN-XS-0.01001 > Algorithm::KNN::XS

Download:
Algorithm-KNN-XS-0.01001.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01001   Source  

NAME ^

Algorithm::KNN::XS - A class interface to perform a fast k neareast neighbor search using libANN via XS.

SYNOPSIS ^

    use Algorithm::KNN::XS;
    
    # define data points in a N dimensional space
    my @points = (
      [7.45, 2],
      [16.56, 32.1],
    );
    
    # create a new knn object
    my $knn = Algorithm::KNN::XS->new(points => \@points);
    
    # perform a k nearest neighbor search at the given query point, the result
    # contains all neighbors and their distance to the query point.
    my $result = $knn->annkSearch(query_point => [4.23, 2.45]);

DESCRIPTION ^

A class interface todo a fast k nearest neighbor search using libANN via XS.

The XS Module automatically creates the namespace Algorithm::KNN::XS::LibANNInterface.

More information about libANN can be found with the following links.

libANN main page: http://www.cs.umd.edu/~mount/ANN/ libANN manual: http://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ANNmanual_1.1.pdf

If you want to use another Minkowski distance metric than "Euclidean" you must compile another libANN library with the correct options before building this Module. Possible other distances are "Manhatten" and "Max".

USAGE ^

Methods

SEE ALSO ^

AUTHOR ^

Stephan Conrad, <conrad@stephanconrad.de>

COPYRIGHT AND LICENSE ^

Copyright (C) 2011 by Stephan Conrad

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: