File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 B (MSK_makeemptytask); \
1919 B (MSK_deletetask); \
2020 B (MSK_writedata); \
21- B (MSK_writesolutionfile); \
21+ B (MSK_writesolution); \
2222 B (MSK_appendvars); \
2323 B (MSK_getnumvar); \
2424 B (MSK_putvartype); \
Original file line number Diff line number Diff line change @@ -184,14 +184,23 @@ void MOSEKModel::close()
184184void MOSEKModel::write (const std::string &filename)
185185{
186186 bool is_solution = false ;
187- if (filename.ends_with (" .sol" ) || filename.ends_with (" .bas" ) || filename.ends_with (" .int" ))
187+ if (filename.ends_with (" .sol" ) || filename.ends_with (" .bas" ) || filename.ends_with (" .int" ) ||
188+ filename.ends_with (" .jsol" ))
188189 {
189190 is_solution = true ;
190191 }
191192 MSKrescodee error;
192193 if (is_solution)
193194 {
194- error = mosek::MSK_writesolutionfile (m_model.get (), filename.c_str ());
195+ if (m_soltype)
196+ {
197+ error = mosek::MSK_writesolution (m_model.get (), m_soltype.value (), filename.c_str ());
198+ }
199+ else
200+ {
201+ throw std::runtime_error (
202+ " Solution type is unavailable. Please optimize before writing solution." );
203+ }
195204 }
196205 else
197206 {
You can’t perform that action at this time.
0 commit comments