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



    sparseGraphStructure &Struct() throw() {return X;};
    
    bool            IsSparse() throw()
                        {return 1;};

    void            ReSize(TNode nn,TArc mm) throw()
                        {X.ReSize(nn,mm);};
    
    TNode           StartNode(TArc a) throw(ERRange)
                        {return X.StartNode(a);};
    TNode           EndNode(TArc a) throw(ERRange)
                        {return X.EndNode(a);};
    
    TArc            First(TNode v) throw(ERRange)
                        {return X.First(v);};
    TArc            Right(TArc a,TNode v = NoNode) throw(ERRange)
                        {return X.Right(a);};

    TNode           Align(TArc a) throw(ERRange)
                        {return X.Align(a);};
    bool            CAlign() throw()
                        {return X.CAlign();};
    TNode           Interpolate(TNode v) throw(ERRange)
                        {return X.Interpolate(v);};
    bool            CInterpolate() throw()
                        {return X.CInterpolate();};

    void            FlipArc(TArc a) throw(ERRange)
                        {X.FlipArc(a);};

    TNode  InsertNode() throw(ERRejected)
    {
        n++;
        TNode ret = X.InsertNode();
        
        ReleaseAdjacencies();
        ReleasePartition();
        ReleaseDegrees();
       
        if (colour!=NULL)
        {
            colour = (TNode*)GoblinRealloc(colour,n*sizeof(TNode));
            colour[n-1] = NoNode;
        };
        
        if (d!=NULL)
        {
            d = (TFloat*)GoblinRealloc(d,n*sizeof(TFloat));
            d[n-1] = InfFloat;
        };

        if (pi!=NULL)
        {
            pi = (TFloat*)GoblinRealloc(pi,n*sizeof(TFloat));
            pi[n-1] = 0;
        };

        if (P!=NULL)
        {
            P = (TArc*)GoblinRealloc(P,n*sizeof(TArc));
            P[n-1] = NoArc;
        };
        
        return ret;
    };
    
    TNode           InsertAlignmentPoint(TArc a) throw(ERRejected,ERRange)
                        {ni++; return X.InsertAlignmentPoint(a);};
    TNode           InsertBendNode(TNode v) throw(ERRejected,ERRange)
                        {ni++; return X.InsertBendNode(v);};

    void  ReleaseBendNodes(TArc a) throw(ERRange)
    {
        X.ReleaseBendNodes(a);
        ni = X.NI();
    };

    void  DeleteNode(TNode v) throw(ERRange)
    {
        ReleaseAll();
        X.DeleteNode(v);
        n = X.N()-X.NI();
        ni = X.NI();
        m = X.M();
    };
    
    void  ReleaseAll() throw()
    {
        ReleaseAdjacencies();
        ReleaseDegrees();
        ReleaseLabels();
        ReleasePotentials();
        ReleasePredecessors();
        ReleaseColours();
        ReleasePartition();
    };
    
    #include <genincl.h>
