37 typename TRankDictionary,
38 typename TSuffixArray,
48 if (k == index_type(-1))
51 return fmi.
count( c );
67 typename TRankDictionary,
68 typename TSuffixArray,
78 if (range.x == range.y)
80 const index_type r =
rank( fmi, range.x, c );
83 else if (range.x == index_type(-1))
85 const index_type r =
rank( fmi, range.y, c );
88 if (range.y == fmi.
length())
91 rank( fmi, range.x, c ),
95 if (range.x >= fmi.
primary()) --range.x;
108 typename TRankDictionary,
109 typename TSuffixArray,
112 typename TRankDictionary::vec4_type
rank4(
118 const index_type zero = index_type(0);
120 if (k == index_type(-1))
122 else if (k == fmi.
length())
146 typename TRankDictionary,
147 typename TSuffixArray,
152 typename TRankDictionary::vec4_type* outl,
153 typename TRankDictionary::vec4_type* outh)
157 const index_type zero = index_type(0);
159 if (range.x == range.y)
161 *outl =
rank4( fmi, range.x );
165 else if (range.x == index_type(-1))
168 *outh =
rank4( fmi, range.y );
171 else if (range.y == fmi.
length())
173 *outl =
rank4( fmi, range.x );
182 if (range.x >= fmi.
primary()) --range.x;
195 typename TRankDictionary,
196 typename TSuffixArray,
206 const index_type zero = index_type(0);
208 if (k == index_type(-1))
213 else if (k == fmi.
length())
216 (*out)[i] = fmi.
count(i);
234 typename TRankDictionary,
235 typename TSuffixArray,
245 const index_type zero = index_type(0);
247 if (range.x == range.y)
253 else if (range.x == index_type(-1))
260 else if (range.y == fmi.
length())
264 (*outh)[i] = fmi.
count(i);
268 if (range.x >= fmi.
primary()) --range.x;
281 typename TRankDictionary,
282 typename TSuffixArray,
288 const Iterator pattern,
297 return match( fmi, pattern, pattern_len, range );
308 typename TRankDictionary,
309 typename TSuffixArray,
315 const Iterator pattern,
324 range_type range = in_range;
326 for (
int32 i = pattern_len-1; i >= 0 && range.x <= range.y; --i)
328 const symbol_type c = pattern[i];
332 const range_type c_rank =
rank(
337 range.x = fmi.
L2(c) + c_rank.x + 1;
338 range.y = fmi.
L2(c) + c_rank.y;
350 typename TRankDictionary,
351 typename TSuffixArray,
357 const Iterator pattern,
367 for (
uint32 i = 0; i < pattern_len && range.x <= range.y; ++i)
369 const symbol_type c = pattern[i];
373 const range_type c_rank =
rank(
378 range.x = fmi.
L2(c) + c_rank.x + 1;
379 range.y = fmi.
L2(c) + c_rank.y;
391 typename TRankDictionary,
392 typename TSuffixArray,
404 typename FMIndexType::bwt_type
bwt = fmi.
bwt();
409 const index_type k = i < fmi.
primary() ? i : i-1;
411 const uint8 c = bwt[k];
423 typename TRankDictionary,
424 typename TSuffixArray,
440 typename FMIndexType::suffix_array_type sa = fmi.
sa();
441 typename FMIndexType::bwt_type
bwt = fmi.
bwt();
443 while (sa.fetch( j, suffix ) ==
false)
448 j = fmi.
L2(c) +
rank( fmi, j, c );
467 typename TRankDictionary,
468 typename TSuffixArray,
484 typename FMIndexType::suffix_array_type sa = fmi.
sa();
485 typename FMIndexType::bwt_type
bwt = fmi.
bwt();
487 while (sa.fetch( j, suffix ) ==
false)
492 j = fmi.
L2(c) +
rank( fmi, j, c );
500 return (suffix + t) ;
512 typename TRankDictionary,
513 typename TSuffixArray,
528 typename FMIndexType::suffix_array_type sa = fmi.
sa();
529 typename FMIndexType::bwt_type
bwt = fmi.
bwt();
531 while (sa.has( j ) ==
false)
536 j = fmi.
L2(c) +
rank( fmi, j, c );
554 typename TRankDictionary,
555 typename TSuffixArray,
566 typename FMIndexType::suffix_array_type sa = fmi.
sa();
567 index_type suffix; sa.fetch( it.x, suffix );
568 return suffix + it.y;
572 #if defined(MOD_NAMESPACE)
590 cudaChannelFormatDesc channel_desc = cudaCreateChannelDesc<uint32>();
591 s_count_table_tex.normalized =
false;
592 s_count_table_tex.filterMode = cudaFilterModePoint;
593 cudaBindTexture( 0, &s_count_table_tex, count_table, &channel_desc, 256*
sizeof(
uint32) );
601 cudaUnbindTexture( &s_count_table_tex );
604 #if defined(MOD_NAMESPACE)