Disjksta::setDistance() now return a pointer to the copied object.
* Change: In Anabatic::Dijkstra the _distanceCb attribute got copied from the setDistance() argument. To be able to access the duplicated distance (and therefore access/modify it) the function now return a pointer to it. Done with the "target()" accessor of std::function<>. * Change: In Katana::GlobalRouting::runGlobalRouter() use the new Disjkstra::setDistance() to be able to call setNet() on the right object.
This commit is contained in:
parent
f8b9957d20
commit
3598c6d8f7
|
@ -295,7 +295,8 @@ namespace Anabatic {
|
|||
inline bool isSourceVertex ( Vertex* ) const;
|
||||
inline bool isTargetVertex ( Vertex* ) const;
|
||||
inline DbU::Unit getSearchAreaHalo () const;
|
||||
inline void setDistance ( distance_t );
|
||||
template<typename DistanceT>
|
||||
inline DistanceT* setDistance ( DistanceT );
|
||||
inline void setSearchAreaHalo ( DbU::Unit );
|
||||
void load ( Net* );
|
||||
void run ( Mode mode=Mode::Standart );
|
||||
|
@ -335,9 +336,10 @@ namespace Anabatic {
|
|||
inline bool Dijkstra::isSourceVertex ( Vertex* v ) const { return (_sources.find(v) != _sources.end()); }
|
||||
inline bool Dijkstra::isTargetVertex ( Vertex* v ) const { return (_targets.find(v) != _targets.end()); }
|
||||
inline DbU::Unit Dijkstra::getSearchAreaHalo () const { return _searchAreaHalo; }
|
||||
inline void Dijkstra::setDistance ( distance_t cb ) { _distanceCb = cb; }
|
||||
inline void Dijkstra::setSearchAreaHalo ( DbU::Unit halo ) { _searchAreaHalo = halo; }
|
||||
|
||||
template<typename DistanceT>
|
||||
inline DistanceT* Dijkstra::setDistance ( DistanceT cb ) { _distanceCb = cb; return _distanceCb.target<DistanceT>(); }
|
||||
|
||||
} // Anabatic namespace.
|
||||
|
||||
|
|
|
@ -154,10 +154,10 @@ namespace Katana {
|
|||
float edgeHInc = getConfiguration()->getEdgeHInc();
|
||||
|
||||
openSession();
|
||||
Dijkstra* dijkstra = new Dijkstra ( this );
|
||||
DigitalDistance distance ( getConfiguration()->getEdgeCostH()
|
||||
, getConfiguration()->getEdgeCostK() );
|
||||
dijkstra->setDistance( distance );
|
||||
Dijkstra* dijkstra = new Dijkstra ( this );
|
||||
DigitalDistance* distance =
|
||||
dijkstra->setDistance( DigitalDistance( getConfiguration()->getEdgeCostH()
|
||||
, getConfiguration()->getEdgeCostK() ));
|
||||
|
||||
size_t iteration = 0;
|
||||
size_t netCount = 0;
|
||||
|
@ -168,7 +168,7 @@ namespace Katana {
|
|||
for ( NetData* netData : getNetOrdering() ) {
|
||||
if (netData->isGlobalRouted()) continue;
|
||||
|
||||
distance.setNet( netData->getNet() );
|
||||
distance->setNet( netData->getNet() );
|
||||
dijkstra->load( netData->getNet() );
|
||||
dijkstra->run();
|
||||
++netCount;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// -*- C++ -*-
|
||||
// -*- mode: C++; explicit-buffer-name: "RoutingEvent.cpp<katana>" -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC 2008-2016, All Rights Reserved
|
||||
|
|
Loading…
Reference in New Issue