diff options
| author | Tyge Løvset <[email protected]> | 2020-08-09 22:47:53 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-08-09 22:47:53 +0200 |
| commit | 2e51101a5d4846cd47679505378dcf862d72ccec (patch) | |
| tree | e2758a7111c48395e38f19001553a2b3ff8c45fa /examples/complex.c | |
| parent | 37ac780f49f1ec56c443b034a3f37df5b5af2b5b (diff) | |
| download | STC-modified-2e51101a5d4846cd47679505378dcf862d72ccec.tar.gz STC-modified-2e51101a5d4846cd47679505378dcf862d72ccec.zip | |
Simplified carray API.
Diffstat (limited to 'examples/complex.c')
| -rw-r--r-- | examples/complex.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/complex.c b/examples/complex.c index 6a6a268b..cd8a6d78 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -20,17 +20,17 @@ int main() { carray2f table = carray2f_make(ydim, xdim, 0.f);
printf("table: (%zu, %zu)\n", carray2_ydim(table), carray2_xdim(table));
clist_t2 tableList = clist_init;
+ // Put in some data.
cmap_il listMap = cmap_init;
- // Put in some data.
- carray2f_data(table, y)[x] = 3.1415927; // table[y][x]
+ *carray2f_at(&table, y, x) = 3.1415927; // table[y][x]
clist_t2_push_back(&tableList, table);
cmap_il_put(&listMap, tableKey, tableList);
cmap_sm_put(&theMap, strKey, listMap);
}
{ // Access the data entry
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));
+ printf("value (%d, %d) is: %f\n", y, x, *carray2f_at(&table, y, x));
}
cmap_sm_destroy(&theMap); // free up the whole shebang!
|
