Coder Social home page Coder Social logo

Compilation error with g++ about geometry HOT 6 CLOSED

boostorg avatar boostorg commented on June 4, 2024
Compilation error with g++

from geometry.

Comments (6)

awulkiew avatar awulkiew commented on June 4, 2024

Ok, so you adapt Eigen::Matrix to Boost.Geometry Point concept. The code above looks ok.

What's the program you're compiling? I see that you're creating R-tree and passing std::pair<Eigen::Matrix<...>, double> as ValueType. Is that correct? Or are you calling some algorithm?

The NOT_VALID_INDEXABLE_TYPE MPL assertion occurs when tag<ValueType>::type is neither point_tag, box_tag nor segment_tag. Could you check in your code if the tag is set properly? E.g.: std::cout << boost::is_same<bg::tag<Eigen::Matrix<...>>::type, point_tag>::value;.

How are you including Boost.Geometry in your code and what is the order of includes? It's possible that the order of #includes is important for GCC. This wouldn't be the first time something like this happen with this compiler.

from geometry.

thk686 avatar thk686 commented on June 4, 2024
// [[Rcpp::export]]
void test_tag()
{
  Rcout << boost::is_same<bg::tag<Eigen::Matrix<double, 2, 1>>::type, bg::point_tag>::value << std::endl;
}

Returns 1.

from geometry.

thk686 avatar thk686 commented on June 4, 2024

Tried moving header to first and last in source file without luck.

from geometry.

awulkiew avatar awulkiew commented on June 4, 2024

This may be a problem with wrong traits specializations. If Eigen::Matrix rows, cols, options etc. are int, not std::size_t then DimensionCount in specializations should be of type int too.

Btw, I see that Eigen::Matrix is defined as:

Matrix<typename Scalar,
   int RowsAtCompileTime,
   int ColsAtCompileTime,
   int Options = 0,
   int MaxRowsAtCompileTime = RowsAtCompileTime,
   int MaxColsAtCompileTime = ColsAtCompileTime>

Maybe this particular compiler would prefer to have all 6 template parameters in specializations? You pass only 3.

Ok, so bg::tag seems to work. How about some simple algorithm? Does distance(p1, p2) or disjoint(p1, p2) compile and generate correct result?

from geometry.

thk686 avatar thk686 commented on June 4, 2024

from geometry.

awulkiew avatar awulkiew commented on June 4, 2024

Ok, great.

from geometry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.