IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
CrossLinkData.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/CrossLinkData.h \brief Normal distribution of Function
3  *
4  * Copyright 2007-2022 IMP Inventors. All rights reserved.
5  */
6 
7 #ifndef IMPISD_CROSS_LINK_DATA_H
8 #define IMPISD_CROSS_LINK_DATA_H
9 
10 #include <IMP/isd/isd_config.h>
11 #include <IMP/macros.h>
12 #include <IMP/Model.h>
13 #include <IMP/constants.h>
14 #include <cmath>
15 #include <cereal/access.hpp>
16 #include <cereal/types/vector.hpp>
17 
18 IMPISD_BEGIN_NAMESPACE
19 
20 //! CrossLinkData
21 /**
22  */
23 
24 class IMPISDEXPORT CrossLinkData : public Object {
25  double lexp_; // length of the linker
26  Floats dist_grid_;
27  Floats sigma_grid_;
28  Floats omega_grid_;
29  Floats pot_x_grid_;
30  Floats pot_value_grid_;
31  int prior_type_;
32  bool bias_;
33  std::vector<Floats> grid_;
34 
35  friend class cereal::access;
36 
37  template<class Archive> void serialize(Archive &ar) {
38  ar(cereal::base_class<Object>(this), lexp_, dist_grid_, sigma_grid_,
39  omega_grid_, pot_x_grid_, pot_value_grid_, prior_type_, bias_, grid_);
40  }
41 
42  double get_unbiased_element(double dist, double sigmai) const;
43  double get_biased_element(double dist, double sigmai) const;
44 
45  public:
46  CrossLinkData(Floats dist_grid, Floats omega_grid, Floats sigma_grid,
47  double lexp_, double don = std::numeric_limits<double>::max(),
48  double doff = std::numeric_limits<double>::max(),
49  int prior_type = 0);
50  CrossLinkData(Floats dist_grid, Floats omega_grid, Floats sigma_grid,
51  Floats pot_x_grid, Floats pot_value_grid,
52  double don = std::numeric_limits<double>::max(),
53  double doff = std::numeric_limits<double>::max(),
54  int prior_type = 0);
55  CrossLinkData() : Object("") {}
56  int get_closest(std::vector<double> const& vec, double value) const;
57  Floats get_omegas(double sigma, Floats dists) const;
58  double get_omega_prior(double omega, double omega0) const;
59  Floats get_nonmarginal_elements(double sigmai, Floats dists) const;
60  Floats get_marginal_elements(double sigma, Floats dists) const;
61  double get_marginal_maximum(double sigma) const;
62  double get_marginal_maximum() const;
63 
65 };
66 
67 IMPISD_END_NAMESPACE
68 
69 #endif /* IMPISD_CROSS_LINK_DATA_H */
Various useful constants.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Storage of a model, its restraints, constraints and particles.
Various general useful macros for IMP.
Common base class for heavy weight IMP objects.
Definition: Object.h:111
Object(std::string name)
Construct an object with the given name.