IMP  2.2.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-2014 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 class IMPSAXSEXPORT FitParameters {
16  public:
17  FitParameters()
18  : chi_(0.0), c1_(0.0), c2_(0.0), c_(0.0), o_(0.0), default_chi_(0.0) {}
19  FitParameters(float chi, float c1, float c2, float c, float o)
20  : chi_(chi), c1_(c1), c2_(c2), c_(c), o_(o), default_chi_(0.0) {}
21  FitParameters(float chi, float c1, float c2)
22  : chi_(chi), c1_(c1), c2_(c2), c_(0.0), o_(0.0), default_chi_(0.0) {}
23 
24  float get_score() const { return chi_; }
25  float get_chi() const { return chi_; }
26  float get_c1() const { return c1_; }
27  float get_c2() const { return c2_; }
28  float get_scale() const { return c_; }
29  float get_offset() const { return o_; }
30  float get_default_chi() const { return default_chi_; }
31  std::string get_pdb_file_name() const { return pdb_file_name_; }
32  std::string get_profile_file_name() const { return profile_file_name_; }
33  int get_mol_index() const { return mol_index_; }
34 
35  void set_chi(float chi) { chi_ = chi; }
36  void set_default_chi(float chi) { default_chi_ = chi; }
37  void set_profile_file_name(std::string file_name) {
38  profile_file_name_ = file_name;
39  }
40  void set_pdb_file_name(std::string file_name) { pdb_file_name_ = file_name; }
41  void set_mol_index(int index) { mol_index_ = index; }
42 
43  void show(std::ostream& s) const {
44  s << "Chi = " << chi_ << " c1 = " << c1_ << " c2 = " << c2_
45  << " default chi = " << default_chi_ << std::endl;
46  }
47 #ifndef SWIG
48  struct compare_fit_parameters {
49  bool operator()(const FitParameters& fp1, const FitParameters& fp2) {
50  return fp1.get_chi() < fp2.get_chi();
51  }
52  };
53 #endif
54 
55  protected:
56  float chi_; // fit score
57  float c1_; // excluded volume fit
58  float c2_; // water layer fit
59  float c_; // scaling
60  float o_; // offset
61  float default_chi_; // default chi value without fitting c1/c2
62  std::string profile_file_name_;
63  std::string pdb_file_name_;
64  int mol_index_; // unique mol index
65 };
66 
67 IMPSAXS_END_NAMESPACE
68 
69 #endif /* IMPSAXS_FIT_PARAMETERS_H */
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.