summaryrefslogtreecommitdiffhomepage
path: root/examples/complex.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-07-27 13:39:50 +0200
committerTyge Løvset <[email protected]>2020-07-27 13:39:50 +0200
commitbdd322f4c7d30a3cba1aa0c6ff3106b2045fb879 (patch)
treedb32c9d05ec690d87a68bfd9d92ee340ee8c0f5e /examples/complex.c
parent8532f8e1db438d791a2d7b49d29f73a253dfb492 (diff)
downloadSTC-modified-bdd322f4c7d30a3cba1aa0c6ff3106b2045fb879.tar.gz
STC-modified-bdd322f4c7d30a3cba1aa0c6ff3106b2045fb879.zip
Renamed carray<123>_<tag> to carray<123><tag>.
Diffstat (limited to 'examples/complex.c')
-rw-r--r--examples/complex.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/complex.c b/examples/complex.c
index a52bd175..40dc9722 100644
--- a/examples/complex.c
+++ b/examples/complex.c
@@ -6,7 +6,7 @@
void check_destroy(float* v) {printf("destroy %g\n", *v);}
declare_CArray(f, float, check_destroy); // normally omit the last argument - float type need no destroy.
-declare_CList(t2, CArray2_f, carray2_f_destroy, c_noCompare);
+declare_CList(t2, CArray2f, carray2f_destroy, c_noCompare);
declare_CMap(il, int, CList_t2, clist_t2_destroy);
declare_CMap_str(sm, CMap_il, cmap_il_destroy);
@@ -17,20 +17,20 @@ int main() {
CMap_sm theMap = cmap_init;
{ // Construct.
- CArray2_f table = carray2_f_make(ydim, xdim, 0.f);
+ CArray2f table = carray2f_make(ydim, xdim, 0.f);
printf("table: (%zu, %zu)\n", carray2_ydim(table), carray2_xdim(table));
CList_t2 tableList = clist_init;
CMap_il listMap = cmap_init;
// Put in some data.
- carray2_f_data(table, y)[x] = 3.1415927; // table[y][x]
+ carray2f_data(table, y)[x] = 3.1415927; // table[y][x]
clist_t2_pushBack(&tableList, table);
cmap_il_put(&listMap, tableKey, tableList);
cmap_sm_put(&theMap, strKey, listMap);
}
{ // Access the data entry
- CArray2_f table = clist_back(cmap_il_find(&cmap_sm_find(&theMap, strKey)->value, tableKey)->value);
- printf("value (%d, %d) is: %f\n", y, x, carray2_f_value(table, y, x));
+ CArray2f table = clist_back(cmap_il_find(&cmap_sm_find(&theMap, strKey)->value, tableKey)->value);
+ printf("value (%d, %d) is: %f\n", y, x, carray2f_value(table, y, x));
}
cmap_sm_destroy(&theMap); // free up the whole shebang!