
/*
**  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(_SPSBIG_H_)

#define _SPSBIG_H_

#include <absbig.h>
#include <spsstruc.h>


class biGraph : public virtual abstractBiGraph
{                                 
protected:
        
    sparseGraphStructure X;    

public:

    biGraph(TNode nn1,TNode nn2,TOption options=0,
        goblinController &thisContext = goblinDefaultContext) throw();
    biGraph(char* impFileName,
        goblinController &thisContext = goblinDefaultContext)
        throw(ERFile,ERParse);
    biGraph(abstractBiGraph &G,TOption options=0) throw();
    ~biGraph() throw();

    unsigned long   Size() throw();
    unsigned long   Allocated() throw();
    virtual objectType ClassID() throw() {return IDSparseBiGraph;};
    virtual void*   BackCast() {return (void*)this;};

    TArc            InsertArc(TNode u,TNode v) throw(ERRange,ERRejected)
                        {ReleaseAdjacencies(); m++; return X.InsertArc(u,v);};
    TArc            InsertArc(TNode u,TNode v,TCap uu,TFloat cc) throw(ERRange,ERRejected)
                        {ReleaseAdjacencies(); m++; return X.InsertArc(u,v,uu,0,cc);};
    TArc            InsertArc(TNode u,TNode v,TCap uu,TCap ll,TFloat cc) throw(ERRange,ERRejected)
                        {ReleaseAdjacencies(); m++; return X.InsertArc(u,v,uu,ll,cc);};
    void            DeleteArc(TArc a) throw(ERRange)
                        {ReleaseAll(); X.DeleteArc(a); ni = X.NI(); m = X.M();};

    #include <spsincl.h>

    TFloat          Length(TArc a) throw(ERRange)
                        {return X.Length(a);};     

};                           


class inducedBigraph : public biGraph
{                                        
public:

    inducedBigraph(abstractMixedGraph&,TNode,TNode,TOption = OPT_PARALLELS)
        throw(ERRejected);

};


#endif
