88 virtual Sequence<F> getCompressedNeighbours()
const;
94 virtual void SetSubdomains(
const int NbParts = 2);
95 void EmptyGraph() {Vertexes_.clear(); };
98 virtual std::ostream& info(std::ostream&
os)
const;
104 std::ostream& Graph<F>::info(std::ostream&
os)
const
108 = this->Vertexes_.begin(); i != this->Vertexes_.end(); ++i, ++n)
109 os <<
"Point " << n <<
"(value " << i->getValue() <<
") belongs to graph " << i->getDomain() << std::endl;
115 std::ostream& operator<<(std::ostream&
os,
const Graph<F> & Value)
117 return Value.info(
os);
121 void GraphVertex<F>::setValue(
const F Value)
123 this->Value_ = Value;
127 void GraphVertex<F>::setWeight(
const int Weight)
133 void GraphVertex<F>::addWeight(
const int Weight)
145 void GraphVertex<F>::addNeighbour(
const F Value)
147 if ( this->Neighbours_.exist(Value) )
149 this->Neighbours_.push_back(Value);
153 void GraphVertex<F>::addWeightedNeighbour(
const F Value,
const int Weight)
155 if ( this->Neighbours_.exist(Value) )
157 this->Neighbours_.push_back(Value);
162 void GraphVertex<F>::setDomain(
const int Domain)
168 void GraphVertex<F>::clearNeighbours()
170 this->Neighbours_.clear();
174 F GraphVertex<F>::getValue()
const
180 int GraphVertex<F>::getWeight()
const
182 return this->Weight_;
188 return this->Neighbours_;
192 int GraphVertex<F>::getDomain()
const
194 return this->Domain_;
208 = this->Vertexes_.begin(); i != this->Vertexes_.end(); ++i)
209 if (i->getValue() == Value)
213 this->Vertexes_.push_back(
VValue);
229 = this->Vertexes_.begin();
232 if (i->getValue() ==
Value1)
237 if (i->getValue() ==
Value2)
260 = this->Vertexes_.begin();
263 if (i->getValue() ==
Value1)
268 if (i->getValue() ==
Value2)
283 = this->Vertexes_.begin(); i != this->Vertexes_.end(); ++i)
302 = this->Vertexes_.begin(); i != this->Vertexes_.end(); ++i, ++n)
305 cml += i->getNeighbours().size();
308 Weights.push_back(i->getWeight());
313 for(
typename std::vector<F>::const_iterator i
319 typename std::vector<GraphVertex<F> >::const_iterator j = this->Vertexes_.begin();
320 for(; (j != this->Vertexes_.end()) && (*i != j->getValue()); ++j,
346 for(
typename std::vector<int>::const_iterator i
356 for(
typename std::vector<int>::const_iterator i
364 for(
typename std::vector<int>::const_iterator i
392 DEBUGL(GRAPH_OUTPUT,
"Starting Broadcasting on process " <<
mpirank);
399 DEBUGL(GRAPH_OUTPUT,
"Broadcast ended on process " <<
mpirank);
403 for(
typename std::vector<int>::iterator i
434 typename std::vector<GraphVertex<F> >::iterator
iv =
435 this->Vertexes_.begin();
436 typename std::vector<int>::const_iterator i =
Subdomains.begin();
445 void Graph<F>::SetSubdomains(
const int NbParts)
452 for(
typename std::vector<int>::iterator i
469 for(
typename std::vector<int>::iterator i
471 *i = (n *
NbParts) / this->Vertexes_.size();
483 typename std::vector<GraphVertex<F> >::const_iterator
iv =
484 this->Vertexes_.begin();
485 for ( ;
iv != this->Vertexes_.end(); ++
iv)
487 if (
iv->getDomain() ==
Part )
496 Sequence<bool> Graph<F>::GetSubdomainBool(
const int Part)
const
500 typename std::vector<GraphVertex<F> >::const_iterator
iv =
501 this->Vertexes_.begin();
502 for ( ;
iv != this->Vertexes_.end(); ++
iv)
504 if (
iv->getDomain() ==
Part )