BooleSetSequence.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_BooleSetSequence_h_
#define polybori_BooleSetSequence_h_
// include basic definitions
#include <polybori/pbori_defs.h>
#include <vector>
#include <algorithm>
#include <polybori/BooleSet.h>
BEGIN_NAMESPACE_PBORI
class BooleSetSequence {
public:
typedef std::vector<BooleSet> vector_type;
typedef vector_type::const_iterator const_iterator;
typedef vector_type::const_reverse_iterator const_reverse_iterator;
BooleSetSequence(): m_termsets() { }
template <class SetType, class Operator>
BooleSetSequence(const SetType& terms, const Operator& func):
m_termsets(terms.size(), terms.ring()) {
std::transform(terms.begin(), terms.end(), m_termsets.begin(), func);
}
const_iterator begin() const { return m_termsets.begin(); }
const_iterator end() const { return m_termsets.end(); }
const_reverse_iterator rbegin() const { return m_termsets.rbegin(); }
const_reverse_iterator rend() const { return m_termsets.rend(); }
bool empty() const { return m_termsets.empty(); }
private:
vector_type m_termsets;
};
END_NAMESPACE_PBORI
#endif /* polybori_BooleSetSequence_h_ */
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
polybori::BooleSetSequence::end
const_iterator end() const
Definition: BooleSetSequence.h:54
BooleSet.h
polybori::BooleSetSequence::rbegin
const_reverse_iterator rbegin() const
Definition: BooleSetSequence.h:55
polybori::BooleSetSequence::empty
bool empty() const
Definition: BooleSetSequence.h:57
pbori_defs.h
polybori::BooleSetSequence::begin
const_iterator begin() const
Sequence-like interface.
Definition: BooleSetSequence.h:53
polybori::BooleSetSequence
This class converts a BooleSet to a sequence-like structure.
Definition: BooleSetSequence.h:33
polybori::transform
OutIter transform(InIter start, InIter finish, OutIter result, Object &obj, MemberFuncPtr func)
Definition: pbori_algo.h:849
polybori::BooleSetSequence::BooleSetSequence
BooleSetSequence(const SetType &terms, const Operator &func)
Construct sequence from a set of terms and an unary conversion function.
Definition: BooleSetSequence.h:46
polybori::BooleSetSequence::BooleSetSequence
BooleSetSequence()
Standard constructor yields an empty set.
Definition: BooleSetSequence.h:41
polybori::BooleSetSequence::const_reverse_iterator
vector_type::const_reverse_iterator const_reverse_iterator
Definition: BooleSetSequence.h:38
polybori::BooleSetSequence::const_iterator
vector_type::const_iterator const_iterator
Definition: BooleSetSequence.h:37
polybori::BooleSetSequence::vector_type
std::vector< BooleSet > vector_type
Definition: BooleSetSequence.h:36
polybori::BooleSetSequence::rend
const_reverse_iterator rend() const
Definition: BooleSetSequence.h:56