MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / put_array

Function put_array

src/testapi_userdataset.c:77–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void put_array (void *vector, unsigned int type, char *txt) {
78 /* Print one row with the output data */
79 double *d = NULL;
80 float *f = NULL;
81 uint64_t *ul = NULL;
82 int64_t *sl = NULL;
83 unsigned int *ui = NULL;
84 int *si = NULL;
85 unsigned short int *uh = NULL;
86 short int *sh = NULL;
87 unsigned char *uc = NULL;
88 char *sc = NULL;
89 unsigned int k;
90 printf ("%s", txt);
91 switch (type) {
92 case GMT_DOUBLE:
93 d = vector; for (k = 0; k < NM; k++) printf (" %5.1f", d[k]);
94 break;
95 case GMT_FLOAT:
96 f = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)f[k]);
97 break;
98 case GMT_ULONG:
99 ul = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)ul[k]);
100 break;
101 case GMT_LONG:
102 sl = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)sl[k]);
103 break;
104 case GMT_UINT:
105 ui = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)ui[k]);
106 break;
107 case GMT_INT:
108 si = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)si[k]);
109 break;
110 case GMT_USHORT:
111 uh = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)uh[k]);
112 break;
113 case GMT_SHORT:
114 sh = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)sh[k]);
115 break;
116 case GMT_UCHAR:
117 uc = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)uc[k]);
118 break;
119 case GMT_CHAR:
120 sc = vector; for (k = 0; k < NM; k++) printf (" %5.1f", (double)sc[k]);
121 break;
122 }
123 printf ("\n");
124}
125
126double sum_array (void *vector, unsigned int type) {
127 /* Print one row with the output data */

Callers 1

deploy_testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected