OR-Tools  8.1
hungarian_test.cc File Reference

Go to the source code of this file.

Namespaces

 operations_research
 The vehicle routing library lets one model and solve generic vehicle routing problems ranging from the Traveling Salesman Problem to more complex problems such as the Capacitated Vehicle Routing Problem with Time Windows.
 

Macros

#define MATRIX_TEST
 

Functions

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[])
 
void TestMinimization (const std::vector< std::vector< double > > &cost, const int expected_assignment_size, const int expected_agents[], const int expected_tasks[])
 
void TestMaximization (const std::vector< std::vector< double > > &cost, const int expected_assignment_size, const int expected_agents[], const int expected_tasks[])
 
 TEST (LinearAssignmentTest, NullMatrix)
 
 TEST (LinearAssignmentTest, SizeOneMatrix)
 
 TEST (LinearAssignmentTest, Small4x4Matrix)
 
 TEST (LinearAssignmentTest, Small3x4Matrix)
 
 TEST (LinearAssignmentTest, Small4x3Matrix)
 

Macro Definition Documentation

◆ MATRIX_TEST

#define MATRIX_TEST
Value:
{ \
std::vector<std::vector<double> > cost(kMatrixHeight); \
for (int row = 0; row < kMatrixHeight; ++row) { \
cost[row].resize(kMatrixWidth); \
for (int col = 0; col < kMatrixWidth; ++col) { \
cost[row][col] = kCost[row][col]; \
} \
} \
EXPECT_EQ(arraysize(expected_agents_for_min), \
arraysize(expected_tasks_for_min)); \
EXPECT_EQ(arraysize(expected_agents_for_max), \
arraysize(expected_tasks_for_max)); \
const int assignment_size = arraysize(expected_agents_for_max); \
TestMinimization(cost, assignment_size, expected_agents_for_min, \
expected_tasks_for_min); \
TestMaximization(cost, assignment_size, expected_agents_for_max, \
expected_tasks_for_max); \
}

Definition at line 68 of file hungarian_test.cc.

arraysize
#define arraysize(array)
Definition: macros.h:39
cost
int64 cost
Definition: routing_flow.cc:130
col
ColIndex col
Definition: markowitz.cc:176
row
RowIndex row
Definition: markowitz.cc:175