Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Jan 4, 2019
1 parent 86bf069 commit 013006c
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 98 deletions.
2 changes: 2 additions & 0 deletions include/oxli/storage.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Contact: [email protected]
#include <mutex>
#include <unordered_map>
using MuxGuard = std::lock_guard<std::mutex>;
#include <iostream>

#include "gqf.h"

Expand Down Expand Up @@ -137,6 +138,7 @@ public:
_counts[i] = new Byte[tablebytes];
memset(_counts[i], 0, tablebytes);
}
std::cout << "DEBUG: " << _counts[0] << std::endl << std::flush;
}

// Accessors for protected/private table info members
Expand Down
14 changes: 14 additions & 0 deletions khmer/_oxli/graphs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -904,3 +904,17 @@ cdef class Nodegraph(Hashgraph):

def containment(self, Nodegraph other):
return deref(self._ng_this).containment(deref(other._ng_this))

def get_raw_tables(self):
cdef uint8_t ** table_ptrs = deref(self._ng_this).get_raw_tables()
cdef vector[uint64_t] sizes = deref(self._ng_this).get_tablesizes()

new_raw_tables = []
for table_idx, table_size in enumerate(sizes):
table = table_ptrs[table_idx]
counter = table[0]
new_table = []
for i in range(table_size):
new_table.append(counter >> i)
new_raw_tables.append(new_table)
return new_raw_tables
29 changes: 20 additions & 9 deletions notebooks/debug_graphs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -20,27 +20,31 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[0, 171, 134, 226, 57, 127, 0]"
"[0, 0, 0, 0, 0, 0, 0]"
]
},
"execution_count": 13,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ng.get_raw_tables()[0].tolist()"
"tables = []\n",
"counter = ng.get_raw_tables()[0][0]\n",
"for i, _ in enumerate(ng.get_raw_tables()[0].tolist()):\n",
" tables.append(counter >> i)\n",
"tables"
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -49,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 29,
"metadata": {},
"outputs": [
{
Expand All @@ -58,14 +62,21 @@
"[0, 0, 0, 0, 0, 0, 0]"
]
},
"execution_count": 15,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cg.get_raw_tables()[0].tolist()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 013006c

Please sign in to comment.