CMR  1.3.0
Public Types | Public Member Functions | List of all members
tu::matroid< NameType > Class Template Reference

#include <matroid.hpp>

Public Types

typedef NameType name_type
 
typedef size_t size_type
 
typedef std::vector< name_typename_vector_type
 
typedef name_typereference_type
 
typedef const name_typeconst_reference_type
 
typedef matroid< name_typeself_type
 

Public Member Functions

 matroid (const name_vector_type &names1, const name_vector_type &names2)
 
 matroid (size_t size1=0, size_t size2=0)
 
void resize (size_t size1, size_t size2)
 
size_t size1 () const
 
size_t size2 () const
 
name_typename1 (size_t index)
 
const name_typename1 (size_t index) const
 
name_typename2 (size_t index)
 
const name_typename2 (size_t index) const
 
std::set< NameType > get_elements () const
 

Detailed Description

template<typename NameType>
class tu::matroid< NameType >

A matroid class which maintains the index-to-element relation. It should mostly be associated with a representation matrix.

Member Typedef Documentation

◆ const_reference_type

template<typename NameType >
typedef const name_type& tu::matroid< NameType >::const_reference_type

◆ name_type

template<typename NameType >
typedef NameType tu::matroid< NameType >::name_type

◆ name_vector_type

template<typename NameType >
typedef std::vector<name_type> tu::matroid< NameType >::name_vector_type

◆ reference_type

template<typename NameType >
typedef name_type& tu::matroid< NameType >::reference_type

◆ self_type

template<typename NameType >
typedef matroid<name_type> tu::matroid< NameType >::self_type

◆ size_type

template<typename NameType >
typedef size_t tu::matroid< NameType >::size_type

Constructor & Destructor Documentation

◆ matroid() [1/2]

template<typename NameType >
tu::matroid< NameType >::matroid ( const name_vector_type names1,
const name_vector_type names2 
)
inline

Constructs a matroid by copying the matroid elements from the row/column vectors.

Parameters
names1Row names
names2Column names

◆ matroid() [2/2]

template<typename NameType >
tu::matroid< NameType >::matroid ( size_t  size1 = 0,
size_t  size2 = 0 
)
inline

Constructs a matroid with given height and width. The names are set in default manner.

Parameters
size1Size of a base
size2Size of a cobase

Member Function Documentation

◆ get_elements()

template<typename NameType >
std::set<NameType> tu::matroid< NameType >::get_elements ( ) const
inline
Returns
A set of all matroid elements

◆ name1() [1/2]

template<typename NameType >
name_type& tu::matroid< NameType >::name1 ( size_t  index)
inline
Parameters
indexA row index
Returns
The corresponding matroid element

◆ name1() [2/2]

template<typename NameType >
const name_type& tu::matroid< NameType >::name1 ( size_t  index) const
inline
Parameters
indexA row index
Returns
The corresponding matroid element

◆ name2() [1/2]

template<typename NameType >
name_type& tu::matroid< NameType >::name2 ( size_t  index)
inline
Parameters
indexA column index
Returns
The corresponding matroid element

◆ name2() [2/2]

template<typename NameType >
const name_type& tu::matroid< NameType >::name2 ( size_t  index) const
inline
Parameters
indexA column index
Returns
The corresponding matroid element

◆ resize()

template<typename NameType >
void tu::matroid< NameType >::resize ( size_t  size1,
size_t  size2 
)
inline

Resizes a matroid.

Parameters
size1New height, i.e. size of each base
size2New width, i.e. size of each cobase

◆ size1()

template<typename NameType >
size_t tu::matroid< NameType >::size1 ( ) const
inline
Returns
Height, i.e. size of each base

◆ size2()

template<typename NameType >
size_t tu::matroid< NameType >::size2 ( ) const
inline
Returns
Width, i.e. size of each cobase

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