Skip to content

Commit

Permalink
Clang format run over all files
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Apr 10, 2024
1 parent 1def015 commit 0ce824e
Show file tree
Hide file tree
Showing 68 changed files with 545 additions and 526 deletions.
10 changes: 5 additions & 5 deletions packages/seacas/libraries/chaco/assign/assign_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <stdio.h>

static void assign_out_normal(int nvtxs, /* number of vertices to output */
int * sets, /* values to be printed */
int *sets, /* values to be printed */
char *outname /* name of output file */
)
{
Expand All @@ -36,14 +36,14 @@ static void assign_out_normal(int nvtxs, /* number of vertices to output */
}

static void assign_out_inv(int nvtxs, /* number of vertices to output */
int * sets, /* values to be printed */
int *sets, /* values to be printed */
int nsets, /* number of sets */
char *outname /* name of output file */
)
{
FILE *fout; /* output file */
int * size; /* # vtxs in sets / index into inorder */
int * inorder; /* list of vtxs in each set */
int *size; /* # vtxs in sets / index into inorder */
int *inorder; /* list of vtxs in each set */
int i, j; /* loop counter */

/* Print assignment in inverted format. */
Expand Down Expand Up @@ -105,7 +105,7 @@ static void assign_out_inv(int nvtxs, /* number of vertices to output */
}

void assign_out(int nvtxs, /* number of vertices to output */
int * sets, /* values to be printed */
int *sets, /* values to be printed */
int nsets, /* number of sets */
char *outname /* name of output file */
)
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/chaco/assign/y2x.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
void y2x(double **xvecs, /* pointer to list of x-vectors */
int ndims, /* number of divisions to make (# xvecs) */
int nmyvtxs, /* number of vertices I own (length xvecs) */
double * wsqrt /* sqrt of vertex weights */
double *wsqrt /* sqrt of vertex weights */
)

/* Convert from y to x by dividing by wsqrt. */
Expand All @@ -36,7 +36,7 @@ void y2x(double **xvecs, /* pointer to list of x-vectors */
void x2y(double **yvecs, /* pointer to list of y-vectors */
int ndims, /* number of divisions to make (# yvecs) */
int nmyvtxs, /* number of vertices I own (length yvecs) */
double * wsqrt /* sqrt of vertex weights */
double *wsqrt /* sqrt of vertex weights */
)

/* Convert from x to y by multiplying by wsqrt. */
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/chaco/bpmatch/genvals2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
void genvals2d(
/* Create lists of sets of values to be sorted. */
double **xvecs, /* vectors to partition */
double * vals[4][MAXSETS], /* ptrs to lists of values */
double *vals[4][MAXSETS], /* ptrs to lists of values */
int nvtxs /* number of values */
)
{
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/chaco/bpmatch/genvals3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
void genvals3d(
/* Create lists of sets of values to be sorted. */
double **xvecs, /* vectors to partition */
double * vals[8][MAXSETS], /* ptrs to lists of values */
double *vals[8][MAXSETS], /* ptrs to lists of values */
int nvtxs /* number of values */
)
{
Expand Down
14 changes: 7 additions & 7 deletions packages/seacas/libraries/chaco/bpmatch/inits2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "params.h" // for MAXSETS
#include "structs.h" // for vtx_data

int findindex(int * indices, /* indices sorting values */
int findindex(int *indices, /* indices sorting values */
double *vals, /* values sorted by indices */
double target, /* target value */
int nvals /* number of values */
Expand Down Expand Up @@ -62,14 +62,14 @@ int findindex(int * indices, /* indices sorting values */
}

void inits2d(struct vtx_data **graph, /* graph data structure for vertex weights */
double ** xvecs, /* values to partition with */
double * vals[4][MAXSETS], /* values in sorted lists */
int * indices[4][MAXSETS], /* indices sorting lists */
double **xvecs, /* values to partition with */
double *vals[4][MAXSETS], /* values in sorted lists */
int *indices[4][MAXSETS], /* indices sorting lists */
int nvtxs, /* number of vertices */
double * dist, /* trial separation point */
double *dist, /* trial separation point */
int startvtx[4][MAXSETS], /* indices defining separation */
double * size, /* size of each set being modified */
int * sets /* set each vertex gets assigned to */
double *size, /* size of each set being modified */
int *sets /* set each vertex gets assigned to */
)
{
double xmid, ymid; /* median x and y values */
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/chaco/bpmatch/sorts2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
void sorts2d(
/* Sort the lists needed to find the splitter. */
double *vals[4][MAXSETS], /* lists of values to sort */
int * indices[4][MAXSETS], /* indices of sorted lists */
int *indices[4][MAXSETS], /* indices of sorted lists */
int nvtxs /* number of vertices */
)
{
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/chaco/bpmatch/sorts3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
void sorts3d(
/* Sort the lists needed to find the splitter. */
double *vals[8][MAXSETS], /* lists of values to sort */
int * indices[8][MAXSETS], /* indices of sorted lists */
int *indices[8][MAXSETS], /* indices of sorted lists */
int nvtxs /* number of vertices */
)
{
Expand Down
10 changes: 5 additions & 5 deletions packages/seacas/libraries/chaco/coarsen/countcedges.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ void countcedges(
/* Count edges in coarsened graph and construct start array. */
struct vtx_data **graph, /* array of vtx data for graph */
int nvtxs, /* number of vertices in graph */
int * start, /* start of edgevals list for each vertex */
int * seenflag, /* flags indicating vtxs already counted */
int * mflag, /* flag indicating vtx matched or not */
int * v2cv, /* mapping from fine to coarse vertices */
int * pcnedges /* number of edges in coarsened graph */
int *start, /* start of edgevals list for each vertex */
int *seenflag, /* flags indicating vtxs already counted */
int *mflag, /* flag indicating vtx matched or not */
int *v2cv, /* mapping from fine to coarse vertices */
int *pcnedges /* number of edges in coarsened graph */
)
{
int *jptr; /* loops through edge list */
Expand Down
10 changes: 5 additions & 5 deletions packages/seacas/libraries/chaco/coarsen/interpolate.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
which they were collapsed.
*/

void ch_interpolate(double ** vecs, /* approximate eigenvectors for graph */
double ** cvecs, /* exact eigenvectors for coarse graph */
void ch_interpolate(double **vecs, /* approximate eigenvectors for graph */
double **cvecs, /* exact eigenvectors for coarse graph */
int ndims, /* number of vectors to interpolate */
struct vtx_data **graph, /* array of vtx data for graph */
int nvtxs, /* number of vertices in graph */
int * v2cv, /* mapping from vtxs to cvtxs */
int *v2cv, /* mapping from vtxs to cvtxs */
int using_ewgts /* are edge weights being used in fine graph? */
)
{
double *vec, *cvec; /* pointers into vecs and vecs */
int * eptr; /* loops through edge lists */
float * ewptr; /* loops through edge weights */
int *eptr; /* loops through edge lists */
float *ewptr; /* loops through edge weights */
float ewgt; /* value for edge weight */
double ewsum; /* sum of incident edge weights */
double sum; /* sum of values of neighbors */
Expand Down
8 changes: 4 additions & 4 deletions packages/seacas/libraries/chaco/coarsen/makeccoords.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

void makeccoords(struct vtx_data **graph, /* array of vtx data for graph */
int cnvtxs, /* number of vertices in coarse graph */
int * cv2v_ptrs, /* vtxs corresponding to each cvtx */
int * cv2v_vals, /* indices into cv2v_vals */
int *cv2v_ptrs, /* vtxs corresponding to each cvtx */
int *cv2v_vals, /* indices into cv2v_vals */
int igeom, /* dimensions of geometric data */
float ** coords, /* coordinates for vertices */
float ** ccoords /* coordinates for coarsened vertices */
float **coords, /* coordinates for vertices */
float **ccoords /* coordinates for coarsened vertices */
)
{
double mass; /* total mass of merged vertices */
Expand Down
12 changes: 6 additions & 6 deletions packages/seacas/libraries/chaco/connect/add_edges.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@

void add_edges(struct vtx_data **graph, /* graph data structure */
struct edgeslist *new_edges, /* list of edges connecting graph */
struct ilists ** old_edges, /* edges data overwritten for connecting */
struct flists ** old_ewgts, /* weights of edges overwritten */
struct ilists **old_edges, /* edges data overwritten for connecting */
struct flists **old_ewgts, /* weights of edges overwritten */
int using_ewgts /* are edge weights being used? */
)
{
struct ilists * save_list; /* space to save old edge list */
struct flists * save_ewgts; /* space to save old edge weights */
struct ilists *save_list; /* space to save old edge list */
struct flists *save_ewgts; /* space to save old edge weights */
struct edgeslist *edges; /* loops through new edges */
float * new_ewgts; /* new edge weights */
int * new_list; /* new edge list */
float *new_ewgts; /* new edge weights */
int *new_list; /* new edge list */
int nedges; /* number of edges a vertex has */
int vtx, vtx2; /* two vertices in edge to be added */
int i, j; /* loop counter */
Expand Down
14 changes: 7 additions & 7 deletions packages/seacas/libraries/chaco/connect/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <stdio.h>
#include <stdlib.h>

#define left(i) (2 * (i))
#define right(i) (2 * (i) + 1)
#define left(i) (2 * (i))
#define right(i) (2 * (i) + 1)
#define parent(i) ((int)((i) / 2))

/* NOTE: heap assumes indices are 1-based. */
Expand All @@ -22,7 +22,7 @@
void heapify(struct heap *heap, /* array of vals/tag to make into heap */
int index, /* root of subtree to heapify */
int nvals, /* number of values in array */
int * map /* maps from tag values to heap indices */
int *map /* maps from tag values to heap indices */
)
{
double swap_val; /* temporary storage for swapping values */
Expand Down Expand Up @@ -66,7 +66,7 @@ void heapify(struct heap *heap, /* array of vals/tag to make into heap */
/* Construct a heap from an unordered set of values. */
void heap_build(struct heap *heap, /* array of vals/tag to make into heap */
int nvals, /* number of values in array */
int * map /* maps from tag values to heap indices */
int *map /* maps from tag values to heap indices */
)
{
int i; /* loop counter */
Expand All @@ -84,8 +84,8 @@ void heap_build(struct heap *heap, /* array of vals/tag to make into heap */

double heap_extract_max(struct heap *heap, /* array of vals/tag in a heap */
int nvals, /* number of values in array */
int * ptag, /* tag associated with return value */
int * map /* maps from tag values to heap indices */
int *ptag, /* tag associated with return value */
int *map /* maps from tag values to heap indices */
)
{
double maxval; /* return value */
Expand Down Expand Up @@ -117,7 +117,7 @@ double heap_extract_max(struct heap *heap, /* array of vals/tag in a heap */
void heap_update_val(struct heap *heap, /* array of vals/tag in a heap */
int index, /* index of value to update */
double newval, /* new value to insert */
int * map /* maps from tag values to heap indices */
int *map /* maps from tag values to heap indices */
)
{
int tag; /* tag value associated with updated val */
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/chaco/graph/graph_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
void graph_out(struct vtx_data **graph, /* graph data structure */
int nvtxs, /* number of vtxs in graph */
int using_ewgts, /* Are edges weighted? */
char * tag, /* message to include */
char * file_name /* output file name if not null */
char *tag, /* message to include */
char *file_name /* output file name if not null */
)
{
FILE *file; /* output file */
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/chaco/graph/mm_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
void mm_out(struct vtx_data **graph, /* graph data structure */
int nvtxs, /* number of vtxs in graph */
int using_ewgts, /* Are edges weighted? */
char * tag, /* message to include */
char * file_name /* output file name if not null */
char *tag, /* message to include */
char *file_name /* output file name if not null */
)
{
FILE *file; /* output file */
Expand Down
24 changes: 12 additions & 12 deletions packages/seacas/libraries/chaco/graph/reformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@

/* Change from a FORTRAN graph style to our graph data structure. */

int reformat(int * start, /* start of edge list for each vertex */
int * adjacency, /* edge list data */
int reformat(int *start, /* start of edge list for each vertex */
int *adjacency, /* edge list data */
int nvtxs, /* number of vertices in graph */
int * pnedges, /* ptr to number of edges in graph */
int * vwgts, /* weights for all vertices */
float * ewgts, /* weights for all edges */
int *pnedges, /* ptr to number of edges in graph */
int *vwgts, /* weights for all vertices */
float *ewgts, /* weights for all edges */
struct vtx_data ***pgraph /* ptr to array of vtx data for graph */
)
{
extern FILE * Output_File; /* output file or null */
extern FILE *Output_File; /* output file or null */
struct vtx_data **graph = NULL; /* array of vtx data for graph */
struct vtx_data * links = NULL; /* space for data for all vtxs */
int * edges = NULL; /* space for all adjacency lists */
float * eweights = NULL; /* space for all edge weights */
int * eptr = NULL; /* steps through adjacency list */
int * eptr_save = NULL; /* saved index into adjacency list */
float * wptr = NULL; /* steps through edge weights list */
struct vtx_data *links = NULL; /* space for data for all vtxs */
int *edges = NULL; /* space for all adjacency lists */
float *eweights = NULL; /* space for all edge weights */
int *eptr = NULL; /* steps through adjacency list */
int *eptr_save = NULL; /* saved index into adjacency list */
float *wptr = NULL; /* steps through edge weights list */
int self_edge; /* number of self loops detected */
int size; /* length of all edge lists */
double sum; /* sum of edge weights for a vtx */
Expand Down
22 changes: 11 additions & 11 deletions packages/seacas/libraries/chaco/graph/subgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
void make_subgraph(struct vtx_data **graph, /* graph data structure */
struct vtx_data **subgraph, /* subgraph data structure */
int subnvtxs, /* number of vtxs in subgraph */
int * psubnedges, /* ptr to number of edges in subgraph */
int * assignment, /* values designating subgraph inclusion */
int *psubnedges, /* ptr to number of edges in subgraph */
int *assignment, /* values designating subgraph inclusion */
int set, /* assignment value indicating inclusion */
int * glob2loc, /* mapping from graph to subgraph numbering */
int * loc2glob, /* mapping from subgraph to graph numbering */
int * degree, /* degrees of vertices in graph */
int *glob2loc, /* mapping from graph to subgraph numbering */
int *loc2glob, /* mapping from subgraph to graph numbering */
int *degree, /* degrees of vertices in graph */
int using_ewgts /* are edge weights being used? */
)
{
struct vtx_data *subgptr = NULL; /* loops through subgraph */
float * fptr = NULL; /* loops through edge weights */
int * iptr = NULL; /* loops through edge list */
float *fptr = NULL; /* loops through edge weights */
int *iptr = NULL; /* loops through edge list */
float tempwgt; /* weight of vertex being swapped */
double ewgtsum; /* sum of weights of subgraph edges */
int subnedges; /* number of edges in subgraph */
Expand Down Expand Up @@ -83,14 +83,14 @@ void make_subgraph(struct vtx_data **graph, /* graph data structure */
/* Undo the construction of the subgraph. */
void remake_graph(struct vtx_data **subgraph, /* subgraph data structure */
int subnvtxs, /* number of vtxs in subgraph */
int * loc2glob, /* mapping from subgraph to graph numbering */
int * degree, /* degrees of vertices in graph */
int *loc2glob, /* mapping from subgraph to graph numbering */
int *degree, /* degrees of vertices in graph */
int using_ewgts /* are edge weights being used? */
)
{
struct vtx_data *subgptr; /* loops through subgraph */
float * fptr; /* loops through edge weights */
int * iptr; /* loops through adjacency list */
float *fptr; /* loops through edge weights */
int *iptr; /* loops through adjacency list */
double ewgtsum; /* sum of weights of subgraph edges */
int nedges; /* vertex degree in subgraph */
int i, j; /* loop counter */
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/chaco/inertial/make_subgeom.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void make_subgeom(int igeom, /* 1, 2 or 3 dimensional geometry? */
float **coords, /* x, y and z coordinates of vertices */
float **subcoords, /* x, y and z coordinates in subgraph */
int subnvtxs, /* number of vertices in subgraph */
int * loc2glob /* maps from subgraph to graph numbering */
int *loc2glob /* maps from subgraph to graph numbering */
)
{
int i; /* loop counter */
Expand Down
Loading

0 comments on commit 0ce824e

Please sign in to comment.