STANN

STANN‎ > ‎User Guide‎ > ‎

SFCNN Example

sample.cpp

#include <iostream>
#include <vector>
#include <dpoint.hpp>
#include <test.hpp>

#include<sfcnn.hpp>

using namespace std;

typedef reviver::dpoint<double, 3> Point;

int main()
{
  int count;

  vector<Point> points;

  cin >> count;
  for(int i=0;i < count;++i)
    points[i] = newRandomPoint<Point, double>(0,1);

  sfcnn<Point, 3, double>
    NN(&points[0], count);

  vector<long unsigned int> answer;

  NN.ksearch(points[0], 10, answer);
}

Compiling

To compile the sample program use:
g++ -O3 -o sample sample.cpp -ISTANN/include