OR-Tools  9.3
hungarian_test.cc File Reference

Go to the source code of this file.

Namespaces

namespace  operations_research
 Collection of objects used to extend the Constraint Solver library.
 

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, InvalidMatrix)
 
 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); \
}
#define arraysize(array)
Definition: macros.h:39
ColIndex col
Definition: markowitz.cc:183
RowIndex row
Definition: markowitz.cc:182
int64_t cost

Definition at line 92 of file hungarian_test.cc.