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

Re: [IMP-dev] [IMP-commits] r5550 - in trunk/modules/em: include src




Notification of IMP commits <> wrote:

>Author: 
>Date: 2010-03-20 20:27:30 -0700 (Sat, 20 Mar 2010)
>New Revision: 5550
>
>Modified:
>   trunk/modules/em/include/KernelParameters.h
>   trunk/modules/em/src/KernelParameters.cpp
>Log:
>move show to cpp and generate parameters to radius if none were found in get_params
>
>Modified: trunk/modules/em/include/KernelParameters.h
>===================================================================
>--- trunk/modules/em/include/KernelParameters.h	2010-03-19 21:32:28 UTC (rev 5549)
>+++ trunk/modules/em/include/KernelParameters.h	2010-03-21 03:27:30 UTC (rev 5550)
>@@ -26,12 +26,8 @@
>     RadiusDependentKernelParameters(
>        float radii,float rsigsq,float timessig,
>        float sq2pi3,float inv_rsigsq, float rnormfac, float rkdist);
>-  void show(std::ostream& s=std::cout) {
>-      s << "vsig : " << vsig_ << " vsigsq: " << vsigsq_
>-        << " inv_sigsq: " << inv_sigsq_ << " sig: " << sig_
>-        << " kdist: " << kdist_ << " normfac: " << normfac_
>-        << std::endl;
>-    }
>+    //! Show
>+    void show(std::ostream& s=std::cout) const;
>     //! Gets the value of vsig parameter
>     inline float get_vsig() const { return vsig_;}
>     //! Gets the value of vsig square parameter
>@@ -77,8 +73,9 @@
>   /** The other variables of the parameters
>     (rsigsq,timessig,sq2pi3,inv_rsigsq,rnormfac,rkdist) must have been set.
>     \param[in] radius the radius
>+    \param[out] the radius based parameters
>   */
>-  void set_params(float radius);
>+  const RadiusDependentKernelParameters* set_params(float radius);
> 
>   //! Finds the precomputed parameters given a particle radius.
>   /**
>
>Modified: trunk/modules/em/src/KernelParameters.cpp
>===================================================================
>--- trunk/modules/em/src/KernelParameters.cpp	2010-03-19 21:32:28 UTC (rev 5549)
>+++ trunk/modules/em/src/KernelParameters.cpp	2010-03-21 03:27:30 UTC (rev 5550)
>@@ -11,7 +11,12 @@
> #include <IMP/constants.h>
> 
> IMPEM_BEGIN_NAMESPACE
>-
>+void RadiusDependentKernelParameters::show(std::ostream& s) const {
>+   s << "vsig : " << vsig_ << " vsigsq: " << vsigsq_
>+     << " inv_sigsq: " << inv_sigsq_ << " sig: " << sig_
>+     << " kdist: " << kdist_ << " normfac: " << normfac_
>+     << std::endl;
>+}
> RadiusDependentKernelParameters::RadiusDependentKernelParameters(
>    float radii, float rsigsq,
>    float timessig, float sq2pi3,
>@@ -52,7 +57,8 @@
>   lim_ = exp(-0.5 * (timessig_ - EPS) * (timessig_ - EPS));
> }
> 
>-void KernelParameters::set_params(float radius) {
>+const RadiusDependentKernelParameters*
>+  KernelParameters::set_params(float radius) {
>   IMP_USAGE_CHECK(initialized_,
>             "The Kernel Parameters are not initialized");
>   std::map<float ,const RadiusDependentKernelParameters *>::iterator iter =
>@@ -63,6 +69,7 @@
>   radii2params_[radius]=new RadiusDependentKernelParameters(
>      radius,rsigsq_,timessig_,sq2pi3_,
>      inv_rsigsq_,rnormfac_,rkdist_);
>+  return radii2params_[radius];
> }
> 
> const RadiusDependentKernelParameters* KernelParameters::get_params(
>@@ -96,6 +103,8 @@
>    }
>    if (closest == NULL) {
>      IMP_WARN("could not find parameters for radius:"<<radius<<std::endl);
>+     IMP_WARN("Setting params for radius :"<<radius<<std::endl);
>+     closest = set_params(radius);
>    }
>    return closest;
> }
>
>_______________________________________________
>IMP-commits mailing list
>
>https://salilab.org/mailman/listinfo/imp-commits