Version: 9.15.0
YACS::ENGINE::ForkBlocPoint Class Reference

#include <ForkBlocPoint.hxx>

Inheritance diagram for YACS::ENGINE::ForkBlocPoint:
Collaboration diagram for YACS::ENGINE::ForkBlocPoint:

Public Member Functions

 ForkBlocPoint ()=default
 
 ForkBlocPoint (const std::list< AbstractPoint * > &nodes, AbstractPoint *father)
 
AbstractPointdeepCopy (AbstractPoint *father) const override
 
NodegetFirstNode () override
 
NodegetLastNode () override
 
int getMaxLevelOfParallelism () const
 
void getWeightRegardingDPL (ComplexWeight *weight)
 
void partitionRegardingDPL (const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap) const
 
std::string getRepr () const
 
void accept (PointVisitor *pv) override
 
AbstractPointexpandNonSimpleCaseOn (NotSimpleCasePoint *pathologicalPt, const std::set< Node * > &uncatchedNodes) override
 
virtual ~ForkBlocPoint ()
 
- Public Member Functions inherited from YACS::ENGINE::BlocPoint
 BlocPoint ()=default
 
 BlocPoint (const std::list< AbstractPoint * > &nodes, AbstractPoint *father)
 
void deepCopyFrom (const BlocPoint &other)
 
AbstractPointfindPointWithNode (Node *node)
 
AbstractPointgetNodeAfter (Node *node)
 
AbstractPointgetNodeB4 (Node *node)
 
bool contains (Node *node) const override
 
bool anyOf (const std::set< Node * > &nodes) const override
 
int getNumberOfNodes () const
 
const std::list< AbstractPoint * > & getListOfPoints () const
 
virtual ~BlocPoint ()
 
bool internalContinueForSimplify () const
 
bool presenceOfNonSimpleCase () const
 
AbstractPointgetUnique ()
 
const AbstractPointgetUnique () const
 
AbstractPointgetUniqueAndReleaseIt ()
 
- Public Member Functions inherited from YACS::ENGINE::AbstractPoint
 AbstractPoint ()=default
 
 AbstractPoint (AbstractPoint *father)
 
AbstractPointgetFather () const
 
AbstractPointgetGodFather ()
 
bool amIGod ()
 
void setFather (AbstractPoint *father)
 
bool isBegin ()
 
bool isLast ()
 
bool isSimplyLinkedBeforeAfter (BlocPoint *sop)
 
bool isSimplyLinkedAfterNullBefore (BlocPoint *sop)
 
bool isSimplyLinkedBeforeNullAfter (BlocPoint *sop)
 
bool isNullBeforeNullAfter (BlocPoint *sop)
 
LinkedBlocPointtryAsLink (BlocPoint *sop)
 
ForkBlocPointtryAsFork (BlocPoint *sop)
 
ForkBlocPointtryAsForkBis (BlocPoint *sop)
 
ForkBlocPointtryAsForkTer (BlocPoint *sop)
 
ForkBlocPointtryAsForkQuatro (BlocPoint *sop)
 
virtual ~AbstractPoint ()
 
bool isSimplyLinkedAfter (BlocPoint *sop, Node *node)
 
bool isSimplyLinkedBefore (BlocPoint *sop, Node *node)
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::AbstractPoint
static void TryAsNotSimpleCase (AbstractPoint *father, const std::vector< AbstractPoint * > &ptsToKill, std::list< AbstractPoint * > &nodes, bool &somethingDone)
 
static bool IsGatherB4Ext (Node *node)
 
static bool IsSimplyLinkedAfterExt (Node *node)
 
static bool IsScatterAfterExt (Node *node)
 
static bool IsSimplyLinkedBeforeExt (Node *node)
 
static bool IsNoLinksBefore (Node *node)
 
static bool IsNoLinksAfter (Node *node)
 
static NodeGetNodeB4 (Node *node)
 
static NodeGetNodeAfter (Node *node)
 
static AbstractPointGetDirectSonOf (AbstractPoint *refFather, AbstractPoint *sonOrLittleSon)
 
