I'm getting
Warning: Not enough memory to allocate s_graph->even_adj_list
Cannot proceed with 0-1/2 cut separation
written to stdout and then my application that uses Cbc just exit's.
It seems that Cgl012cut.cpp boldly tries to allocate space for a completely dense graph:
|
maxedges = (nnodes * (nnodes - 1)) / 2; |
|
s_graph->even_adj_list = reinterpret_cast<edge **> (malloc(maxedges*sizeof(edge *))); |
|
if ( s_graph->even_adj_list == NULL ) alloc_error(const_cast<char*>("s_graph->even_adj_list")); |
And then alloc_error() just decided that doing an exit() is a sensible way to treat an error.
|
void alloc_error(char *s) |
|
{ |
|
printf("\n Warning: Not enough memory to allocate %s\n",s); |
|
printf("\n Cannot proceed with 0-1/2 cut separation\n"); |
|
exit(FALSE); |
|
} |
Could the estimate on how many edges one may need be improved? Maybe one could reallocate when necessary?
In my case, I have nnodes=49800, so that (nnodes * (nnodes - 1)) / 2 gives an integer overflow, and I get maxedges=-907488548.
Could one please not just exit() a whole process when a memory allocation fails?
A new[] instead of a malloc() would have thrown an exception, I believe.
I'm getting
written to stdout and then my application that uses Cbc just exit's.
It seems that Cgl012cut.cpp boldly tries to allocate space for a completely dense graph:
Cgl/src/CglZeroHalf/Cgl012cut.cpp
Lines 640 to 642 in c4f8ff9
And then
alloc_error()just decided that doing anexit()is a sensible way to treat an error.Cgl/src/CglZeroHalf/Cgl012cut.cpp
Lines 133 to 138 in c4f8ff9
Could the estimate on how many edges one may need be improved? Maybe one could reallocate when necessary?
In my case, I have
nnodes=49800, so that(nnodes * (nnodes - 1)) / 2gives an integer overflow, and I getmaxedges=-907488548.Could one please not just exit() a whole process when a memory allocation fails?
A
new[]instead of amalloc()would have thrown an exception, I believe.