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

Function put_array

src/testapi_uservectors.c:91–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

deploy_testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected