/* $Id: sysmatmlnodes.h,v 1.3 1996/11/21 14:15:57 bzferdma Exp $ */

#ifndef SYSMATMLNODES_H
#define SYSMATMLNODES_H

#include "general.h"
#include "alloc.h"

//-------------------------------------------------------------------------


class NodeNeighbour
{
  public:
    
    Num  aij;
    int  node;
    NodeNeighbour* next;

    virtual Num& Aij() { return aij; }
    virtual Num& Aji() { return aij; }

    void* operator new(size_t /*size*/)     { return alloc.Get(); }
    void  operator delete(void* neighb) { alloc.Return((NodeNeighbour*) neighb);}
    
    static StaticAllocator<NodeNeighbour>  alloc;

    NodeNeighbour() { reset(); }
    virtual ~NodeNeighbour() { }

    void reset() { node=0; aij=0.0; }
};
//-------------------------------------------------------------------------


class AsymNodeNeighbour : public NodeNeighbour
{
  public:
    
    Num  aji;
    int  node;
    AsymNodeNeighbour* next;

    virtual Num& Aij() { return aij; }
    virtual Num& Aji() { return aji; }

    void* operator new(size_t /*size*/)     { return alloc.Get(); }
    void  operator delete(void* neighb) 
    				   { alloc.Return((AsymNodeNeighbour*) neighb);}
    
    static StaticAllocator<AsymNodeNeighbour>  alloc;

    AsymNodeNeighbour() { reset(); }
    virtual ~AsymNodeNeighbour() { }

    void reset() { node=0;  aij=aji=0.0; }
};

#endif
