
/*
**  This file forms part of the GOBLIN C++ Class Library.
**
**  Written by Christian Fremuth-Paeger, December 1998.
**  
**  Copying, compiling, distribution and modification
**  of this source code is permitted only in accordance
**  with the GOBLIN general licence information.
*/             


#if !defined(_DNSGRA_H_)

#define _DNSGRA_H_

#include <absgra.h>
#include <dnsstruc.h>


class denseGraph : public virtual abstractGraph
{
    friend class iDenseGraph;
    
protected:
        
    denseGraphStructure X;    

public:

    denseGraph(TNode nn,TOption options = 0,
        goblinController &thisContext = goblinDefaultContext) throw();
    denseGraph(char* impFileName,
        goblinController &thisContext = goblinDefaultContext)
        throw(ERFile,ERParse);
    denseGraph(abstractGraph &G) throw();
    ~denseGraph() throw();

    TArc            InsertArc(TNode u,TNode v) throw(ERRange,ERRejected);
    TArc            InsertArc(TNode u,TNode v,TCap cc,TCap bb,TFloat ll)
                        throw(ERRange,ERRejected);

    unsigned long   Size() throw();
    unsigned long   Allocated() throw();
    virtual objectType ClassID() throw() {return IDDenseGraph;};
    virtual void*   BackCast() {return (void*)this;};
    
    TArc            Adjacency(TNode u,TNode v) throw(ERRange);
    TNode           StartNode(TArc a) throw(ERRange);
    TNode           EndNode(TArc a) throw(ERRange);
   
    TArc            First(TNode v) throw(ERRange);
    TArc            Right(TArc a,TNode u) throw(ERRange);

    void            Write(char* fileName) throw(ERFile)
                        {WriteGraph(fileName,NO_INCIDENCES);};

    #include <dnsincl.h>

    TFloat          Length(TArc a) throw(ERRange) {return X.Length(a);};     
    
    TFloat          TSPHeuristics(TNode r = NoNode) throw(ERRange,ERRejected);

};                           


class metricGraph : public denseGraph
{                                        
public:

    metricGraph(abstractGraph &G) throw(ERRejected);

};


#endif
