Changeset 1827 for stable/1.14/Clp/test


Ignore:
Timestamp:
Nov 28, 2011 10:45:50 PM (8 years ago)
Author:
lou
Message:

Per user request, add an overload of loadProblem that takes a ClpMatrixBase?
parameter. Really just exposes an underlying method from ClpModel?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/1.14/Clp/test/OsiClpSolverInterfaceTest.cpp

    r1753 r1827  
    2121#include "CoinModel.hpp"
    2222#include "CoinIndexedVector.hpp"
     23#include "ClpPlusMinusOneMatrix.hpp"
    2324
    2425//#############################################################################
     
    586587    }
    587588  }
     589
     590  // Test ClpPlusMinusOneMatrix by way of loadProblem(ClpMatrixBase, ... )
     591  { int pos_start[4] = {0,5,9,12};
     592    int neg_start[4] = {3,7,11,12};
     593    int col[12] = {0,1,2,3,4,5,6,7,0,1,2,3};
     594    double rhs[3] = {0.0,0.0,0.0};
     595    double cost[8];
     596    double var_lb[8];
     597    double var_ub[8];
     598    for (uint i = 0 ; i < 8 ; i++) {
     599      cost[i] = 1.0;
     600      var_lb[i] = 0.0;
     601      var_ub[i] = 1.0;
     602    }
     603    ClpPlusMinusOneMatrix pmone_matrix(3,8,false,col,pos_start,neg_start);
     604    OsiClpSolverInterface clpSi;
     605    OSIUNITTEST_CATCH_ERROR(
     606        {clpSi.loadProblem(pmone_matrix,var_lb,var_ub,cost,rhs,rhs);
     607         clpSi.initialSolve();},
     608        {},"clp","loadProblem(ClpMatrixBase, ...)")
     609  }
     610
    588611
    589612  // Test add/delete columns
Note: See TracChangeset for help on using the changeset viewer.