-
Notifications
You must be signed in to change notification settings - Fork 4
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
Restore function 'PNE_EcrireJeuDeDonneesMPS_avecNom' #5
Changes from all commits
c0075dd
7a28bdb
dc183af
2ea2097
1d421f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,4 +67,5 @@ int * NomCntSuivant; | |
int * FirstNomVar; | ||
int * NomVarSuivant; | ||
|
||
double objective_offset; | ||
} PROBLEME_MPS; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ void PNE_copy_problem(PROBLEME_MPS * Mps, PROBLEME_A_RESOUDRE * Probleme, int To | |
Probleme->CoupesLiftAndProject = NON_PNE; | ||
Probleme->AffichageDesTraces = OUI_PNE; | ||
Probleme->FaireDuPresolve = OUI_PNE /* OUI_PNE */; | ||
Probleme->objective_offset = Mps->objective_offset; | ||
if (Probleme->FaireDuPresolve == NON_PNE) printf("!!!!!!!!!!!!!! Attention pas de presolve !!!!!!!!!\n"); | ||
|
||
Probleme->TempsDExecutionMaximum = 0; | ||
|
@@ -124,30 +125,32 @@ int computeColBoundType(double lb, double ub) { | |
// *** Enf of Utility functions *** | ||
|
||
int initProblemMpsPointer(SRS_PROBLEM * problem_srs) { | ||
problem_srs->problem_mps = (PROBLEME_MPS *)malloc(sizeof(PROBLEME_MPS)); | ||
problem_srs->problem_mps->LabelDeLObjectif = NULL; | ||
problem_srs->problem_mps->NbVar = 0; | ||
problem_srs->problem_mps->NbCnt = 0; | ||
problem_srs->problem_mps->Msui = NULL; | ||
problem_srs->problem_mps->Mder = NULL; | ||
problem_srs->problem_mps->Nuvar = NULL; | ||
problem_srs->problem_mps->BRange = NULL; | ||
problem_srs->problem_mps->LabelDeLaContrainte = NULL; | ||
problem_srs->problem_mps->LabelDuSecondMembre = NULL; | ||
problem_srs->problem_mps->A = NULL; | ||
problem_srs->problem_mps->Mdeb = NULL; | ||
problem_srs->problem_mps->NbTerm = NULL; | ||
problem_srs->problem_mps->B = NULL; | ||
problem_srs->problem_mps->SensDeLaContrainte = NULL; | ||
problem_srs->problem_mps->VariablesDualesDesContraintes = NULL; | ||
problem_srs->problem_mps->TypeDeVariable = NULL; | ||
problem_srs->problem_mps->TypeDeBorneDeLaVariable = NULL; | ||
problem_srs->problem_mps->U = NULL; | ||
problem_srs->problem_mps->L = NULL; | ||
problem_srs->problem_mps->Umin = NULL; | ||
problem_srs->problem_mps->Umax = NULL; | ||
problem_srs->problem_mps->LabelDeLaVariable = NULL; | ||
|
||
PROBLEME_MPS* mps = (PROBLEME_MPS *)malloc(sizeof(PROBLEME_MPS)); | ||
mps->LabelDeLObjectif = NULL; | ||
mps->NbVar = 0; | ||
mps->NbCnt = 0; | ||
mps->Msui = NULL; | ||
mps->Mder = NULL; | ||
mps->Nuvar = NULL; | ||
mps->BRange = NULL; | ||
mps->LabelDeLaContrainte = NULL; | ||
mps->LabelDuSecondMembre = NULL; | ||
mps->A = NULL; | ||
mps->Mdeb = NULL; | ||
mps->NbTerm = NULL; | ||
mps->B = NULL; | ||
mps->SensDeLaContrainte = NULL; | ||
mps->VariablesDualesDesContraintes = NULL; | ||
mps->TypeDeVariable = NULL; | ||
mps->TypeDeBorneDeLaVariable = NULL; | ||
mps->U = NULL; | ||
mps->L = NULL; | ||
mps->Umin = NULL; | ||
mps->Umax = NULL; | ||
mps->LabelDeLaVariable = NULL; | ||
mps->objective_offset = 0; | ||
|
||
problem_srs->problem_mps = mps; | ||
return 0; | ||
} | ||
|
||
|
@@ -160,7 +163,6 @@ SRS_PROBLEM * SRScreateprob() { | |
problem_srs->read_an_mps = false; | ||
problem_srs->is_mip = false; | ||
problem_srs->maximize = false; | ||
problem_srs->objective_offset = 0; | ||
//params | ||
problem_srs->verboseSpx = 0; | ||
problem_srs->verbosePne = 0; | ||
|
@@ -229,7 +231,7 @@ int SRSwritempsprob(PROBLEME_MPS * problem_mps, const char * fileName) { | |
PROBLEME_A_RESOUDRE problem_a_resoudre; | ||
PROBLEME_PNE problem_pne; | ||
PNE_copy_problem(problem_mps, &problem_a_resoudre, 0, 0.0); | ||
//FIXME PNE_EcrireJeuDeDonneesMPS_avecNom(&problem_pne, &problem_a_resoudre, fileName); | ||
PNE_EcrireJeuDeDonneesMPS_avecNom(&problem_pne, &problem_a_resoudre, fileName); | ||
|
||
return 0; | ||
} | ||
|
@@ -478,7 +480,7 @@ int SRSgetobjval(SRS_PROBLEM * problem_srs, double * objVal) { | |
if (problem_srs->maximize) | ||
(*objVal) *= -1.; | ||
|
||
*objVal += problem_srs->objective_offset; | ||
*objVal += problem_mps->objective_offset; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line should be before line 480 to take into account the min/max There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, not really
|
||
|
||
return 0; | ||
} | ||
|
@@ -734,13 +736,13 @@ int SRSchgrangeval(SRS_PROBLEM * problem_srs, size_t nbRowIndexes, const int * r | |
|
||
int SRSsetobjoffset(SRS_PROBLEM* problem_srs, double value) | ||
{ | ||
problem_srs->objective_offset = value; | ||
problem_srs->problem_mps->objective_offset = value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should take into account the maximize attribute value |
||
return 0; | ||
} | ||
|
||
double SRSgetobjoffset(const SRS_PROBLEM* problem_srs) | ||
{ | ||
return problem_srs->objective_offset; | ||
return problem_srs->problem_mps->objective_offset; | ||
} | ||
|
||
int SRScopyvarboundstype(SRS_PROBLEM * problem_srs, int * varBoundsTypeValues) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take into account the maximize attribute value