| 59 | } |
| 60 | |
| 61 | void write_array(const Context& ctx) { |
| 62 | // Write some simple data to cells (1, 1), (2, 4) and (2, 3). |
| 63 | std::vector<int> coords_rows = {1, 2, 2}; |
| 64 | std::vector<int> coords_cols = {1, 4, 3}; |
| 65 | std::vector<int> data = {1, 2, 3}; |
| 66 | |
| 67 | // Open the array for writing and create the query. |
| 68 | Array array(ctx, array_uri, TILEDB_WRITE); |
| 69 | Query query(ctx, array, TILEDB_WRITE); |
| 70 | query.set_layout(TILEDB_UNORDERED) |
| 71 | .set_data_buffer("a", data) |
| 72 | .set_data_buffer("rows", coords_rows) |
| 73 | .set_data_buffer("cols", coords_cols); |
| 74 | |
| 75 | // Perform the write and close the array. |
| 76 | query.submit(); |
| 77 | array.close(); |
| 78 | } |
| 79 | |
| 80 | void write_array2(const Context& ctx) { |
| 81 | // Write some simple data to cells (1, 1), (2, 4) and (2, 3). |
no test coverage detected