static bool IsCommonDirectSonOf (AbstractPoint *refFather, const std::list< OutGate * > &outgs, AbstractPoint *&ret)
 
static bool IsCommonDirectSonOf (AbstractPoint *refFather, const std::list< InGate * > &ings, AbstractPoint *&ret)
 
static void FeedData (AbstractPoint *ptToBeRewired, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
static void FeedData (const std::list< AbstractPoint * > &ptsToBeRewired, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
static void Rewire (const std::vector< AbstractPoint * > &ptsToKill, std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
static void UnRewire (std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > &m)
 
static void Display (std::map< std::string, std::tuple< ElementaryPoint *, Node *, std::shared_ptr< Bloc > > > *m)
 
- Protected Member Functions inherited from YACS::ENGINE::BlocPoint
void getOutPoint (AbstractPoint *node)
 
- Protected Attributes inherited from YACS::ENGINE::BlocPoint
std::list< AbstractPoint * > _nodes
 
- Protected Attributes inherited from YACS::ENGINE::AbstractPoint
AbstractPoint_father = nullptr
 

Detailed Description

Definition at line 30 of file ForkBlocPoint.hxx.

Constructor & Destructor Documentation

◆ ForkBlocPoint() [1/2]

YACS::ENGINE::ForkBlocPoint::ForkBlocPoint ( )
default

◆ ForkBlocPoint() [2/2]

ForkBlocPoint::ForkBlocPoint ( const std::list< AbstractPoint * > &  nodes,
AbstractPoint father 
)

Definition at line 28 of file ForkBlocPoint.cxx.

28  :BlocPoint(nodes,father)
29 {
30 }

◆ ~ForkBlocPoint()

ForkBlocPoint::~ForkBlocPoint ( )
virtual

Definition at line 40 of file ForkBlocPoint.cxx.

41 {
42 }

Member Function Documentation

◆ accept()

void ForkBlocPoint::accept ( PointVisitor pv)
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 122 of file ForkBlocPoint.cxx.

123 {
124  pv->beginForkBlocPoint(this);
125  for(auto it:_nodes)
126  it->accept(pv);
127  pv->endForkBlocPoint(this);
128 }
std::list< AbstractPoint * > _nodes
Definition: BlocPoint.hxx:35
virtual void endForkBlocPoint(ForkBlocPoint *pt)=0
virtual void beginForkBlocPoint(ForkBlocPoint *pt)=0

References YACS::ENGINE::BlocPoint::_nodes, YACS::ENGINE::PointVisitor::beginForkBlocPoint(), and YACS::ENGINE::PointVisitor::endForkBlocPoint().

◆ deepCopy()

AbstractPoint * ForkBlocPoint::deepCopy ( AbstractPoint father) const
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 32 of file ForkBlocPoint.cxx.

33 {
34  ForkBlocPoint *ret(new ForkBlocPoint);
35  ret->deepCopyFrom(*this);
36  ret->setFather(father);
37  return ret;
38 }

References YACS::ENGINE::BlocPoint::deepCopyFrom(), and YACS::ENGINE::AbstractPoint::setFather().

◆ expandNonSimpleCaseOn()

AbstractPoint * ForkBlocPoint::expandNonSimpleCaseOn ( NotSimpleCasePoint pathologicalPt,
const std::set< Node * > &  uncatchedNodes 
)
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 130 of file ForkBlocPoint.cxx.

131 {
132  for(auto& it : _nodes)
133  {
134  AbstractPoint *ret(it->expandNonSimpleCaseOn(pathologicalPt,uncatchedNodes));
135  if(ret!=it)
136  {
137  ret->setFather(this);
138  auto oldIt(it);
139  it = ret;
140  delete oldIt;
141  }
142  }
143  return this;
144 }

References YACS::ENGINE::BlocPoint::_nodes, and YACS::ENGINE::AbstractPoint::setFather().

◆ getFirstNode()

Node * ForkBlocPoint::getFirstNode ( )
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 44 of file ForkBlocPoint.cxx.

45 {
46  if(_nodes.empty())
47  throw Exception("ForkBlocPoint::getFirstNode : error no branches !");
48  return _nodes.front()->getFirstNode();
49 }

References YACS::ENGINE::BlocPoint::_nodes.

◆ getLastNode()

Node * ForkBlocPoint::getLastNode ( )
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 51 of file ForkBlocPoint.cxx.

52 {
53  if(_nodes.empty())
54  throw Exception("ForkBlocPoint::getLastNode : error no branches !");
55  return _nodes.front()->getLastNode();//not a bug - seen from the outside only first branch exists !
56 }

References YACS::ENGINE::BlocPoint::_nodes.

◆ getMaxLevelOfParallelism()

int ForkBlocPoint::getMaxLevelOfParallelism ( ) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 58 of file ForkBlocPoint.cxx.

59 {
60  int ret(0);
61  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
62  ret+=(*it)->getMaxLevelOfParallelism();
63  return ret;
64 }

References YACS::ENGINE::BlocPoint::_nodes.

Referenced by YACS::ENGINE::Bloc::getMaxLevelOfParallelism().

◆ getRepr()

std::string ForkBlocPoint::getRepr ( ) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 103 of file ForkBlocPoint.cxx.

104 {
105  std::size_t sz(_nodes.size()),ii(0);
106  std::string ret("[");
107  std::vector<std::string> elts(sz);
108  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++,ii++)
109  elts[ii]=(*it)->getRepr();
110  std::sort(elts.begin(),elts.end());
111  ii=0;
112  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++,ii++)
113  {
114  ret+=elts[ii];
115  if(ii!=sz-1)
116  ret+="*";
117  }
118  ret+="]";
119  return ret;
120 }

References YACS::ENGINE::BlocPoint::_nodes.

◆ getWeightRegardingDPL()

void ForkBlocPoint::getWeightRegardingDPL ( ComplexWeight weight)
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 66 of file ForkBlocPoint.cxx.

67 {
68  ComplexWeight localWeight;
69  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
70  {
71  (*it)->getWeightRegardingDPL(&localWeight);
72  weight->addWeight(&localWeight);
73  localWeight.setToZero();
74  }
75 }
void addWeight(const ComplexWeight *other)

References YACS::ENGINE::BlocPoint::_nodes, YACS::ENGINE::ComplexWeight::addWeight(), and YACS::ENGINE::ComplexWeight::setToZero().

Referenced by YACS::ENGINE::Bloc::getWeightRegardingDPL().

◆ partitionRegardingDPL()

void ForkBlocPoint::partitionRegardingDPL ( const PartDefinition pd,
std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &  zeMap 
) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 77 of file ForkBlocPoint.cxx.

78 {
79  std::vector< std::pair<const PartDefinition *, const ComplexWeight *> > parts;
80  std::vector< int> nbCoresPerShot;
81  std::vector<std::size_t> v;
82  std::vector<ComplexWeight> nodesWeight(_nodes.size());
83  std::size_t ii(0);
84  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++,ii++)
85  {
86  ComplexWeight *w=&nodesWeight[ii];
87  (*it)->getWeightRegardingDPL(w);
88  parts.push_back(std::pair<const PartDefinition *, const ComplexWeight *>(pd,w));
89  nbCoresPerShot.push_back((*it)->getMaxLevelOfParallelism());
90  v.push_back(ii);
91  }
92  std::vector<AbstractPoint *> nodes2(_nodes.begin(),_nodes.end());
93  if(!parts.empty())
94  {
95  const PlayGround *pg(pd->getPlayGround());
96  std::vector< YACS::BASES::AutoRefCnt<PartDefinition> > pds(pg->partition(parts,nbCoresPerShot));
97  ii=0;
98  for(std::vector<std::size_t>::const_iterator iter=v.begin();iter!=v.end();iter++,ii++)
99  nodes2[*iter]->partitionRegardingDPL(pds[ii],zeMap);
100  }
101 }
const PlayGround * getPlayGround() const
Definition: PlayGround.hxx:127

References YACS::ENGINE::BlocPoint::_nodes, YACS::ENGINE::PartDefinition::getPlayGround(), YACS::ENGINE::PlayGround::partition(), and gui.logview::w.

Referenced by YACS::ENGINE::Bloc::partitionRegardingDPL().


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