Victor
 All Data Structures Functions Variables Friends Pages
SubMatrix.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 __SubMatrix_H__
19 #define __SubMatrix_H__
20 
21 #include <Substitution.h>
22 
23 namespace Victor { namespace Align2{
24 
30  class SubMatrix : public Substitution {
31  public:
32 
33  // CONSTRUCTORS:
34 
36  SubMatrix();
37 
39  SubMatrix(istream &is);
40 
42  SubMatrix(const SubMatrix &orig);
43 
45  virtual ~SubMatrix();
46 
47 
48  // OPERATORS:
49 
51  SubMatrix& operator =(const SubMatrix &orig);
52 
54  friend ostream& operator <<(ostream &os, const SubMatrix &object);
55 
57  friend istream& operator >>(istream &is, SubMatrix &object);
58 
59 
60  // PREDICATES:
61 
63  virtual string getResidues() const;
64 
66  virtual unsigned int size() const;
67 
68 
69  // MODIFIERS:
70 
72  virtual void copy(const SubMatrix &orig);
73 
75  virtual SubMatrix* newCopy();
76 
77 
78  protected:
79 
80 
81  private:
82 
83  // ATTRIBUTES:
84 
85  vector< vector<int> > residuescores;
86  string residues;
87 
88  };
89 
90  // -----------------------------------------------------------------------------
91  // SubMatrix
92  // -----------------------------------------------------------------------------
93 
94  // PREDICATES:
95 
96  inline string
98  return residues;
99  }
100 
101  inline unsigned int
102  SubMatrix::size() const {
103  return residuescores.size();
104  }
105 
106 }} // namespace
107 
108 #endif
friend istream & operator>>(istream &is, SubMatrix &object)
Input operator.
Definition: SubMatrix.cc:77
Implement a standard substitution matrix.
Definition: SubMatrix.h:30
virtual void copy(const SubMatrix &orig)
Copy orig object to this object ("deep copy").
Definition: SubMatrix.cc:91
virtual string getResidues() const
Implementation of abstract class method.
Definition: SubMatrix.h:97
Base class for deriving substitution matrices.
Definition: Substitution.h:33
SubMatrix & operator=(const SubMatrix &orig)
Assignment operator.
Definition: SubMatrix.cc:52
virtual ~SubMatrix()
Destructor.
Definition: SubMatrix.cc:41
virtual SubMatrix * newCopy()
Construct a new "deep copy" of this object.
Definition: SubMatrix.cc:105
friend ostream & operator<<(ostream &os, const SubMatrix &object)
Output operator.
Definition: SubMatrix.cc:65
virtual unsigned int size() const
Return the dimension of the matrix.
Definition: SubMatrix.h:102
SubMatrix()
Default constructor.
Definition: SubMatrix.cc:30