~ubuntu-branches/ubuntu/quantal/genometools/quantal-backports

« back to all changes in this revision

Viewing changes to src/match/eis-bwtseq-context-param.h

  • Committer: Package Import Robot
  • Author(s): Sascha Steinbiss
  • Date: 2012-07-09 14:10:23 UTC
  • Revision ID: package-import@ubuntu.com-20120709141023-juuu4spm6chqsf9o
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright (c) 2008 Thomas Jahns <Thomas.Jahns@gmx.net>
 
3
 
 
4
  Permission to use, copy, modify, and distribute this software for any
 
5
  purpose with or without fee is hereby granted, provided that the above
 
6
  copyright notice and this permission notice appear in all copies.
 
7
 
 
8
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 
9
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 
10
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 
11
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
12
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 
13
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 
14
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
15
*/
 
16
 
 
17
#ifndef EIS_BWTSEQ_CONTEXT_PARAM_H
 
18
#define EIS_BWTSEQ_CONTEXT_PARAM_H
 
19
 
 
20
#include <limits.h>
 
21
 
 
22
#include "core/minmax.h"
 
23
#include "core/option_api.h"
 
24
 
 
25
/* #include "core/bitpackstring.h" Not necessary. Stefan */
 
26
#include "match/eis-bitpackseqpos.h"
 
27
 
 
28
enum ctxMapSize {
 
29
  CTX_MAP_ILOG_NOMAP = -2,
 
30
  CTX_MAP_ILOG_AUTOSIZE = -1,
 
31
};
 
32
 
 
33
void
 
34
gt_registerCtxMapOptions(GtOptionParser *op, int *ilogOut);
 
35
 
 
36
static inline bool
 
37
ctxMapILogIsValid(unsigned long seqLen, short mapIntervalLog2)
 
38
{
 
39
  return (mapIntervalLog2 == CTX_MAP_ILOG_NOMAP
 
40
          || mapIntervalLog2 == CTX_MAP_ILOG_AUTOSIZE
 
41
          || (mapIntervalLog2 >= 0
 
42
              && mapIntervalLog2
 
43
              < MIN(requiredUlongBits(seqLen),
 
44
                    sizeof (unsigned long) * CHAR_BIT)));
 
45
}
 
46
 
 
47
#endif