Port to g++ 4.1.2

This commit is contained in:
Laurent Saboret 2008-10-13 12:10:14 +00:00
parent d0361b02b0
commit 824c080451
3 changed files with 24 additions and 24 deletions

View File

@ -68,26 +68,26 @@ struct Peak_memory_sizer : public Memory_sizer
size_t m,m_low,m_high,m_tol;
char* p;
size_t m_max;
// Limit malloc test to avoid an infinite loop on Linux
// (malloc() never returns null due to "optimistic memory allocation").
int is_32_bits = (sizeof(void*) == 4);
if (is_32_bits)
{
m_max = 4294967295; // 2^32 - 1 = 4 GB
m_max = 4294967295U; // 2^32 - 1 = 4 GB
}
else
{
// Limit malloc test by physical system memory size.
// TODO: replace m_sys by virtual address space limit?
// TODO: replace m_sys by virtual address space limit?
m_sys = (size_t) (taucs_system_memory_size() + 0.5);
if (m_sys > 0)
m_max = m_sys;
else
m_max = (std::numeric_limits<size_t>::max)();
}
/* malloc test */
m = 1048576;

View File

@ -659,7 +659,7 @@ public:
CGAL_TRACE(" %ld Mb allocated, largest free memory block=%ld Mb, #blocks over 100 Mb=%ld\n",
long(CGAL::Memory_sizer().virtual_size())>>20,
(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().count_free_memory_blocks(100*1048576)));
CGAL_TRACE(" Create matrix...\n");
@ -693,7 +693,7 @@ public:
*duration_assembly = (clock() - time_init)/CLOCKS_PER_SEC;
CGAL_TRACE(" Create matrix: done (%.2lf s)\n", *duration_assembly);
/*
time_init = clock();
if(!solver.solve_conjugate_gradient(B,X,10000,1e-15))
@ -703,7 +703,7 @@ public:
CGAL_TRACE(" %ld Mb allocated, largest free memory block=%ld Mb, #blocks over 100 Mb=%ld\n",
long(CGAL::Memory_sizer().virtual_size())>>20,
(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().count_free_memory_blocks(100*1048576)));
CGAL_TRACE(" Choleschy factorization...\n");
@ -721,7 +721,7 @@ public:
CGAL_TRACE(" %ld Mb allocated, largest free memory block=%ld Mb, #blocks over 100 Mb=%ld\n",
long(CGAL::Memory_sizer().virtual_size())>>20,
(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().count_free_memory_blocks(100*1048576)));
CGAL_TRACE(" Direct solve...\n");
@ -756,7 +756,7 @@ public:
CGAL_TRACE(" %ld Mb allocated, largest free memory block=%ld Mb, #blocks over 100 Mb=%ld\n",
long(CGAL::Memory_sizer().virtual_size())>>20,
(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().largest_free_block()>>20),
long(CGAL::Peak_memory_sizer().count_free_memory_blocks(100*1048576)));
CGAL_TRACE("End of solve_poisson()\n");
@ -1533,7 +1533,7 @@ private:
}
bool is_refinable(Cell_handle cell,
K_nearest_neighbor& nn_search,
K_nearest_neighbor& nn_search,
const FT size_shell,
const FT sizing,
FT& size,

View File

@ -11,7 +11,7 @@
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $URL$
// $Id$
//
// Author(s) : Pierre Alliez and Mario Botsch
@ -29,7 +29,7 @@
#ifdef WIN32
#include <CGAL/Win32_exception.h>
#endif
#include <vector>
#include <set>
@ -91,7 +91,7 @@ public:
n_rows = (int)colptr.size()-1;
}
}
void add_value(int _i, T _val)
{
// We store only the lower diagonal matrix
@ -116,7 +116,7 @@ public:
#ifdef WIN32
Win32_exception_handler eh; // catch Win32 structured exceptions
#endif
supernodal_ = _use_supernodal;
// delete old matrices
@ -133,7 +133,7 @@ public:
// bandlimitation
try {
taucs_ccs_order(&A, &perm, &invperm, (char*)"metis");
}
}
catch (...) {}
if (perm == NULL || invperm == NULL)
{
@ -143,7 +143,7 @@ public:
try {
PAP = taucs_ccs_permute_symmetrically(&A, perm, invperm);
}
}
catch (...) {}
if (PAP == NULL)
{
@ -155,7 +155,7 @@ public:
try {
if (supernodal_) SL = taucs_ccs_factor_llt_mf (PAP);
else L = taucs_ccs_factor_llt (PAP, 0, 0);
}
}
catch (...) {}
if (!(L || SL))
{
@ -171,7 +171,7 @@ public:
#ifdef WIN32
Win32_exception_handler eh; // catch Win32 structured exceptions
#endif
// delete old matrices
delete_matrices();
@ -185,7 +185,7 @@ public:
// bandlimitation
try {
taucs_ccs_order(&A, &perm, &invperm, (char*)"metis");
}
}
catch (...) {}
if (perm == NULL || invperm == NULL)
{
@ -195,7 +195,7 @@ public:
try {
PAP = taucs_ccs_permute_symmetrically(&A, perm, invperm);
}
}
catch (...) {}
if (PAP == NULL)
{
@ -208,7 +208,7 @@ public:
CGAL_surface_reconstruction_assertion(matrixfile != NULL);
try {
m_io_handle = taucs_io_create_multifile(matrixfile);
}
}
catch (...) {}
free(matrixfile);
if(m_io_handle == NULL)
@ -221,14 +221,14 @@ public:
try {
double available_memory = taucs_available_memory_size();
result = taucs_ooc_factor_llt(PAP,m_io_handle,available_memory);
}
}
catch (...) {}
if(result != TAUCS_SUCCESS)
{
std::cerr << "Taucs_solver: ooc factorization failed\n";
return false;
}
return true;
}