src/work/athos/old/minlengthpaths.h
changeset 997 665ffade9aca
parent 986 e997802b855c
equal deleted inserted replaced
3:7a659e947bd3 4:8651205042eb
    28   ///
    28   ///
    29   ///\author Attila Bernath
    29   ///\author Attila Bernath
    30   template <typename Graph, typename LengthMap>
    30   template <typename Graph, typename LengthMap>
    31   class MinLengthPaths {
    31   class MinLengthPaths {
    32 
    32 
    33     typedef typename LengthMap::ValueType Length;
    33     typedef typename LengthMap::Value Length;
    34     
    34     
    35     typedef typename Graph::Node Node;
    35     typedef typename Graph::Node Node;
    36     typedef typename Graph::NodeIt NodeIt;
    36     typedef typename Graph::NodeIt NodeIt;
    37     typedef typename Graph::Edge Edge;
    37     typedef typename Graph::Edge Edge;
    38     typedef typename Graph::OutEdgeIt OutEdgeIt;
    38     typedef typename Graph::OutEdgeIt OutEdgeIt;
    47       const ResGraphType& G;
    47       const ResGraphType& G;
    48       const EdgeIntMap& rev;
    48       const EdgeIntMap& rev;
    49       const LengthMap &ol;
    49       const LengthMap &ol;
    50       const NodeMap &pot;
    50       const NodeMap &pot;
    51     public :
    51     public :
    52       typedef typename LengthMap::KeyType KeyType;
    52       typedef typename LengthMap::Key Key;
    53       typedef typename LengthMap::ValueType ValueType;
    53       typedef typename LengthMap::Value Value;
    54 	
    54 	
    55       ValueType operator[](typename ResGraphType::Edge e) const {     
    55       Value operator[](typename ResGraphType::Edge e) const {     
    56 	//if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){
    56 	//if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){
    57 	//  std::cout<<"Negative length!!"<<std::endl;
    57 	//  std::cout<<"Negative length!!"<<std::endl;
    58 	//}
    58 	//}
    59 	return (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)]);   
    59 	return (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)]);   
    60       }     
    60       }