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

Function put_array

src/testapi_usergrid.c:88–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

deploy_testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected