From c6cbe911146f04c697889401932bccb81e981c4b Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Thu, 6 Jan 2011 19:32:14 +0100
Subject: [PATCH] improve calculation of reduced potential on views

---
 modules/qa/src/reduced_potential.cc  | 2 +-
 modules/qa/src/reduced_statistics.cc | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/qa/src/reduced_potential.cc b/modules/qa/src/reduced_potential.cc
index 1799c18e4..b6c308e0c 100644
--- a/modules/qa/src/reduced_potential.cc
+++ b/modules/qa/src/reduced_potential.cc
@@ -144,7 +144,7 @@ Real ReducedPotential::GetTotalEnergy(ost::mol::EntityHandle ent, bool norm)
 
 Real ReducedPotential::GetTotalEnergy(ost::mol::EntityView ent, bool norm)
 {
-  ReducedEnergiesCalc calc(opts_, energies_, ent, norm);
+  ReducedEnergiesCalc calc(opts_, energies_, ent.GetHandle(), norm);
   ent.Apply(calc);
   return calc.GetEnergy();
 }
diff --git a/modules/qa/src/reduced_statistics.cc b/modules/qa/src/reduced_statistics.cc
index 723fe29f9..3a75afe84 100644
--- a/modules/qa/src/reduced_statistics.cc
+++ b/modules/qa/src/reduced_statistics.cc
@@ -129,7 +129,7 @@ void ReducedStatistics::Extract(mol::EntityHandle ent)
   if (ent.GetChainCount()!=1) {
     std::stringstream ss;
     ss << "Expected exactly one chain, but entity has " 
-       <<  ent.GetChainCount() << "chains";
+       <<  ent.GetChainCount() << " chains";
     throw std::runtime_error(ss.str());
   }
   ReducedStatExtractor extractor(opts_, histo_, ent);
@@ -141,10 +141,10 @@ void ReducedStatistics::Extract(mol::EntityView ent)
   if (ent.GetChainCount()!=1) {
     std::stringstream ss;
     ss << "Expected exactly one chain, but entity has " 
-       <<  ent.GetChainCount() << "chains";
+       <<  ent.GetChainCount() << " chains";
     throw std::runtime_error(ss.str());
   }
-  ReducedStatExtractor extractor(opts_, histo_, ent);
+  ReducedStatExtractor extractor(opts_, histo_, ent.GetHandle());
   ent.Apply(extractor);
 }
 
-- 
GitLab