1
/* $Id: lookup_util.h,v 1.8 2004/05/19 14:52:01 camacho Exp $
2
* ===========================================================================
5
* National Center for Biotechnology Information
7
* This software/database is a "United States Government Work" under the
8
* terms of the United States Copyright Act. It was written as part of
9
* the author's offical duties as a United States Government employee and
10
* thus cannot be copyrighted. This software/database is freely available
11
* to the public for use. The National Library of Medicine and the U.S.
12
* Government have not placed any restriction on its use or reproduction.
14
* Although all reasonable efforts have been taken to ensure the accuracy
15
* and reliability of the software and data, the NLM and the U.S.
16
* Government do not and cannot warrant the performance or results that
17
* may be obtained by using this software or data. The NLM and the U.S.
18
* Government disclaim all warranties, express or implied, including
19
* warranties of performance, merchantability or fitness for any particular
22
* Please cite the author in any work or product based on this material.
24
* ===========================================================================
27
/** @file lookup_util.h
28
* @todo FIXME: need description
31
#include <algo/blast/core/blast_def.h>
39
/** Integer exponentiation using right to left binary algorithm.
40
* See knuth TAOCP vol. 2, section 4.6.3.
44
* @return x to the n-th power
47
Int4 iexp(Int4 x, Int4 n);
50
* Integer base two logarithm.
58
/** Make a bit mask with the low-order x bits set
64
Int4 makemask(Int4 x);
67
* generates a de Bruijn sequence containing all substrings
68
* of length n over an alphabet of size k.
69
* if alphabet is not NULL, use it as a translation table
71
* expects that "output" has already been allocated and is at
74
* @param n the number of letters in each word
75
* @param k the size of the alphabet
76
* @param output the output sequence
77
* @param alphabet optional translation alphabet
80
void debruijn(Int4 n, Int4 k, Uint1* output, Uint1* alphabet);