00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef IMPEM_KERNEL_PARAMETERS_H
00010 #define IMPEM_KERNEL_PARAMETERS_H
00011
00012 #include "def.h"
00013 #include <IMP/exception.h>
00014 #include <IMP/log.h>
00015 #include <map>
00016 #include <cmath>
00017 #include <algorithm>
00018 #include <iostream>
00019 #include <iomanip>
00020
00021 IMPEM_BEGIN_NAMESPACE
00022
00023
00024 class IMPEMEXPORT RadiusDependentKernelParameters {
00025 public:
00026 RadiusDependentKernelParameters(
00027 float radii,float rsigsq,float timessig,
00028 float sq2pi3,float inv_rsigsq, float rnormfac, float rkdist);
00029 void show(std::ostream& s=std::cout) {
00030 s << "vsig : " << vsig_ << " vsigsq: " << vsigsq_
00031 << " inv_sigsq: " << inv_sigsq_ << " sig: " << sig_
00032 << " kdist: " << kdist_ << " normfac: " << normfac_
00033 << std::endl;
00034 }
00035
00036 inline float get_vsig() const { return vsig_;}
00037
00038 inline float get_vsigsq() const { return vsigsq_;}
00039
00040 inline float get_inv_sigsq() const { return inv_sigsq_;}
00041
00042 inline float get_sig() const { return sig_;}
00043
00044 inline float get_kdist() const { return kdist_;}
00045
00046 inline float get_normfac() const { return normfac_;}
00047 protected:
00048
00049 float vsig_;
00050
00051 float vsigsq_;
00052
00053 float inv_sigsq_;
00054
00055 float sig_;
00056
00057 float kdist_;
00058
00059 float normfac_;
00060 };
00061
00062
00063
00064 class IMPEMEXPORT KernelParameters
00065 {
00066 public:
00067 KernelParameters() {
00068 initialized_ = false;
00069 }
00070
00071 KernelParameters(float resolution) {
00072 init(resolution);
00073 initialized_ = true;
00074 }
00075
00076
00077
00078
00079
00080
00081 void set_params(float radius);
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 const RadiusDependentKernelParameters* get_params(
00094 float radius,float eps=0.001);
00095 bool are_params_set(float radius,float eps=0.001) {
00096 return get_params(radius, eps) != NULL;
00097 }
00098
00099
00100 inline float get_rsig() const {return rsig_;}
00101
00102 inline float get_rsigsq() const {return rsigsq_;}
00103
00104 inline float get_timessig() const {return timessig_;}
00105
00106 inline float get_sq2pi3() const {return sq2pi3_;}
00107
00108 inline float get_inv_rsigsq() const {return inv_rsigsq_;}
00109
00110 inline float get_rnormfac() const {return rnormfac_;}
00111
00112 inline float get_rkdist() const {return rkdist_;}
00113
00114 inline float get_lim() const {return lim_;}
00115 protected:
00116 float rsig_,rsigsq_,timessig_,sq2pi3_,inv_rsigsq_,rnormfac_,rkdist_,lim_;
00117 bool initialized_;
00118 std::map <float,const RadiusDependentKernelParameters *> radii2params_;
00119 void init(float resolution);
00120 };
00121
00122 IMPEM_END_NAMESPACE
00123
00124 #endif