[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IMP-dev] Add accessor methods to Harmonic



The attached patch adds accessor methods to Harmonic (and subclasses) to get/set the mean and standard deviation. (Frido asked for this to help in tweaking his optimizations.)

	Ben
--
                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle
Index: kernel/include/IMP/unary_functions/Harmonic.h
===================================================================
--- kernel/include/IMP/unary_functions/Harmonic.h	(revision 405)
+++ kernel/include/IMP/unary_functions/Harmonic.h	(working copy)
@@ -27,6 +27,26 @@
 
   virtual ~Harmonic() {}
 
+  //! \return the mean of this function
+  Float get_mean() const {
+    return mean_;
+  }
+
+  //! \return the standard deviation of this function
+  Float get_sd() const {
+    return sd_;
+  }
+
+  //! Set the mean of this function
+  void set_mean(Float mean) {
+    mean_ = mean;
+  }
+
+  //! Set the standard deviation of this function
+  void set_sd(Float sd) {
+    sd_ = sd;
+  }
+
   //! Calculate harmonic score with respect to the given feature.
   /** \param[in] feature Value of feature being tested.
       \return Score