UtilGraphLib.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the Decomp Solver Framework.                         //
00003 //                                                                           //
00004 // Decomp is distributed under the Common 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 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
00011 //===========================================================================//
00012 
00013 /*
00014   Author  : Matthew Galati
00015   Date    : 02/20/03
00016   Purpose : A class for storing data instances from TSPLIB and VRPLIB.
00017 
00018   02/20/03: Initial version for VRPLIB
00019   TODO    : TSPLIB
00020   : apply to KCCP code
00021 */
00022 
00023 
00024 #ifndef UTIL_GRAPHLIB_INCLUDED
00025 #define UTIL_GRAPHLIB_INCLUDED
00026 
00027 #include "UtilMacros.h"
00028 
00029 #include <string>
00030 using namespace std;
00031 
00032 // ----------------------------------------------------------------------- //
00033 class UtilGraphLib {
00034 private:
00035    UtilGraphLib(const UtilGraphLib&);
00036    UtilGraphLib& operator=(const UtilGraphLib&);
00037 
00038 public:
00039    UtilGraphLib()
00040       : name(""), n_vertices(0), n_edges(0), capacity(0), edge_wt(0),
00041         vertex_wt(0), posx(0), posy(0),
00042         coordx(0), coordy(0), coordz(0) {};
00043    ~UtilGraphLib() {
00044       UTIL_DELARR(edge_wt);
00045       UTIL_DELARR(vertex_wt);
00046       UTIL_DELARR(posx);
00047       UTIL_DELARR(posy);
00048       UTIL_DELARR(coordx);
00049       UTIL_DELARR(coordy);
00050       UTIL_DELARR(coordz);
00051    };
00052 
00053 public:
00054    //TODO: make these private and provide access functions?
00055    //TSPLIB/VRPLIB
00056    string name;
00057    int    n_vertices;
00058    int    n_edges;
00059    int    capacity;
00060    int*    edge_wt;
00061    int*    vertex_wt;
00062    int*    posx, *posy;
00063    double* coordx, *coordy, *coordz;
00064 
00065 public:
00066    void read_data(const char* datafile);
00067    int compute_icost(const int wtype, const int va, const int vb);
00068 };
00069 
00070 #endif

Generated on 3 Jun 2015 for Dip-All by  doxygen 1.6.1