23 printf(
"Testing iisort...\n");
29 for (i=0; i<N-1; i++) {
30 if (array[i] > array[i+1])
31 printf(
"gk_isorti error at index %jd [%d %d]\n", (
intmax_t)i, array[i], array[i+1]);
36 printf(
"Testing disort...\n");
42 for (i=0; i<N-1; i++) {
43 if (array[i] < array[i+1])
44 printf(
"gk_isortd error at index %jd [%d %d]\n", (
intmax_t)i, array[i], array[i+1]);
59 printf(
"Testing ifsort...\n");
65 for (i=0; i<N-1; i++) {
66 if (array[i] > array[i+1])
67 printf(
"gk_fsorti error at index %jd [%f %f]\n", (
intmax_t)i, array[i], array[i+1]);
72 printf(
"Testing dfsort...\n");
78 for (i=0; i<N-1; i++) {
79 if (array[i] < array[i+1])
80 printf(
"gk_fsortd error at index %jd [%f %f]\n", (
intmax_t)i, array[i], array[i+1]);
95 printf(
"Testing idxsorti...\n");
101 for (i=0; i<N-1; i++) {
102 if (array[i] > array[i+1])
103 printf(
"gk_idxsorti error at index %zd [%zd %zd]\n", (
ssize_t)i, (
ssize_t)array[i], (
ssize_t)array[i+1]);
108 printf(
"Testing idxsortd...\n");
114 for (i=0; i<N-1; i++) {
115 if (array[i] < array[i+1])
116 printf(
"gk_idxsortd error at index %zd [%zd %zd]\n", (
ssize_t)i, (
ssize_t)array[i], (
ssize_t)array[i+1]);
132 printf(
"Testing ikvsorti...\n");
133 for (i=0; i<
N; i++) {
140 for (i=0; i<N-1; i++) {
141 if (array[i].
key > array[i+1].
key)
142 printf(
"gk_ikvsorti error at index %jd [%d %d] [%jd %jd]\n", (
intmax_t)i, array[i].
key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
147 printf(
"Testing ikvsortd...\n");
148 for (i=0; i<
N; i++) {
155 for (i=0; i<N-1; i++) {
156 if (array[i].
key < array[i+1].
key)
157 printf(
"gk_ikvsortd error at index %jd [%d %d] [%jd %jd]\n", (
intmax_t)i, array[i].
key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
173 printf(
"Testing fkvsorti...\n");
174 for (i=0; i<
N; i++) {
181 for (i=0; i<N-1; i++) {
182 if (array[i].
key > array[i+1].
key)
183 printf(
"gk_fkvsorti error at index %jd [%f %f] [%jd %jd]\n", (
intmax_t)i, array[i].
key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
188 printf(
"Testing fkvsortd...\n");
189 for (i=0; i<
N; i++) {
196 for (i=0; i<N-1; i++) {
197 if (array[i].
key < array[i+1].
key)
198 printf(
"gk_fkvsortd error at index %jd [%f %f] [%jd %jd]\n", (
intmax_t)i, array[i].
key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
213 printf(
"Testing dkvsorti...\n");
214 for (i=0; i<
N; i++) {
221 for (i=0; i<N-1; i++) {
222 if (array[i].
key > array[i+1].
key)
223 printf(
"gk_dkvsorti error at index %jd [%lf %lf] [%jd %jd]\n", (
intmax_t)i, array[i].
key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
228 printf(
"Testing dkvsortd...\n");
229 for (i=0; i<
N; i++) {
236 for (i=0; i<N-1; i++) {
237 if (array[i].
key < array[i+1].
key)
238 printf(
"gk_dkvsortd error at index %jd [%lf %lf] [%jd %jd]\n", (
intmax_t)i, array[i].
key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
254 printf(
"Testing skvsorti...\n");
255 for (i=0; i<
N; i++) {
263 for (i=0; i<N-1; i++) {
264 if (strcmp(array[i].
key, array[i+1].key) > 0)
265 printf(
"gk_skvsorti error at index %jd [%s %s] [%jd %jd]\n", (
intmax_t)i, array[i].key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
270 printf(
"Testing skvsortd...\n");
271 for (i=0; i<
N; i++) {
279 for (i=0; i<N-1; i++) {
281 if (strcmp(array[i].
key, array[i+1].key) < 0)
282 printf(
"gk_skvsortd error at index %jd [%s %s] [%jd %jd]\n", (
intmax_t)i, array[i].key, array[i+1].key, (
intmax_t)array[i].val, (
intmax_t)array[i+1].val);
297 printf(
"Testing idxkvsorti...\n");
298 for (i=0; i<
N; i++) {
305 for (i=0; i<N-1; i++) {
306 if (array[i].
key > array[i+1].
key)
307 printf(
"gk_idxkvsorti error at index %zd [%zd %zd] [%zd %zd]\n",
314 printf(
"Testing idxkvsortd...\n");
315 for (i=0; i<
N; i++) {
322 for (i=0; i<N-1; i++) {
323 if (array[i].
key < array[i+1].
key)
324 printf(
"gk_idxkvsortd error at index %zd [%zd %zd] [%zd %zd]\n",
const gtsam::Symbol key('X', 0)
void gk_isorti(size_t, int *)
void gk_fkvsorti(size_t, gk_fkv_t *)
void gk_ikvsorti(size_t, gk_ikv_t *)
void gk_skvsortd(size_t, gk_skv_t *)
void gk_fsorti(size_t, float *)
void gk_skvsorti(size_t, gk_skv_t *)
void gk_fkvsortd(size_t, gk_fkv_t *)
void gk_idxsorti(size_t, gk_idx_t *)
void gk_idxkvsorti(size_t, gk_idxkv_t *)
void gk_ikvsortd(size_t, gk_ikv_t *)
char * gk_strdup(char *orgstr)
Duplicates a string.
void gk_fsortd(size_t, float *)
void gk_idxkvsortd(size_t, gk_idxkv_t *)
void gk_idxsortd(size_t, gk_idx_t *)
void gk_dkvsortd(size_t, gk_dkv_t *)
void gk_isortd(size_t, int *)
void gk_dkvsorti(size_t, gk_dkv_t *)