[Coin-discuss] OsiGlpkSolverInterface.cpp don't compile on VS6

Vivian De Smedt vivian at vdesmedt.com
Wed Dec 11 17:07:45 EST 2002


Dear coin,

this small email just to tell you that (because of a uncomformity of VS6 
and the c++ standart). OsiGlpkSolverInterface.cpp don't compile on that 
platform.

The VS6 message is i redefinition arround line 1815 I propose to make the 
obvious slight modification we are all used to namly replace

   for (int i=1; i <= numelem; i++)
     {
       index_adj[i] = index[i-1] + 1;
       value_adj[i] = value[i-1];
     }

   int j;
   for( j = 0; j < numrows; j++ )
     {
       setRowBounds( j, rowlb ? rowlb[j]:-inf, rowub ? rowub[j]:inf );

       // Note that we should really add one to start[j].  However, we need
       // to give GLPK the address one before that, so it turns out to be
       // just start[j]
       lpx_set_mat_row( model, j, start[j+1]-start[j],
		       &(index_adj[start[j]]), &(value_adj[start[j]]) );
     }

   int i;
   for( i = 0; i < numcols; i++ )

by:

   int i;
   for (i=1; i <= numelem; i++)
     {
       index_adj[i] = index[i-1] + 1;
       value_adj[i] = value[i-1];
     }

   int j;
   for( j = 0; j < numrows; j++ )
     {
       setRowBounds( j, rowlb ? rowlb[j]:-inf, rowub ? rowub[j]:inf );

       // Note that we should really add one to start[j].  However, we need
       // to give GLPK the address one before that, so it turns out to be
       // just start[j]
       lpx_set_mat_row( model, j, start[j+1]-start[j],
		       &(index_adj[start[j]]), &(value_adj[start[j]]) );
     }

   for( i = 0; i < numcols; i++ )

Yours,

Vivian De Smedt.




More information about the Coin-discuss mailing list