Victor
 All Data Structures Functions Variables Friends Pages
Potential.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 #ifndef _POTENTIAL_H_
18 #define _POTENTIAL_H_
19 
20 
21 // Includes:
22 #include <vector>
23 #include <Spacer.h>
24 
25 // Global constants, typedefs, etc. (to avoid):
26 using namespace Victor::Biopool;
27  namespace Victor{ namespace Energy{
28 
37  class Potential {
38  public:
39 
40  struct ANGLES {
41  double phi;
42  double psi;
43  double omega;
44  double energy;
45  };
46 
47  // CONSTRUCTORS/DESTRUCTOR:
48 
49  Potential() {
50  }
51 
52  Potential(string inputFile) {
53  }
54 
55  virtual ~Potential() {
56  PRINT_NAME;
57  }
58 
59  // PREDICATES:
60  virtual long double calculateEnergy(Spacer& sp) = 0;
61  virtual long double calculateEnergy(Spacer& sp, unsigned int index1,
62  unsigned int index2) = 0;
63  virtual long double calculateEnergy(AminoAcid& aa, Spacer& sp) = 0;
64 
65  virtual long double calculateEnergy(AminoAcid& resid, AminoAcidCode type, Spacer& sp) {
66  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception)
67  }
68 
69  virtual long double pReturnMaxPropensity(const AminoAcidCode type) const {
70  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception);
71  }
72 
73  virtual long double pReturnMinPropensity(const AminoAcidCode type) const {
74  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception);
75  }
76 
77  virtual vector< vector<ANGLES> >* orderedEnergy() {
78  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception);
79  }
80  // MODIFIERS:
81 
82  // OPERATORS:
83 
84  protected:
85 
86  // HELPERS:
87 
88  // ATTRIBUTES:
89 
90  private:
91 
92  };
93 
94  // ---------------------------------------------------------------------------
95  // Potential
96  // -----------------x-------------------x-------------------x-----------------
97 
104  struct EnergyGreater : public binary_function<const Potential::ANGLES &, const Potential::ANGLES &, bool> {
105 
106  bool operator()(const Potential::ANGLES &ref1, const Potential::ANGLES &ref2) {
107  return ref1.energy > ref2.energy;
108  }
109  };
110 
111 }} // namespace
112 #endif //_POTENTIAL_H_
Energy operator. It compares enrgies of two Potential::ANGLES structures.
Definition: Potential.h:104
Abstract class for the energy potential.
Definition: Potential.h:37
It mplements a simple amino acid.
Definition: AminoAcid.h:43
Implements a "Spacer" for a protein chain. Includes methods to obtain values from the atoms and its p...
Definition: Spacer.h:42