Skip to content

Commit a9bd1eb

Browse files
committed
add dec file
1 parent 9f7e376 commit a9bd1eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

solvers/gcgmp/gcgmpbackend.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ pre::ValueMapDbl GcgBackend::DualSolution() {
102102
ArrayRef<double> GcgBackend::DualSolution_LP() {
103103
int num_cons = NumLinCons();
104104
std::vector<double> pi(num_cons);
105-
// int error = GCG_GetLpSolution(lp(), NULL, NULL, pi.data(), NULL);
106-
int error = 0;
107-
if (error)
108-
pi.clear();
105+
if (SCIPisDualSolAvailable(getSCIP(), TRUE)) {
106+
for (int i=0; i < num_cons; i++)
107+
GCG_CCALL( SCIPgetDualSolVal(getSCIP(), getPROBDATA()->linconss[i], pi.data() + i, NULL) );
108+
}
109109
return pi;
110110
}
111111

@@ -137,6 +137,8 @@ void GcgBackend::SetInterrupter(mp::Interrupter *inter) {
137137
}
138138

139139
void GcgBackend::Solve() {
140+
InputDecomposition();
141+
140142
if (!storedOptions_.exportFile_.empty())
141143
ExportModel(storedOptions_.exportFile_);
142144
if (!storedOptions_.paramRead_.empty())
@@ -147,8 +149,6 @@ void GcgBackend::Solve() {
147149
GCG_CCALL( SCIPsetSeparating(getSCIP(), (SCIP_PARAMSETTING)storedOptions_.cuts_, TRUE) );
148150
if (storedOptions_.presolvings_ != 0)
149151
GCG_CCALL( SCIPsetSeparating(getSCIP(), (SCIP_PARAMSETTING)storedOptions_.presolvings_, TRUE) );
150-
151-
InputDecomposition();
152152

153153
GCG_CCALL(GCGsolve(getSCIP()));
154154

0 commit comments

Comments
 (0)