IMP  2.4.0
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-2015 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, const Profile* model_profile,
28  bool use_offset = false) const;
29 
30  Float compute_scale_factor(const Profile* exp_profile,
31  const Profile* model_profile,
32  Float offset = 0.0) const;
33 
34  Float compute_offset(const Profile* exp_profile,
35  const Profile* model_profile) const;
36 
37  private:
38  unsigned int ns_; // number of Shannon channels
39  unsigned int K_;
40  Float last_scale_;
41  bool last_scale_updated_;
42 };
43 
44 IMPSAXS_END_NAMESPACE
45 
46 #endif /* IMPSAXS_CHI_FREE_SCORE_H */
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
A class for profile storing and computation.