Belle II Software light-2406-ragdoll
|
Class to store a single element of a relation. More...
#include <RelationElement.h>
Public Types | |
typedef unsigned int | index_type |
type used for indices. | |
typedef float | weight_type |
type used for weights. | |
Public Member Functions | |
RelationElement () | |
Empty constructor for ROOT. | |
RelationElement (index_type from, index_type to, weight_type weight=1.0) | |
Constructor for a 1:1 relation. | |
RelationElement (index_type from, const std::vector< index_type > &to, const std::vector< weight_type > &weights) | |
Constructor for a 1:n relation. | |
template<class InputIterator > | |
RelationElement (index_type from, const InputIterator &begin, const InputIterator &end) | |
Constructor for a 1:n relation. | |
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. | |
Protected Member Functions | |
ClassDef (RelationElement, 1) | |
Class to store a single element of a relation. | |
Protected Attributes | |
index_type | m_from |
index we point from. | |
std::vector< index_type > | m_to |
indices we point to. | |
std::vector< weight_type > | m_weights |
weights for to-indices. | |
Class to store a single element of a relation.
Supports 1:n relations with individual weights.
Definition at line 25 of file RelationElement.h.
typedef unsigned int index_type |
type used for indices.
Definition at line 29 of file RelationElement.h.
typedef float weight_type |
type used for weights.
Definition at line 32 of file RelationElement.h.
RelationElement | ( | ) |
Empty constructor for ROOT.
Definition at line 28 of file RelationElement.cc.
|
inline |
Constructor for a 1:1 relation.
from | index to point from |
to | index to point to |
weight | weight of the relation |
Definition at line 44 of file RelationElement.h.
RelationElement | ( | index_type | from, |
const std::vector< index_type > & | to, | ||
const std::vector< weight_type > & | weights | ||
) |
Constructor for a 1:n relation.
from | index to point from |
to | indices to point to |
weights | weights of the relation |
Definition at line 18 of file RelationElement.cc.
|
inline |
Constructor for a 1:n relation.
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 63 of file RelationElement.h.
|
inline |
|
inline |
|
inline |
Get nth pair of index,weight we point to.
Definition at line 76 of file RelationElement.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set index we point to, converts relation to 1:1 and discards all existing to-indices.
Definition at line 94 of file RelationElement.h.
|
inline |
Set new indices and weights we point to.
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 107 of file RelationElement.h.
|
protected |
index we point from.
Definition at line 118 of file RelationElement.h.
|
protected |
indices we point to.
Definition at line 121 of file RelationElement.h.
|
protected |
weights for to-indices.
Definition at line 124 of file RelationElement.h.