<ahref="hungarian__test_8cc.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Test file for hungarian.h</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> </div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="preprocessor">#include "<aclass="code"href="hungarian_8h.html">ortools/algorithms/hungarian.h</a>"</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> </div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="preprocessor">#include "absl/container/flat_hash_map.h"</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="preprocessor">#include "gtest/gtest.h"</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="preprocessor">#include "<aclass="code"href="integral__types_8h.html">ortools/base/integral_types.h</a>"</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="preprocessor">#include "<aclass="code"href="macros_8h.html">ortools/base/macros.h</a>"</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="preprocessor">#include "<aclass="code"href="map__util_8h.html">ortools/base/map_util.h</a>"</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="preprocessor">#include "<aclass="code"href="random_8h.html">ortools/base/random.h</a>"</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> </div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="keyword">namespace </span><aclass="code"href="namespaceoperations__research.html">operations_research</a> {</div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> </div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment">// Generic check function that checks consistency of a linear assignment</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment">// result as well as whether the result is the expected one.</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> </div><divclass="line"><aname="l00017"></a><spanclass="lineno"><aclass="line"href="namespaceoperations__research.html#aaa8d9a49b1a63a8931a9d542c26b62d8"> 17</a></span> <spanclass="keywordtype">void</span><aclass="code"href="namespaceoperations__research.html#aaa8d9a49b1a63a8931a9d542c26b62d8">GenericCheck</a>(<spanclass="keyword">const</span><spanclass="keywordtype">int</span> expected_assignment_size,</div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="keyword">const</span> absl::flat_hash_map<int, int>& direct_assignment,</div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="keyword">const</span> absl::flat_hash_map<int, int>& reverse_assignment,</div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="keyword">const</span><spanclass="keywordtype">int</span> expected_agents[], <spanclass="keyword">const</span><spanclass="keywordtype">int</span> expected_tasks[]) {</div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span>  EXPECT_EQ(expected_assignment_size, direct_assignment.size());</div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span>  EXPECT_EQ(expected_assignment_size, reverse_assignment.size());</div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="keywordflow">for
<divclass="ttc"id="namespaceoperations__research_html_aaa8d9a49b1a63a8931a9d542c26b62d8"><divclass="ttname"><ahref="namespaceoperations__research.html#aaa8d9a49b1a63a8931a9d542c26b62d8">operations_research::GenericCheck</a></div><divclass="ttdeci">void GenericCheck(const int expected_assignment_size, const absl::flat_hash_map< int, int >&direct_assignment, const absl::flat_hash_map< int, int >&reverse_assignment, const int expected_agents[], const int expected_tasks[])</div><divclass="ttdef"><b>Definition:</b><ahref="hungarian__test_8cc_source.html#l00017">hungarian_test.cc:17</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html_ab5bea9dc4042e821f42017d8a2ddb51b"><divclass="ttname"><ahref="namespaceoperations__research.html#ab5bea9dc4042e821f42017d8a2ddb51b">operations_research::TestMinimization</a></div><divclass="ttdeci">void TestMinimization(const std::vector< std::vector< double >>&cost, const int expected_assignment_size, const int expected_agents[], const int expected_tasks[])</div><divclass="ttdef"><b>Definition:</b><ahref="hungarian__test_8cc_source.html#l00036">hungarian_test.cc:36</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html_a4aa4c1802c8d88cdbf4557e487a76030"><divclass="ttname"><ahref="namespaceoperations__research.html#a4aa4c1802c8d88cdbf4557e487a76030">operations_research::TestMaximization</a></div><divclass="ttdeci">void TestMaximization(const std::vector< std::vector< double >>&cost, const int expected_assignment_size, const int expected_agents[], const int expected_tasks[])</div><divclass="ttdef"><b>Definition:</b><ahref="hungarian__test_8cc_source.html#l00047">hungarian_test.cc:47</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html"><divclass="ttname"><ahref="namespaceoperations__research.html">operations_research</a></div><divclass="ttdoc">Collection of objects used to extend the Constraint Solver library.</div><divclass="ttdef"><b>Definition:</b><ahref="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>