Esempio n. 1
0
static void backwardderive(const GtBucketspec2 *bucketspec2,
                           GtSuffixsortspace *suffixsortspace,
                           GtUword *targetoffset,
                           unsigned int source,
                           GtUword idx)
{
  GtUword startpos;
  GtUchar cc;

  for (; idx + 1 > targetoffset[source] + 1; idx--)
  {
    startpos = gt_suffixsortspace_getdirect(suffixsortspace,idx);
    if (startpos > 0)
    {
      cc = gt_encseq_get_encoded_char(bucketspec2->encseq,
                                      startpos-1,
                                      bucketspec2->readmode);
      if (ISNOTSPECIAL(cc) && !bucketspec2->superbuckettab[cc].sorted)
      {
        gt_suffixsortspace_setdirect(suffixsortspace,targetoffset[cc],
                                     startpos - 1);
        targetoffset[cc]--;
      }
    }
  }
}
Esempio n. 2
0
void gt_suffixsortspace_set(GtSuffixsortspace *sssp,
                            unsigned long subbucketleft,
                            unsigned long idx,
                            unsigned long value)
{
  gt_suffixsortspace_setdirect(sssp, sssp->bucketleftidx
                                       + subbucketleft
                                       + idx
                                       - sssp->partoffset,value);
}
Esempio n. 3
0
void gt_suffixsortspace_set(GtSuffixsortspace *sssp,
                            GtUword subbucketleft,
                            GtUword idx,
                            GtUword value)
{
  gt_suffixsortspace_setdirect(sssp, sssp->bucketleftidx
                                       + subbucketleft
                                       + idx
                                       - sssp->partoffset,value);
}
Esempio n. 4
0
static void gt_seqorder_sort(GtSuffixsortspace *suffixsortspace,
    GtEncseq *encseq)
{
  unsigned long i;
  Sfxstrategy sfxstrategy;

  defaultsfxstrategy(&sfxstrategy, false);
  for (i = 0; i < gt_encseq_num_of_sequences(encseq); i++)
    gt_suffixsortspace_setdirect(suffixsortspace, i,
        gt_encseq_seqstartpos(encseq, i));
  gt_sortallsuffixesfromstart(suffixsortspace,
      gt_encseq_num_of_sequences(encseq), encseq, GT_READMODE_FORWARD, NULL, 0,
      &sfxstrategy, NULL, NULL, NULL);
}