Changeset 26 for branches/devel1/Test/unitTest.cpp
 Timestamp:
 Sep 23, 2002 9:40:07 AM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/devel1/Test/unitTest.cpp
r20 r26 21 21 #include "CoinPackedMatrix.hpp" 22 22 #include "CoinPackedVector.hpp" 23 #include "Coin WarmStartBasis.hpp"23 #include "CoinHelperFunctions.hpp" 24 24 25 25 #include "ClpFactorization.hpp" … … 343 343 int rowBasis1[3]={1,1,1}; 344 344 int colBasis1[5]={1,1,1,1,1}; 345 solution.loadProblem(matrix,colLower,colUpper,objective, 346 rowLower,rowUpper); 345 347 int i; 346 CoinWarmStartBasis warm; 347 warm.setSize(5,3); 348 solution.createStatus(); 348 349 for (i=0;i<3;i++) { 349 350 if (rowBasis1[i]<0) { 350 warm.setArtifStatus(i,CoinWarmStartBasis::atLowerBound);351 solution.setRowStatus(i,ClpSimplex::atLowerBound); 351 352 } else { 352 warm.setArtifStatus(i,CoinWarmStartBasis::basic);353 solution.setRowStatus(i,ClpSimplex::basic); 353 354 } 354 355 } 355 356 for (i=0;i<5;i++) { 356 357 if (colBasis1[i]<0) { 357 warm.setStructStatus(i,CoinWarmStartBasis::atLowerBound);358 solution.setColumnStatus(i,ClpSimplex::atLowerBound); 358 359 } else { 359 warm.setStructStatus(i,CoinWarmStartBasis::basic); 360 } 361 } 362 solution.loadProblem(matrix,colLower,colUpper,objective, 363 rowLower,rowUpper); 360 solution.setColumnStatus(i,ClpSimplex::basic); 361 } 362 } 364 363 solution.setLogLevel(3+4+8+16+32); 365 364 solution.primal(); 365 for (i=0;i<3;i++) { 366 if (rowBasis1[i]<0) { 367 solution.setRowStatus(i,ClpSimplex::atLowerBound); 368 } else { 369 solution.setRowStatus(i,ClpSimplex::basic); 370 } 371 } 372 for (i=0;i<5;i++) { 373 if (colBasis1[i]<0) { 374 solution.setColumnStatus(i,ClpSimplex::atLowerBound); 375 } else { 376 solution.setColumnStatus(i,ClpSimplex::basic); 377 } 378 } 366 379 // intricate stuff does not work with scaling 367 380 solution.scaling(0); 368 solution.setBasis(warm);369 381 assert(!solution.factorize ( )); 370 382 const double * colsol = solution.primalColumnSolution(); … … 379 391 ClpSimplex solution2 = solution; 380 392 solution2.setFactorization(factorization2); 381 solution2.setBasis(warm); 393 solution2.createStatus(); 394 for (i=0;i<3;i++) { 395 if (rowBasis1[i]<0) { 396 solution2.setRowStatus(i,ClpSimplex::atLowerBound); 397 } else { 398 solution2.setRowStatus(i,ClpSimplex::basic); 399 } 400 } 401 for (i=0;i<5;i++) { 402 if (colBasis1[i]<0) { 403 solution2.setColumnStatus(i,ClpSimplex::atLowerBound); 404 } else { 405 solution2.setColumnStatus(i,ClpSimplex::basic); 406 } 407 } 382 408 // intricate stuff does not work with scaling 383 409 solution2.scaling(0); … … 506 532 CoinDisjointCopyN(solution.dualRowSolution(),numberRows,rowObjective); 507 533 CoinDisjointCopyN(solution.dualColumnSolution(),numberColumns,objective); 508 CoinWarmStartBasis basis;509 solution. setBasis(basis);534 // this sets up all slack basis 535 solution.createStatus(); 510 536 solution.dual(); 511 537 CoinFillN(rowObjective,numberRows,0.0);
Note: See TracChangeset
for help on using the changeset viewer.