Several changes in order to compile with gcc-3.4
authoralpar
Mon, 21 Mar 2005 11:46:13 +0000
changeset 123449d018060749
parent 1233 f3d856bf1ebf
child 1235 4511c7d91834
Several changes in order to compile with gcc-3.4
src/lemon/graph_to_eps.h
src/lemon/max_matching.h
     1.1 --- a/src/lemon/graph_to_eps.h	Mon Mar 21 11:40:08 2005 +0000
     1.2 +++ b/src/lemon/graph_to_eps.h	Mon Mar 21 11:46:13 2005 +0000
     1.3 @@ -26,6 +26,7 @@
     1.4  #include<algorithm>
     1.5  #include<vector>
     1.6  
     1.7 +#include<lemon/invalid.h>
     1.8  #include<lemon/xy.h>
     1.9  #include<lemon/maps.h>
    1.10  #include<lemon/bezier.h>
    1.11 @@ -191,11 +192,6 @@
    1.12  
    1.13    ConstMap<typename Graph::Edge,double > _edgeWidths;
    1.14  
    1.15 -  static const double A4HEIGHT = 841.8897637795276;
    1.16 -  static const double A4WIDTH  = 595.275590551181;
    1.17 -  static const double A4BORDER = 15;
    1.18 -
    1.19 -  
    1.20    double _edgeWidthScale;
    1.21    
    1.22    double _nodeScale;
    1.23 @@ -271,6 +267,58 @@
    1.24  /// - A second color and percent value for the lines.
    1.25  template<class T> class GraphToEps : public T 
    1.26  {
    1.27 +  // Can't believe it is required by the C++ standard
    1.28 +  using T::g;
    1.29 +  using T::os;
    1.30 +
    1.31 +  using T::_coords;
    1.32 +  using T::_nodeSizes;
    1.33 +  using T::_nodeShapes;
    1.34 +  using T::_nodeColors;
    1.35 +  using T::_edgeColors;
    1.36 +  using T::_edgeWidths;
    1.37 +
    1.38 +  using T::_edgeWidthScale;
    1.39 +  using T::_nodeScale;
    1.40 +  using T::_xBorder;
    1.41 +  using T::_yBorder;
    1.42 +  using T::_scale;
    1.43 +  using T::_nodeBorderQuotient;
    1.44 +  
    1.45 +  using T::_drawArrows;
    1.46 +  using T::_arrowLength;
    1.47 +  using T::_arrowWidth;
    1.48 +  
    1.49 +  using T::_showNodes;
    1.50 +  using T::_showEdges;
    1.51 +
    1.52 +  using T::_enableParallel;
    1.53 +  using T::_parEdgeDist;
    1.54 +
    1.55 +  using T::_showNodeText;
    1.56 +  using T::_nodeTexts;  
    1.57 +  using T::_nodeTextSize;
    1.58 +
    1.59 +  using T::_showNodePsText;
    1.60 +  using T::_nodePsTexts;  
    1.61 +  using T::_nodePsTextsPreamble;
    1.62 +  
    1.63 +  using T::_undir;
    1.64 +  using T::_pleaseRemoveOsStream;
    1.65 +
    1.66 +  using T::_scaleToA4;
    1.67 +
    1.68 +  using T::_title;
    1.69 +  using T::_copyright;
    1.70 +
    1.71 +  using T::NodeTextColorType;
    1.72 +  using T::CUST_COL;
    1.73 +  using T::DIST_COL;
    1.74 +  using T::DIST_BW;
    1.75 +  using T::_nodeTextColorType;
    1.76 +  using T::_nodeTextColors;
    1.77 +  // dradnats ++C eht yb deriuqer si ti eveileb t'naC
    1.78 +
    1.79    typedef typename T::Graph Graph;
    1.80    typedef typename Graph::Node Node;
    1.81    typedef typename Graph::NodeIt NodeIt;
    1.82 @@ -280,6 +328,9 @@
    1.83    typedef typename Graph::OutEdgeIt OutEdgeIt;
    1.84  
    1.85    static const int INTERPOL_PREC=20;
    1.86 +  static const double A4HEIGHT = 841.8897637795276;
    1.87 +  static const double A4WIDTH  = 595.275590551181;
    1.88 +  static const double A4BORDER = 15;
    1.89  
    1.90    bool dontPrint;
    1.91  
    1.92 @@ -323,8 +374,10 @@
    1.93    };
    1.94    bool isParallel(Edge e,Edge f) const
    1.95    {
    1.96 -    return (g.source(e)==g.source(f)&&g.target(e)==g.target(f))||
    1.97 -      (g.source(e)==g.target(f)&&g.target(e)==g.source(f));
    1.98 +    return (g.source(e)==g.source(f)&&
    1.99 +	    g.target(e)==g.target(f)) ||
   1.100 +      (g.source(e)==g.target(f)&&
   1.101 +       g.target(e)==g.source(f));
   1.102    }
   1.103    template<class TT>
   1.104    static std::string psOut(const xy<TT> &p) 
   1.105 @@ -583,7 +636,7 @@
   1.106    ///
   1.107    ///\sa nodePsTexts()
   1.108    GraphToEps<T> & nodePsTextsPreamble(const char *str) {
   1.109 -    _nodePsTextsPreamble=s ;return *this;
   1.110 +    _nodePsTextsPreamble=str ;return *this;
   1.111    }
   1.112    ///Sets whether the the graph is undirected
   1.113  
     2.1 --- a/src/lemon/max_matching.h	Mon Mar 21 11:40:08 2005 +0000
     2.2 +++ b/src/lemon/max_matching.h	Mon Mar 21 11:46:13 2005 +0000
     2.3 @@ -262,16 +262,17 @@
     2.4      void lateShrink(Node v, typename Graph::template NodeMap<Node>& ear,  
     2.5  		    UFE& blossom, UFE& tree);
     2.6  
     2.7 -    void normShrink(Node v, typename Graph::NodeMap<Node>& ear,  
     2.8 +    void normShrink(Node v, typename Graph::template NodeMap<Node>& ear,  
     2.9  		    UFE& blossom, UFE& tree);
    2.10  
    2.11 -    bool noShrinkStep(Node x, typename Graph::NodeMap<Node>& ear,  
    2.12 +    bool noShrinkStep(Node x, typename Graph::template NodeMap<Node>& ear,  
    2.13  		      UFE& blossom, UFE& tree, std::queue<Node>& Q);
    2.14  
    2.15 -    void shrinkStep(Node& top, Node& middle, Node& bottom, typename Graph::NodeMap<Node>& ear,  
    2.16 +    void shrinkStep(Node& top, Node& middle, Node& bottom,
    2.17 +		    typename Graph::template NodeMap<Node>& ear,  
    2.18  		    UFE& blossom, UFE& tree, std::queue<Node>& Q);
    2.19  
    2.20 -    void augment(Node x, typename Graph::NodeMap<Node>& ear,  
    2.21 +    void augment(Node x, typename Graph::template NodeMap<Node>& ear,  
    2.22  		 UFE& blossom, UFE& tree);
    2.23  
    2.24    };
    2.25 @@ -386,9 +387,10 @@
    2.26  
    2.27  
    2.28    template <typename Graph>
    2.29 -  void MaxMatching<Graph>::normShrink(Node v, typename Graph::NodeMap<Node>& ear,  
    2.30 +  void MaxMatching<Graph>::normShrink(Node v,
    2.31 +				      typename Graph::template
    2.32 +				      NodeMap<Node>& ear,  
    2.33  				      UFE& blossom, UFE& tree) {
    2.34 -
    2.35      std::queue<Node> Q;   //queue of the unscanned nodes
    2.36      Q.push(v);  
    2.37      while ( !Q.empty() ) {
    2.38 @@ -490,8 +492,11 @@
    2.39    }
    2.40  
    2.41    template <typename Graph>
    2.42 -  bool MaxMatching<Graph>::noShrinkStep(Node x, typename Graph::NodeMap<Node>& ear,  
    2.43 -					UFE& blossom, UFE& tree, std::queue<Node>& Q) {
    2.44 +  bool MaxMatching<Graph>::noShrinkStep(Node x,
    2.45 +					typename Graph::template 
    2.46 +					NodeMap<Node>& ear,  
    2.47 +					UFE& blossom, UFE& tree,
    2.48 +					std::queue<Node>& Q) {
    2.49      for( IncEdgeIt e(g,x); e!= INVALID; ++e ) {
    2.50        Node y=g.runningNode(e);
    2.51  	
    2.52 @@ -519,8 +524,11 @@
    2.53    }
    2.54  
    2.55    template <typename Graph>
    2.56 -  void MaxMatching<Graph>::shrinkStep(Node& top, Node& middle, Node& bottom, typename Graph::NodeMap<Node>& ear,  
    2.57 -				      UFE& blossom, UFE& tree, std::queue<Node>& Q) {
    2.58 +  void MaxMatching<Graph>::shrinkStep(Node& top, Node& middle, Node& bottom,
    2.59 +				      typename Graph::template
    2.60 +				      NodeMap<Node>& ear,  
    2.61 +				      UFE& blossom, UFE& tree,
    2.62 +				      std::queue<Node>& Q) {
    2.63      ear.set(top,bottom);
    2.64      Node t=top;
    2.65      while ( t!=middle ) {
    2.66 @@ -542,7 +550,8 @@
    2.67    }
    2.68  
    2.69    template <typename Graph>
    2.70 -  void MaxMatching<Graph>::augment(Node x, typename Graph::NodeMap<Node>& ear,  
    2.71 +  void MaxMatching<Graph>::augment(Node x,
    2.72 +				   typename Graph::template NodeMap<Node>& ear,  
    2.73  				   UFE& blossom, UFE& tree) { 
    2.74      Node v=_mate[x];
    2.75      while ( v!=INVALID ) {