// Copyright (C) 2003, International Business Machines // Corporation and others. All Rights Reserved. /* Note (JJF) I have added some operations on arrays even though they may duplicate CoinDenseVector. I think the use of templates was a mistake as I don't think inline generic code can take as much advantage of parallelism or machine architectures or memory hierarchies. */ #include #include #include "CoinHelperFunctions.hpp" #include "CoinFinite.hpp" double maximumAbsElement(const double * region, int size) { int i; double maxValue=0.0; for (i=0;i #include #include typedef void (*NEW_HANDLER)(); static NEW_HANDLER new_handler; // function to call if `new' fails (cf. ARM p. 281) // Allocate storage. void * operator new(size_t size) { void * p; for (;;) { p = malloc(size); if (p) break; // success else if (new_handler) new_handler(); // failure - try again (allow user to release some storage first) else break; // failure - no retry } if (size>1000000) printf("Allocating memory of size %d\n",size); return p; } // Deallocate storage. void operator delete(void *p) { free(p); return; } void operator delete [] (void *p) { free(p); return; } #endif