Files
ortools-clone/docs/cpp_graph/io_8h_source.html

84 lines
57 KiB
HTML
Raw Normal View History

2019-06-13 15:36:14 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OR-Tools</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
2019-06-20 23:08:48 +02:00
<link rel="stylesheet" type="text/css" href="ortools.css" title="default" media="screen,print" />
2019-06-13 15:36:14 +02:00
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
2019-06-29 18:18:08 +02:00
<span id="sfml">OR-Tools 7.2</span>
2019-06-13 15:36:14 +02:00
</div>
</div>
2019-06-29 18:18:08 +02:00
<link rel="icon" href="https://developers.google.com/optimization/images/orLogo.png">
2019-06-13 15:36:14 +02:00
<div id="content">
<!-- Generated by Doxygen 1.8.15 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
2019-07-12 13:25:23 -07:00
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('io_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
2019-06-13 15:36:14 +02:00
<div class="header">
<div class="headertitle">
<div class="title">io.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="io_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright 2010-2018 Google LLC</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// limitations under the License.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// A collections of i/o utilities for the Graph classes in ./graph.h.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="preprocessor">#ifndef UTIL_GRAPH_IO_H_</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#define UTIL_GRAPH_IO_H_</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;numeric&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;absl/strings/numbers.h&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;absl/strings/str_cat.h&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;absl/strings/str_format.h&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno">
<div class="ttc" id="namespaceutil_html"><div class="ttname"><a href="namespaceutil.html">util</a></div><div class="ttdoc">Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in c...</div><div class="ttdef"><b>Definition:</b> <a href="connected__components_8h_source.html#l00056">connected_components.h:56</a></div></div>
<div class="ttc" id="namespaceutil_html_a9c5c6763e52cd1465a3e1a3ab2437e37"><div class="ttname"><a href="namespaceutil.html#a9c5c6763e52cd1465a3e1a3ab2437e37">util::ReadGraphFile</a></div><div class="ttdeci">***util::StatusOr&lt; Graph * &gt; ReadGraphFile(const std::string &amp;filename, bool directed, std::vector&lt; int &gt; *num_nodes_with_color_or_null)</div><div class="ttdef"><b>Definition:</b> <a href="io_8h_source.html#l00132">io.h:132</a></div></div>
<div class="ttc" id="namespaceutil_html_ae76339cb2dcd3bc05ad762146f91fdda"><div class="ttname"><a href="namespaceutil.html#ae76339cb2dcd3bc05ad762146f91fdda">util::Graph</a></div><div class="ttdeci">ListGraph Graph</div><div class="ttdoc">Defining the simplest Graph interface as Graph for convenience.</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l02358">graph.h:2358</a></div></div>
<div class="ttc" id="classutil_1_1BaseGraph_html_a0f551c921fa0b5aaa334a6e36f61db4a"><div class="ttname"><a href="classutil_1_1BaseGraph.html#a0f551c921fa0b5aaa334a6e36f61db4a">util::BaseGraph::num_nodes</a></div><div class="ttdeci">NodeIndexType num_nodes() const</div><div class="ttdoc">Returns the number of valid nodes in the graph.</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00201">graph.h:201</a></div></div>
<div class="ttc" id="namespaceutil_html_affed79554a202aaa8bda5b5e98c3a6b2"><div class="ttname"><a href="namespaceutil.html#affed79554a202aaa8bda5b5e98c3a6b2">util::GraphToString</a></div><div class="ttdeci">std::string GraphToString(const Graph &amp;graph, GraphToStringFormat format)</div><div class="ttdoc">Implementations of the templated methods.</div><div class="ttdef"><b>Definition:</b> <a href="io_8h_source.html#l00107">io.h:107</a></div></div>
<div class="ttc" id="namespaceutil_html_a6600986f328a49c9485aa03fb6c82946"><div class="ttname"><a href="namespaceutil.html#a6600986f328a49c9485aa03fb6c82946">util::WriteGraphToFile</a></div><div class="ttdeci">util::Status WriteGraphToFile(const Graph &amp;graph, const std::string &amp;filename, bool directed, const std::vector&lt; int &gt; &amp;num_nodes_with_color)</div><div class="ttdoc">Writes a graph to the &quot;.g&quot; file format described above.</div><div class="ttdef"><b>Definition:</b> <a href="io_8h_source.html#l00223">io.h:223</a></div></div>
<div class="ttc" id="classutil_1_1BaseGraph_html_a0eba6e5899924388644dfa2258ae8929"><div class="ttname"><a href="classutil_1_1BaseGraph.html#a0eba6e5899924388644dfa2258ae8929">util::BaseGraph&lt; NodeIndexType, ArcIndexType, false &gt;::ArcIndex</a></div><div class="ttdeci">ArcIndexType ArcIndex</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00190">graph.h:190</a></div></div>
<div class="ttc" id="classutil_1_1ListGraph_html_ad7d3d076d3c154d89f1eda855a34b487"><div class="ttname"><a href="classutil_1_1ListGraph.html#ad7d3d076d3c154d89f1eda855a34b487">util::ListGraph::Head</a></div><div class="ttdeci">NodeIndexType Head(ArcIndexType arc) const</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l01114">graph.h:1114</a></div></div>
<div class="ttc" id="classutil_1_1ListGraph_html_ab63770fa993b9347586d2852b841bdc2"><div class="ttname"><a href="classutil_1_1ListGraph.html#ab63770fa993b9347586d2852b841bdc2">util::ListGraph::OutgoingArcs</a></div><div class="ttdeci">BeginEndWrapper&lt; OutgoingArcIterator &gt; OutgoingArcs(NodeIndexType node) const</div><div class="ttdoc">Allows to iterate over the forward arcs that verify Tail(arc) == node.</div></div>
<div class="ttc" id="graph_8h_html"><div class="ttname"><a href="graph_8h.html">graph.h</a></div></div>
<div class="ttc" id="classutil_1_1BaseGraph_html_a32ba4a5ca9a4b89f750eb2dc56518b02"><div class="ttname"><a href="classutil_1_1BaseGraph.html#a32ba4a5ca9a4b89f750eb2dc56518b02">util::BaseGraph::AllNodes</a></div><div class="ttdeci">IntegerRange&lt; NodeIndex &gt; AllNodes() const</div><div class="ttdoc">Allows nice range-based for loop: for (const NodeIndex node : graph.AllNodes()) { ....</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00929">graph.h:929</a></div></div>
<div class="ttc" id="classutil_1_1BaseGraph_html_aefb468e4d4a3128c91b3bad9f5b314c8"><div class="ttname"><a href="classutil_1_1BaseGraph.html#aefb468e4d4a3128c91b3bad9f5b314c8">util::BaseGraph::num_arcs</a></div><div class="ttdeci">ArcIndexType num_arcs() const</div><div class="ttdoc">Returns the number of valid arcs in the graph.</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00204">graph.h:204</a></div></div>
<div class="ttc" id="namespaceutil_html_ae705e1342dacc10a13fb3f11f91d0696acac9245da1bf36d1d9382dc579e1a4fd"><div class="ttname"><a href="namespaceutil.html#ae705e1342dacc10a13fb3f11f91d0696acac9245da1bf36d1d9382dc579e1a4fd">util::PRINT_GRAPH_ARCS</a></div><div class="ttdoc">One arc per line, eg. &quot;3-&gt;1&quot;.</div><div class="ttdef"><b>Definition:</b> <a href="io_8h_source.html#l00040">io.h:40</a></div></div>
<div class="ttc" id="classutil_1_1BaseGraph_html_adb271cf4bcf2de5b5bbe300d7054af29"><div class="ttname"><a href="classutil_1_1BaseGraph.html#adb271cf4bcf2de5b5bbe300d7054af29">util::BaseGraph&lt; NodeIndexType, ArcIndexType, false &gt;::NodeIndex</a></div><div class="ttdeci">NodeIndexType NodeIndex</div><div class="ttdoc">Typedef so you can use Graph::NodeIndex and Graph::ArcIndex to be generic but also to improve the rea...</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00189">graph.h:189</a></div></div>
<div class="ttc" id="namespaceutil_html_ae705e1342dacc10a13fb3f11f91d0696aaed5759e3b6e3a8592c9a21e0048b565"><div class="ttname"><a href="namespaceutil.html#ae705e1342dacc10a13fb3f11f91d0696aaed5759e3b6e3a8592c9a21e0048b565">util::PRINT_GRAPH_ADJACENCY_LISTS</a></div><div class="ttdoc">One space-separated adjacency list per line, eg.</div><div class="ttdef"><b>Definition:</b> <a href="io_8h_source.html#l00044">io.h:44</a></div></div>
<div class="ttc" id="namespaceutil_html_ae705e1342dacc10a13fb3f11f91d0696a454bb1ede69e280a1e4959acb82748ef"><div class="ttname"><a href="namespaceutil.html#ae705e1342dacc10a13fb3f11f91d0696a454bb1ede69e280a1e4959acb82748ef">util::PRINT_GRAPH_ADJACENCY_LISTS_SORTED</a></div><div class="ttdoc">Ditto, but the adjacency lists are sorted.</div><div class="ttdef"><b>Definition:</b> <a href="io_8h_source.html#l00047">io.h:47</a></div></div>
<div class="ttc" id="classutil_1_1ListGraph_html"><div class="ttname"><a href="classutil_1_1ListGraph.html">util::ListGraph</a></div><div class="ttdoc">Basic graph implementation without reverse arc.</div><div class="ttdef"><b>Definition:</b> <a href="graph_8h_source.html#l00297">graph.h:297</a></div></div>
</div><!-- fragment --></div><!-- contents -->
2019-07-12 13:25:23 -07:00
</div><!-- doc-content -->
2019-06-13 15:36:14 +02:00
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
</html>