Algorithm-KNN-XS

 view release on metacpan or  search on metacpan

lib_ann_interface.h  view on Meta::CPAN

#include <exception>
#include <iostream>
#include <sstream>
#include <vector>

#include <ANN/ANN.h> // http://www.cs.umd.edu/~mount/ANN/
#include <ANN/ANNperf.h> // http://www.cs.umd.edu/~mount/ANN/

using namespace std;

class InvalidParameterValueException : public std::exception {
    public:
        explicit InvalidParameterValueException(const std::string& what) : m_what(what) {}
        virtual ~InvalidParameterValueException() throw() {}
        virtual const char * what() const throw() {
            return m_what.c_str();
        }

    private:
        std::string m_what;
};

// libANN can do a exit(1) if a a given dump file is incorrect

class LibANNInterface {
    public:
        LibANNInterface(std::vector< std::vector<double> >&, string&, bool, int, int, int);
        ~LibANNInterface();

        void set_annMaxPtsVisit(int);
        std::vector< std::vector<double> > annkSearch(std::vector<double>&, int, double);
        std::vector< std::vector<double> > annkPriSearch(std::vector<double>&, int, double);
        std::vector< std::vector<double> > annkFRSearch(std::vector<double>&, int, double, double);
        int annCntNeighbours(std::vector<double>&, double, double);
        int theDim();
        int nPoints();



( run in 0.498 second using v1.01-cache-2.11-cpan-64827b87656 )