Go to the documentation of this file.
53 "Usage: gkgraph [options] <graph-file> [<out-file>]",
55 " Required parameters",
57 " The name of the file storing the graph. The file is in ",
58 " Metis' graph format.",
60 " Optional parameters",
62 " Specifies the maximum number of iterations. [default: 100]",
65 " Specifies the follow-the-adjacent-links probability. [default: 0.80]",
68 " Specifies the error tollerance. [default: 1e-10]",
71 " Prints this message.",
77 " Usage: gkgraph [options] <graph-file> [<out-file>]",
78 " use 'gkgraph -help' for a summary of the options.",
97 int main(
int argc,
char *argv[])
119 for (
i=0;
i<1;
i++) {
122 printf(
"BFS from %8d. Compactness: %le\n",
130 printf(
"BestF from %8d. Compactness: %le\n",
140 printf(
"\tAfter centroid; Compactness: %le\n",
168 double compactness=0.0;
171 nvtxs =
graph->nvtxs;
175 freq = gk_ismalloc(nvtxs, 0,
"compute_compactness: freq");
177 for (
i=0;
i<nvtxs;
i++) {
181 compactness +=
fabs(
v-u);
192 printf(
"\tnsmall: %d\n", freq[1]+freq[2]+freq[3]);
194 return compactness/
xadj[nvtxs];
209 nvtxs =
graph->nvtxs;
213 cand = gk_fkvmalloc(nvtxs,
"reorder_centroid: cand");
215 for (
i=0;
i<nvtxs;
i++) {
234 gk_i32set(nvtxs, -1,
perm);
235 for (
i=0;
i<nvtxs;
i++) {
256 printf(
"*******************************************************************************\n");
257 printf(
" gkgraph\n\n");
258 printf(
"Graph Information ----------------------------------------------------------\n");
259 printf(
" input file=%s, [%d, %zd]\n",
263 printf(
"Options --------------------------------------------------------------------\n");
264 printf(
" type=%d, niter=%d, lamda=%f, eps=%e\n",
268 printf(
"Working... -----------------------------------------------------------------\n");
278 printf(
"Memory Usage Information -----------------------------------------------------\n");
281 printf(
"********************************************************************************\n");
327 printf(
"Illegal command-line option(s)\nUse %s -help for a summary of the options.\n", argv[0]);
333 printf(
"Unrecognized parameters.");
char * gk_optarg
For communication arguments to the caller.
idx_t idx_t idx_t idx_t idx_t * perm
gk_graph_t * gk_graph_Read(char *filename, int format, int isfewgts, int isfvwgts, int isfvsizes)
char * gk_strdup(char *orgstr)
Duplicates a string.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void gk_free(void **ptr1,...)
void gk_fkvsorti(size_t, gk_fkv_t *)
void gk_graph_ComputeBFSOrdering(gk_graph_t *graph, int v, int32_t **r_perm, int32_t **r_iperm)
idx_t idx_t idx_t * adjncy
void gk_graph_ComputeBestFOrdering(gk_graph_t *graph, int v, int type, int32_t **r_perm, int32_t **r_iperm)
int main(int argc, char *argv[])
params_t * parse_cmdline(int argc, char *argv[])
void errexit(char *f_str,...)
static const SmartProjectionParams params
The structure that stores the information about the command-line options.
static char shorthelpstr[][100]
void print_final_info(params_t *params)
int gk_optind
Index in ARGV of the next element to be scanned.
#define GK_GRAPH_FMT_METIS
size_t gk_GetMaxMemoryUsed()
void reorder_centroid(params_t *params, gk_graph_t *graph, int32_t *perm)
static struct gk_option long_options[]
int gk_fexists(char *fname)
static char helpstr[][100]
Array< int, Dynamic, 1 > v
void gk_graph_Free(gk_graph_t **graph)
gk_graph_t * gk_graph_Reorder(gk_graph_t *graph, int32_t *perm, int32_t *iperm)
int gk_getopt_long_only(int argc, char **argv, char *options, struct gk_option *long_options, int *opt_index)
Parse command-line arguments with only long options.
NonlinearFactorGraph graph
size_t gk_GetCurMemoryUsed()
double compute_compactness(params_t *params, gk_graph_t *graph, int32_t *perm)
void * gk_malloc(size_t nbytes, char *msg)
void gk_graph_Write(gk_graph_t *graph, char *filename, int format)
void print_init_info(params_t *params, gk_graph_t *graph)
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:37