IMP logo
IMP Reference Guide  develop.97bab1d8fd,2021/09/21
The Integrative Modeling Platform
spb/ChiSquareMetric.h
Go to the documentation of this file.
1 /**
2  * \file IMP/spb/ChiSquareMetric.h
3  * \brief Contact Map Metric
4  *
5  * Copyright 2007-2021 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPSPB_CHI_SQUARE_METRIC_H
9 #define IMPSPB_CHI_SQUARE_METRIC_H
10 
11 #include <IMP/algebra.h>
12 #include <IMP/statistics.h>
13 #include <IMP/spb/spb_config.h>
14 
15 IMPSPB_BEGIN_NAMESPACE
16 
17 /** Compute the RMSD between two sets of particles in two configurations.
18  */
19 class IMPSPBEXPORT ChiSquareMetric : public statistics::Metric {
20  Floats weight_;
21  Floats nu_exp_;
22  Floats norm_;
23  int constr_type_;
24 
25  std::vector<Floats> nus_;
26  std::vector<Floats> stddev_;
27 
28  double get_chisquare(unsigned i, unsigned j) const;
29 
30  double get_scalarchisquare(unsigned i, unsigned j) const;
31 
32  public:
33  // double constructor
34  ChiSquareMetric(Floats nu_exp, int constr_type = 0);
35 
36  void add_configuration(Floats nu, Floats stddev, double weight = 1.0);
37 
38  Floats get_nu(unsigned i) const;
39  Floats get_stddev(unsigned i) const;
40  Float get_weight(unsigned i) const;
41 
42  double get_chisquare_exp(unsigned i) const;
43 
44  double get_distance(unsigned int i, unsigned int j) const IMP_OVERRIDE;
45  unsigned int get_number_of_items() const IMP_OVERRIDE;
47 
48  // IMP_METRIC(ChiSquareMetric);
49 };
50 
51 IMPSPB_END_NAMESPACE
52 
53 #endif /* IMPSPB_CHI_SQUARE_METRIC_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Include all non-deprecated headers in IMP.statistics.
Include all non-deprecated headers in IMP.algebra.
double get_weight(unsigned int i) const
Return a weight for the point.
Definition: Metric.h:37
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Store data to be clustered for distance metric based algorithms.
Definition: Metric.h:25