CMR  1.3.0
Public Types | Public Member Functions | List of all members
tu::bipartite_graph_dimensions Struct Reference

#include <bipartite_graph_bfs.hpp>

Public Types

typedef size_t index_type
 

Public Member Functions

 bipartite_graph_dimensions (size_t height, size_t width)
 
size_t height () const
 
size_t width () const
 
size_t size () const
 
bool is_row (index_type index) const
 
bool is_column (index_type index) const
 
size_t index_to_row (index_type index) const
 
size_t index_to_column (index_type index) const
 
index_type row_to_index (size_t row) const
 
index_type column_to_index (size_t column) const
 
std::pair< size_t, size_t > indexes_to_coordinates (index_type first, index_type second) const
 

Detailed Description

A helper struct for breadth first search on bipartite graphs to map row- and column-indices into on index-range.

Member Typedef Documentation

◆ index_type

Constructor & Destructor Documentation

◆ bipartite_graph_dimensions()

tu::bipartite_graph_dimensions::bipartite_graph_dimensions ( size_t  height,
size_t  width 
)
inline

Constructs the helper object with the given number of rows and columns.

Parameters
heightNumber of rows
widthNumber of columns

Member Function Documentation

◆ column_to_index()

index_type tu::bipartite_graph_dimensions::column_to_index ( size_t  column) const
inline
Parameters
columnA given column-index
Returns
Corresponding node-index

◆ height()

size_t tu::bipartite_graph_dimensions::height ( ) const
inline
Returns
Number of rows

◆ index_to_column()

size_t tu::bipartite_graph_dimensions::index_to_column ( index_type  index) const
inline
Parameters
indexA given node-index which indexes a column
Returns
Corresponding column index

◆ index_to_row()

size_t tu::bipartite_graph_dimensions::index_to_row ( index_type  index) const
inline
Parameters
indexA given node-index which indexes a row
Returns
Corresponding row index

◆ indexes_to_coordinates()

std::pair<size_t, size_t> tu::bipartite_graph_dimensions::indexes_to_coordinates ( index_type  first,
index_type  second 
) const
inline

Maps two node-indices at once and puts the resulting row and column and indices in this fixed ording into the resulting pair.

Parameters
firstA first node-index
secondA second node-index
Returns
A pair consisting of the corresponding column-index and row-index.

◆ is_column()

bool tu::bipartite_graph_dimensions::is_column ( index_type  index) const
inline
Parameters
indexA given node-index
Returns
true if it indexes a column

◆ is_row()

bool tu::bipartite_graph_dimensions::is_row ( index_type  index) const
inline
Parameters
indexA given node-index
Returns
true if it indexes a row

◆ row_to_index()

index_type tu::bipartite_graph_dimensions::row_to_index ( size_t  row) const
inline
Parameters
rowA given row-index
Returns
Correspoding node-index

◆ size()

size_t tu::bipartite_graph_dimensions::size ( ) const
inline
Returns
Number of all node-indices

◆ width()

size_t tu::bipartite_graph_dimensions::width ( ) const
inline
Returns
Number of columns

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