COPASI API  4.16.103
CBitPatternTree.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/elementaryFluxModes/CBitPatternTree.cpp,v $
3 // $Revision: 1.2 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2010/01/29 21:59:25 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 #include "copasi.h"
15 
16 #include "CBitPatternTree.h"
17 
19  mpRoot(NULL)
20 {}
21 
22 CBitPatternTree::CBitPatternTree(const std::vector< CStepMatrixColumn * > & patterns):
23  mpRoot(NULL)
24 {
25  if (!patterns.empty())
26  {
27  mpRoot = new CBitPatternTreeNode(0, patterns);
28  }
29 }
30 
32 {
33  pdelete(mpRoot);
34 }
35 
37 {
38  return mpRoot;
39 }
40 
41 bool CBitPatternTree::isExtremeRay(const CZeroSet & set) const
42 {
43  if (mpRoot != NULL)
44  {
45  return !mpRoot->hasSuperset(set);
46  }
47 
48  return true;
49 }
50 
51 size_t CBitPatternTree::size() const
52 {
53  if (mpRoot != NULL)
54  {
55  return mpRoot->getChildrenCount();
56  }
57 
58  return 0;
59 }
#define pdelete(p)
Definition: copasi.h:215
bool isExtremeRay(const CZeroSet &ray) const
bool hasSuperset(const CZeroSet &set) const
const CBitPatternTreeNode * getRoot() const
CBitPatternTreeNode * mpRoot
size_t size() const
size_t getChildrenCount() const