COIN-OR::LEMON - Graph Library

Ticket #138: improvement2_d900fd1e760f.patch

File improvement2_d900fd1e760f.patch, 2.7 KB (added by Peter Kovacs, 16 years ago)

Print line numbers (depends on [cdbff91c2166])

  • lemon/bfs.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1224499599 -7200
    # Node ID d900fd1e760fe35dddfa29d9b00de1a9e9f6323e
    # Parent  cdbff91c2166a1222fc3a1295f1f4597b6412425
    Print the failed line numbers in the unifier script (ticket #138)
    
    diff --git a/lemon/bfs.h b/lemon/bfs.h
    a b  
    5151    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    5252    ///Instantiates a PredMap.
    5353
    54     ///This function instantiates a PredMap.
     54    ///This function instantiates a PredMap. 
    5555    ///\param g is the digraph, to which we would like to define the
    5656    ///PredMap.
    5757    static PredMap *createPredMap(const Digraph &g)
     
    8080
    8181    ///The type of the map that indicates which nodes are reached.
    8282
    83     ///The type of the map that indicates which nodes are reached.
    84     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     83    ///The type of the map that indicates which nodes are reached.///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    8584    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    8685    ///Instantiates a ReachedMap.
    8786
  • lemon/list_graph.h

    diff --git a/lemon/list_graph.h b/lemon/list_graph.h
    a b  
    840840      explicit Arc(int pid) { id = pid;}
    841841
    842842    public:
    843       operator Edge() const { 
    844         return id != -1 ? edgeFromId(id / 2) : INVALID; 
     843      operator Edge() const {
     844        return id != -1 ? edgeFromId(id / 2) : INVALID;
    845845      }
    846846
    847847      Arc() {}
  • lemon/smart_graph.h

    diff --git a/lemon/smart_graph.h b/lemon/smart_graph.h
    a b  
    464464      explicit Arc(int id) { _id = id;}
    465465
    466466    public:
    467       operator Edge() const { 
    468         return _id != -1 ? edgeFromId(_id / 2) : INVALID; 
     467      operator Edge() const {
     468        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
    469469      }
    470470
    471471      Arc() {}
  • scripts/unify-sources.sh

    diff --git a/scripts/unify-sources.sh b/scripts/unify-sources.sh
    a b  
    8888function check_action() {
    8989    if ! diff -q $1 $2 >/dev/null
    9090    then
    91         echo -n " [$3 failed]"
     91        echo
     92        echo -n "      $3 failed at line(s): "
     93        echo -n $(diff $1 $2 | grep '^[0-9]' | sed "s/^\(.*\)c.*$/ \1/g" |
     94                  sed "s/,/-/g" | paste -s -d',')
    9295        FAILED=YES
    9396    fi
    9497}
    9598
    9699function check_warning() {
    97     echo -n " [$2 warning]"
     100    echo
     101    if [ "$2" == 'long lines' ]
     102    then
     103        echo -n "      $2 warning at line(s): "
     104        echo -n $(grep -n -E '.{81,}' $1 | sed "s/^\([0-9]*\)/ \1\t/g" |
     105                  cut -f 1 | paste -s -d',')
     106    else
     107        echo -n "      $2 warning"
     108    fi
    98109    WARNED=YES
    99110}
    100111