Weighted graph

Name

Weighted graph -- 

Synopsis


#include <gts.h>


#define     GTS_WGEDGE_CLASS                (klass)
#define     GTS_WGEDGE                      (obj)
#define     GTS_IS_WGEDGE                   (obj)
            GtsWGEdgeClass;
            GtsWGEdge;

GtsWGEdgeClass* gts_wgedge_class            (void);
GtsWGEdge*  gts_wgedge_new                  (GtsWGEdgeClass *klass,
                                             GtsGNode *n1,
                                             GtsGNode *n2,
                                             gfloat weight);

#define     GTS_WGNODE_CLASS                (klass)
#define     GTS_WGNODE                      (obj)
#define     GTS_IS_WGNODE                   (obj)
            GtsWGNodeClass;
            GtsWGNode;

GtsWGNodeClass* gts_wgnode_class            (void);
GtsWGNode*  gts_wgnode_new                  (GtsWGNodeClass *klass,
                                             gfloat weight);

#define     GTS_WGRAPH_CLASS                (klass)
#define     GTS_WGRAPH                      (obj)
#define     GTS_IS_WGRAPH                   (obj)
            GtsWGraphClass;
            GtsWGraph;

GtsWGraphClass* gts_wgraph_class            (void);
gfloat      gts_wgraph_weight_max           (GtsWGraph *wg);

Description

Details

GTS_WGEDGE_CLASS()

#define     GTS_WGEDGE_CLASS(klass)

klass :


GTS_WGEDGE()

#define     GTS_WGEDGE(obj)

obj :


GTS_IS_WGEDGE()

#define     GTS_IS_WGEDGE(obj)

obj :


GtsWGEdgeClass

typedef struct {
  GtsGEdgeClass parent_class;
} GtsWGEdgeClass;


GtsWGEdge

typedef struct {
  GtsGEdge gedge;

  gfloat weight;
} GtsWGEdge;


gts_wgedge_class ()

GtsWGEdgeClass* gts_wgedge_class            (void);

Returns :

the GtsWGEdgeClass.


gts_wgedge_new ()

GtsWGEdge*  gts_wgedge_new                  (GtsWGEdgeClass *klass,
                                             GtsGNode *n1,
                                             GtsGNode *n2,
                                             gfloat weight);

klass :

a GtsWGEdgeClass.

n1 :

a GtsGNode.

n2 :

another GtsGNode.

weight :

the weight of the new edge.

Returns :

a new GtsWGEdge of weight weight linking n1 and n2.


GTS_WGNODE_CLASS()

#define     GTS_WGNODE_CLASS(klass)

klass :


GTS_WGNODE()

#define     GTS_WGNODE(obj)

obj :


GTS_IS_WGNODE()

#define     GTS_IS_WGNODE(obj)

obj :


GtsWGNodeClass

typedef struct {
  GtsGNodeClass parent_class;
} GtsWGNodeClass;


GtsWGNode

typedef struct {
  GtsGNode node;
  
  gfloat weight;
} GtsWGNode;


gts_wgnode_class ()

GtsWGNodeClass* gts_wgnode_class            (void);

Returns :

the GtsWGNodeClass.


gts_wgnode_new ()

GtsWGNode*  gts_wgnode_new                  (GtsWGNodeClass *klass,
                                             gfloat weight);

klass :

a GtsWGNodeClass.

weight :

the weight of the GtsWGNode to create.

Returns :

a new GtsWGNode of weight weight.


GTS_WGRAPH_CLASS()

#define     GTS_WGRAPH_CLASS(klass)

klass :


GTS_WGRAPH()

#define     GTS_WGRAPH(obj)

obj :


GTS_IS_WGRAPH()

#define     GTS_IS_WGRAPH(obj)

obj :


GtsWGraphClass

typedef struct {
  GtsGraphClass parent_class;
} GtsWGraphClass;


GtsWGraph

typedef struct {
  GtsGraph graph;

  gfloat weight;
} GtsWGraph;


gts_wgraph_class ()

GtsWGraphClass* gts_wgraph_class            (void);

Returns :

the GtsWGraphClass.


gts_wgraph_weight_max ()

gfloat      gts_wgraph_weight_max           (GtsWGraph *wg);

wg :

a GtsWGraph.

Returns :

the maximum weight of any vertices belonging to g.