Boost logo

Boost Users :

Subject: [Boost-users] can not compile nearest neighbors in d dimensions
From: Georgios Samaras (georgesamarasdit_at_[hidden])
Date: 2014-04-15 18:41:39

I can not create a point in d(in the code M is dimensions) dimensions.
The error is this:
error: the value of ‘M’ is not usable in a constant expression
note: ‘int M’ is not const
error: template argument 2 is invalid

and the line is this:
int M;
typedef bg::model::point<float, M, bg::cs::cartesian> point;

Then, I am trying to create an Rtree (I have already the data in a 2D
array), like this:
// create the rtree using default constructor
bgi::rtree< point, bgi::quadratic<16> > rtree;

point tmp;
for ( unsigned i = 0 ; i < N ; ++i )
   // insert new value
   for(int j = 0 ; j < M ; ++j) {
     bg::set<M>(tmp, a[i][j]);

and I think the error is in insert(). I am attaching a file with the
minimal code and one with the errors I receive (I receive another one

I am struggling to achieve that all day long. :/

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at