Skip to content

Commit b03ccff

Browse files
authored
expose objective offset (#17)
* code dump * workflows * ran formatter * readme * workflow * removed old workflows * new workflow * c++ workflow * C++ workflow * new line at eof to formatter * improved interface * new workflow * new workflow * new workflow * updated default settings * small changes to API * added one test * small changes to interface * minor * minor change to test * cmake link * expose objective offset
1 parent 259ca2e commit b03ccff

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎include/PSLP/PSLP_API.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ extern "C"
7070
// variable bounds lbs <= x <= ubs
7171
double *lbs;
7272
double *ubs;
73+
74+
/* offset to be added to the objective value. (When the presolver fixes
75+
variables, it adds an offset to the objective. This offset should
76+
possibly be taken into account when evaluating the relative optimality gap
77+
of the reduced problem.) */
78+
double obj_offset;
7379
} PresolvedProblem;
7480

7581
/* struct corresponding to the presolver:

‎src/core/Presolver.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ void populate_presolved_problem(Presolver *presolver)
536536
ps_prob->rhs = constraints->rhs;
537537
ps_prob->lhs = constraints->lhs;
538538
ps_prob->c = presolver->prob->obj->c;
539+
ps_prob->obj_offset = presolver->prob->obj->offset;
539540

540541
// create bounds arrays
541542
ps_prob->lbs = (double *) malloc(A->n * sizeof(double));

0 commit comments

Comments
 (0)