Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added function to the C API: #620

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/Cbc_C_Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,29 @@ static int cbc_callb(CbcModel *cbcModel, int whereFrom) {
return 0;
}

void CBC_LINKAGE
Osi_setColSolution(Cbc_Model* model, double* solution) {
model->solver_->setColSolution(solution);
}

void CBC_LINKAGE
Osi_setRowPrice(Cbc_Model* model, double* price) {
model->solver_->setRowPrice(price);
}

void CBC_LINKAGE
Osi_setBasisStatus(Cbc_Model* model, int* vardata, int* condata) {
model->solver_->setBasisStatus(vardata, condata);
}

void CBC_LINKAGE
Osi_getBasisStatus(Cbc_Model* model, int* vardata, int* condata) {
model->solver_->getBasisStatus(vardata, condata);
}




// adds all sos objects to the current cbcModel_ object
static void Cbc_addAllSOS( Cbc_Model *model, CbcModel &cbcModel );

Expand Down
19 changes: 19 additions & 0 deletions src/Cbc_C_Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,9 @@ Osi_getObjSense();
CBCLIB_EXPORT const double * CBC_LINKAGE
Osi_getColSolution( void *osi );




/** @brief Returns vector of reduced costs */
CBCLIB_EXPORT const double * CBC_LINKAGE
Osi_getReducedCost( void *osi );
Expand Down Expand Up @@ -1760,6 +1763,22 @@ OsiCuts_senseRowCut( void *osiCuts, int iRowCut );
CBCLIB_EXPORT void CBC_LINKAGE
OsiCuts_delete( void *osiCuts );

/** Set a starting solution */
CBCLIB_EXPORT void CBC_LINKAGE
Osi_setColSolution(Cbc_Model *model, double* solution);

/** Set a starting dual solution */
CBCLIB_EXPORT void CBC_LINKAGE
Osi_setRowPrice(Cbc_Model *model, double *price);

/** Set basis statuses */
CBCLIB_EXPORT void CBC_LINKAGE
Osi_setBasisStatus(Cbc_Model *model, int* vardata, int* condata);

/** Get basis statuses */
CBCLIB_EXPORT void CBC_LINKAGE
Osi_getBasisStatus(Cbc_Model *model, int *vardata, int *condata);



/*@}*/
Expand Down