NCBI C++ ToolKit
masksubj.inl
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: masksubj.inl 50570 2011-07-25 13:51:21Z camacho $
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 official 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  */
28 
29 /**
30  * @brief Determines the scanner's offsets taking the database masking
31  * restrictions into account (if any). This function should be called from the
32  * WordFinder routines only.
33  *
34  * @param subject The subject sequence [in]
35  * @param word_length the real word length [in]
36  * @param lut_word_length the lookup table word length [in]
37  * @param range the structure to record seq mask index, start and
38  * end of scanning pos, and start and end of current mask [in][out]
39  *
40  * @return TRUE if the scanning should proceed, FALSE otherwise
41  */
42 static NCBI_INLINE Boolean
44  Int4 word_length,
45  Int4 lut_word_length,
46  Int4* range)
47 {
48  ASSERT(subject->seq_ranges);
49  ASSERT(subject->num_seq_ranges >= 1);
50  while (range[1] > range[2]) {
51  range[0]++;
52  if (range[0] >= (Int4)subject->num_seq_ranges) {
53  return FALSE;
54  }
55  range[1] = subject->seq_ranges[range[0]].left + word_length - lut_word_length;
56  range[2] = subject->seq_ranges[range[0]].right - lut_word_length;
57  }
58  return TRUE;
59 }
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
static NCBI_INLINE Boolean s_DetermineScanningOffsets(const BLAST_SequenceBlk *subject, Int4 word_length, Int4 lut_word_length, Int4 *range)
Determines the scanner's offsets taking the database masking restrictions into account (if any).
Definition: masksubj.inl:43
range(_Ty, _Ty) -> range< _Ty >
#define NCBI_INLINE
"inline" seems to work on our remaining in-house compilers (WorkShop, Compaq, ICC,...
Definition: ncbi_std.h:81
Uint1 Boolean
bool replacment for C
Definition: ncbi_std.h:94
#define ASSERT
macro for assert.
Definition: ncbi_std.h:107
Structure to hold a sequence.
Definition: blast_def.h:242
static string subject
@ FALSE
Definition: testodbc.c:27
@ TRUE
Definition: testodbc.c:27
Modified on Fri Mar 01 10:08:58 2024 by modify_doxy.py rev. 669887