[Coin-discuss] OsiPackedMatrix patche for VC6

Laszlo Ladanyi ladanyi at us.ibm.com
Thu Sep 26 11:32:28 EDT 2002


Hi Vivian,

Thanks for pointing this out. We knew about this bug in VC++, it's just that
we don't use it and occasionally we slip up and put in this sort of construct. 
I have fixed it in the repository in the way you suggested.

--Laci

On Thu, 26 Sep 2002, Vivian De Smedt wrote:

> 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.
> 
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at www-124.ibm.com
> http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss
> 




More information about the Coin-discuss mailing list