1
/* This software was developed by Bruce Hendrickson and Robert Leland *
2
* at Sandia National Laboratories under US Department of Energy *
3
* contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
10
void makevwsqrt(vwsqrt, graph, nvtxs)
11
/* Make vector of square roots of vertex weights. */
12
double *vwsqrt; /* vector returned */
13
struct vtx_data **graph; /* graph data structure */
14
int nvtxs; /* number of vertices in graph */
16
extern int NSQRTS; /* number of sqrts already computed */
17
extern double *SQRTS; /* values computed */
18
int vwgt; /* vertex weight */
19
int i; /* loop counter */
21
for (i = 1; i <= nvtxs; i++) {
22
vwgt = graph[i]->vwgt;
24
vwsqrt[i] = SQRTS[vwgt];
26
vwsqrt[i] = sqrt((double) vwgt);
31
/* Extract the subgraph vwsqrt values */
32
void make_subvector(vec, subvec, subnvtxs, loc2glob)
33
double *vec; /* vector for all vertices */
34
double *subvec; /* vector for vertices in subgraph */
35
int subnvtxs; /* number of vtxs in subgraph */
36
int *loc2glob; /* subgraph -> graph numbering map */
40
for (i = 1; i <= subnvtxs; i++) {
42
(*subvec) = vec[loc2glob[i]];