COIN-OR::LEMON - Graph Library

Changeset 7:f227a74db59d in glemon


Ignore:
Timestamp:
10/10/08 14:36:20 (10 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Tags:
tip
Message:

Update to compile with the latest LEMON (version 1.0 or [5e12d7734036])

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • io_helper.cc

    r1 r7  
    2828      else
    2929      {
    30         throw DataFormatError("Bad format");
     30        throw FormatError("Bad format");
    3131      }
    3232    }
  • mapstorage.cc

    r1 r7  
    723723  // write .lgf file
    724724  {
    725     DigraphWriter<Digraph> gwriter(filename, digraph);
     725    DigraphWriter<Digraph> gwriter(digraph, filename);
    726726
    727727    gwriter.nodeMap("label", node_label);
     
    827827  if (gui_sect_save_dest == CONF_FILE)
    828828  {
    829     DigraphWriter<Digraph> lwriter(filename + ".conf", digraph);
     829    DigraphWriter<Digraph> lwriter(digraph, filename + ".conf");
    830830    GuiWriter gui_writer(this);
    831831    gui_writer.write(lwriter.ostream());
     
    13381338  using std::string;
    13391339
    1340   DigraphReader<Digraph> greader(filename, digraph);
     1340  DigraphReader<Digraph> greader(digraph, filename);
    13411341
    13421342  // read the label maps
     
    14611461      if(active_nodemaps[N_RADIUS]!="")
    14621462        {
    1463           _nodeSizes=getNumericNodeMap(active_nodemaps[N_RADIUS]);
     1463          const  Digraph::NodeMap<double> &temp =
     1464            getNumericNodeMap(active_nodemaps[N_RADIUS]);
     1465          for(NodeIt n(digraph);n!=INVALID;++n)
     1466            _nodeSizes[n]= temp[n];
    14641467        }
    14651468      if(active_nodemaps[N_COLOR]!="")
     
    14841487      if(active_arcmaps[E_WIDTH]!="")
    14851488        {
    1486           _arcWidths=getNumericArcMap(active_arcmaps[E_WIDTH]);
     1489          const  Digraph::ArcMap<double> &temp =
     1490            getNumericArcMap(active_arcmaps[E_WIDTH]);
     1491          for(ArcIt a(digraph);a!=INVALID;++a)
     1492            _arcWidths[a]=temp[a];
    14871493        }
    14881494      if(active_arcmaps[E_COLOR]!="")
  • xml.h

    r1 r7  
    2626#include <map>
    2727#include <lemon/error.h>
     28#include <lemon/assert.h>
    2829#include <lemon/dim2.h>
    2930
     
    7576        if(level>=0) indent(level);
    7677        else level=0;
    77       else throw LogicError(); 
     78      else LEMON_ASSERT(true, "Invalid indentation."); 
    7879    }
    7980 
     
    160161    void skipWhiteSpaces()
    161162    {
    162       if(write()) throw LogicError();
     163      if(write()) LEMON_ASSERT(true, "Can't skip whitespaces in write mode.");
    163164      {
    164165        char c;
     
    181182    void useTag(const std::string &_tag) {
    182183      if(nextTag()==_tag) useTag();
    183       else throw DataFormatError("",line_number,"Unexpected token name");
     184      else throw FormatError("Unexpected token name","",line_number);
    184185    }
    185186  public:
     
    190191    const std::string &nextTag()
    191192    {
    192       if(write()) throw LogicError();
     193      if(write()) LEMON_ASSERT(true,"Don't use nextTag() in write mode");
    193194      else if(next_tag.empty()) {
    194195        char c;
    195196        skipWhiteSpaces();
    196197        if(!is.get(c) || c!='<')
    197           throw DataFormatError("",line_number,"Bad format");
     198          throw FormatError("Bad format","",line_number);
    198199        next_tag.clear();
    199200        while (is.get(c) && c!='>') next_tag.push_back(c);
    200201        if(c!='>')
    201           throw DataFormatError("",line_number,"Bad format");
     202          throw FormatError("Bad format","",line_number);
    202203      }
    203204      return next_tag;
     
    230231        skipWhiteSpaces();
    231232        if(!(is >> const_cast<int &>(v)))
    232           throw DataFormatError("",line_number,"Not an 'int'");
     233          throw FormatError("Not an 'int'","",line_number);
    233234      }
    234235      return *this;
     
    240241        skipWhiteSpaces();
    241242        if(!(is >> const_cast<double &>(v)))
    242           throw DataFormatError("",line_number,"Not an 'double'");
     243          throw FormatError("Not an 'double'","",line_number);
    243244      }
    244245      return *this;
     
    272273          if(c=='\\')
    273274            if(!is.get(c))
    274               throw DataFormatError("",line_number,"Bad string");
     275              throw FormatError("Bad string","",line_number);
    275276            else switch(c) {
    276277            case 'n':
     
    286287          }
    287288        if(c!='<')
    288           throw DataFormatError("",line_number,"Unexpected eof");
     289          throw FormatError("Unexpected eof","",line_number);
    289290        is.unget();
    290291      }
     
    426427  ///
    427428  template<class T>
    428   void xml(XmlIo &x,lemon::dim2::BoundingBox<T> &v)
     429  void xml(XmlIo &x,lemon::dim2::Box<T> &v)
    429430  {
    430431    if(x.write()) {
Note: See TracChangeset for help on using the changeset viewer.