Changeset 2037


Ignore:
Timestamp:
Jun 10, 2014 11:13:06 PM (5 years ago)
Author:
mlubin
Message:

Remove nonworking problem modification functions. Update docs.

Location:
trunk/Cbc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/Cbc_C_Interface.cpp

    r2036 r2037  
    370370    model->model_->setBestSolution(sol, n, objval, true);
    371371}
    372 
    373 /* Deletes rows */
    374 COINLIBAPI void COINLINKAGE
    375 Cbc_deleteRows(Cbc_Model * model, int number, const int * which)
    376 {
    377     const char prefix[] = "Cbc_C_Interface::Cbc_deleteRows(): ";
    378     if (VERBOSE > 0) printf("%s begin\n", prefix);
    379 
    380     OsiSolverInterface * solver = model->model_->solver();
    381     solver->deleteRows(number, which);
    382 
    383     if (VERBOSE > 0) printf("%s return\n", prefix);
    384 }
    385 /* Add rows */
    386 COINLIBAPI void COINLINKAGE
    387 Cbc_addRows(Cbc_Model * /*model*/, const int /*number*/,
    388             const double * /*rowLower*/,
    389             const double * /*rowUpper*/,
    390             const int * /*rowStarts*/, const int * /*columns*/,
    391             const double * /*elements*/)
    392 {
    393     const char prefix[] = "Cbc_C_Interface::Cbc_addRows(): ";
    394     if (VERBOSE > 0) printf("%s begin\n", prefix);
    395 
    396 // available through OsiClp
    397 //tbd  model->model_->addRows(number,rowLower,rowUpper,rowStarts,columns,elements);
    398     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    399 
    400     if (VERBOSE > 0) printf("%s return\n", prefix);
    401 }
    402 
    403 /* Deletes columns */
    404 COINLIBAPI void COINLINKAGE
    405 Cbc_deleteColumns(Cbc_Model * model, int number, const int * which)
    406 {
    407     const char prefix[] = "Cbc_C_Interface::Cbc_deleteColumns(): ";
    408 //  const int  VERBOSE = 1;
    409     if (VERBOSE > 0) printf("%s begin\n", prefix);
    410 
    411     OsiSolverInterface * solver = model->model_->solver();
    412     solver->deleteCols(number, which);
    413 
    414     if (VERBOSE > 0) printf("%s return\n", prefix);
    415 }
    416 /* Add columns */
    417 COINLIBAPI void COINLINKAGE
    418 Cbc_addColumns(Cbc_Model * /*model*/, int /*number*/,
    419                const double * /*columnLower*/,
    420                const double * /*columnUpper*/,
    421                const double * /*objective*/,
    422                const int * /*columnStarts*/, const int * /*rows*/,
    423                const double * /*elements*/)
    424 {
    425     const char prefix[] = "Cbc_C_Interface::Cbc_addColumns(): ";
    426 //  const int  VERBOSE = 1;
    427     if (VERBOSE > 0) printf("%s begin\n", prefix);
    428 
    429 // available through OsiClp
    430 //tbd  model->model_->addColumns(number,columnLower,columnUpper,objective,
    431 //tbd                       columnStarts,rows,elements);
    432     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    433 
    434     if (VERBOSE > 0) printf("%s return\n", prefix);
    435 }
    436 
    437372
    438373COINLIBAPI void COINLINKAGE
  • trunk/Cbc/src/Cbc_C_Interface.h

    r2036 r2037  
    1313#include <stddef.h>
    1414
    15 /** This is a "C" interface to Cbc.
    16    Original verison contributed by Bob Entriken,
    17    significantly updated by Miles Lubin.
     15/*
     16 * Original verison contributed by Bob Entriken,
     17 * significantly updated by Miles Lubin.
    1818*/
     19
    1920
    2021#ifdef __cplusplus
     
    2324
    2425    /**@name Constructors and destructor
    25        The user does not need to know structure of Cbc_Model.
     26      This is a "C" interface to Cbc.
     27      The user does not need to know structure of Cbc_Model.
    2628    */
    2729    /*@{*/
     
    4042    /*@}*/
    4143
    42     /**@name Getting and setting model data */
     44    /**@name Getting and setting model data
     45     Note that problem access and modification methods,
     46       such as getColLower and setColLower,
     47       are *not valid* after calling Cbc_solve().
     48       Therefore it is not recommended to reuse a Cbc_Model
     49       object for multiple solves. A workaround is to call Cbc_clone()
     50       before solving.
     51     * */
    4352    /*@{*/
    4453    /** Loads a problem (the constraints on the
     
    8190    Cbc_setInitialSolution(Cbc_Model *model, const double * sol)
    8291    ;
    83     /** Deletes rows */
    84     COINLIBAPI void COINLINKAGE
    85     Cbc_deleteRows(Cbc_Model * model, int number, const int * which)
    86     ;
    87     /** Add rows */
    88     COINLIBAPI void COINLINKAGE
    89     Cbc_addRows(Cbc_Model * model, const int number, const double * rowLower,
    90                 const double * rowUpper,
    91                 const int * rowStarts, const int * columns,
    92                 const double * elements)
    93     ;
    94 
    95     /** Deletes columns */
    96     COINLIBAPI void COINLINKAGE
    97     Cbc_deleteColumns(Cbc_Model * model, int number, const int * which)
    98     ;
    99     /** Add columns */
    100     COINLIBAPI void COINLINKAGE
    101     Cbc_addColumns(Cbc_Model * model, int number, const double * columnLower,
    102                    const double * columnUpper,
    103                    const double * objective,
    104                    const int * columnStarts, const int * rows,
    105                    const double * elements);
    10692    /** Fills in array with problem name  */
    10793    COINLIBAPI void COINLINKAGE
  • trunk/Cbc/test/CInterfaceTest.c

    r2036 r2037  
    111111}
    112112
     113/*
    113114void testProblemModification() {
    114115
    115116    Cbc_Model *model = Cbc_newModel();
    116117
    117     /* Simple knapsack problem
     118    / * Simple knapsack problem
    118119       Maximize  5x[1] + 3x[2] + 2x[3] + 7x[4] + 4x[5]
    119120       s.t.      2x[1] + 8x[2] + 4x[3] + 2x[4] + 5x[5] <= 10
    120121       All x binary
    121        */
     122       * /
    122123   
    123124    CoinBigIndex start[] = {0, 1, 2, 3, 4, 5, 6};
     
    189190
    190191}
     192*/
    191193
    192194/*
     
    334336    printf("Unbounded test\n");
    335337    testIntegerUnbounded();
    336     printf("Problem modification test\n");
    337     testProblemModification();
     338    /*printf("Problem modification test\n");
     339    testProblemModification();*/
    338340
    339341    return 0;
Note: See TracChangeset for help on using the changeset viewer.