Version: 9.15.0
YACS::ENGINE::LinkedBlocPoint Class Reference

#include <LinkedBlocPoint.hxx>

Inheritance diagram for YACS::ENGINE::LinkedBlocPoint:
Collaboration diagram for YACS::ENGINE::LinkedBlocPoint:

Public Member Functions

 LinkedBlocPoint ()=default
 
 LinkedBlocPoint (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 ~LinkedBlocPoint ()
 
- 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 32 of file LinkedBlocPoint.hxx.

Constructor & Destructor Documentation

◆ LinkedBlocPoint() [1/2]

YACS::ENGINE::LinkedBlocPoint::LinkedBlocPoint ( )
default

◆ LinkedBlocPoint() [2/2]

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

Definition at line 34 of file LinkedBlocPoint.cxx.

34  :BlocPoint(nodes,father)
35 {
36 }

◆ ~LinkedBlocPoint()

LinkedBlocPoint::~LinkedBlocPoint ( )
virtual

Definition at line 136 of file LinkedBlocPoint.cxx.

137 {
138 }

Member Function Documentation

◆ accept()

void LinkedBlocPoint::accept ( PointVisitor pv)
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 128 of file LinkedBlocPoint.cxx.

129 {
130  pv->beginLinkedBlocPoint(this);
131  for(auto it:_nodes)
132  it->accept(pv);
133  pv->endLinkedBlocPoint(this);
134 }
std::list< AbstractPoint * > _nodes
Definition: BlocPoint.hxx:35
virtual void beginLinkedBlocPoint(LinkedBlocPoint *pt)=0
virtual void endLinkedBlocPoint(LinkedBlocPoint *pt)=0

References YACS::ENGINE::BlocPoint::_nodes, YACS::ENGINE::PointVisitor::beginLinkedBlocPoint(), and YACS::ENGINE::PointVisitor::endLinkedBlocPoint().

◆ deepCopy()

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

Implements YACS::ENGINE::AbstractPoint.

Definition at line 38 of file LinkedBlocPoint.cxx.

39 {
41  ret->deepCopyFrom(*this);
42  ret->setFather(father);
43  return ret;
44 }

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

Referenced by expandNonSimpleCaseOn().

◆ expandNonSimpleCaseOn()

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

Implements YACS::ENGINE::AbstractPoint.

Definition at line 99 of file LinkedBlocPoint.cxx.

100 {
101  if(anyOf(uncatchedNodes))
102  {
103  for(auto& it : _nodes)
104  {
105  AbstractPoint *ret(it->expandNonSimpleCaseOn(pathologicalPt,uncatchedNodes));
106  if(ret!=it)
107  {
108  ret->setFather(this);
109  auto oldIt(it);
110  it = ret;
111  delete oldIt;
112  }
113  }
114  return this;
115  }
116  else
117  {
118  std::list<AbstractPoint *> l;
119  AbstractPoint *p0(this->deepCopy(getFather())),*p1(pathologicalPt->getUnique()->deepCopy(getFather()));
120  l.push_back(p0);
121  l.push_back(p1);
122  AbstractPoint *ret(new ForkBlocPoint(l,getFather()));
123  p0->setFather(ret); p1->setFather(ret);
124  return ret;
125  }
126 }
virtual AbstractPoint * deepCopy(AbstractPoint *father) const =0
AbstractPoint * getFather() const
AbstractPoint * getUnique()
Definition: BlocPoint.cxx:111
bool anyOf(const std::set< Node * > &nodes) const override
Definition: BlocPoint.cxx:101
AbstractPoint * deepCopy(AbstractPoint *father) const override

References YACS::ENGINE::BlocPoint::_nodes, YACS::ENGINE::BlocPoint::anyOf(), YACS::ENGINE::AbstractPoint::deepCopy(), deepCopy(), YACS::ENGINE::AbstractPoint::getFather(), YACS::ENGINE::BlocPoint::getUnique(), testCppPluginInvokation::l, and YACS::ENGINE::AbstractPoint::setFather().

◆ getFirstNode()

Node * LinkedBlocPoint::getFirstNode ( )
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 46 of file LinkedBlocPoint.cxx.

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

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

◆ getLastNode()

Node * LinkedBlocPoint::getLastNode ( )
overridevirtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 53 of file LinkedBlocPoint.cxx.

54 {
55  if(_nodes.empty())
56  throw Exception("LinkedBlocPoint::getFirstNode : error no branches !");
57  return _nodes.back()->getLastNode();
58 }

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

◆ getMaxLevelOfParallelism()

int LinkedBlocPoint::getMaxLevelOfParallelism ( ) const
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 60 of file LinkedBlocPoint.cxx.

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

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

◆ getRepr()

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

Implements YACS::ENGINE::AbstractPoint.

Definition at line 85 of file LinkedBlocPoint.cxx.

86 {
87  std::size_t sz(_nodes.size()),ii(0);
88  std::string ret("(");
89  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++,ii++)
90  {
91  ret+=(*it)->getRepr();
92  if(ii!=sz-1)
93  ret+="+";
94  }
95  ret+=")";
96  return ret;
97 }

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

◆ getWeightRegardingDPL()

void LinkedBlocPoint::getWeightRegardingDPL ( ComplexWeight weight)
virtual

Implements YACS::ENGINE::AbstractPoint.

Definition at line 68 of file LinkedBlocPoint.cxx.

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

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

◆ partitionRegardingDPL()

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

Implements YACS::ENGINE::AbstractPoint.

Definition at line 79 of file LinkedBlocPoint.cxx.

80 {
81  for(std::list<AbstractPoint *>::const_iterator it=_nodes.begin();it!=_nodes.end();it++)
82  (*it)->partitionRegardingDPL(pd,zeMap);
83 }

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


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