00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef CLIPPER_SFWEIGHT
00046 #define CLIPPER_SFWEIGHT
00047
00048
00049 #include "function_object_bases.h"
00050
00051
00052 namespace clipper {
00053
00054
00056
00067 template<class T> class SFweight_spline : public SFweight_base<T> {
00068 public:
00070 SFweight_spline( const int n_reflns = 1000, const int n_params = 20, const int n_phases = 24 ) { init( n_reflns, n_params, n_phases ); }
00072 SFweight_spline( HKL_data<datatypes::F_phi<T> >& fb, HKL_data<datatypes::F_phi<T> >& fd, HKL_data<datatypes::Phi_fom<T> >& phiw, const HKL_data<datatypes::F_sigF<T> >& fo, const HKL_data<datatypes::F_phi<T> >& fc, const HKL_data<datatypes::Flag>& usage, const int n_reflns = 1000, const int n_params = 20 );
00074 void init( const int n_reflns = 1000, const int n_params = 20, const int n_phases = 24 );
00075 bool operator() ( HKL_data<datatypes::F_phi<T> >& fb, HKL_data<datatypes::F_phi<T> >& fd, HKL_data<datatypes::Phi_fom<T> >& phiw, const HKL_data<datatypes::F_sigF<T> >& fo, const HKL_data<datatypes::F_phi<T> >& fc, const HKL_data<datatypes::Flag>& usage );
00076 bool operator() ( HKL_data<datatypes::F_phi<T> >& fb, HKL_data<datatypes::F_phi<T> >& fd, HKL_data<datatypes::Phi_fom<T> >& phiw, const HKL_data<datatypes::F_sigF<T> >& fo, const HKL_data<datatypes::ABCD<T> >& hl, const HKL_data<datatypes::F_phi<T> >& fc, const HKL_data<datatypes::Flag>& usage );
00077 const std::vector<ftype>& params_scale() { return param_s; }
00078 const std::vector<ftype>& params_error() { return param_w; }
00079 void debug() const;
00080 private:
00081 struct TargetResult { ftype r, ds, dw, dss, dww, dsw; };
00082 struct HLterms { ftype cosa, sina, cos2a, sin2a; };
00084 TargetResult targetfn0( const HKL_class cls, const datatypes::F_sigF<T>& fo0, const datatypes::F_phi<T>& fc0, const ftype& s, const ftype& w ) const;
00085 TargetResult targetfn1( const HKL_class cls, const datatypes::F_sigF<T>& fo0, const datatypes::ABCD<T>& hl0, const datatypes::F_phi<T>& fc0, const ftype& s, const ftype& w ) const;
00086 TargetResult targetfn2( const HKL_class cls, const datatypes::F_sigF<T>& fo0, const datatypes::ABCD<T>& hl0, const datatypes::F_phi<T>& fc0, const ftype& s, const ftype& w ) const;
00087 int nparams, nreflns;
00088 std::vector<ftype> param_s, param_w;
00089 std::vector<HLterms> hlterms;
00090 };
00091
00092
00093 }
00094
00095 #endif