summaryrefslogtreecommitdiff
blob: 96cb21531bbf38046036a4f86a94b821c335d70c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
 .../scitbx/math/boost_python/distributions.cpp     |   60 +++++++++++++------
 cctbx_sources/scitbx/rigid_body/spatial_lib.h      |    1 +
 cctbx_sources/scitbx/rigid_body/tardy.h            |    4 +-
 .../refinement/boost_python/weighting_schemes.cpp  |    4 +-
 .../smtbx/structure_factors/direct/standard_xray.h |    4 +-
 5 files changed, 48 insertions(+), 25 deletions(-)

diff --git a/cctbx_sources/scitbx/math/boost_python/distributions.cpp b/cctbx_sources/scitbx/math/boost_python/distributions.cpp
index a676798..68818e7 100644
--- a/cctbx_sources/scitbx/math/boost_python/distributions.cpp
+++ b/cctbx_sources/scitbx/math/boost_python/distributions.cpp
@@ -59,29 +59,51 @@ namespace {
   {
     typedef Distribution wt;
 
+    #define NEW_MEMBER(name)                \
+    static FloatType name(wt const &self) { \
+      return boost::math::name(self);                    \
+    }
+
+    NEW_MEMBER(mean);
+    NEW_MEMBER(median);
+    NEW_MEMBER(mode);
+    NEW_MEMBER(variance);
+    NEW_MEMBER(standard_deviation);
+    NEW_MEMBER(skewness);
+    NEW_MEMBER(kurtosis);
+
+    #undef NEW_MEMBER
+
+    #define NEW_MEMBER(name)                               \
+    static FloatType name(wt const &self, FloatType arg) { \
+      return boost::math::name(self, arg);                              \
+    }
+
+    NEW_MEMBER(pdf);
+    NEW_MEMBER(cdf);
+    NEW_MEMBER(quantile);
+
+    #undef NEW_MEMBER
+
+    static scitbx::af::shared<FloatType> quantiles(wt const &self, std::size_t n) {
+      return scitbx::math::quantiles<FloatType>(self, n);
+    }
+
     static void
     wrap()
     {
       using namespace boost::python;
-      def("mean", (FloatType(*)(wt const&)) boost::math::mean);
-      def("median", (FloatType(*)(wt const&)) boost::math::median);
-      def("mode", (FloatType(*)(wt const&)) boost::math::mode);
-      def("variance", (FloatType(*)(wt const&)) boost::math::variance);
-      def("standard_deviation",
-        (FloatType(*)(wt const&)) boost::math::standard_deviation);
-      def("skewness", (FloatType(*)(wt const&)) boost::math::skewness);
-      def("kurtosis", (FloatType(*)(wt const&)) boost::math::kurtosis);
-      def("pdf", (FloatType(*)(wt const&, FloatType const&)) boost::math::pdf);
-      def("cdf", (FloatType(*)(wt const&, FloatType const&)) boost::math::cdf);
-      def("quantile", (FloatType(*)(wt const&, FloatType const&))
-        boost::math::quantile);
-      def("quantiles",
-#if BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
-        (scitbx::af::shared<FloatType>(*)(wt const&, std::size_t)) quantiles
-#else
-        quantiles<FloatType, wt>
-#endif
-        );
+      def("mean"              , mean);
+      def("median"            , median);
+      def("mode"              , mode);
+      def("variance"          , variance);
+      def("standard_deviation", standard_deviation);
+      def("skewness"          , skewness);
+      def("kurtosis"          , kurtosis);
+      def("pdf"               , pdf);
+      def("cdf"               , cdf);
+      def("quantile"          , quantile);
+      def("quantiles"         , quantiles);
     }
   };
 
diff --git a/cctbx_sources/scitbx/rigid_body/spatial_lib.h b/cctbx_sources/scitbx/rigid_body/spatial_lib.h
index a084f0f..e377292 100755
--- a/cctbx_sources/scitbx/rigid_body/spatial_lib.h
+++ b/cctbx_sources/scitbx/rigid_body/spatial_lib.h
@@ -2,6 +2,7 @@
 #define SCITBX_RIGID_BODY_SPATIAL_LIB_H
 
 #include <scitbx/rotr3.h>
+#include <scitbx/rigid_body/matrix_helpers.h>
 #include <scitbx/array_family/versa_matrix.h>
 
 namespace scitbx { namespace rigid_body {
diff --git a/cctbx_sources/scitbx/rigid_body/tardy.h b/cctbx_sources/scitbx/rigid_body/tardy.h
index 104f16b..a8f76cc 100755
--- a/cctbx_sources/scitbx/rigid_body/tardy.h
+++ b/cctbx_sources/scitbx/rigid_body/tardy.h
@@ -346,7 +346,7 @@ namespace tardy {
       unsigned nb = this->bodies_size();
       af::shared<af::small<ft, 7> > result((af::reserve(nb)));
       af::shared<af::small<ft, 6> >
-        tau_array = f_ext_as_tau(f_ext_array().const_ref());
+        tau_array = this->f_ext_as_tau(f_ext_array().const_ref());
       for(unsigned ib=0;ib<nb;ib++) {
         result.push_back(
           this->bodies[ib]->joint->tau_as_d_e_pot_d_q(tau_array[ib]));
@@ -379,7 +379,7 @@ namespace tardy {
     qdd_array()
     {
       if (!qdd_array_) {
-        qdd_array_ = forward_dynamics_ab(
+        qdd_array_ = this->forward_dynamics_ab(
           /*tau_array*/ af::const_ref<af::small<ft, 6> >(0, 0),
           f_ext_array().const_ref(),
           /*grav_accn*/ af::const_ref<ft>(0, 0));
diff --git a/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp b/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp
index ce0c27b..904e8d7 100644
--- a/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp
+++ b/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp
@@ -25,9 +25,9 @@ namespace smtbx { namespace refinement { namespace least_squares {
       : base_t(name, boost::python::no_init)
     {
       using namespace boost::python;
-      def("__call__", &wt::operator(),
+      this->def("__call__", &wt::operator(),
           (arg("fo_sq"), arg("sigma"), arg("fc_sq")));
-      def("__call__", weights,
+      this->def("__call__", weights,
           (arg("fo_sq"), arg("sigmas"), arg("fc_sq")));
     }
   };
diff --git a/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h b/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h
index 5e2df76..911bfde 100644
--- a/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h
+++ b/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h
@@ -161,7 +161,7 @@ namespace smtbx { namespace structure_factors { namespace direct {
         for (int k=0; k < hr_ht.groups.size(); ++k) {
           hr_ht_group<float_type> const &g = hr_ht.groups[k];
           float_type hrx = g.hr * scatterer.site;
-          complex_type f = exp_i_2pi(hrx + g.ht);
+          complex_type f = this->exp_i_2pi(hrx + g.ht);
           if (scatterer.flags.use_u_aniso()) {
             float_type dw = debye_waller_factor_u_star(g.hr, scatterer.u_star);
             f *= dw;
@@ -336,7 +336,7 @@ namespace smtbx { namespace structure_factors { namespace direct {
         for (int k=0; k < hr_ht.groups.size(); ++k) {
           hr_ht_group<float_type> const &g = hr_ht.groups[k];
           float_type hrx = g.hr * scatterer.site;
-          complex_type f = exp_i_2pi(hrx + g.ht);
+          complex_type f = this->exp_i_2pi(hrx + g.ht);
           float_type fa = f.real(), fb = f.imag();
           if (scatterer.flags.use_u_aniso()) {
             float_type dw = debye_waller_factor_u_star(g.hr, scatterer.u_star);