#ifndef __READERLP_MODEL_HPP__ #define __READERLP_MODEL_HPP__ #include #include #include #include enum class VariableType { CONTINUOUS, BINARY, GENERAL, SEMICONTINUOUS, SEMIINTEGER }; enum class ObjectiveSense { MIN, MAX }; struct Variable { VariableType type = VariableType::CONTINUOUS; double lowerbound = 0.0; double upperbound = std::numeric_limits::infinity(); std::string name; Variable(std::string n = "") : name(n){}; }; struct LinTerm { std::shared_ptr var; double coef = 1.0; }; struct QuadTerm { std::shared_ptr var1; std::shared_ptr var2; double coef = 1.0; }; struct Expression { std::vector> linterms; std::vector> quadterms; double offset = 0.0; std::string name = ""; }; struct Constraint { double lowerbound = -std::numeric_limits::infinity(); double upperbound = std::numeric_limits::infinity(); std::shared_ptr expr; Constraint() : expr(std::shared_ptr(new Expression)){}; }; struct SOS { std::string name = ""; short type = 0; // 1 or 2 std::vector, double>> entries; }; struct Model { std::shared_ptr objective; ObjectiveSense sense; std::vector> constraints; std::vector> variables; std::vector> soss; }; #endif