MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DDTree< ValueType > Class Template Reference

#include <DDTree.h>

Public Member Functions

template<typename SORTERTYPE >
void sortDaughtersBy ()
 
template<typename SORTERTYPE >
void sortAllBy ()
 
void sortDaughters ()
 
bool isFinalState () const
 
int nDgtr () const
 
void setVal (const ValueType &m)
 
const ValueType & getVal () const
 
ValueType & getVal ()
 
const ValueType & getDgtrVal (int i) const
 
ValueType & getDgtrVal (int i)
 
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr (int i) const
 
MINT::counted_ptr< DDTree< ValueType > > getDgtrTreePtr (int i)
 
int setDgtrSize (int i)
 
void setDgtr (unsigned int i, const MINT::counted_ptr< DDTree< ValueType > > &tr)
 
 DDTree ()
 
 DDTree (const ValueType &pdg_id)
 
 DDTree (const DDTree< ValueType > *parent)
 
 DDTree (const ValueType &val, const DDTree< ValueType > *parent)
 
bool hasParent () const
 
template<typename COMPATIBLE_TYPE >
MINT::counted_ptr< DDTree< COMPATIBLE_TYPE > > CloneVariableType (DDTree< COMPATIBLE_TYPE > *parent=0) const
 
MINT::counted_ptr< DDTree< ValueType > > Clone (DDTree< ValueType > *parent=0) const
 
template<typename COMPATIBLE_ITEM >
void Copy (const DDTree< COMPATIBLE_ITEM > &other)
 
 DDTree (const DDTree< ValueType > &other)
 
template<typename COMPATIBLE_ITEM >
 DDTree (const DDTree< COMPATIBLE_ITEM > &other)
 
DDTree< ValueType > operator= (const DDTree< ValueType > &other)
 
template<typename COMPATIBLE_ITEM >
DDTree< ValueType > operator= (const DDTree< COMPATIBLE_ITEM > &other)
 
MINT::counted_ptr< DDTree< ValueType > > addDgtr (const DDTree< ValueType > *treePtr)
 
MINT::counted_ptr< DDTree< ValueType > > addDgtr (const ValueType &pdg_id)
 
MINT::counted_ptr< DDTree< ValueType > > addDgtr (const ValueType &pdg_id1, const ValueType &pdg_id2)
 
MINT::counted_ptr< DDTree< ValueType > > addDgtr (const ValueType &pdg_id1, const ValueType &pdg_id2, const ValueType &pdg_id3)
 
MINT::counted_ptr< DDTree< ValueType > > addDgtr (const ValueType &pdg_id1, const ValueType &pdg_id2, const ValueType &pdg_id3, const ValueType &pdg_id4)
 
void addDgtrArray (ValueType pdg_id[], int n)
 
void addDgtrArray (DDTree< ValueType > *treePtr[], int n)
 
virtual ~DDTree ()
 
const DDTree< ValueType > * getParent () const
 
int nSisters () const
 
std::vector< MINT::const_counted_ptr< DDTree< ValueType > > > getSistersTrees () const
 
int nGenerations () const
 
std::vector< const ValueType * > finalState () const
 
std::vector< ValueType * > finalState ()
 
MINT::counted_ptr< std::vector< const ValueType * > > finalStatePtr () const
 
MINT::counted_ptr< std::vector< ValueType * > > finalStatePtr ()
 
void finalState (std::vector< const ValueType * > &theList) const
 
void finalState (std::vector< ValueType * > &theList)
 
template<typename COMPARABLE_CLASS >
std::vector< ValueType * > finalStateInThisOrder (const std::vector< COMPARABLE_CLASS > &pattern)
 
void print (std::ostream &os=std::cout, std::string indentString="") const
 
void oneLiner (std::stringstream &seam, int generation=0) const
 
void oneLiner (std::string &ring) const
 
std::string oneLiner () const
 

Protected Member Functions

void setParent (const DDTree< ValueType > *parent=0)
 
void disconnectAllDaughters ()
 

Protected Attributes

std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
 
ValueType _thisVal
 
const DDTree< ValueType > * _parentPtr
 

Detailed Description

template<typename ValueType>
class DDTree< ValueType >

Definition at line 37 of file DDTree.h.

Constructor & Destructor Documentation

◆ DDTree() [1/6]

template<typename ValueType>
DDTree< ValueType >::DDTree ( )
inline

