IMP logo
IMP Reference Guide  2.6.0
The Integrative Modeling Platform
FitParameters.h
Go to the documentation of this file.
1 /**
2  * \file IMP/saxs/FitParameters.h \brief
3  *
4  * Copyright 2007-2016 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPSAXS_FIT_PARAMETERS_H
9 #define IMPSAXS_FIT_PARAMETERS_H
10 #include <IMP/saxs/saxs_config.h>
11 #include <iostream>
12 
13 IMPSAXS_BEGIN_NAMESPACE
14 
15 //! Parameters of a fit, from ProfileFitter.
16 class IMPSAXSEXPORT FitParameters {
17  public:
19  : chi_(0.0), c1_(0.0), c2_(0.0), c_(0.0), o_(0.0), default_chi_(0.0) {}
20  FitParameters(double chi, double c1, double c2, double c, double o)
21  : chi_(chi), c1_(c1), c2_(c2), c_(c), o_(o), default_chi_(0.0) {}
22  FitParameters(double chi, double c1, double c2)
23  : chi_(chi), c1_(c1), c2_(c2), c_(0.0), o_(0.0), default_chi_(0.0) {}
24 
25  double get_score() const { return chi_; }
26  double get_chi() const { return chi_; }
27  double get_c1() const { return c1_; }
28  double get_c2() const { return c2_; }
29  double get_scale() const { return c_; }
30  double get_offset() const { return o_; }
31  double get_default_chi() const { return default_chi_; }
32  std::string get_pdb_file_name() const { return pdb_file_name_; }
33  std::string get_profile_file_name() const { return profile_file_name_; }
34  int get_mol_index() const { return mol_index_; }
35 
36  void set_chi(double chi) { chi_ = chi; }
37  void set_default_chi(double chi) { default_chi_ = chi; }
38  void set_profile_file_name(std::string file_name) {
39  profile_file_name_ = file_name;
40  }
41  void set_pdb_file_name(std::string file_name) { pdb_file_name_ = file_name; }
42  void set_mol_index(int index) { mol_index_ = index; }
43 
44  void show(std::ostream& s) const {
45  s << "Chi = " << chi_ << " c1 = " << c1_ << " c2 = " << c2_
46  << " default chi = " << default_chi_ << std::endl;
47  }
48 #ifndef SWIG
49  struct compare_fit_parameters {
50  bool operator()(const FitParameters& fp1, const FitParameters& fp2) {
51  return fp1.get_chi() < fp2.get_chi();
52  }
53  };
54 #endif
55 
56  protected:
57  double chi_; // fit score
58  double c1_; // excluded volume fit
59  double c2_; // water layer fit
60  double c_; // scaling
61  double o_; // offset
62  double default_chi_; // default chi value without fitting c1/c2
63  std::string profile_file_name_;
64  std::string pdb_file_name_;
65  int mol_index_; // unique mol index
66 };
67 
68 IMPSAXS_END_NAMESPACE
69 
70 #endif /* IMPSAXS_FIT_PARAMETERS_H */
Parameters of a fit, from ProfileFitter.
Definition: FitParameters.h:16
std::ostream & show(Hierarchy h, std::ostream &out=std::cout)
Print the hierarchy using a given decorator to display each node.