Class to store a single element of a relation.
More...
#include <RelationElement.h>
|
| RelationElement () |
| Empty constructor for ROOT.
|
|
| RelationElement (index_type from, index_type to, weight_type weight=1.0) |
| Constructor for a 1:1 relation. More...
|
|
| RelationElement (index_type from, const std::vector< index_type > &to, const std::vector< weight_type > &weights) |
| Constructor for a 1:n relation. More...
|
|
template<class InputIterator > |
| RelationElement (index_type from, const InputIterator &begin, const InputIterator &end) |
| Constructor for a 1:n relation. More...
|
|
index_type | getFromIndex () const |
| Get index we point from.
|
|
size_t | getSize () const |
| Get number of indices we points to.
|
|
std::pair< index_type, weight_type > | getTo (size_t n=0) const |
| Get nth pair of index,weight we point to.
|
|
index_type | getToIndex (size_t n=0) const |
| Get nth index we point to.
|
|
weight_type | getWeight (size_t n=0) const |
| Get nth weight we point to.
|
|
const std::vector< index_type > & | getToIndices () const |
| Get vector of indices 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.
|
|
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.
|
|
template<class InputIterator > |
void | setToIndices (InputIterator begin, const InputIterator &end) |
| Set new indices and weights we point to. More...
|
|
Class to store a single element of a relation.
Supports 1:n relations with individual weights.
Definition at line 33 of file RelationElement.h.
◆ RelationElement() [1/3]
Constructor for a 1:1 relation.
- Parameters
-
from | index to point from |
to | index to point to |
weight | weight of the relation |
Definition at line 52 of file RelationElement.h.
◆ RelationElement() [2/3]
Constructor for a 1:n relation.
- Parameters
-
from | index to point from |
to | indices to point to |
weights | weights of the relation |
Definition at line 20 of file RelationElement.cc.
23 m_to(to.begin(), to.end()),
26 if (to.size() != weights.size()) {
27 B2FATAL(
"Index and weight vector sizes differ!");
◆ RelationElement() [3/3]
Constructor for a 1:n relation.
- Parameters
-
from | index to point from |
begin | iterator pointing to the begin of a sequence of std::pair<index_type,weight_type> or compatible |
end | iterator pointing to the end of a sequence of std::pair<index_type,weight_type> or compatible |
Definition at line 71 of file RelationElement.h.
◆ setToIndices()
void setToIndices |
( |
InputIterator |
begin, |
|
|
const InputIterator & |
end |
|
) |
| |
|
inline |
Set new indices and weights we point to.
- Parameters
-
begin | iterator pointing to the begin of a sequence of std::pair<index_type,weight_type> or compatible |
end | iterator pointing to the end of a sequence of std::pair<index_type,weight_type> or compatible |
Definition at line 115 of file RelationElement.h.
The documentation for this class was generated from the following files: