Victor
 All Data Structures Functions Variables Friends Pages
GapFunction.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 
18 #ifndef __GapFunction_H__
19 #define __GapFunction_H__
20 
21 #include <Debug.h>
22 #include <iostream>
23 
24 namespace Victor { namespace Align2{
25 
31  class GapFunction {
32  public:
33 
34  // CONSTRUCTORS:
35 
37 
39  }
40 
42 
43  GapFunction(const GapFunction &orig) {
44  copy(orig);
45  }
46 
48 
49  virtual ~GapFunction() {
50  }
51 
52 
53  // OPERATORS:
54 
56  GapFunction& operator =(const GapFunction &orig);
57 
58 
59  // PREDICATES:
60 
62  virtual double getOpenPenalty(int p) = 0;
63 
65  virtual double getExtensionPenalty(int p) = 0;
66 
67 
68  // MODIFIERS:
69 
71  virtual void copy(const GapFunction &orig);
72 
74  virtual GapFunction* newCopy() = 0;
75 
77  virtual void setOpenPenalty(double pen) = 0;
78 
80  virtual void setExtensionPenalty(double pen) = 0;
81 
82 
83  protected:
84 
85 
86  private:
87 
88  };
89 
90  // -----------------------------------------------------------------------------
91  // GapFunction
92  // -----------------------------------------------------------------------------
93 
94  // OPERATORS:
95 
96  inline GapFunction&
98  if (&orig != this)
99  copy(orig);
100  POSTCOND((orig == *this), exception);
101  return *this;
102  }
103 
104 
105  // MODIFIERS:
106 
107  inline void
109  }
110 
111 }} // namespace
112 
113 #endif
virtual double getOpenPenalty(int p)=0
Return open gap penalty for template position p.
virtual void setOpenPenalty(double pen)=0
Set open gap penalty.
Base class for gap functions.
Definition: GapFunction.h:31
GapFunction(const GapFunction &orig)
Copy constructor.
Definition: GapFunction.h:43
virtual double getExtensionPenalty(int p)=0
Return extension gap penalty for template position p.
virtual void setExtensionPenalty(double pen)=0
Set extension gap penalty.
GapFunction()
Default constructor.
Definition: GapFunction.h:38
virtual ~GapFunction()
Destructor.
Definition: GapFunction.h:49
GapFunction & operator=(const GapFunction &orig)
Assignment operator.
Definition: GapFunction.h:97
virtual void copy(const GapFunction &orig)
Copy orig object to this object ("deep copy").
Definition: GapFunction.h:108
virtual GapFunction * newCopy()=0
Construct a new "deep copy" of this object.