summaryrefslogtreecommitdiffstats
path: root/src/sord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sord.c')
-rw-r--r--src/sord.c87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/sord.c b/src/sord.c
index 9c193a0..3843e2c 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -1047,90 +1047,3 @@ sord_remove(SordModel sord, const SordQuad tup)
--sord->n_quads;
}
-
-void
-sord_remove_iter(SordModel sord, SordIter iter)
-{
- SordQuad tup;
- sord_iter_get(iter, tup);
-
- SORD_WRITE_LOG("Remove " TUP_FMT "\n", TUP_FMT_ARGS(tup));
-
- // TODO: Directly remove the iterator's index (avoid one search)
-
- for (unsigned i = 0; i < NUM_ORDERS; ++i) {
- if (sord->indices[i]) {
- const int* const ordering = orderings[i];
- const SordQuad key = {
- tup[ordering[0]], tup[ordering[1]], tup[ordering[2]], tup[ordering[3]]
- };
- GSequenceIter* const cur = index_search(sord, sord->indices[i], key);
- if (!g_sequence_iter_is_end(cur)) {
- g_sequence_remove(cur);
- } else {
- assert(i == 0); // Assuming index coherency
- }
- }
- }
-
- for (int i = 0; i < TUP_LEN; ++i)
- sord_drop_quad_ref(sord, tup[i]);
-
- --sord->n_quads;
-
- iter->end = g_sequence_iter_is_end(iter->cur);
-}
-
-void
-sord_remove_graph(SordModel sord, SordNode graph)
-{
-#if 0
- if (!sord->indices[GSPO])
- return;
-
- // Remove all quads in graph from non-graph indices
- BDBCUR* cur = tcbdbcurnew(sord->indices[GSPO]);
- const SordQuad search_key = { graph, 0, 0, 0 };
- int key_size = sizeof(SordQuad);
- tcbdbcurjump(cur, &search_key, key_size);
- do {
- const SordNode* key = (const SordNode*)tcbdbcurkey3(cur, &key_size);
- if (!key || key[0] != graph)
- break;
-
- for (unsigned i = 0; i < GSPO; ++i) {
- if (sord->indices[i]) {
- const int* const ordering = orderings[i];
- const SordQuad tup = { key[1], key[2], key[3], key[0] }; // Key in SPOG order
- const SordQuad subkey = {
- tup[ordering[0]], tup[ordering[1]], tup[ordering[2]], tup[ordering[3]]
- };
- if (!tcbdbout(sord->indices[i], &subkey, sizeof(SordQuad)))
- fprintf(stderr, "Failed to remove key " TUP_FMT "\n", TUP_FMT_ARGS(subkey));
- }
- }
-
- --sord->n_quads;
- } while (tcbdbcurnext(cur));
-
- // Remove all quads in graph from graph indices
- for (unsigned i = GSPO; i < NUM_ORDERS; ++i) {
- if (sord->indices[i]) {
- BDBCUR* cur = tcbdbcurnew(sord->indices[i]);
- tcbdbcurjump(cur, &search_key, key_size);
- while (true) {
- const SordNode* key = (const SordNode*)tcbdbcurkey3(cur, &key_size);
- if (!key || key[0] != graph) {
- break;
- } else if (i == GSPO) {
- for (int i = 0; i < TUP_LEN; ++i) {
- sord_drop_quad_ref(sord, key[i]);
- }
- }
- if (!tcbdbcurout(cur))
- break;
- }
- }
- }
-#endif
-}