Error using CGAL: class 'Alpha_shape_cell_base_3' has no member named 'hide_points' - cgal

I am trying to install the software Sibaco, but I get an error relative to CGAL class Alpha_shape_cell_base_3.
/usr/local/include/CGAL/Regular_triangulation_3.h:1230:12: error: ‘class CGAL::Alpha_shape_cell_base_3<CGAL::Epick, CGAL::Triangulation_cell_base_3<CGAL::Epick, CGAL::Triangulation_ds_cell_base_3<CGAL::Triangulation_data_structure_3<CGAL::Alpha_shape_vertex_base_3<CGAL::Epick, CGAL::Regular_triangulation_vertex_base_3<CGAL::Epick> >, CGAL::Alpha_shape_cell_base_3<CGAL::Epick> > > >, CGAL::Boolean_tag<false>, CGAL::Boolean_tag<false> >’ has no member named ‘hide_point’
A similar error is reported for the members ‘hidden_points_begin’ and ‘hidden_points_end’.
I am using CGAL-4.11.3, since for later releases of CGAL I get many more errors when I try to install the software.
Any help to address this problem would be really appreciated!

The cell base needs to match the triangulation. Since you're using a regular triangulation, the cell base must be a model of the concept RegularTriangulationCellBase_3, so CGAL::Regular_triangulation_cell_base_3 for example.
As pointed in the comment above, the example ex_weighted_alpha_shapes_3.cpp shows a correct setting of vertex and cell for 3D weighted alpha shapes.
If you need to use some more recent CGAL features and CGAL 4.11 is too old, feel free to post the errors you get and we can maybe help you upgrade the code from that library.

Related

Set the gap for Gurobi.Optimizer in Julia-JuMP

I am trying to understand how to set the gap for Gurobi.Optimizer, because it solves too long when the default gap threshold is used (10e-4).
I couldn't find it anywhere (they might be referred to as attributes or parameters).
PS: Also, I am trying to find the right tutorial or instructions on how to use the solver in JuMP. I checked here https://juliahub.com/docs/Gurobi/do9v6/0.7.7, but they don't reveal the meanings of different attributes and inputs. Please, send me one in case somebody knows.
Best,
A.
You can set the MIP gap via the MIPGap parameter:
using JuMP, Gurobi
model = Model(Gurobi.Optimizer)
set_optimizer_attribute(model, "MIPGap", 0.1)
You can read more about JuMP here: https://github.com/jump-dev/Gurobi.jl

Matlab Interface Issue - seg fault?

for my problem Matlab crashes in the 5th loop of the main loop in worhp.cpp in the subroutine
if (GetUserAction(&cnt, callWorhp))
{
Worhp(&opt, &wsp, &par, &cnt);
// No DoneUserAction!
}
with a seg fault. It would be great if you could help me to debug by providing information on the opt, wsp, par and cnt structs and what to look for.
Thanks and best regards
I am currently having trouble with a similar issue. In one case, I was able to find an error by checking, whether the solver was able to terminate without an error when using approximated hessian matrices, instead of providing them myself. The error in this case occured, because I gave the library the wrong number of nonzero hessian entries and accessed entries of the hessian matrix that weren't allocated by the solver in my hessian function. Maybe your error is caused by a similar problem.
Kind regards,
Jan

Where can the implementation of tf.image.resize_bicubic be found?

I would like to know the kernel that this op is using. I've been looking through the TF source code. The closest I got to was image_ops.cc. Can someone point me to the right place to look?
The python hook is inside:
tensorflow/python/ops/image_ops.py
The compiler system applies a translation to the operation names;
resize_bicubic -> ResizBicubicOP
Finally, you can find the Kernel inside:
tensorflow/core/kernels/resize_bicubic_op.cc#L88

3D boolean assertion fail. "mark" not matching

I'm trying to do some 3D boolean operations with CGAL. I have successfully converted my polyhedra to nef polyhedra. However, when ever I try doing a simple union, I get an assertion fail on line 286 of SM_overlayer.h:
CGAL error: assertion violation!
Expression : G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1)
File : ./CGAL/include/CGAL/Nef_S2/SM_overlayer.h
Line : 287
I tried searching the documentation for "mark". Apparently it is a template argument on the Nef_polyhedron_3" that defaults to bool. However the documentation also says it is not implemented and that you shouldn't mess with it. I am a bit confused why there is even an assertion on some unimplemented feature. I tried simply commenting out the assertion, but it simply goes on to fail at a later point.
I am using the following kernel and typedefs as it was the only example I could find that allowed doubles in the construction of the meshes.
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
I used CGAL 4.6.3 installed with the exe installer. I have also tried the 4.7 beta and I get the same exception(at line 300 instead though).
Related github issue: https://github.com/CGAL/cgal/issues/353
EDIT: The issue turned out to be with the meshes. The meshes I were using had self intersections. Thus, even though is_valid, is_closed and is_triangular returned true, the mesh was in valid for conversion to a nef polyhedron. From CGAL 4.7. The Polygon mesh processing package has been introduced which contains this which can be used to check for self intersections.

function that returns value from dlsym()?

Stupid question that I'm sure is some bit of syntax that's not right. How do I get dlsym to work with a function that returns a value? I'm getting the error 'invalid conversion of void* to LSError (*)()' in the following code - trying to get the compile the linux lightscribe sample program hoping that I can link it against the OSX dylib (why the hell won't HP release an actual Cocoa SDK? LS has only been around for what? 6 or 7 years now?):
void* LSHandle = dlopen("liblightscribe.1.dylib", RTLD_LOCAL|RTLD_LAZY);
if (LSHandle) {
LSError (*LS_DiscPrinter_ReleaseExclusiveUse)() = dlsym(LSHandle, "LS_DiscPrinter_ReleaseExclusiveUse");
..
lsError = LS_DiscPrinter_ReleaseExclusiveUse( pDiscPrinter);
The C standard does not actually define behaviour for converting to and from function pointers. Explanations vary as to why; the most common being that not all architectures implement function pointers as simple pointers to data. On some architectures, functions may reside in an entirely different segment of memory that is unaddressable using a pointer to void.
The “recommended” way to use dlsym is:
LSError (*LS_DiscPrinter_ReleaseExclusiveUse)(LS_DiscPrinterHandle);
*(void **)&LS_DiscPrinter_ReleaseExclusiveUse = dlsym("LS_DiscPrinter_ReleaseExclusiveUse");
Read the rationale and example on the POSIX page for dlsym for more information.