@@ -102,10 +102,10 @@ pre::ValueMapDbl GcgBackend::DualSolution() {
102
102
ArrayRef<double > GcgBackend::DualSolution_LP () {
103
103
int num_cons = NumLinCons ();
104
104
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
+ }
109
109
return pi ;
110
110
}
111
111
@@ -137,6 +137,8 @@ void GcgBackend::SetInterrupter(mp::Interrupter *inter) {
137
137
}
138
138
139
139
void GcgBackend::Solve () {
140
+ InputDecomposition ();
141
+
140
142
if (!storedOptions_.exportFile_ .empty ())
141
143
ExportModel (storedOptions_.exportFile_ );
142
144
if (!storedOptions_.paramRead_ .empty ())
@@ -147,8 +149,6 @@ void GcgBackend::Solve() {
147
149
GCG_CCALL ( SCIPsetSeparating (getSCIP (), (SCIP_PARAMSETTING)storedOptions_.cuts_ , TRUE ) );
148
150
if (storedOptions_.presolvings_ != 0 )
149
151
GCG_CCALL ( SCIPsetSeparating (getSCIP (), (SCIP_PARAMSETTING)storedOptions_.presolvings_ , TRUE ) );
150
-
151
- InputDecomposition ();
152
152
153
153
GCG_CCALL (GCGsolve (getSCIP ()));
154
154
0 commit comments