Scotch Brand 5.1.10 User Manual

Page 80

Advertising
background image

Description

The SCOTCH graphBuild routine fills the source graph structure pointed to
by grafptr with all of the data that are passed to it.

baseval

is the graph base value for index arrays (typically 0 for structures

built from C and 1 for structures built from Fortran). vertnbr is the number
of vertices. verttab is the adjacency index array, of size (vertnbr + 1) if
the edge array is compact (that is, if vendtab equals verttab + 1 or NULL),
or of size vertnbr else. vendtab is the adjacency end index array, of size
vertnbr

if it is disjoint from verttab. velotab is the vertex load array, of

size vertnbr if it exists. vlbltab is the vertex label array, of size vertnbr if
it exists. edgenbr is the number of arcs (that is, twice the number of edges).
edgetab

is the adjacency array, of size at least edgenbr (it can be more if the

edge array is not compact). edlotab is the arc load array, of size edgenbr if
it exists.

The vendtab, velotab, vlbltab and edlotab arrays are optional, and a NULL
pointer can be passed as argument whenever they are not defined. Since, in
Fortran, there is no null reference, passing the scotchfgraphbuild routine a
reference equal to verttab in the velotab or vlbltab fields makes them be
considered as missing arrays. The same holds for edlotab when it is passed a
reference equal to edgetab. Setting vendtab to refer to one cell after verttab
yields the same result, as it is the exact semantics of a compact vertex array.

To limit memory consumption, SCOTCH graphBuild does not copy array data,
but instead references them in the SCOTCH Graph structure. Therefore, great
care should be taken not to modify the contents of the arrays passed to
SCOTCH graphBuild

as long as the graph structure is in use. Every update

of the arrays should be preceded by a call to SCOTCH graphFree, to free in-
ternal graph structures, and eventually followed by a new call to SCOTCH
graphBuild

to re-build these internal structures so as to be able to use the

new graph.

To ensure that inconsistencies in user data do not result in an erroneous behav-
ior of the libScotch routines, it is recommended, at least in the development
stage, to call the SCOTCH graphCheck routine on the newly created SCOTCH
Graph

structure before calling any other libScotch routine.

Return values

SCOTCH graphBuild

returns 0 if the graph structure has been successfully set

with all of the input data, and 1 else.

7.5.7

SCOTCH graphBase

Synopsis

int SCOTCH graphBase (SCOTCH Graph *

grafptr,

SCOTCH Num

baseval)

scotchfgraphbase (doubleprecision (*)

grafdat,

integer*num

baseval,

integer*num

oldbaseval)

80

Advertising