~ubuntu-branches/ubuntu/maverick/ncbi-tools6/maverick

« back to all changes in this revision

Viewing changes to algo/blast/core/lookup_util.h

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-03-27 12:00:15 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050327120015-embhesp32nj73p9r
Tags: 6.1.20041020-3
* Fix FTBFS under GCC 4.0 caused by inconsistent use of "static" on
  functions.  (Closes: #295110.)
* Add a watch file, now that we can.  (Upstream's layout needs version=3.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: lookup_util.h,v 1.8 2004/05/19 14:52:01 camacho Exp $
 
2
 * ===========================================================================
 
3
 *
 
4
 *                            PUBLIC DOMAIN NOTICE
 
5
 *               National Center for Biotechnology Information
 
6
 *
 
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.
 
13
 *
 
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
 
20
 *  purpose.
 
21
 *
 
22
 *  Please cite the author in any work or product based on this material.
 
23
 *
 
24
 * ===========================================================================
 
25
 */
 
26
 
 
27
/** @file lookup_util.h
 
28
 * @todo FIXME: need description
 
29
 */
 
30
 
 
31
#include <algo/blast/core/blast_def.h>
 
32
#ifndef UTIL__H
 
33
#define UTIL__H
 
34
 
 
35
#ifdef __cplusplus
 
36
extern "C" {
 
37
#endif
 
38
 
 
39
/** Integer exponentiation using right to left binary algorithm.
 
40
 *  See knuth TAOCP vol. 2, section 4.6.3.
 
41
 *
 
42
 * @param x x
 
43
 * @param n n
 
44
 * @return x to the n-th power
 
45
 */
 
46
 
 
47
Int4 iexp(Int4 x, Int4 n);
 
48
 
 
49
/**
 
50
 * Integer base two logarithm.
 
51
 *
 
52
 * @param x x
 
53
 * @return lg(x)
 
54
 */
 
55
 
 
56
Int4 ilog2(Int4 x);
 
57
 
 
58
/** Make a bit mask with the low-order x bits set
 
59
 *
 
60
 * @param x x
 
61
 * @return the mask
 
62
 */
 
63
 
 
64
Int4 makemask(Int4 x);
 
65
 
 
66
/**
 
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
 
70
 * for the output.
 
71
 * expects that "output" has already been allocated and is at
 
72
 * least k^n in size.
 
73
 *
 
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
 
78
 */
 
79
 
 
80
void debruijn(Int4 n, Int4 k, Uint1* output, Uint1* alphabet);
 
81
 
 
82
#ifdef __cplusplus
 
83
}
 
84
#endif
 
85
 
 
86
#endif /* UTIL__H */