IMP logo
IMP Reference Guide  2.23.0
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-2022 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/statistics/Metric.h>
12 #include <IMP/spb/spb_config.h>
13 
14 IMPSPB_BEGIN_NAMESPACE
15 
16 /** Compute the RMSD between two sets of particles in two configurations.
17  */
18 class IMPSPBEXPORT ChiSquareMetric : public statistics::Metric {
19  Floats weight_;
20  Floats nu_exp_;
21  Floats norm_;
22  int constr_type_;
23 
24  std::vector<Floats> nus_;
25  std::vector<Floats> stddev_;
26 
27  double get_chisquare(unsigned i, unsigned j) const;
28 
29  double get_scalarchisquare(unsigned i, unsigned j) const;
30 
31  public:
32  // double constructor
33  ChiSquareMetric(Floats nu_exp, int constr_type = 0);
34 
35  void add_configuration(Floats nu, Floats stddev, double weight = 1.0);
36 
37  Floats get_nu(unsigned i) const;
38  Floats get_stddev(unsigned i) const;
39  Float get_weight(unsigned i) const;
40 
41  double get_chisquare_exp(unsigned i) const;
42 
43  double get_distance(unsigned int i, unsigned int j) const override;
44  unsigned int get_number_of_items() const override;
46 
47  // IMP_METRIC(ChiSquareMetric);
48 };
49 
50 IMPSPB_END_NAMESPACE
51 
52 #endif /* IMPSPB_CHI_SQUARE_METRIC_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
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:19
Cluster sets of points.
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
Store data to be clustered for distance metric based algorithms.
Definition: Metric.h:25