Commit 86abae54 authored by jonasseidel's avatar jonasseidel
Browse files

misc

parent d1bb6aad
......@@ -40,5 +40,14 @@ int main(){
Graph g2 (ifs_graph);
std::cout << g2 << std::endl;
while(true){
Graph g_mem_leak({{"Flow", Attribute(max, 0)}, {"Lower", Attribute(fix, 0)}, {"Upper", Attribute(fix, 1)} });
while(!random_graph_generator::grow_random_acyclic(g_mem_leak, 20, 40, rand_gen_edge, rand_gen_node).first){
std::cout << "failed attempt" << std::endl;
};
}
// look mum no leak!
return 0;
}
......@@ -3,21 +3,22 @@
#include <iostream>
int main(){
auto var1 = new Variable("x1", Continuous, {true, 0});
auto var2 = new Variable("x2", Continuous, {true, 0});
auto var3 = new Variable("x3", Continuous, {false,0}, {true, 6});
std::vector<boost::bimap<Variable*, size_t>::value_type> v = {{var1, 0}, {var2, 1}, {var3, 2}};
Linear_Program lp ("test", true, {{var1, 1}, {var2, -2}}, Polyeder({Constraint("1", Equality, {{var1, 1}, {var3, -1}}, 0), Constraint("2", Inequality, {{var1, 1}, {var2, 1}, {var3, 1}}, 1), Constraint("3", Inequality, {{var1, -1}, {var3, -1}}, 5)}, {v.begin(), v.end()}));
while(true){
auto var1 = new Variable("x1", Continuous, {true, 0});
auto var2 = new Variable("x2", Continuous, {true, 0});
auto var3 = new Variable("x3", Continuous, {false,0}, {true, 6});
std::vector<boost::bimap<Variable*, size_t>::value_type> v = {{var1, 0}, {var2, 1}, {var3, 2}};
Linear_Program lp ("test", true, {{var1, 1}, {var2, -2}}, Polyeder({Constraint("1", Equality, {{var1, 1}, {var3, -1}}, 0), Constraint("2", Inequality, {{var1, 1}, {var2, 1}, {var3, 1}}, 1), Constraint("3", Inequality, {{var1, -1}, {var3, -1}}, 5)}, {v.begin(), v.end()}));
std::cout << lp << std::endl;
SCIP* model = lp.computational_model().first;
SCIPwriteOrigProblem(model, NULL, NULL, false);
SCIPsolve(model);
auto dual = lp.relaxation_dual();
std::cout << dual << std::endl;
SCIP* dual_model = dual.computational_model().first;
SCIPwriteOrigProblem(dual_model, NULL, NULL, false);
SCIPsolve(dual_model);
std::cout << lp << std::endl;
SCIP* model = lp.computational_model().first;
SCIPwriteOrigProblem(model, NULL, NULL, false);
SCIPsolve(model);
auto dual = lp.relaxation_dual();
std::cout << dual << std::endl;
SCIP* dual_model = dual.computational_model().first;
SCIPwriteOrigProblem(dual_model, NULL, NULL, false);
SCIPsolve(dual_model);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment