DNA sequences and character strings are now handled using AVL trees.

This commit is contained in:
Celine Mercier
2015-12-11 17:24:44 +01:00
parent 1586956d57
commit c139367555
26 changed files with 2178 additions and 1711 deletions

View File

@ -17,7 +17,7 @@
#include "obitypes.h"
#include "obierrno.h"
#include "obidebug.h"
#include "obiarray.h"
#include "obiavl.h"
#define DEBUG_LEVEL 0 // TODO has to be defined somewhere else (cython compil flag?)
@ -67,8 +67,8 @@ int obi_column_set_obistr_with_elt_idx(OBIDMS_column_p column, index_t line_nb,
if (value_b == NULL)
return -1;
// Add in the obiarray
idx = obi_array_add(column->array, value_b);
// Add in the AVL tree
idx = obi_avl_add(column->avl, value_b);
if (idx == -1)
return -1;
@ -106,7 +106,7 @@ const char* obi_column_get_obistr_with_elt_idx(OBIDMS_column_p column, index_t l
if (idx == OBIIdx_NA)
return "\0"; // TODO
value_b = obi_array_get(column->array, idx);
value_b = obi_avl_get(column->avl, idx);
return obi_obibytes_to_str(value_b);
}