#define PROG_NAME "DegreeOfNode" #define PROG_DESC "???" #define PROG_VERS "1.0" #define DegreeOfNode_C_COPYRIGHT \ "" #define PROG_INFO \ "" \ " " /* This module prints the degree of each node. */ #define _GNU_SOURCE #include #include #include TYPE typedef struct Options_t { char *inFile; } Options_t *GetOptions(int argc, char **argv); int main(int argc, char **argv) { Options_t *o = GetOptions(argc, argv); char *topo_cmt = jsprintf("Created by %s on %s", PROG_NAME, Today()); /* Random_t coins = MakeRandomSource(4615); */ ??? tc = Triangulation.ReadToMa(o->inFile); ??? top = tc.top; { fprintf(stderr, "node label degree\n"); fprintf(stderr, "----------------------\n"); for (i = 0; i < top->node.nel; i++) { ??? a = top->node[i]; ??? v = Triangulation.OrgV(a); ??? l = v.label; ??? d = Triangulation.DegreeOfNode(a); { fprintf(stderr, Fmt.Pad(Fmt.Int(i),5) & " " & l \ Fmt.Pad(Fmt.Int(d),7) & "\n"); } } return 0; } Options_t GetOptions () { Options_t *o = (Options_t *)malloc(sizeof(Options_t)); argparser_t *pp = argparser_new(stderr, argc, argv); argparser_set_help(pp, PROG_NAME " version " PROG_VERS ", usage:\n" PROG_HELP); argparser_set_info(pp, PROG_INFO); argparser_process_help_info_options(pp); argparser_get_keyword(pp, "-inFile"); o->inFile = argparser_get_next(pp); argparser_finish(pp); ----------------------------------- #define _HELP \ fprintf(stderr,"Usage: DegreeOfNode \\\n"); fprintf(stderr," -inFile \n"); END¦ } } return o; } /* END GetOptions */ /* end DegreeOfNode */ /* Copyright © 2000 Universidade Estadual de Campinas (UNICAMP) */