Files
entt/adjacency__matrix_8hpp_source.html
2022-11-09 12:39:12 +01:00

344 lines
65 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EnTT: src/entt/graph/adjacency_matrix.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">EnTT<span id="projectnumber">&#160;3.11.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_66e9674e8206a335795995fa32a03c91.html">entt</a></li><li class="navelem"><a class="el" href="dir_cb9807796ea702d95f280c116c66a3f6.html">graph</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">adjacency_matrix.hpp</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef ENTT_GRAPH_ADJACENCY_MATRIX_HPP</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define ENTT_GRAPH_ADJACENCY_MATRIX_HPP</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &lt;cstddef&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;iterator&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;../config/config.h&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;../core/iterator.hpp&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;fwd.hpp&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceentt.html">entt</a> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span>internal {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">template</span>&lt;<span class="keyword">typename</span> It&gt;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">class </span>edge_iterator {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">using </span>size_type = std::size_t;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">using </span>value_type = std::pair&lt;size_type, size_type&gt;;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">using </span>pointer = input_iterator_pointer&lt;value_type&gt;;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">using </span>reference = value_type;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">using </span>difference_type = std::ptrdiff_t;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">using </span>iterator_category = std::input_iterator_tag;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">constexpr</span> edge_iterator() noexcept</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> : it{},</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> vert{},</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> pos{},</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> last{},</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> offset{} {}</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">constexpr</span> edge_iterator(It base, <span class="keyword">const</span> size_type vertices, <span class="keyword">const</span> size_type from, <span class="keyword">const</span> size_type to, <span class="keyword">const</span> size_type step) noexcept</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> : it{std::move(base)},</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> vert{vertices},</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> pos{from},</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> last{to},</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> offset{step} {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">for</span>(; pos != last &amp;&amp; !it[pos]; pos += offset) {}</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> }</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">constexpr</span> edge_iterator &amp;operator++() noexcept {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">for</span>(pos += offset; pos != last &amp;&amp; !it[pos]; pos += offset) {}</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">constexpr</span> edge_iterator operator++(<span class="keywordtype">int</span>) <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> edge_iterator orig = *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">return</span> ++(*this), orig;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> [[nodiscard]] <span class="keyword">constexpr</span> reference operator*() const noexcept {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> *operator-&gt;();</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> [[nodiscard]] <span class="keyword">constexpr</span> pointer operator-&gt;() const noexcept {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> std::make_pair&lt;size_type&gt;(pos / vert, pos % vert);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Type&gt;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">friend</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespaceentt.html#af7c61951b721a1e3612cf536bd707501">operator==</a>(<span class="keyword">const</span> edge_iterator&lt;Type&gt; &amp;, <span class="keyword">const</span> edge_iterator&lt;Type&gt; &amp;) <span class="keyword">noexcept</span>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> It it;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> size_type vert;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> size_type pos;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> size_type last;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> size_type offset{};</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>};</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="keyword">template</span>&lt;<span class="keyword">typename</span> Container&gt;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>[[nodiscard]] <span class="keyword">inline</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespaceentt.html#af7c61951b721a1e3612cf536bd707501">operator==</a>(<span class="keyword">const</span> edge_iterator&lt;Container&gt; &amp;lhs, <span class="keyword">const</span> edge_iterator&lt;Container&gt; &amp;rhs) <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">return</span> lhs.pos == rhs.pos;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span>}</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="keyword">template</span>&lt;<span class="keyword">typename</span> Container&gt;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span>[[nodiscard]] <span class="keyword">inline</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespaceentt.html#ad9accc71a383509ada028f7fa2b767bf">operator!=</a>(<span class="keyword">const</span> edge_iterator&lt;Container&gt; &amp;lhs, <span class="keyword">const</span> edge_iterator&lt;Container&gt; &amp;rhs) <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">return</span> !(lhs == rhs);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span>}</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span>} <span class="comment">// namespace internal</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="keyword">template</span>&lt;<span class="keyword">typename</span> Category, <span class="keyword">typename</span> Allocator&gt;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html"> 102</a></span><span class="keyword">class </span><a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> {</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keyword">using </span>alloc_traits = std::allocator_traits&lt;Allocator&gt;;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keyword">static_assert</span>(std::is_base_of_v&lt;directed_tag, Category&gt;, <span class="stringliteral">&quot;Invalid graph category&quot;</span>);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keyword">static_assert</span>(std::is_same_v&lt;typename alloc_traits::value_type, std::size_t&gt;, <span class="stringliteral">&quot;Invalid value type&quot;</span>);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">using </span>container_type = std::vector&lt;std::size_t, typename alloc_traits::template rebind_alloc&lt;std::size_t&gt;&gt;;</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8"> 110</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a> = Allocator;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c"> 112</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a> = std::size_t;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9"> 114</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> = <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a>;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#aa2ac50f08d437489d4f761b418c48eda"> 116</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#aa2ac50f08d437489d4f761b418c48eda">edge_type</a> = std::pair&lt;vertex_type, vertex_type&gt;;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a2a5cd6977bd31867ed853b737f3a2ff1"> 118</a></span> <span class="keyword">using </span><a class="code hl_class" href="classentt_1_1iota__iterator.html">vertex_iterator</a> = <a class="code hl_class" href="classentt_1_1iota__iterator.html">iota_iterator&lt;vertex_type&gt;</a>;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a4e2e74717c42df138ed98b1a33b6ffd8"> 120</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a4e2e74717c42df138ed98b1a33b6ffd8">edge_iterator</a> = internal::edge_iterator&lt;typename container_type::const_iterator&gt;;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a88b3a1f0df93f9785b51ece42cb71852"> 122</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a88b3a1f0df93f9785b51ece42cb71852">out_edge_iterator</a> = <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a4e2e74717c42df138ed98b1a33b6ffd8">edge_iterator</a>;</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ad1eb3bad19846f57d9a6a44bed6f360d"> 124</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad1eb3bad19846f57d9a6a44bed6f360d">in_edge_iterator</a> = <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a4e2e74717c42df138ed98b1a33b6ffd8">edge_iterator</a>;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a3beccfd9cecbffa10c80dc702ef95917"> 126</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a3beccfd9cecbffa10c80dc702ef95917">graph_category</a> = Category;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a3b3d88826c5e9e6d6696c57cfeadc365"> 129</a></span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a3b3d88826c5e9e6d6696c57cfeadc365">adjacency_matrix</a>() noexcept(noexcept(<a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a>{}))</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> : <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a>{0u} {}</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ae6940bc105cd3cd328a6abc3f19c14dc"> 136</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#ae6940bc105cd3cd328a6abc3f19c14dc">adjacency_matrix</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a> &amp;allocator) noexcept</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> : <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a>{0u, allocator} {}</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a854098472673c06c946df5efec991517"> 145</a></span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a854098472673c06c946df5efec991517">adjacency_matrix</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a>, <span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a> &amp;allocator = <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a>{})</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> : matrix{<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a> * <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a>, allocator},</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> vert{<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a>} {}</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ac77dc5ede8d11be4d33fab1e220c86bf"> 153</a></span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#ac77dc5ede8d11be4d33fab1e220c86bf">adjacency_matrix</a>(<span class="keyword">const</span> <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;other)</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> : <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a>{other, other.<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aea59b70885fd22df3f80f59cf6e9e58b">get_allocator</a>()} {}</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#adaa9b708b88f549673e7a9db7203b96c"> 161</a></span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#adaa9b708b88f549673e7a9db7203b96c">adjacency_matrix</a>(<span class="keyword">const</span> <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;other, <span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a> &amp;allocator)</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> : matrix{other.matrix, allocator},</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> vert{other.vert} {}</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#adde64d83b6a3cdc0414e15799c792f58"> 169</a></span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#adde64d83b6a3cdc0414e15799c792f58">adjacency_matrix</a>(<a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;&amp;other) noexcept</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> : <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a>{std::move(other), other.<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aea59b70885fd22df3f80f59cf6e9e58b">get_allocator</a>()} {}</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a7195a32e20c1099e6e32ef3e73475801"> 177</a></span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a7195a32e20c1099e6e32ef3e73475801">adjacency_matrix</a>(<a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;&amp;other, <span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a> &amp;allocator)</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> : matrix{std::move(other.matrix), allocator},</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> vert{std::exchange(other.vert, 0u)} {}</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a2241ebad4fdf44c71cbe730d99a5478b"> 186</a></span> <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a2241ebad4fdf44c71cbe730d99a5478b">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;other) {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> matrix = other.matrix;</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> vert = other.vert;</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> }</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> </div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ad9f952a075274d9e86156535684ebcd4"> 197</a></span> <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#ad9f952a075274d9e86156535684ebcd4">operator=</a>(<a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;&amp;other) <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> matrix = std::move(other.matrix);</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> vert = std::exchange(other.vert, 0u);</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> }</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> </div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#aea59b70885fd22df3f80f59cf6e9e58b"> 207</a></span> [[nodiscard]] <span class="keyword">constexpr</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">allocator_type</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aea59b70885fd22df3f80f59cf6e9e58b">get_allocator</a>() const noexcept {</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordflow">return</span> matrix.get_allocator();</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a81931cd90488b3e5269217f7d6064c93"> 212</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a81931cd90488b3e5269217f7d6064c93">clear</a>() noexcept {</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> matrix.clear();</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> vert = {};</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> }</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a711862b28cd489f1bffdf453d458f477"> 221</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a711862b28cd489f1bffdf453d458f477">swap</a>(<a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> &amp;other) {</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="keyword">using </span>std::swap;</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a711862b28cd489f1bffdf453d458f477">swap</a>(matrix, other.matrix);</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a711862b28cd489f1bffdf453d458f477">swap</a>(vert, other.vert);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> }</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> </div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a70f8706c96d4c000ceab51d88402ca74"> 231</a></span> [[nodiscard]] <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a70f8706c96d4c000ceab51d88402ca74">size</a>() const noexcept {</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keywordflow">return</span> vert;</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> }</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4"> 239</a></span> [[nodiscard]] <a class="code hl_struct" href="structentt_1_1iterable__adaptor.html">iterable_adaptor&lt;vertex_iterator&gt;</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a>() const noexcept {</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="keywordflow">return</span> {0u, vert};</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> }</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> </div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ab6638e821360bafa2d7ce2e12ef0825a"> 247</a></span> [[nodiscard]] <a class="code hl_struct" href="structentt_1_1iterable__adaptor.html">iterable_adaptor&lt;edge_iterator&gt;</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#ab6638e821360bafa2d7ce2e12ef0825a">edges</a>() const noexcept {</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> <span class="keyword">const</span> <span class="keyword">auto</span> it = matrix.cbegin();</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = matrix.size();</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="keywordflow">return</span> {{it, vert, 0u, sz, 1u}, {it, vert, sz, sz, 1u}};</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> }</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> </div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a4e28de523aa924aea9c8c78b5981a9df"> 258</a></span> [[nodiscard]] <a class="code hl_struct" href="structentt_1_1iterable__adaptor.html">iterable_adaptor&lt;out_edge_iterator&gt;</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a4e28de523aa924aea9c8c78b5981a9df">out_edges</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> vertex) <span class="keyword">const</span> <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <span class="keyword">const</span> <span class="keyword">auto</span> it = matrix.cbegin();</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <span class="keyword">const</span> <span class="keyword">auto</span> from = vertex * vert;</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <span class="keyword">const</span> <span class="keyword">auto</span> to = vertex * vert + vert;</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> <span class="keywordflow">return</span> {{it, vert, from, to, 1u}, {it, vert, to, to, 1u}};</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> }</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> </div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a9213407b3d7b543348000a44357ccca1"> 270</a></span> [[nodiscard]] <a class="code hl_struct" href="structentt_1_1iterable__adaptor.html">iterable_adaptor&lt;in_edge_iterator&gt;</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a9213407b3d7b543348000a44357ccca1">in_edges</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> vertex) <span class="keyword">const</span> <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="keyword">const</span> <span class="keyword">auto</span> it = matrix.cbegin();</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> <span class="keyword">const</span> <span class="keyword">auto</span> from = vertex;</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keyword">const</span> <span class="keyword">auto</span> to = vert * (vert - 1u) + vertex;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordflow">return</span> {{it, vert, from, to, vert}, {it, vert, to, to, vert}};</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> }</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#ad45c4c6b938ed028d7c99b1d1a678b9e"> 281</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#ad45c4c6b938ed028d7c99b1d1a678b9e">resize</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a>) {</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> <a class="code hl_class" href="classentt_1_1adjacency__matrix.html">adjacency_matrix</a> other{<a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">vertices</a>, <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#aea59b70885fd22df3f80f59cf6e9e58b">get_allocator</a>()};</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> [lhs, rhs]: <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#ab6638e821360bafa2d7ce2e12ef0825a">edges</a>()) {</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> other.insert(lhs, rhs);</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> }</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> </div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> other.swap(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> }</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> </div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a16d422fbdac17535196b27001b4bfd63"> 299</a></span> std::pair&lt;edge_iterator, bool&gt; <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a16d422fbdac17535196b27001b4bfd63">insert</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> lhs, <span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> rhs) {</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="keyword">const</span> <span class="keyword">auto</span> pos = lhs * vert + rhs;</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> </div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span>(std::is_same_v&lt;graph_category, undirected_tag&gt;) {</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keyword">const</span> <span class="keyword">auto</span> rev = rhs * vert + lhs;</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> ENTT_ASSERT(matrix[pos] == matrix[rev], <span class="stringliteral">&quot;Something went really wrong&quot;</span>);</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> matrix[rev] = 1u;</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> }</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <span class="keyword">const</span> <span class="keyword">auto</span> inserted = !std::exchange(matrix[pos], 1u);</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">return</span> {<a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a4e2e74717c42df138ed98b1a33b6ffd8">edge_iterator</a>{matrix.cbegin(), vert, pos, matrix.size(), 1u}, inserted};</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> }</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> </div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#adf91bac04f07bf7ce0478ecd5baeece7"> 318</a></span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#adf91bac04f07bf7ce0478ecd5baeece7">erase</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> lhs, <span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> rhs) {</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="keyword">const</span> <span class="keyword">auto</span> pos = lhs * vert + rhs;</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> </div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span>(std::is_same_v&lt;graph_category, undirected_tag&gt;) {</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <span class="keyword">const</span> <span class="keyword">auto</span> rev = rhs * vert + lhs;</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> ENTT_ASSERT(matrix[pos] == matrix[rev], <span class="stringliteral">&quot;Something went really wrong&quot;</span>);</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> matrix[rev] = 0u;</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> }</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> </div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> <span class="keywordflow">return</span> std::exchange(matrix[pos], 0u);</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> }</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> </div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"><a class="line" href="classentt_1_1adjacency__matrix.html#a783833a34672bcbd0afab063ab417a97"> 336</a></span> [[nodiscard]] <span class="keywordtype">bool</span> <a class="code hl_function" href="classentt_1_1adjacency__matrix.html#a783833a34672bcbd0afab063ab417a97">contains</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> lhs, <span class="keyword">const</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">vertex_type</a> rhs)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <span class="keyword">const</span> <span class="keyword">auto</span> pos = lhs * vert + rhs;</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> <span class="keywordflow">return</span> pos &lt; matrix.size() &amp;&amp; matrix[pos];</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> }</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> </div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> container_type matrix;</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> <a class="code hl_typedef" href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">size_type</a> vert;</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span>};</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> </div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span>} <span class="comment">// namespace entt</span></div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> </div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html">entt::adjacency_matrix</a></div><div class="ttdoc">Basic implementation of a directed adjacency matrix.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00102">adjacency_matrix.hpp:102</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a16d422fbdac17535196b27001b4bfd63"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a16d422fbdac17535196b27001b4bfd63">entt::adjacency_matrix::insert</a></div><div class="ttdeci">std::pair&lt; edge_iterator, bool &gt; insert(const vertex_type lhs, const vertex_type rhs)</div><div class="ttdoc">Inserts an edge into the adjacency matrix, if it does not exist.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00299">adjacency_matrix.hpp:299</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a2241ebad4fdf44c71cbe730d99a5478b"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a2241ebad4fdf44c71cbe730d99a5478b">entt::adjacency_matrix::operator=</a></div><div class="ttdeci">adjacency_matrix &amp; operator=(const adjacency_matrix &amp;other)</div><div class="ttdoc">Default copy assignment operator.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00186">adjacency_matrix.hpp:186</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a3b3d88826c5e9e6d6696c57cfeadc365"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a3b3d88826c5e9e6d6696c57cfeadc365">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix() noexcept(noexcept(allocator_type{}))</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00129">adjacency_matrix.hpp:129</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a3beccfd9cecbffa10c80dc702ef95917"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a3beccfd9cecbffa10c80dc702ef95917">entt::adjacency_matrix::graph_category</a></div><div class="ttdeci">Category graph_category</div><div class="ttdoc">Graph category tag.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00126">adjacency_matrix.hpp:126</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a4e28de523aa924aea9c8c78b5981a9df"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a4e28de523aa924aea9c8c78b5981a9df">entt::adjacency_matrix::out_edges</a></div><div class="ttdeci">iterable_adaptor&lt; out_edge_iterator &gt; out_edges(const vertex_type vertex) const noexcept</div><div class="ttdoc">Returns an iterable object to visit all out edges of a vertex.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00258">adjacency_matrix.hpp:258</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a4e2e74717c42df138ed98b1a33b6ffd8"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a4e2e74717c42df138ed98b1a33b6ffd8">entt::adjacency_matrix::edge_iterator</a></div><div class="ttdeci">internal::edge_iterator&lt; typename container_type::const_iterator &gt; edge_iterator</div><div class="ttdoc">Edge iterator type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00120">adjacency_matrix.hpp:120</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a70f8706c96d4c000ceab51d88402ca74"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a70f8706c96d4c000ceab51d88402ca74">entt::adjacency_matrix::size</a></div><div class="ttdeci">size_type size() const noexcept</div><div class="ttdoc">Returns the number of vertices.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00231">adjacency_matrix.hpp:231</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a711862b28cd489f1bffdf453d458f477"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a711862b28cd489f1bffdf453d458f477">entt::adjacency_matrix::swap</a></div><div class="ttdeci">void swap(adjacency_matrix &amp;other)</div><div class="ttdoc">Exchanges the contents with those of a given adjacency matrix.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00221">adjacency_matrix.hpp:221</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a7195a32e20c1099e6e32ef3e73475801"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a7195a32e20c1099e6e32ef3e73475801">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix(adjacency_matrix &amp;&amp;other, const allocator_type &amp;allocator)</div><div class="ttdoc">Allocator-extended move constructor.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00177">adjacency_matrix.hpp:177</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a72507bd210570d5712a5c40b0d345b6c"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a72507bd210570d5712a5c40b0d345b6c">entt::adjacency_matrix::size_type</a></div><div class="ttdeci">std::size_t size_type</div><div class="ttdoc">Unsigned integer type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00112">adjacency_matrix.hpp:112</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a740021db9b7bad492ebe3d074769d8b8"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a740021db9b7bad492ebe3d074769d8b8">entt::adjacency_matrix::allocator_type</a></div><div class="ttdeci">Allocator allocator_type</div><div class="ttdoc">Allocator type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00110">adjacency_matrix.hpp:110</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a783833a34672bcbd0afab063ab417a97"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a783833a34672bcbd0afab063ab417a97">entt::adjacency_matrix::contains</a></div><div class="ttdeci">bool contains(const vertex_type lhs, const vertex_type rhs) const</div><div class="ttdoc">Checks if an adjacency matrix contains a given edge.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00336">adjacency_matrix.hpp:336</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a81931cd90488b3e5269217f7d6064c93"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a81931cd90488b3e5269217f7d6064c93">entt::adjacency_matrix::clear</a></div><div class="ttdeci">void clear() noexcept</div><div class="ttdoc">Clears the adjacency matrix.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00212">adjacency_matrix.hpp:212</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a854098472673c06c946df5efec991517"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a854098472673c06c946df5efec991517">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix(const size_type vertices, const allocator_type &amp;allocator=allocator_type{})</div><div class="ttdoc">Constructs an empty container with a given allocator and user supplied number of vertices.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00145">adjacency_matrix.hpp:145</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a88b3a1f0df93f9785b51ece42cb71852"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a88b3a1f0df93f9785b51ece42cb71852">entt::adjacency_matrix::out_edge_iterator</a></div><div class="ttdeci">edge_iterator out_edge_iterator</div><div class="ttdoc">Out edge iterator type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00122">adjacency_matrix.hpp:122</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_a9213407b3d7b543348000a44357ccca1"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#a9213407b3d7b543348000a44357ccca1">entt::adjacency_matrix::in_edges</a></div><div class="ttdeci">iterable_adaptor&lt; in_edge_iterator &gt; in_edges(const vertex_type vertex) const noexcept</div><div class="ttdoc">Returns an iterable object to visit all in edges of a vertex.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00270">adjacency_matrix.hpp:270</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_aa2ac50f08d437489d4f761b418c48eda"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#aa2ac50f08d437489d4f761b418c48eda">entt::adjacency_matrix::edge_type</a></div><div class="ttdeci">std::pair&lt; vertex_type, vertex_type &gt; edge_type</div><div class="ttdoc">Edge type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00116">adjacency_matrix.hpp:116</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_aac3dbc29bb2a31de879b62742124ddd4"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#aac3dbc29bb2a31de879b62742124ddd4">entt::adjacency_matrix::vertices</a></div><div class="ttdeci">iterable_adaptor&lt; vertex_iterator &gt; vertices() const noexcept</div><div class="ttdoc">Returns an iterable object to visit all vertices of a matrix.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00239">adjacency_matrix.hpp:239</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ab6638e821360bafa2d7ce2e12ef0825a"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ab6638e821360bafa2d7ce2e12ef0825a">entt::adjacency_matrix::edges</a></div><div class="ttdeci">iterable_adaptor&lt; edge_iterator &gt; edges() const noexcept</div><div class="ttdoc">Returns an iterable object to visit all edges of a matrix.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00247">adjacency_matrix.hpp:247</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ac77dc5ede8d11be4d33fab1e220c86bf"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ac77dc5ede8d11be4d33fab1e220c86bf">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix(const adjacency_matrix &amp;other)</div><div class="ttdoc">Copy constructor.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00153">adjacency_matrix.hpp:153</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ad1eb3bad19846f57d9a6a44bed6f360d"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ad1eb3bad19846f57d9a6a44bed6f360d">entt::adjacency_matrix::in_edge_iterator</a></div><div class="ttdeci">edge_iterator in_edge_iterator</div><div class="ttdoc">In edge iterator type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00124">adjacency_matrix.hpp:124</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ad45c4c6b938ed028d7c99b1d1a678b9e"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ad45c4c6b938ed028d7c99b1d1a678b9e">entt::adjacency_matrix::resize</a></div><div class="ttdeci">void resize(const size_type vertices)</div><div class="ttdoc">Resizes an adjacency matrix.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00281">adjacency_matrix.hpp:281</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ad59306803ff05b7d2d3244f7e59ef9d9"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ad59306803ff05b7d2d3244f7e59ef9d9">entt::adjacency_matrix::vertex_type</a></div><div class="ttdeci">size_type vertex_type</div><div class="ttdoc">Vertex type.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00114">adjacency_matrix.hpp:114</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ad9f952a075274d9e86156535684ebcd4"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ad9f952a075274d9e86156535684ebcd4">entt::adjacency_matrix::operator=</a></div><div class="ttdeci">adjacency_matrix &amp; operator=(adjacency_matrix &amp;&amp;other) noexcept</div><div class="ttdoc">Default move assignment operator.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00197">adjacency_matrix.hpp:197</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_adaa9b708b88f549673e7a9db7203b96c"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#adaa9b708b88f549673e7a9db7203b96c">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix(const adjacency_matrix &amp;other, const allocator_type &amp;allocator)</div><div class="ttdoc">Allocator-extended copy constructor.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00161">adjacency_matrix.hpp:161</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_adde64d83b6a3cdc0414e15799c792f58"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#adde64d83b6a3cdc0414e15799c792f58">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix(adjacency_matrix &amp;&amp;other) noexcept</div><div class="ttdoc">Move constructor.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00169">adjacency_matrix.hpp:169</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_adf91bac04f07bf7ce0478ecd5baeece7"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#adf91bac04f07bf7ce0478ecd5baeece7">entt::adjacency_matrix::erase</a></div><div class="ttdeci">size_type erase(const vertex_type lhs, const vertex_type rhs)</div><div class="ttdoc">Removes the edge associated with a pair of given vertices.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00318">adjacency_matrix.hpp:318</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_ae6940bc105cd3cd328a6abc3f19c14dc"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#ae6940bc105cd3cd328a6abc3f19c14dc">entt::adjacency_matrix::adjacency_matrix</a></div><div class="ttdeci">adjacency_matrix(const allocator_type &amp;allocator) noexcept</div><div class="ttdoc">Constructs an empty container with a given allocator.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00136">adjacency_matrix.hpp:136</a></div></div>
<div class="ttc" id="aclassentt_1_1adjacency__matrix_html_aea59b70885fd22df3f80f59cf6e9e58b"><div class="ttname"><a href="classentt_1_1adjacency__matrix.html#aea59b70885fd22df3f80f59cf6e9e58b">entt::adjacency_matrix::get_allocator</a></div><div class="ttdeci">constexpr allocator_type get_allocator() const noexcept</div><div class="ttdoc">Returns the associated allocator.</div><div class="ttdef"><b>Definition:</b> <a href="adjacency__matrix_8hpp_source.html#l00207">adjacency_matrix.hpp:207</a></div></div>
<div class="ttc" id="aclassentt_1_1iota__iterator_html"><div class="ttname"><a href="classentt_1_1iota__iterator.html">entt::iota_iterator</a></div><div class="ttdoc">Plain iota iterator (waiting for C++20).</div><div class="ttdef"><b>Definition:</b> <a href="iterator_8hpp_source.html#l00056">iterator.hpp:56</a></div></div>
<div class="ttc" id="anamespaceentt_html"><div class="ttname"><a href="namespaceentt.html">entt</a></div><div class="ttdoc">EnTT default namespace.</div><div class="ttdef"><b>Definition:</b> <a href="dense__map_8hpp_source.html#l00021">dense_map.hpp:21</a></div></div>
<div class="ttc" id="anamespaceentt_html_ad9accc71a383509ada028f7fa2b767bf"><div class="ttname"><a href="namespaceentt.html#ad9accc71a383509ada028f7fa2b767bf">entt::operator!=</a></div><div class="ttdeci">constexpr bool operator!=(const basic_hashed_string&lt; Char &gt; &amp;lhs, const basic_hashed_string&lt; Char &gt; &amp;rhs) noexcept</div><div class="ttdoc">Compares two hashed strings.</div><div class="ttdef"><b>Definition:</b> <a href="hashed__string_8hpp_source.html#l00249">hashed_string.hpp:249</a></div></div>
<div class="ttc" id="anamespaceentt_html_af7c61951b721a1e3612cf536bd707501"><div class="ttname"><a href="namespaceentt.html#af7c61951b721a1e3612cf536bd707501">entt::operator==</a></div><div class="ttdeci">constexpr bool operator==(const basic_hashed_string&lt; Char &gt; &amp;lhs, const basic_hashed_string&lt; Char &gt; &amp;rhs) noexcept</div><div class="ttdoc">Compares two hashed strings.</div><div class="ttdef"><b>Definition:</b> <a href="hashed__string_8hpp_source.html#l00237">hashed_string.hpp:237</a></div></div>
<div class="ttc" id="astructentt_1_1iterable__adaptor_html"><div class="ttname"><a href="structentt_1_1iterable__adaptor.html">entt::iterable_adaptor</a></div><div class="ttdoc">Utility class to create an iterable object from a pair of iterators.</div><div class="ttdef"><b>Definition:</b> <a href="iterator_8hpp_source.html#l00141">iterator.hpp:141</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>