tree.h 642 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "sti/sti.h"
  2. struct seqtree;
  3. typedef struct seqchar {
  4. char c;
  5. float prob;
  6. struct seqtree* kids;
  7. } seqchar;
  8. typedef struct seqtree {
  9. VEC(seqchar) chars;
  10. } seqtree;
  11. void sq_insert_char(seqtree* tree, char c, float count);
  12. void sq_insert_seq(seqtree* tree, char* seq, int n, float count);
  13. void sq_total_and_invert(seqtree* tree);
  14. seqtree* sq_descend(seqtree* tree, char* seq, int depth);
  15. char sq_sample(seqtree* tree);
  16. char sq_sample_depth(seqtree* tree, char* seq, int depth);
  17. float sq_prob_depth(seqtree* tree, char* seq, int depth);
  18. long sq_memstats(seqtree* tree);
  19. void sq_print_tree(seqtree* tree, int depth);