Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: Container Registry, Job Artifacs,. Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

### using explicit template instantiation (and other methods) to increase build granularity

parent e2499d4b
 ... ... @@ -67,15 +67,15 @@ for (@\$integral_indexes) { #print "@\$labels\n"; #print "@\$restr_labels\n"; # calculating the wanted data: print "Mixed Integer Convex Hull:\n"; my \$mint_hull = mixed_integer_hull(\$import, \$integral_indexes); \$mint_hull->COORDINATE_LABELS = \$import->COORDINATE_LABELS; print "Mixed Integer Convex Hull:\n"; print_constraints(\$mint_hull); print "Integral Coordinate Projection Convex Hull\n"; my \$proj = projection(\$import, \$integral_indexes); my \$proj_hull = integer_hull(\$proj); \$proj_hull->COORDINATE_LABELS = \$restr_labels; print "Integral Coordinate Projection Convex Hull\n"; print_constraints(\$proj_hull); #print "check: Integral Coordinate Projection of MI Convex Hull\n"; ... ...
 ... ... @@ -3,6 +3,7 @@ #include "../Common/integrality.h" enum opt_dir : int {max = 1, fix = 0, min = -1}; class Attribute{ ... ... @@ -11,7 +12,7 @@ class Attribute{ integrality _integrality; double _value; public: Attribute(opt_dir optimization_direction, double attribute, integrality integrality = Continuous); Attribute(opt_dir optimization_direction = fix, double attribute = 0, integrality integrality = Continuous); opt_dir& optimization_direction(); bool is_dependent(); ... ...
 #ifndef GRAPH_H #define GRAPH_H #include #include #include #include #include #include #include #include #include "Edge.h" #include "Node.h" template class Graph{ std::set*> _edges; std::set*> _nodes; std::map _template_node_attributes; std::map _template_edge_attributes; public: // TODO: use references to speed up constructors Graph(){}; Graph(std::map default_values_edge_attributes, std::map default_values_node_attributes = {}); Graph(Graph& graph); Graph(Graph&& graph); Edge* add_edge(Node* from, Node* to, std::map edge_attributes = {}, std::string description = ""); Edge* add_edge(Node* from, Node* to, std::map edge_attributes = {}, std::string description = ""); Edge* add_edge(Edge* remote_edge, std::map*, Node*>& node_lookup); Node* add_node(std::map node_attributes = {}, std::string description = ""); Node* add_node(std::map node_attributes = {}, std::string description = ""); Node* add_node(Node* remote_node); void remove_node(Node* node); void remove_edge(Edge* edge); // change to non reference return type? std::set*>& edges(){ return this->_edges; } std::set*>& nodes(){ return this->_nodes; } Attribute node_template(E attr){ return this->_templatNode_attributes.find(attr)->second; } Attribute edge_template(E attr){ return this->_template_edge_attributes.find(attr)->second; } void reset_attribute_values(std::set edge_attr, std::set node_attr = {}); std::pair size(){ return {this->_nodes.size(), this->_edges.size()}; } ~Graph(){ while(this->nodes().begin() != this->nodes().end()){ this->remove_node(*this->nodes().begin()); } } // _advanced.cpp: void conditional_bfs_all_components(std::function* from, Edge* via, bool used_in_traversal)> edge_exec, std::function*)> node_exec,std::function* from, Edge* via)> guide = [](Node* n, Edge* e)->bool {return e->from() == n;}); // _special_members_and_operators: void operator=(Graph& graph); void operator=(Graph&& graph); }; template std::ostream& operator<<(std::ostream& os, Graph& g); #include "Basic_Graph.ipp" #include "Basic_Graph_advanced.ipp" #include "Basic_Graph_special_members_and_operators.ipp" #endif
 ... ... @@ -23,7 +23,7 @@ class Edge{ public: Edge(Edge& local_edge) : _description(local_edge._description), _from(local_edge._from), _to(local_edge._to), _attributes(local_edge._attributes) {} Edge(Edge& remote_edge, std::map*, Node*>& node_lookup) : _description(remote_edge._description), _from(node_lookup.find(remote_edge._from)->second), _to(node_lookup.find(remote_edge._from)->second), _attributes(remote_edge._attributes) {} Edge(Node* from, Node* to, std::string description = "") : _description(description), _from(from), _to(to){ from->add_incident(this); to->add_incident(this); ... ... @@ -85,6 +85,5 @@ public: template std::ostream& operator<<(std::ostream& os, Edge& e); #include "Edge.ipp" #endif
 ... ... @@ -26,6 +26,5 @@ public: void operator>>(std::map& var); }; #include "random_attribute_generator.ipp" #endif
 #ifndef RANDOM_GRAPH_GENERATOR #define RANDOM_GRAPH_GENERATOR #include #include #include #include #include "../Basic_Graph.h" #include "../Graph.h" #include "../../Common/random_set_element_generator.h" #include "random_attribute_generator.h" ... ... @@ -28,4 +31,5 @@ public: static std::pair*>, std::vector*>>> grow_random_acyclic(Graph& g, size_t number_of_nodes, size_t number_of_edges, random_attribute_generator& edge_attribute_generator, random_attribute_generator& node_attribute_generator); }; #include "random_graph_generator.ipp" #endif
 ... ... @@ -4,8 +4,8 @@ random_graph_generator::random_graph_generator(std::map defaul template Graph random_graph_generator::next_acyclic(){ Graph g (this->default_values_edge_attributes, this->default_values_edge_attributes); while(!random_graph_generator::grow_random_acyclic(g, this->_number_of_nodes, this->_number_of_edges, this->_edge_generator, this->_node_generator)){ Graph g (this->_default_values_edge_attributes, this->_default_values_node_attributes); while(!random_graph_generator::grow_random_acyclic(g, this->_number_of_nodes, this->_number_of_edges, this->_edge_generator, this->_node_generator).first){ std::cout << "generation failed; retrying!" << std::endl; } return g; ... ... @@ -13,8 +13,8 @@ Graph random_graph_generator::next_acyclic(){ template Graph random_graph_generator::next(){ Graph g (this->default_values_edge_attributes, this->default_values_edge_attributes); while(!random_graph_generator::grow_random(g, this->_number_of_nodes, this->_number_of_edges, this->_edge_generator, this->_node_generator)){ Graph g (this->_default_values_edge_attributes, this->_default_values_node_attributes); while(!random_graph_generator::grow_random(g, this->_number_of_nodes, this->_number_of_edges, this->_edge_generator, this->_node_generator).first){ std::cout << "generation failed; retrying!" << std::endl; } return g; ... ... @@ -26,7 +26,7 @@ std::pair*, Node*>,Graph> random_graph_generator_number_of_nodes, this->_number_of_edges, this->_edge_generator, this->_node_generator).first){ std::cout << "generation failed; retrying!" << std::endl; } auto tips = tip_fringes(g, this->_edge_generator, this->_node_generator); auto tips = g.tip_fringes(this->_edge_generator, this->_node_generator); return {tips, std::move(g)}; } ... ... @@ -59,7 +59,7 @@ std::pair*>, std::vector*>>> ran } { auto existing_path = directed_admissible_st_path(g, n1, n2); auto existing_path = Path::directed_admissible_st_path(n1, n2); if(existing_path.first && existing_path.second.number_of_edges() <= 1) { attempt++; goto redo; ... ... @@ -113,7 +113,7 @@ std::pair*>, std::vector*>>> ran goto failed; } if(n1 == n2 || directed_admissible_st_path(g, n2, n1).first || directed_admissible_st_path(g, n1, n2).second.number_of_edges() == 1) { if(n1 == n2 || Path::directed_admissible_st_path(n2, n1).first || Path::directed_admissible_st_path(n1, n2).second.number_of_edges() == 1) { attempt++; goto redo; } ... ...
 #ifndef GRAPH_EXPORT #define GRAPH_EXPORT #ifndef GRAPH_H #define GRAPH_H #include "Basic_Graph.h" #include #include #include #include #include #include #include #include #include "Edge.h" #include "Node.h" #include "Path.h" #include "Graph_Operations/path_operations.ipp" #include "Graph_Operations/fringe_graph_operations.ipp" #include "Graph_Operations/flow_algorithms.ipp" #include "Generators/random_attribute_generator.h" template class Graph; template std::ostream& operator<<(std::ostream& os, Graph& g); template class Graph{ std::set*> _edges; std::set*> _nodes; std::map _template_node_attributes; std::map _template_edge_attributes; public: // TODO: use references to speed up constructors Graph(){}; Graph(std::map default_values_edge_attributes, std::map default_values_node_attributes = {}); Graph(Graph& graph); Graph(Graph&& graph); Edge* add_edge(Node* from, Node* to, std::map edge_attributes = {}, std::string description = ""); Edge* add_edge(Node* from, Node* to, std::map edge_attributes = {}, std::string description = ""); Edge* add_edge(Edge* remote_edge, std::map*, Node*>& node_lookup); Node* add_node(std::map node_attributes = {}, std::string description = ""); Node* add_node(std::map node_attributes = {}, std::string description = ""); Node* add_node(Node* remote_node); void remove_node(Node* node); void remove_edge(Edge* edge); // change to non reference return type? std::set*>& edges(){ return this->_edges; } std::set*>& nodes(){ return this->_nodes; } Attribute node_template(N attr){ return this->_template_node_attributes.find(attr)->second; } Attribute edge_template(E attr){ return this->_template_edge_attributes.find(attr)->second; } void reset_attribute_values(std::set edge_attr, std::set node_attr = {}); std::pair size(){ return {this->_nodes.size(), this->_edges.size()}; } ~Graph(){ while(this->nodes().begin() != this->nodes().end()){ this->remove_node(*this->nodes().begin()); } } // _advanced.cpp: void conditional_bfs_all_components( std::function* from, Edge* via, bool used_in_traversal)> edge_exec, std::function*)> node_exec, std::function* from, Edge* via)> guide = [](Node* n, Edge* e)->bool {return e->from() == n;} ); // _selections.cpp; // finges std::vector*> select_terminals(); Node* tip_terminals( random_attribute_generator& edge_attribute_generator = random_attribute_generator({}), random_attribute_generator& node_attribute_generator = random_attribute_generator({}) ); std::vector*> select_sources(); Node* tip_sources( random_attribute_generator& edge_attribute_generator = random_attribute_generator({}), random_attribute_generator& node_attribute_generator = random_attribute_generator({}) ); std::pair*, Node*> tip_fringes( random_attribute_generator& edge_attribute_generator = random_attribute_generator({}), random_attribute_generator& node_attribute_generator = random_attribute_generator({}) ); // _flow_alg.ipp double ford_fulkerson(Node* s, Node* t, E opt_attr, E lower_limit_attr, E upper_limit_attr); // _special_members_and_operators: void operator=(Graph& graph); void operator=(Graph&& graph); // io: friend std::ostream& operator<< (std::ostream& os, Graph& g); }; #endif
 template double ford_fulkerson(Graph& g, Node* s, Node* t, E opt_attr, E lower_limit_attr, E upper_limit_attr){ double value; while(true){ auto path = directed_admissible_st_path(g, s,t, opt_attr, lower_limit_attr, upper_limit_attr); if(!path.first) break; value += augment_edges_along_path(path.second, opt_attr, lower_limit_attr, upper_limit_attr); } return value; }
 template void Graph::conditional_bfs_all_components(std::function* from, Edge* via, bool used_in_traversal)> edge_exec, std::function*)> node_exec,std::function* from, Edge* via)> guide){ /* ... ...
 ... ... @@ -2,8 +2,8 @@ template Graph::Graph(std::map default_values_edge_attributes, std::map default_values_node_attributes) : _template_node_attributes(default_values_node_attributes), _template_edge_attributes(default_values_edge_attributes){} template Edge* Graph::add_edge(Node* from, Node* to, std::map edge_attributes, std::string description){ Edge* ptr = new Edge(from, to, edge_attributes, description); Edge* Graph::add_edge(Node* from, Node* to, std::map edge_attributes_ignore_defaults, std::string description){ Edge* ptr = new Edge(from, to, edge_attributes_ignore_defaults, {}, description); this->edges().insert(ptr); return ptr; } ... ... @@ -23,8 +23,8 @@ Edge* Graph::add_edge(Edge* remote_edge, std::map*, Nod } template Node* Graph::add_node(std::map node_attributes, std::string description){ Node* ptr = new Node(node_attributes, description); Node* Graph::add_node(std::map node_attributes_ignore_defaults, std::string description){ Node* ptr = new Node(node_attributes_ignore_defaults, {}, description); this->nodes().insert(ptr); return ptr; } ... ...
 template double Graph::ford_fulkerson(Node* s, Node* t, E opt_attr, E lower_limit_attr, E upper_limit_attr){ double value; while(true){ auto path = Path::directed_admissible_st_path(s,t, opt_attr, lower_limit_attr, upper_limit_attr); if(!path.first) break; value += path.second.augment_edges_along_path(this->edge_template(opt_attr).optimization_direction(), opt_attr, lower_limit_attr, upper_limit_attr); } return value; }
 #include #include "../Generators/random_attribute_generator.h" #include "Generators/random_attribute_generator.h" /* terminals */ template bool is_terminal(Node* node){ for(Edge* e : node->incident()){ if(node == e->from()) return false; } return true; } template std::vector*> select_terminals(Graph& g){ std::vector*> Graph::select_terminals(){ std::vector*> terminals; for(Node* n : g.nodes()){ if(is_terminal(n)){ for(Node* n : this->_nodes){ if(n->is_terminal()){ terminals.push_back(n); } } ... ... @@ -25,36 +18,31 @@ std::vector*> select_terminals(Graph& g){ } template Node* tip_terminals(Graph& g, random_attribute_generator& edge_attribute_generator = random_attribute_generator({}), random_attribute_generator& node_attribute_generator = random_attribute_generator({})){ std::vector*> terminals = select_terminals(g); Node* Graph::tip_terminals( random_attribute_generator& edge_attribute_generator, random_attribute_generator& node_attribute_generator ){ std::vector*> terminals = this->select_terminals(); std::stringstream name; name << g.size().first; Node* t = g.add_node(node_attribute_generator.next(), name.str()); name << this->size().first; Node* t = this->add_node(node_attribute_generator.next(), name.str()); for(Node* n : terminals){ std::stringstream name; name << n->description() << "_" << t->description(); g.add_edge(n, t, edge_attribute_generator.next(), name.str()); this->add_edge(n, t, edge_attribute_generator.next(), name.str()); } return t; } /* sources */ template bool is_source(Node* node){ for(Edge* e : node->incident()){ if(node == e->to()) return false; } return true; } template std::vector*> select_sources(Graph& g){ std::vector*> Graph::select_sources(){ std::vector*> sources; for(Node* n : g.nodes()){ if(is_source(n)){ for(Node* n : this->nodes()){ if(n->is_source()){ sources.push_back(n); } } ... ... @@ -62,27 +50,33 @@ std::vector*> select_sources(Graph& g){ } template Node* tip_sources(Graph& g, random_attribute_generator& edge_attribute_generator = random_attribute_generator({}), random_attribute_generator& node_attribute_generator = random_attribute_generator({})){ std::vector*> sources = select_sources(g); Node* Graph::tip_sources( random_attribute_generator& edge_attribute_generator, random_attribute_generator& node_attribute_generator ){ std::vector*> sources = this->select_sources(); std::stringstream name; name << g.size().first; Node* s = g.add_node(node_attribute_generator.next(), name.str()); name << this->size().first; Node* s = this->add_node(node_attribute_generator.next(), name.str()); for(Node* n : sources){ std::stringstream name; name << s->description() << "_" << n->description(); g.add_edge(s, n, edge_attribute_generator.next(), name.str()); this->add_edge(s, n, edge_attribute_generator.next(), name.str()); } return s; } /* tandem */ template std::pair*, Node*> tip_fringes(Graph& g, random_attribute_generator& edge_attribute_generator = random_attribute_generator({}), random_attribute_generator& node_attribute_generator = random_attribute_generator({})){ std::pair*, Node*> Graph::tip_fringes( random_attribute_generator& edge_attribute_generator, random_attribute_generator& node_attribute_generator ){ std::pair*, Node*> tips; tips.first = tip_sources(g, edge_attribute_generator, node_attribute_generator); tips.second = tip_terminals(g, edge_attribute_generator, node_attribute_generator); tips.first = this->tip_sources(edge_attribute_generator, node_attribute_generator); tips.second = this->tip_terminals(edge_attribute_generator, node_attribute_generator); return tips; }
 #ifndef GRAPH_EXPORT #define GRAPH_EXPORT #include "Graph.h" #include "Generators/random_attribute_generator.h" #include "Generators/random_graph_generator.h" #endif
 #include "Graphtheory.h" #include "Edge.ipp" #include "Node.ipp" #include "Path.ipp" #include "Path_dops.ipp" #include "Graph_basics.ipp" #include "Graph_advanced.ipp" #include "Graph_special_members_and_operators.ipp" #include "Graph_selections.ipp" #include "Graph_flow_alg.ipp" #include "Generators/random_attribute_generator.ipp" #include "Generators/random_graph_generator.ipp"
 ... ... @@ -56,11 +56,18 @@ public: delete *this->incident().begin(); } } /* derived properties */ bool is_source(); bool is_terminal(); }; template std::ostream& operator<<(std::ostream& os, Node& n); #include "Node.ipp" #endif
 template bool Node::is_source(){ for(Edge* e : this->incident()){ if(this == e->to()) return false; } return true; } template bool Node::is_terminal(){ for(Edge* e : this->incident()){ if(this == e->from()) return false; } return true; } template std::ostream& operator<<(std::ostream& os, Node& n){ os << "\033[0;36m"; ... ...
 ... ... @@ -6,19 +6,17 @@ #include #include template class Graph; template class Path{ Graph* _owner; Node* _first; Node* _last; std::list*> _edges; public: Path(Graph* g, std::list*> edges) : _owner(g), _edges(edges){} Path(Graph* g, std::map*, Edge*>& successor_matrix, Node* start, bool invert_order = true);