UtilGraphLib.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the DIP Solver Framework.                            //
00003 //                                                                           //
00004 // DIP is distributed under the Eclipse Public License as part of the        //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com)       //
00008 //                                                                           //
00009 // Conceptual Design: Matthew Galati, SAS Institute Inc.                     //
00010 //                    Ted Ralphs, Lehigh University                          //
00011 //                                                                           //
00012 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs    //
00013 // All Rights Reserved.                                                      //
00014 //===========================================================================//
00015 
00016 /*
00017   Author  : Matthew Galati
00018   Date    : 02/20/03
00019   Purpose : A class for storing data instances from TSPLIB and VRPLIB.
00020 
00021   02/20/03: Initial version for VRPLIB
00022   TODO    : TSPLIB
00023   : apply to KCCP code
00024 */
00025 
00026 
00027 #ifndef UTIL_GRAPHLIB_INCLUDED
00028 #define UTIL_GRAPHLIB_INCLUDED
00029 
00030 #include "UtilMacros.h"
00031 
00032 #include <string>
00033 
00034 // ----------------------------------------------------------------------- //
00035 class UtilGraphLib {
00036 private:
00037    UtilGraphLib(const UtilGraphLib&);
00038    UtilGraphLib& operator=(const UtilGraphLib&);
00039 
00040 public:
00041    UtilGraphLib() :
00042       name      (""),
00043       n_vertices(0),
00044       n_edges   (0),
00045       capacity  (0),
00046       edge_wt   (0),
00047       vertex_wt (0),
00048       posx      (0),
00049       posy      (0),
00050       coordx    (0),
00051       coordy    (0),
00052       coordz    (0) {
00053    };
00054 
00055    ~UtilGraphLib() {
00056       UTIL_DELARR(edge_wt);
00057       UTIL_DELARR(vertex_wt);
00058       UTIL_DELARR(posx);
00059       UTIL_DELARR(posy);
00060       UTIL_DELARR(coordx);
00061       UTIL_DELARR(coordy);
00062       UTIL_DELARR(coordz);
00063    };
00064 
00065 public:
00066    //TODO: make these private and provide access functions?
00067    //TSPLIB/VRPLIB
00068    std::string name;
00069    int      n_vertices;
00070    int      n_edges;
00071    int      capacity;
00072    int*     edge_wt;
00073    int*     vertex_wt;
00074    int*     posx;
00075    int*     posy;
00076    double* coordx;
00077    double* coordy;
00078    double* coordz;
00079 
00080 public:
00081    void read_data(const char* datafile);
00082    int  compute_icost(const int wtype,
00083                       const int va,
00084                       const int vb);
00085 };
00086 
00087 #endif

Generated on 5 Apr 2015 for Dip-All by  doxygen 1.6.1