Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Hungarian_Result< Cost_Type > Struct Template Reference

Result of the Hungarian assignment algorithm. More...

#include <Hungarian.H>

Collaboration diagram for Aleph::Hungarian_Result< Cost_Type >:
[legend]

Public Member Functions

DynList< std::pair< size_t, size_t > > get_pairs () const
 Get the assignment pairs, excluding dummy entries.
 

Public Attributes

Cost_Type total_cost = Cost_Type{0}
 Optimal total cost.
 
Array< longrow_to_col
 row i is assigned to column row_to_col[i]
 
Array< longcol_to_row
 column j is assigned to row col_to_row[j]
 
size_t orig_rows = 0
 Original number of rows.
 
size_t orig_cols = 0
 Original number of columns.
 

Detailed Description

template<typename Cost_Type = double>
struct Aleph::Hungarian_Result< Cost_Type >

Result of the Hungarian assignment algorithm.

Holds the optimal cost and the row-to-column / column-to-row mappings. For rectangular matrices, dummy assignments (to padded rows or columns) are marked with -1.

Template Parameters
Cost_TypeNumeric type for costs (default: double).

Definition at line 114 of file Hungarian.H.

Member Function Documentation

◆ get_pairs()

template<typename Cost_Type = double>
DynList< std::pair< size_t, size_t > > Aleph::Hungarian_Result< Cost_Type >::get_pairs ( ) const
inline

Get the assignment pairs, excluding dummy entries.

Returns only the pairs (row, col) where both row and col are within the original (non-padded) dimensions.

Returns
List of (row, col) pairs.

Definition at line 133 of file Hungarian.H.

References Aleph::and, Aleph::DynList< T >::append(), Aleph::Hungarian_Result< Cost_Type >::orig_cols, Aleph::Hungarian_Result< Cost_Type >::orig_rows, and Aleph::Hungarian_Result< Cost_Type >::row_to_col.

Member Data Documentation

◆ col_to_row

template<typename Cost_Type = double>
Array<long> Aleph::Hungarian_Result< Cost_Type >::col_to_row

column j is assigned to row col_to_row[j]

Definition at line 122 of file Hungarian.H.

Referenced by Aleph::hungarian_assignment(), and Aleph::hungarian_max_assignment().

◆ orig_cols

template<typename Cost_Type = double>
size_t Aleph::Hungarian_Result< Cost_Type >::orig_cols = 0

◆ orig_rows

template<typename Cost_Type = double>
size_t Aleph::Hungarian_Result< Cost_Type >::orig_rows = 0

◆ row_to_col

template<typename Cost_Type = double>
Array<long> Aleph::Hungarian_Result< Cost_Type >::row_to_col

row i is assigned to column row_to_col[i]

Definition at line 121 of file Hungarian.H.

Referenced by Aleph::Hungarian_Result< Cost_Type >::get_pairs(), Aleph::hungarian_assignment(), and Aleph::hungarian_max_assignment().

◆ total_cost

template<typename Cost_Type = double>
Cost_Type Aleph::Hungarian_Result< Cost_Type >::total_cost = Cost_Type{0}

Optimal total cost.

Definition at line 120 of file Hungarian.H.

Referenced by Aleph::hungarian_assignment(), and Aleph::hungarian_max_assignment().


The documentation for this struct was generated from the following file: