ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/PrimerMatch/shift_and.h
Revision: 1.1.1.1 (vendor branch)
Committed: Wed Dec 22 21:37:18 2004 UTC (11 years, 11 months ago) by nje01
Branch: MAIN
CVS Tags: HEAD, RELEASE-20041222, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
Initial primer_match import

Line File contents
1 /**************************************************************************
2 * This code is part of the supporting infrastructure for ATA Mapper.
3 * Copyright (C) 2002,2003,2004 Applera Corporation. All rights reserved.
4 * Author: Nathan Edwards
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received (LICENSE.txt) a copy of the GNU General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *************************************************************************/
20
21
22 #ifndef _IBPEP_SHIFT_AND_H
23 #define _IBPEP_SHIFT_AND_H
24
25 #include <iostream>
26 #include "char_io.h"
27 #include "pattern_match.h"
28 #include "types.h"
29
30 #if !defined(NO_STD_NAMESPACE)
31 using namespace std;
32 #endif
33
34 class shift_and : public PatternMatch {
35 struct patbit {
36 unsigned int bit;
37 tinylist<pattern_list_element>::const_iterator it;
38 };
39 bigword *m_;
40 bigword **u_;
41 bigword *mask_;
42 bigword *s_;
43 unsigned int k_;
44 unsigned char eos_;
45 bool _wc;
46 bool _textn;
47 unsigned int _wordcount;
48 bigword _highbit;
49 unsigned int _wordbits_1;
50 patbit *_patbits;
51 unsigned int *_patbitind;
52 void computeu(CharacterProducer & cp);
53 void clearu();
54 public:
55 shift_and(bool wc=false, bool tn=false);
56 ~shift_and();
57 long unsigned int add_pattern(std::string const & pat, unsigned long id=0,
58 int esb=0, int eeb=0);
59 void write(ostream & os) const;
60 bool find_patterns(CharacterProducer & cp,
61 pattern_hit_vector & pas,
62 long unsigned minka=1);
63 void init(CharacterProducer & cp) { computeu(cp); }
64 void reset();
65 bool wildcards() const;
66 void wildcards(bool wc);
67 bool wildcard_text_N() const;
68 void wildcard_text_N(bool tn);
69 };
70
71 #endif