Definition at line 136 of file DDTree.h.

136 : _parentPtr(0){};
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ DDTree() [2/6]

template<typename ValueType>
DDTree< ValueType >::DDTree ( const ValueType &  pdg_id)
inline

Definition at line 144 of file DDTree.h.

145  : _thisVal(pdg_id)
146  , _parentPtr(0){
147  daughters.clear();
148  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43
ValueType _thisVal
Definition: DDTree.h:41

◆ DDTree() [3/6]

template<typename ValueType>
DDTree< ValueType >::DDTree ( const DDTree< ValueType > *  parent)
inline

Definition at line 149 of file DDTree.h.

149 : _parentPtr(parent){};
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ DDTree() [4/6]

template<typename ValueType>
DDTree< ValueType >::DDTree ( const ValueType &  val,
const DDTree< ValueType > *  parent 
)
inline

Definition at line 150 of file DDTree.h.

151  : _thisVal(val)
152  , _parentPtr(parent){};
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43
ValueType _thisVal
Definition: DDTree.h:41

◆ DDTree() [5/6]

template<typename ValueType>
DDTree< ValueType >::DDTree ( const DDTree< ValueType > &  other)
inline

Definition at line 189 of file DDTree.h.

190  :_parentPtr(0){
191  this->Copy(other);
192  }
void Copy(const DDTree< COMPATIBLE_ITEM > &other)
Definition: DDTree.h:179
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ DDTree() [6/6]

template<typename ValueType>
template<typename COMPATIBLE_ITEM >
DDTree< ValueType >::DDTree ( const DDTree< COMPATIBLE_ITEM > &  other)
inline

Definition at line 195 of file DDTree.h.

196  : _parentPtr(0){
197  this->Copy(other);
198  }
void Copy(const DDTree< COMPATIBLE_ITEM > &other)
Definition: DDTree.h:179
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ ~DDTree()

template<typename ValueType>
virtual DDTree< ValueType >::~DDTree ( )
inlinevirtual

Definition at line 257 of file DDTree.h.

257  {
259  }
void disconnectAllDaughters()
Definition: DDTree.h:60

Member Function Documentation

◆ addDgtr() [1/5]

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::addDgtr ( const DDTree< ValueType > *  treePtr)
inline

Definition at line 211 of file DDTree.h.

211  {
212  MINT::counted_ptr< DDTree<ValueType> > newDgtr(treePtr->Clone(this));
213  daughters.push_back(newDgtr);
214  //sortDaughters();
215  return newDgtr;
216  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
MINT::counted_ptr< DDTree< ValueType > > Clone(DDTree< ValueType > *parent=0) const
Definition: DDTree.h:174

◆ addDgtr() [2/5]

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::addDgtr ( const ValueType &  pdg_id)
inline

Definition at line 217 of file DDTree.h.

217  {
218  MINT::counted_ptr< DDTree<ValueType> > dgtrTree(new DDTree(pdg_id, this));
219  daughters.push_back(dgtrTree);
220  //sortDaughters();
221  return dgtrTree;
222  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
DDTree()
Definition: DDTree.h:136

◆ addDgtr() [3/5]

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::addDgtr ( const ValueType &  pdg_id1,
const ValueType &  pdg_id2 
)
inline

Definition at line 224 of file DDTree.h.

224  {
225  addDgtr(pdg_id1);
226  //sortDaughters();
227  return addDgtr(pdg_id2);
228  }
MINT::counted_ptr< DDTree< ValueType > > addDgtr(const DDTree< ValueType > *treePtr)
Definition: DDTree.h:211

◆ addDgtr() [4/5]

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::addDgtr ( const ValueType &  pdg_id1,
const ValueType &  pdg_id2,
const ValueType &  pdg_id3 
)
inline

Definition at line 229 of file DDTree.h.

232  {
233  addDgtr(pdg_id1);
234  addDgtr(pdg_id2);
235  return addDgtr(pdg_id3);
236  }
MINT::counted_ptr< DDTree< ValueType > > addDgtr(const DDTree< ValueType > *treePtr)
Definition: DDTree.h:211

◆ addDgtr() [5/5]

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::addDgtr ( const ValueType &  pdg_id1,
const ValueType &  pdg_id2,
const ValueType &  pdg_id3,
const ValueType &  pdg_id4 
)
inline

Definition at line 237 of file DDTree.h.

241  {
242  addDgtr(pdg_id1);
243  addDgtr(pdg_id2);
244  addDgtr(pdg_id3);
245  return addDgtr(pdg_id4);
246  }
MINT::counted_ptr< DDTree< ValueType > > addDgtr(const DDTree< ValueType > *treePtr)
Definition: DDTree.h:211

◆ addDgtrArray() [1/2]

template<typename ValueType>
void DDTree< ValueType >::addDgtrArray ( ValueType  pdg_id[],
int  n 
)
inline

Definition at line 247 of file DDTree.h.

247  {
248  for(int i=0; i<n; i++){
249  addDgtr(pdg_id[i]);
250  }
251  }
MINT::counted_ptr< DDTree< ValueType > > addDgtr(const DDTree< ValueType > *treePtr)
Definition: DDTree.h:211

◆ addDgtrArray() [2/2]

template<typename ValueType>
void DDTree< ValueType >::addDgtrArray ( DDTree< ValueType > *  treePtr[],
int  n 
)
inline

Definition at line 252 of file DDTree.h.

252  {
253  for(int i=0; i<n; i++){
254  addDgtr(treePtr[i]);
255  }
256  }
MINT::counted_ptr< DDTree< ValueType > > addDgtr(const DDTree< ValueType > *treePtr)
Definition: DDTree.h:211

◆ Clone()

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::Clone ( DDTree< ValueType > *  parent = 0) const
inline

Definition at line 174 of file DDTree.h.

174  {
175  return CloneVariableType<ValueType>(parent);
176  }

◆ CloneVariableType()

template<typename ValueType>
template<typename COMPATIBLE_TYPE >
MINT::counted_ptr<DDTree<COMPATIBLE_TYPE> > DDTree< ValueType >::CloneVariableType ( DDTree< COMPATIBLE_TYPE > *  parent = 0) const
inline

Definition at line 159 of file DDTree.h.

159  {
160  //CloneVariableType(counted_ptr<DDTree<COMPATIBLE_TYPE> > parent=0) const{ // BIG DEBUG
161 
163  top(new DDTree<COMPATIBLE_TYPE>(static_cast<COMPATIBLE_TYPE>(_thisVal)
164  , parent)
165  );
166 
167  top->setDgtrSize(daughters.size());
168  for(unsigned int i=0; i < daughters.size(); i++){
169  top->setDgtr(i, daughters[i]->template CloneVariableType<COMPATIBLE_TYPE>(top.get()));
170  }
171  return top;
172  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
Definition: DDTree.h:37
ValueType _thisVal
Definition: DDTree.h:41

◆ Copy()

template<typename ValueType>
template<typename COMPATIBLE_ITEM >
void DDTree< ValueType >::Copy ( const DDTree< COMPATIBLE_ITEM > &  other)
inline

Definition at line 179 of file DDTree.h.

180  {
181  _thisVal = (ValueType) (other.getVal());
182  daughters.resize(other.nDgtr());
183  for(int i=0; i < other.nDgtr(); i++){
184  daughters[i] = other.getDgtrTreePtr(i)->template CloneVariableType<ValueType>(this);
185  }
186  return;
187  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
const ValueType & getVal() const
Definition: DDTree.h:102
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
Definition: DDTree.h:114
int nDgtr() const
Definition: DDTree.h:96
ValueType _thisVal
Definition: DDTree.h:41

◆ disconnectAllDaughters()

template<typename ValueType>
void DDTree< ValueType >::disconnectAllDaughters ( )
inlineprotected

Definition at line 60 of file DDTree.h.

60  {
61  if(daughters.empty()) return;
62  for(unsigned int i=0; i<daughters.size(); i++){
63  if(0!=daughters[i]) {
64  daughters[i]->setParent(0);
65  // Now using counted pointers - no need
66  // to delete daughters, just "disconnect"
67  //daughters[i]->deleteAllDaughters();
68  //delete daughters[i]; // MINT::counted_ptr, no need to delete
69  }
70  }
71  daughters.clear();
72  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ finalState() [1/4]

template<typename ValueType>
std::vector<const ValueType*> DDTree< ValueType >::finalState ( ) const
inline

Definition at line 293 of file DDTree.h.

293  {
294  std::vector<const ValueType*> listOfStableDaughters;
295  finalState(listOfStableDaughters);
296  return listOfStableDaughters;
297  }
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ finalState() [2/4]

template<typename ValueType>
std::vector<ValueType*> DDTree< ValueType >::finalState ( )
inline

Definition at line 298 of file DDTree.h.

298  {
299  std::vector<ValueType*> listOfStableDaughters;
300  finalState(listOfStableDaughters);
301  return listOfStableDaughters;
302  }
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ finalState() [3/4]

template<typename ValueType>
void DDTree< ValueType >::finalState ( std::vector< const ValueType * > &  theList) const
inline

Definition at line 316 of file DDTree.h.

316  {
317  if(daughters.empty()){
318  theList.push_back(&_thisVal);
319  }else{
320  for(int i=0; i<nDgtr(); i++){
321  daughters[i]->finalState(theList);
322  }
323  }
324  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96
ValueType _thisVal
Definition: DDTree.h:41

◆ finalState() [4/4]

template<typename ValueType>
void DDTree< ValueType >::finalState ( std::vector< ValueType * > &  theList)
inline

Definition at line 325 of file DDTree.h.

325  {
326  if(daughters.empty()){
327  theList.push_back(&_thisVal);
328  }else{
329  for(int i=0; i<nDgtr(); i++){
330  daughters[i]->finalState(theList);
331  }
332  }
333  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96
ValueType _thisVal
Definition: DDTree.h:41

◆ finalStateInThisOrder()

template<typename ValueType>
template<typename COMPARABLE_CLASS >
std::vector<ValueType*> DDTree< ValueType >::finalStateInThisOrder ( const std::vector< COMPARABLE_CLASS > &  pattern)
inline

Definition at line 337 of file DDTree.h.

337  {
338  std::vector<ValueType*> stableDaughters = finalState();
339 
340  std::vector<ValueType*> sorted;
341 
342  if(stableDaughters.size() != pattern.size()){
343  return sorted;
344  }
345 
346  for(unsigned int i=0; i<pattern.size(); i++){
347  for(typename std::vector<ValueType*>::iterator jt = stableDaughters.begin();
348  jt != stableDaughters.end();
349  jt++){
350  if( *(*jt) == pattern[i] ){
351  sorted.push_back(*jt);
352  stableDaughters.erase(jt);
353  break;
354  }
355  }
356  }
357  return sorted;
358  }
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ finalStatePtr() [1/2]

template<typename ValueType>
MINT::counted_ptr<std::vector<const ValueType*> > DDTree< ValueType >::finalStatePtr ( ) const
inline

Definition at line 304 of file DDTree.h.

304  {
306  listOfStableDaughtersPtr( new std::vector<const ValueType*> );
307  finalState(*listOfStableDaughtersPtr);
308  return listOfStableDaughtersPtr;
309  }
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ finalStatePtr() [2/2]

template<typename ValueType>
MINT::counted_ptr<std::vector<ValueType*> > DDTree< ValueType >::finalStatePtr ( )
inline

Definition at line 310 of file DDTree.h.

310  {
312  listOfStableDaughtersPtr( new std::vector<ValueType*> );
313  finalState(*listOfStableDaughtersPtr);
314  return listOfStableDaughtersPtr;
315  }
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ getDgtrTreePtr() [1/2]

template<typename ValueType>
MINT::const_counted_ptr<DDTree<ValueType> > DDTree< ValueType >::getDgtrTreePtr ( int  i) const
inline

Definition at line 114 of file DDTree.h.

114  {
115  if(i < 0 || i >= nDgtr()){
117  }
118  return daughters[i];
119  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96

◆ getDgtrTreePtr() [2/2]

template<typename ValueType>
MINT::counted_ptr<DDTree<ValueType> > DDTree< ValueType >::getDgtrTreePtr ( int  i)
inline

Definition at line 120 of file DDTree.h.

120  {
121  if(i < 0 || i >= nDgtr()){
123  }
124  return daughters[i];
125  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96

◆ getDgtrVal() [1/2]

template<typename ValueType>
const ValueType& DDTree< ValueType >::getDgtrVal ( int  i) const
inline

Definition at line 108 of file DDTree.h.

108  {
109  return daughters[i]->getVal();
110  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ getDgtrVal() [2/2]

template<typename ValueType>
ValueType& DDTree< ValueType >::getDgtrVal ( int  i)
inline

Definition at line 111 of file DDTree.h.

111  {
112  return daughters[i]->getVal();
113  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ getParent()

template<typename ValueType>
const DDTree<ValueType>* DDTree< ValueType >::getParent ( ) const
inline

Definition at line 261 of file DDTree.h.

261  {
262  return _parentPtr;
263  }
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ getSistersTrees()

template<typename ValueType>
std::vector<MINT::const_counted_ptr<DDTree<ValueType> > > DDTree< ValueType >::getSistersTrees ( ) const
inline

Definition at line 271 of file DDTree.h.

271  {
272  // i.e. parent's daughters,except yourself
273  std::vector<MINT::const_counted_ptr< DDTree<ValueType> > > sistersTree;
274  if(0 == _parentPtr) return sistersTree;
275 
276  for(int i=0; i < _parentPtr->nDgtr(); i++){
277  if(_parentPtr->daughters[i].get() != this){
278  sistersTree.push_back(_parentPtr->daughters[i]);
279  }
280  }
281  return sistersTree;
282  }
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ getVal() [1/2]

template<typename ValueType>
const ValueType& DDTree< ValueType >::getVal ( ) const
inline

Definition at line 102 of file DDTree.h.

102  {
103  return _thisVal;
104  }
ValueType _thisVal
Definition: DDTree.h:41

◆ getVal() [2/2]

template<typename ValueType>
ValueType& DDTree< ValueType >::getVal ( )
inline

Definition at line 105 of file DDTree.h.

105  {
106  return _thisVal;
107  }
ValueType _thisVal
Definition: DDTree.h:41

◆ hasParent()

template<typename ValueType>
bool DDTree< ValueType >::hasParent ( ) const
inline

Definition at line 154 of file DDTree.h.

154  {
155  return ! (0 == _parentPtr);
156  }
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ isFinalState()

template<typename ValueType>
bool DDTree< ValueType >::isFinalState ( ) const
inline

Definition at line 93 of file DDTree.h.

93  {
94  return nDgtr() == 0;
95  }
int nDgtr() const
Definition: DDTree.h:96

◆ nDgtr()

template<typename ValueType>
int DDTree< ValueType >::nDgtr ( ) const
inline

Definition at line 96 of file DDTree.h.

96  {
97  return daughters.size();
98  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ nGenerations()

template<typename ValueType>
int DDTree< ValueType >::nGenerations ( ) const
inline

Definition at line 283 of file DDTree.h.

283  {
284  int nMax=0;
285  if(! nDgtr()) return 1;
286  for(int i=0; i<nDgtr(); i++){
287  int n = daughters[i]->nGenerations();
288  if(n > nMax) nMax = n;
289  }
290  return nMax + 1;
291  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96

◆ nSisters()

template<typename ValueType>
int DDTree< ValueType >::nSisters ( ) const
inline

Definition at line 265 of file DDTree.h.

265  {
266  if(0 == _parentPtr) return 0;
267  return _parentPtr->nDgtr() -1;
268  }
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ oneLiner() [1/3]

template<typename ValueType>
void DDTree< ValueType >::oneLiner ( std::stringstream &  seam,
int  generation = 0 
) const
inline

Definition at line 375 of file DDTree.h.

376  {
377  seam << _thisVal;
378  if(nDgtr() <= 0) return;
379  if(generation > 0) seam << "(";
380  seam << "->";
381  for(int i=0; i<nDgtr(); i++){
382  daughters[i]->oneLiner(seam, generation + 1);
383  if(i < nDgtr()-1) seam << ",";
384  }
385  if(generation > 0) seam << ")";
386  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96
ValueType _thisVal
Definition: DDTree.h:41

◆ oneLiner() [2/3]

template<typename ValueType>
void DDTree< ValueType >::oneLiner ( std::string &  ring) const
inline

Definition at line 387 of file DDTree.h.

387  {
388  std::stringstream seam;
389  oneLiner(seam);
390  seam >> ring;
391  }
std::string oneLiner() const
Definition: DDTree.h:392

◆ oneLiner() [3/3]

template<typename ValueType>
std::string DDTree< ValueType >::oneLiner ( ) const
inline

Definition at line 392 of file DDTree.h.

392  {
393  std::string ring;
394  oneLiner(ring);
395  return ring;
396  }
std::string oneLiner() const
Definition: DDTree.h:392

◆ operator=() [1/2]

template<typename ValueType>
DDTree<ValueType> DDTree< ValueType >::operator= ( const DDTree< ValueType > &  other)
inline

Definition at line 199 of file DDTree.h.

199  {
200  this->Copy(other);
201  return *this;
202  }
void Copy(const DDTree< COMPATIBLE_ITEM > &other)
Definition: DDTree.h:179

◆ operator=() [2/2]

template<typename ValueType>
template<typename COMPATIBLE_ITEM >
DDTree<ValueType> DDTree< ValueType >::operator= ( const DDTree< COMPATIBLE_ITEM > &  other)
inline

Definition at line 205 of file DDTree.h.

205  {
206  this->Copy(other);
207  return *this;
208  }
void Copy(const DDTree< COMPATIBLE_ITEM > &other)
Definition: DDTree.h:179

◆ print()

template<typename ValueType>
void DDTree< ValueType >::print ( std::ostream &  os = std::cout,
std::string  indentString = "" 
) const
inline

Definition at line 360 of file DDTree.h.

362  {
363  os << " ";
364  os << _thisVal << std::endl;
365  for(int i=0; i<nDgtr(); i++){
366  if(i==nDgtr()-1){
367  os << indentString + " '--";
368  daughters[i]->print(os, indentString + " ");
369  } else{
370  os << indentString + " |--";
371  daughters[i]->print(os, indentString + " | ");
372  }
373  }
374  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40
int nDgtr() const
Definition: DDTree.h:96
ValueType _thisVal
Definition: DDTree.h:41

◆ setDgtr()

template<typename ValueType>
void DDTree< ValueType >::setDgtr ( unsigned int  i,
const MINT::counted_ptr< DDTree< ValueType > > &  tr 
)
inline

Definition at line 131 of file DDTree.h.

131  {
132  if(i >= daughters.size()) daughters.resize(i+0);
133  daughters[i] = tr;
134  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ setDgtrSize()

template<typename ValueType>
int DDTree< ValueType >::setDgtrSize ( int  i)
inline

Definition at line 127 of file DDTree.h.

127  {
128  daughters.resize(i);
129  return daughters.size();
130  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ setParent()

template<typename ValueType>
void DDTree< ValueType >::setParent ( const DDTree< ValueType > *  parent = 0)
inlineprotected

Definition at line 57 of file DDTree.h.

57 {_parentPtr=parent;}
const DDTree< ValueType > * _parentPtr
Definition: DDTree.h:43

◆ setVal()

template<typename ValueType>
void DDTree< ValueType >::setVal ( const ValueType &  m)
inline

Definition at line 99 of file DDTree.h.

99  {
100  _thisVal = m;
101  }
static const double m
ValueType _thisVal
Definition: DDTree.h:41

◆ sortAllBy()

template<typename ValueType>
template<typename SORTERTYPE >
void DDTree< ValueType >::sortAllBy ( )
inline

Definition at line 82 of file DDTree.h.

82  {
83  sortDaughtersBy<SORTERTYPE>();
84  for(unsigned int i=0; i<daughters.size(); i++){
85  daughters[i]->template sortDaughtersBy<SORTERTYPE>();
86  }
87  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

◆ sortDaughters()

template<typename ValueType>
void DDTree< ValueType >::sortDaughters ( )
inline

Definition at line 89 of file DDTree.h.

89  {
90  return sortDaughtersBy<lessByPointedTo< MINT::counted_ptr<DDTree<ValueType> > > >();
91  }

◆ sortDaughtersBy()

template<typename ValueType>
template<typename SORTERTYPE >
void DDTree< ValueType >::sortDaughtersBy ( )
inline

Definition at line 75 of file DDTree.h.

75  {
76  SORTERTYPE sorter;
77  stable_sort(daughters.begin(), daughters.end(), sorter);
78  // lessByPointedTo<ValueType> sorter;
79  // daughters.sort(sorter);
80  }
std::vector< MINT::counted_ptr< DDTree< ValueType > > > daughters
Definition: DDTree.h:40

Member Data Documentation

◆ _parentPtr

template<typename ValueType>
const DDTree<ValueType>* DDTree< ValueType >::_parentPtr
protected

Definition at line 43 of file DDTree.h.

◆ _thisVal

template<typename ValueType>
ValueType DDTree< ValueType >::_thisVal
protected

Definition at line 41 of file DDTree.h.

◆ daughters

template<typename ValueType>
std::vector< MINT::counted_ptr< DDTree<ValueType> > > DDTree< ValueType >::daughters
protected

Definition at line 40 of file DDTree.h.


The documentation for this class was generated from the following file: