Changeset 1bbaa1 in git
- Timestamp:
- May 19, 2000, 3:05:54 PM (23 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 60f2ab568299f910ca263722982843a8d9e49653
- Parents:
- 754cf997b0bc052e7097b430776ff2a512e1dfa5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IntegerProgramming/IP_algorithms.cc
r754cf99 r1bbaa1 2252 2252 2253 2253 float *hom_grad=new float[variables]; 2254 2255 for(short i=0;i<variables;i++)2256 { 2257 input>>hom_grad[ i];2254 2255 for(short _i=0;_i<variables;_i++) 2256 { 2257 input>>hom_grad[_i]; 2258 2258 2259 2259 if(!input) … … 2267 2267 } 2268 2268 2269 if(hom_grad[ i]<=0)2269 if(hom_grad[_i]<=0) 2270 2270 { 2271 2271 cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):" … … 2276 2276 } 2277 2277 } 2278 2278 2279 2279 2280 … … 3085 3086 { 3086 3087 // at the beginning, the variables of interest are zero 3087 for( shorti=0;i<weighted_variables;i++)3088 for(i=0;i<weighted_variables;i++) 3088 3089 right_hand[i]=0; 3089 3090 3090 3091 // right hand vector is read from the input stream into the 3091 3092 // elimination variables 3092 for( shorti=weighted_variables;3093 for(i=weighted_variables; 3093 3094 i<weighted_variables+elimination_variables-1;i++) 3094 3095 { … … 3108 3109 // - min{negative components of right_hand}. 3109 3110 Integer min=0; 3110 for( shorti=weighted_variables;3111 for(i=weighted_variables; 3111 3112 i<weighted_variables+elimination_variables-1;i++) 3112 3113 if(right_hand[i]<min) … … 3115 3116 // transform right_hand so that all components are nonnegative 3116 3117 if(min<0) 3117 for( shorti=weighted_variables;3118 for(i=weighted_variables; 3118 3119 i<weighted_variables+elimination_variables-1;i++) 3119 3120 right_hand[i]-=min; … … 3139 3140 3140 3141 output<<"right hand vector:"<<endl; 3141 for( shorti=weighted_variables;3142 for(i=weighted_variables; 3142 3143 i<weighted_variables+elimination_variables-1;i++) 3143 3144 output<<setw(6)<<right_hand[i]+min; … … 3148 3149 3149 3150 BOOLEAN solvable=TRUE; 3150 for( shorti=weighted_variables;3151 for(i=weighted_variables; 3151 3152 i<=weighted_variables+elimination_variables-1;i++) 3152 3153 if(to_reduce[i]!=0) … … 3160 3161 output<<"YES"<<endl; 3161 3162 output<<"optimal solution:"<<endl; 3162 for( shorti=0;i<weighted_variables;i++)3163 for(i=0;i<weighted_variables;i++) 3163 3164 output<<setw(6)<<to_reduce[i]; 3164 3165 output<<endl; … … 3192 3193 { 3193 3194 // at the beginning, the variables of interest are zero 3194 for( shorti=0;i<weighted_variables;i++)3195 for(i=0;i<weighted_variables;i++) 3195 3196 right_hand[i]=0; 3196 3197 3197 3198 // right hand vector is read from the input stream into the 3198 3199 // elimination variables 3199 for( shorti=weighted_variables;3200 for(i=weighted_variables; 3200 3201 i<weighted_variables+elimination_variables;i++) 3201 3202 { … … 3246 3247 3247 3248 output<<"right hand vector:"<<endl; 3248 for( shorti=weighted_variables;3249 for(i=weighted_variables; 3249 3250 i<weighted_variables+elimination_variables;i++) 3250 3251 output<<setw(6)<<right_hand[i]; … … 3255 3256 3256 3257 BOOLEAN solvable=TRUE; 3257 for( shorti=weighted_variables;3258 for(i=weighted_variables; 3258 3259 i<weighted_variables+elimination_variables;i++) 3259 3260 if(to_reduce[i]!=0) … … 3267 3268 output<<"YES"<<endl; 3268 3269 output<<"optimal solution:"<<endl; 3269 for( shorti=0;i<weighted_variables;i++)3270 for(i=0;i<weighted_variables;i++) 3270 3271 output<<setw(6)<<to_reduce[i]; 3271 3272 output<<endl; … … 3298 3299 // initial solution vector is read from the input stream into the 3299 3300 // elimination variables 3300 for( shorti=0;i<weighted_variables;i++)3301 for(i=0;i<weighted_variables;i++) 3301 3302 { 3302 3303 problem>>initial_solution[i]; … … 3333 3334 3334 3335 output<<"initial solution vector:"<<endl; 3335 for( shorti=0;i<weighted_variables;i++)3336 for(i=0;i<weighted_variables;i++) 3336 3337 output<<setw(6)<<initial_solution[i]; 3337 3338 // original vector … … 3339 3340 3340 3341 output<<"optimal solution:"<<endl; 3341 for( shorti=0;i<weighted_variables;i++)3342 for(i=0;i<weighted_variables;i++) 3342 3343 output<<setw(6)<<to_reduce[i]; 3343 3344 output<<endl;
Note: See TracChangeset
for help on using the changeset viewer.