OpenStructure
all_atom_potential.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_QA_ALL_ATOM_POTENTIAL_HH
20 #define OST_QA_ALL_ATOM_POTENTIAL_HH
21 /*
22  Author: Marco Biasini
23  */
24 
25 #include <boost/shared_ptr.hpp>
26 #include <ost/qa/module_config.hh>
28 
29 
30 namespace ost { namespace qa {
31 
33 typedef boost::shared_ptr<AllAtomPotential> AllAtomPotentialPtr;
34 
37 
39 
40  AllAtomPotentialOpts(float lower_cutoff, float upper_cutoff,
41  float distance_bucket_size, int sequence_sep,
42  float sigma=0.02);
43 
44  public:
46  float sigma;
48  float lower_cutoff;
50  float upper_cutoff;
51 
56 
57  template <typename DS>
58  void Serialize(DS& ds);
59 };
60 
61 
62 
64 public:
67  static AllAtomPotentialPtr Create(const InteractionStatisticsPtr& s,
68  const AllAtomPotentialOpts& o);
69 
71  static AllAtomPotentialPtr LoadFromFile(const String& filename);
72 
74  void SaveToFile(const String& filename);
75 
77  float GetTotalEnergy(mol::EntityView view);
78 
81  float GetEnergy(atom::ChemType type_a, atom::ChemType type_b,
82  float distance)
83  {
84  return energies_.Get(type_a, type_b, distance);
85  }
90  float GetTotalEnergy(mol::EntityView view, mol::EntityView target_view);
91 
93  int GetEnergyCounts() const { return interaction_counts_; }
94 
96  void SetSequenceSeparation(int seq_sep);
97 
98  const AllAtomPotentialOpts& GetOptions() const { return options_; }
99  template <typename DS>
100  void Serialize(DS& ds);
101 public:
102  void Fill(const InteractionStatisticsPtr& stats);
103 
106 private:
107  AllAtomPotentialOpts options_;
108  AllAtomEnergies energies_;
109  mol::EntityView target_view_;
110  int interaction_counts_;
111 };
112 
113 }}
114 
115 #endif