IMP  2.1.1
The Integrative Modeling Platform
ChiFreeScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/saxs/ChiFreeScore.h \brief Chi free score implementation
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  * TODO: add reference
6  */
7 
8 #ifndef IMPSAXS_CHI_FREE_SCORE_H
9 #define IMPSAXS_CHI_FREE_SCORE_H
10 
11 #include <IMP/saxs/saxs_config.h>
12 #include "Profile.h"
13 
14 IMPSAXS_BEGIN_NAMESPACE
15 /**
16  Implementation of chi free score
17  Accurate assessment of mass, models and resolution by small-angle scattering.
18  Rambo RP, Tainer JA. Nature. 2013
19 */
20 class IMPSAXSEXPORT ChiFreeScore {
21  public:
22  ChiFreeScore(unsigned int ns, unsigned int k): ns_(ns), K_(k) {
23  if(K_ % 2 == 0) K_++; // make sure it is odd for median
24  last_scale_updated_=false;
25  }
26 
27  Float compute_score(const Profile* exp_profile,
28  const Profile* model_profile,
29  bool use_offset = false) const;
30 
31  Float compute_scale_factor(const Profile* exp_profile,
32  const Profile* model_profile,
33  Float offset = 0.0) const;
34 
35  Float compute_offset(const Profile* exp_profile,
36  const Profile* model_profile) const;
37 
38  private:
39  unsigned int ns_; // number of Shannon channels
40  unsigned int K_;
41  Float last_scale_;
42  bool last_scale_updated_;
43 };
44 
45 
46 IMPSAXS_END_NAMESPACE
47 
48 #endif /* IMPSAXS_CHI_FREE_SCORE_H */
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
A class for profile storing and computation.