Ignore:
Timestamp:
Sep 23, 2002 9:40:07 AM (18 years ago)
Author:
forrest
Message:

Taking out dependence on CoinWarmStartBasis?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-1/Test/unitTest.cpp

    r20 r26  
    2121#include "CoinPackedMatrix.hpp"
    2222#include "CoinPackedVector.hpp"
    23 #include "CoinWarmStartBasis.hpp"
     23#include "CoinHelperFunctions.hpp"
    2424
    2525#include "ClpFactorization.hpp"
     
    343343    int rowBasis1[3]={-1,-1,-1};
    344344    int colBasis1[5]={1,1,-1,-1,1};
     345    solution.loadProblem(matrix,colLower,colUpper,objective,
     346                         rowLower,rowUpper);
    345347    int i;
    346     CoinWarmStartBasis warm;
    347     warm.setSize(5,3);
     348    solution.createStatus();
    348349    for (i=0;i<3;i++) {
    349350      if (rowBasis1[i]<0) {
    350         warm.setArtifStatus(i,CoinWarmStartBasis::atLowerBound);
     351        solution.setRowStatus(i,ClpSimplex::atLowerBound);
    351352      } else {
    352         warm.setArtifStatus(i,CoinWarmStartBasis::basic);
     353        solution.setRowStatus(i,ClpSimplex::basic);
    353354      }
    354355    }
    355356    for (i=0;i<5;i++) {
    356357      if (colBasis1[i]<0) {
    357         warm.setStructStatus(i,CoinWarmStartBasis::atLowerBound);
     358        solution.setColumnStatus(i,ClpSimplex::atLowerBound);
    358359      } 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    }
    364363    solution.setLogLevel(3+4+8+16+32);
    365364    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    }
    366379    // intricate stuff does not work with scaling
    367380    solution.scaling(0);
    368     solution.setBasis(warm);
    369381    assert(!solution.factorize ( ));
    370382    const double * colsol = solution.primalColumnSolution();
     
    379391    ClpSimplex solution2 = solution;
    380392    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    }
    382408    // intricate stuff does not work with scaling
    383409    solution2.scaling(0);
     
    506532      CoinDisjointCopyN(solution.dualRowSolution(),numberRows,rowObjective);
    507533      CoinDisjointCopyN(solution.dualColumnSolution(),numberColumns,objective);
    508       CoinWarmStartBasis basis;
    509       solution.setBasis(basis);
     534      // this sets up all slack basis
     535      solution.createStatus();
    510536      solution.dual();
    511537      CoinFillN(rowObjective,numberRows,0.0);
Note: See TracChangeset for help on using the changeset viewer.