76 std::pair<index_type, weight_type>
getTo(
size_t n = 0)
const {
return std::make_pair(
m_to[n],
m_weights[n]); }
96 m_to = std::vector<index_type>(1, to);
97 m_weights = std::vector<weight_type>(1, weight);
107 template<
class InputIterator>
void setToIndices(InputIterator begin,
const InputIterator& end)
109 for (; begin != end; ++begin) {
110 m_to.push_back(begin->first);
Class to store a single element of a relation.
index_type m_from
index we point from.
RelationElement()
Empty constructor for ROOT.
index_type getFromIndex() const
Get index we point from.
index_type getToIndex(size_t n=0) const
Get nth index we point to.
ClassDef(RelationElement, 1)
Class to store a single element of a relation.
unsigned int index_type
type used for indices.
const std::vector< index_type > & getToIndices() const
Get vector of indices we point to.
void setToIndex(index_type to, weight_type weight=1.0)
Set index we point to, converts relation to 1:1 and discards all existing to-indices.
float weight_type
type used for weights.
size_t getSize() const
Get number of indices we points to.
void setToIndices(InputIterator begin, const InputIterator &end)
Set new indices and weights we point to.
const std::vector< weight_type > & getWeights() const
Get vector of weights we point to.
void setFromIndex(index_type from)
Set index we point from.
weight_type getWeight(size_t n=0) const
Get nth weight we point to.
std::pair< index_type, weight_type > getTo(size_t n=0) const
Get nth pair of index,weight we point to.
RelationElement(index_type from, index_type to, weight_type weight=1.0)
Constructor for a 1:1 relation.
std::vector< weight_type > m_weights
weights for to-indices.
RelationElement(index_type from, const InputIterator &begin, const InputIterator &end)
Constructor for a 1:n relation.
std::vector< index_type > m_to
indices we point to.
Abstract base class for different kinds of events.