Represent a pair of objects in Pair_Table. More...
#include <Objpair.h>
Public Member Functions | |
int | for_constraint (std::vector< signed char >::size_type k) const |
Retrieve the value set for a constraint. More... | |
void | has_constraint (std::vector< signed char >::size_type k, int val) |
Set the value for a constraint to a value. More... | |
int | i () const |
Return the index of the first object. More... | |
int | j () const |
Return the index of the second object. More... | |
Objpair (int i, int j, int nconstraints) | |
Constructor. More... | |
Private Attributes | |
std::vector< signed char > | _for_constraint |
int | _i |
int | _j |
Friends | |
std::ostream & | operator<< (std::ostream &s, const Objpair &o) |
Output stream operator, print the content of this Objpair to an output stream. More... | |
Represent a pair of objects in Pair_Table.
An Objpair consists of two object indices in a Fourvec_Event, plua a value for each constraint. This value is defined as:
hitfit::Objpair::Objpair | ( | int | i, |
int | j, | ||
int | nconstraints | ||
) |
Constructor.
i | Index of the first object. |
j | Index of the second object. |
nconstraints | The number of constraints in the problem. |
Definition at line 47 of file Objpair.cc.
int hitfit::Objpair::for_constraint | ( | std::vector< signed char >::size_type | k | ) | const |
Retrieve the value set for a constraint.
k | The index of the constraint, index starts from 0. |
void hitfit::Objpair::has_constraint | ( | std::vector< signed char >::size_type | k, |
int | val | ||
) |
Set the value for a constraint to a value.
k | The index of the constraint, index starts from 0. |
val | The value to set for this constraint. |
Definition at line 63 of file Objpair.cc.
References _for_constraint, assert(), and relval_2017::k.
Referenced by hitfit::Pair_Table::Pair_Table().
int hitfit::Objpair::i | ( | ) | const |
Return the index of the first object.
int hitfit::Objpair::j | ( | ) | const |
Return the index of the second object.
|
friend |
Output stream operator, print the content of this Objpair to an output stream.
s | The stream to which to write. |
o | The instance of Objpair to be printed. |
Definition at line 85 of file Objpair.cc.
|
private |
The list of values for each constraint.
Definition at line 132 of file Objpair.h.
Referenced by has_constraint(), and hitfit::operator<<().
|
private |
Index of the first object.
Definition at line 121 of file Objpair.h.
Referenced by hitfit::operator<<().
|
private |
Index of the second object.
Definition at line 126 of file Objpair.h.
Referenced by hitfit::operator<<().