STANN

STANN‎ > ‎User Guide‎ > ‎

GMST Example

example.cpp

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

typedef reviver::dpoint<double,2> Point;
vector<Point> points;
typedef vector<Point>::size_type stype;
vector< std::pair<stype,stype> > outputmst;

using namespace std;

int main(int argc, char *argv[]){

       int count;

       cin >> count;

       points.resize(count);
       for(int i = 0; i < count; ++i){
               points[i] = newRandomPoint<Point, double>(0.0,1.0);
       }

       gmst(points,outputmst);
       return 1;
}

Example Compile Instructions

For sequential execution:

g++ example.cpp -O3 -ISTANN/include/

For Parallel execution where possible:

g++ example.cpp -O3 -ISTANN/include/ -fopenmp -D_GLIBCXX_PARALLEL