Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
ProblemFormat.h
1#pragma once
2
3#include <stdexcept>
4#include <string>
5
6enum class ProblemsFormat
7{
8 MPS_FILE,
9 SAVED_FILE
10};
11
12inline ProblemsFormat problemsFormatFromString(const std::string& str)
13{
14 if (str == "MPS")
15 {
16 return ProblemsFormat::MPS_FILE;
17 }
18 else if (str == "SAVED")
19 {
20 return ProblemsFormat::SAVED_FILE;
21 }
22 else
23 {
24 throw std::runtime_error("Unknown ProblemsFormat: " + str);
25 }
26}