[Coin-discuss] OsiPackedMatrix patche for VC6

Vivian De Smedt vdesmedt at cso.ulb.ac.be
Thu Sep 26 04:41:16 EDT 2002


Dear Osi,

Just to signale that because of uncomformity of VisualC++ 6 the debug 
version of the OsiPackedMatrix.cpp translation unit do not compile.

for VC6 in the following code:

for (int i = 0; i < 3; ++i) {
}
int i = 3;

i is redefined on line 3.

maybe could we change

void
OsiPackedMatrix::appendMinorVector(const int vecsize,
				   const int *vecind,
				   const double *vecelem)
    throw(CoinError)
{
#ifdef OSI_DEBUG
   for (int i = 0; i < vecsize; ++i) {
     if (vecind[i] < 0 || vecind[i] >= majorDim_)
       throw CoinError("out of range index",
		     "appendMinorVector", "OsiPackedMatrix");
   }
#if 0
   if (std::find_if(vecind, vecind + vecsize,
		   compose2(logical_or<bool>(),
			    bind2nd(less<int>(), 0),
			    bind2nd(greater_equal<int>(), majorDim_))) !=
       vecind + vecsize)
     throw CoinError("out of range index",
		   "appendMinorVector", "OsiPackedMatrix");
#endif
#endif

   int i;
   // test that there's a gap at the end of every major-dimension vector where
   // we want to add a new entry

into:

void
OsiPackedMatrix::appendMinorVector(const int vecsize,
				   const int *vecind,
				   const double *vecelem)
    throw(CoinError)
{
   int i;
#ifdef OSI_DEBUG
   for (i = 0; i < vecsize; ++i) {
     if (vecind[i] < 0 || vecind[i] >= majorDim_)
       throw CoinError("out of range index",
		     "appendMinorVector", "OsiPackedMatrix");
   }
#if 0
   if (std::find_if(vecind, vecind + vecsize,
		   compose2(logical_or<bool>(),
			    bind2nd(less<int>(), 0),
			    bind2nd(greater_equal<int>(), majorDim_))) !=
       vecind + vecsize)
     throw CoinError("out of range index",
		   "appendMinorVector", "OsiPackedMatrix");
#endif
#endif

   // test that there's a gap at the end of every major-dimension vector where
   // we want to add a new entry

Vivian De Smedt.




More information about the Coin-discuss mailing list