7 #include <boost/numeric/ublas/matrix.hpp>
8 #include <boost/numeric/ublas/matrix_proxy.hpp>
20 template <
typename NameType>
39 _names1(names1), _names2(names2)
65 _names1.resize(
size1);
66 for (
size_t i = 0; i <
size1; ++i)
67 _names1[i] = -(i + 1);
68 _names2.resize(
size2);
69 for (
size_t i = 0; i <
size2; ++i)
79 return _names1.size();
88 return _names2.size();
98 return _names1[index];
108 return _names1[index];
118 return _names2[index];
128 return _names2[index];
137 std::set <NameType> result;
139 std::copy(_names1.begin(), _names1.end(), std::inserter(result, result.end()));
140 std::copy(_names2.begin(), _names2.end(), std::inserter(result, result.end()));
161 template <
typename NameType>
176 template <
typename Matro
idType,
typename MatrixType>
191 template <
typename NameType>
206 template <
typename Matro
idType,
typename MatrixType>
221 template <
typename NameType>
236 template <
typename Matro
idType,
typename MatrixType>
250 template <
typename Matro
idType,
typename MatrixType>
257 for (
size_t column = 0; column <
matroid.
size2(); ++column)
262 for (
size_t column = 0; column <
matroid.
size2(); ++column)
268 std::cout <<
"\n" << std::setw(3) <<
matroid.
name1(row) <<
" |";
269 for (
size_t column = 0; column <
matroid.
size2(); ++column)
271 std::cout << std::setw(3) << matrix(row, column);
274 std::cout << std::endl;
286 template <
typename Matro
idType,
typename MatrixType>
293 for (
size_t column = 0; column < width; ++column)
298 for (
size_t column = 0; column < width; ++column)
302 for (
size_t row = 0; row < height; ++row)
304 std::cout <<
"\n" << std::setw(3) <<
matroid.
name1(row) <<
" |";
305 for (
size_t column = 0; column < width; ++column)
307 std::cout << std::setw(3) << matrix(row, column);
310 std::cout << std::endl;
320 template <
typename Matro
idType>
323 std::set <int> elements;
326 for (
size_t column = 0; column <
matroid.
size2(); ++column)
Definition: matroid.hpp:22
name_type & reference_type
Definition: matroid.hpp:27
std::vector< name_type > name_vector_type
Definition: matroid.hpp:26
const name_type & name1(size_t index) const
Definition: matroid.hpp:106
void resize(size_t size1, size_t size2)
Definition: matroid.hpp:63
size_t size1() const
Definition: matroid.hpp:77
matroid(size_t size1=0, size_t size2=0)
Definition: matroid.hpp:51
const name_type & name2(size_t index) const
Definition: matroid.hpp:126
size_t size2() const
Definition: matroid.hpp:86
matroid(const name_vector_type &names1, const name_vector_type &names2)
Definition: matroid.hpp:38
NameType name_type
Definition: matroid.hpp:24
name_type & name2(size_t index)
Definition: matroid.hpp:116
matroid< name_type > self_type
Definition: matroid.hpp:29
const name_type & const_reference_type
Definition: matroid.hpp:28
size_t size_type
Definition: matroid.hpp:25
name_type & name1(size_t index)
Definition: matroid.hpp:96
std::set< NameType > get_elements() const
Definition: matroid.hpp:135
Definition: algorithm.hpp:14
std::set< int > matroid_elements(const MatroidType &matroid)
Definition: matroid.hpp:321
void matrix_permute1(MatrixType &matrix, size_t index1, size_t index2)
Definition: matrix.hpp:1723
void matroid_print(const MatroidType &matroid, const MatrixType &matrix)
Definition: matroid.hpp:251
void matroid_print_minor(const MatroidType &matroid, const MatrixType &matrix, size_t height, size_t width)
Definition: matroid.hpp:287
void matroid_permute1(matroid< NameType > &matroid, size_t index1, size_t index2)
Definition: matroid.hpp:162
void matroid_permute2(matroid< NameType > &matroid, size_t index1, size_t index2)
Definition: matroid.hpp:192
void matrix_binary_pivot(matrix_permuted< MatrixType > &matrix, size_t i, size_t j)
Definition: matrix_permuted.hpp:224
void matroid_binary_pivot(matroid< NameType > &matroid, size_t i, size_t j)
Definition: matroid.hpp:222
matroid< int > integer_matroid
A matroid with integer names.
Definition: matroid.hpp:151
void matrix_permute2(MatrixType &matrix, size_t index1, size_t index2)
Definition: matrix.hpp:1740