loicland / cut-pursuit

C++ implementation for the cut pursuit algorithm, with Matlab interfaces
MIT License
76 stars 24 forks source link

MEX Errors #13

Open xueao opened 6 years ago

xueao commented 6 years ago

Hi Loicland: When I tried to compile cut-pursuit with matlab using mex, the following errors occured: ..\cut-pursuit\include\Common.h(38): error C2131: expression is not a constant. ..\cut-pursuit\include\Common.h(38): note: A call to a function that is undefined or a function that is not declared as "constexpr" causes a failure. Do you know how to fix it? thank you!

loicland commented 6 years ago

Hi,

Which version of GCC are you using?

You could also rewrite this part using new if you don't want to change compilers, see this thread. I would rewrite it but I am away for a few weeks so I won't be able to do it myself in the very short term.

Not-IITian commented 5 years ago

same for the Matlab demo code:

expected output after running the demo script provided here: L0-CUT PURSUIT WITH L2 FIDELITY PARAMETERIZATION = FAST Graph 102 vertices and 598 edges and observation of dimension 3 Iteration 1 - 16 components - Saturation 0.0 % - Quadratic Energy 86.956 % - Timer 0.007407 Iteration 2 - 41 components - Saturation 7.0 % - Quadratic Energy 72.009 % - Timer 0.010206 Iteration 3 - 49 components - Saturation 59.0 % - Quadratic Energy 69.368 % - Timer 0.012488 Iteration 4 - 49 components - Saturation 79.0 % - Quadratic Energy 68.690 % - Timer 0.014166 Iteration 5 - 49 components - Saturation 83.0 % - Quadratic Energy 68.690 % - Timer 0.015775 Stopping criterion reached