|
|
Go to the documentation of this file.
4 #include <boost/iterator/iterator_facade.hpp>
5 #include <boost/operators.hpp>
19 : boost::incrementable<
23 boost::multipliable<poly<T>, boost::multipliable2<poly<T>, T, boost::less_than_comparable<poly<T> > > > > > {
36 while (column !=
columns.end() && Rcolumn !=
R.columns.end() && *column == *Rcolumn) {
40 return column !=
columns.end() && Rcolumn !=
R.columns.end() && *column < *Rcolumn;
43 columns.push_back(std::set<T>());
59 columns.back().insert(
R.begin(),
R.end());
76 size *= column->size();
80 class const_iterator :
public boost::iterator_facade<const_iterator, T const, boost::bidirectional_traversal_tag, T> {
83 std::list<typename std::set<T>::const_iterator>
state;
86 typedef typename std::list<typename std::set<T>::const_iterator>::iterator
state_iterator;
99 while (column !=
end && ++*istate == column->
end()) {
107 while (istate !=
state.begin()) {
109 *istate = (--column)->
begin();
115 while (column !=
end && *istate == column->
begin()) {
121 while (istate !=
state.begin()) {
123 *istate = --((--column)->
end());
131 while (column !=
end)
137 *--(it.
state.end()) = (--
p.getColumns().end())->
end();
152 template <
class charT,
class traits,
class T>
153 inline std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& strm,
const poly<T>&
f) {
154 for (
auto const& column :
f.getColumns()) {
156 for (
auto const&
entry : column)
157 strm <<
entry <<
", ";
158 strm <<
" )" << std::endl;
const_iterator(const poly &p)
std::list< std::set< T > > columns
std::list< std::set< T > >::const_iterator begin
poly operator*=(const poly &R)
std::list< std::set< T > >::const_iterator const_column_iterator
std::list< std::set< T > >::iterator column_iterator
const_iterator end() const
const_iterator begin() const
std::list< typename std::set< T >::const_iterator > state
bool equal(const_iterator const &rhs) const
bool operator<(const poly &R) const
poly operator+=(const T &r)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const poly< T > &f)
std::list< typename std::set< T >::const_iterator >::iterator state_iterator
poly< T > operator+(const poly< T > &, const char *)
std::list< typename std::set< T >::const_iterator >::const_iterator const_state_iterator
static const_iterator end_of(const poly &p)
poly operator+=(const poly &R)
friend class boost::iterator_core_access
auto const & getColumns() const
std::list< std::set< T > >::const_iterator end
poly operator*=(const T &r)
bool equal(const T &first, const T &second)