summarylogtreecommitdiffstats
path: root/swig3011-truediv.patch
blob: 587422971ce406641eaf4ffe3477381bbc1a5083 (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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
From a6244164a06262f86409d7a1b21aec01e2771423 Mon Sep 17 00:00:00 2001
From: Julien Schueller <schueller@phimeca.com>
Date: Mon, 28 Nov 2016 14:55:03 +0100
Subject: [PATCH] Hide _truediv from swig 3.0.11

---
 python/src/ComplexMatrix.i              | 6 ++++--
 python/src/Distribution.i               | 4 +++-
 python/src/DistributionImplementation.i | 2 ++
 python/src/HermitianMatrix.i            | 2 ++
 python/src/Matrix.i                     | 7 ++++---
 python/src/NumericalSample.i            | 2 ++
 python/src/SquareComplexMatrix.i        | 2 ++
 python/src/SquareMatrix.i               | 2 ++
 python/src/SymmetricMatrix.i            | 2 ++
 python/src/TriangularComplexMatrix.i    | 2 ++
 python/src/TriangularMatrix.i           | 2 ++
 12 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/python/src/ComplexMatrix.i b/python/src/ComplexMatrix.i
index 52ef93b..979ce9a 100644
--- a/python/src/ComplexMatrix.i
+++ b/python/src/ComplexMatrix.i
@@ -50,9 +50,11 @@ namespace OT {
   OTComplexMatrixGetAccessors()  
   
   ComplexMatrix __rmul__(NumericalComplex s) { return s * (*self); }
-  
+
+#if SWIG_VERSION < 0x030011
   ComplexMatrix __truediv__(NumericalComplex s) { return (*self) / s; }
-  
+#endif
+
   ComplexMatrix __matmul__(const ComplexMatrix & other) { return *self * other; }
 
   ComplexMatrix __matmul__(const Matrix & other) { return *self * other; }
diff --git a/python/src/Distribution.i b/python/src/Distribution.i
index d93bea7..bed5f58 100644
--- a/python/src/Distribution.i
+++ b/python/src/Distribution.i
@@ -171,7 +171,9 @@ Distribution __div__(NumericalScalar s)
  return (*self) / s;
 }
 
-Distribution __truediv__(NumericalScalar s) { return (*self) / s; }
+#if SWIG_VERSION < 0x030011
+  Distribution __truediv__(NumericalScalar s) { return (*self) / s; }
+#endif
 
 } // class Distribution
 } // namespace OT
diff --git a/python/src/DistributionImplementation.i b/python/src/DistributionImplementation.i
index 5d93c3b..dbea3a1 100644
--- a/python/src/DistributionImplementation.i
+++ b/python/src/DistributionImplementation.i
@@ -57,9 +57,11 @@ namespace OT {
 
 DistributionImplementation(const DistributionImplementation & other) { return new OT::DistributionImplementation(other); } 
 
+#if SWIG_VERSION < 0x030011
 Pointer<DistributionImplementation> __truediv__(const NumericalScalar s) { return (*self) / s; }
 
 Pointer<DistributionImplementation> __truediv__(const DistributionImplementation & d) { return (*self) / d; }
+#endif
 
 Pointer<DistributionImplementation> __pow__(const NumericalScalar s) { return self->pow(s); }
 
diff --git a/python/src/HermitianMatrix.i b/python/src/HermitianMatrix.i
index f17684f..487ce9b 100644
--- a/python/src/HermitianMatrix.i
+++ b/python/src/HermitianMatrix.i
@@ -28,7 +28,9 @@ namespace OT {
   HermitianMatrix __rmul__(NumericalComplex s) { return s * (*self); }
   ComplexMatrix __rmul__(const ComplexMatrix & m) { return m * (*self); }
 
+#if SWIG_VERSION < 0x030011
   HermitianMatrix __truediv__(NumericalComplex s) { return (*self) / s; }
+#endif
 
 } // HermitianMatrix
 } // OT
diff --git a/python/src/Matrix.i b/python/src/Matrix.i
index dcc5146..3987b03 100644
--- a/python/src/Matrix.i
+++ b/python/src/Matrix.i
@@ -333,10 +333,11 @@ namespace OT {
   OTMatrixAccessors()
 
   Matrix __rmul__(const NumericalScalar s) { return s * (*self); }
-    
-  Matrix __truediv__(const NumericalScalar s) { return (*self) / s; }
-
   Matrix __matmul__(const Matrix & other) { return *self * other; }
 
+#if SWIG_VERSION < 0x030011
+  Matrix __truediv__(const NumericalScalar s) { return (*self) / s; }
+#endif
+
 } // Matrix
 } // OT
diff --git a/python/src/NumericalSample.i b/python/src/NumericalSample.i
index 94897af..c78e86e 100644
--- a/python/src/NumericalSample.i
+++ b/python/src/NumericalSample.i
@@ -413,11 +413,13 @@ NumericalSample(PyObject * pyObj, UnsignedInteger dimension)
 
 Bool __eq__(const NumericalSample & other) { return (*self) == other; }
 
+#if SWIG_VERSION < 0x030011
 NumericalSample __truediv__(const NumericalScalar & u) { return (*self) / u; }
 
 NumericalSample __truediv__(const NumericalPoint & v) { return (*self) / v; }
 
 NumericalSample __truediv__(const SquareMatrix & m) { return (*self) / m; }
+#endif
 
 } // %extend
 } // namespace OT
diff --git a/python/src/SquareComplexMatrix.i b/python/src/SquareComplexMatrix.i
index 5293448..dcaac6a 100644
--- a/python/src/SquareComplexMatrix.i
+++ b/python/src/SquareComplexMatrix.i
@@ -20,7 +20,9 @@ namespace OT {
 
   OTComplexMatrixGetAccessors()
 
+#if SWIG_VERSION < 0x030011
   SquareComplexMatrix __truediv__(NumericalComplex s) { return (*self) / s; }
+#endif
 
 } // SquareComplexMatrix
 } // OT
diff --git a/python/src/SquareMatrix.i b/python/src/SquareMatrix.i
index 1f1ca41..e1cf0f1 100644
--- a/python/src/SquareMatrix.i
+++ b/python/src/SquareMatrix.i
@@ -25,7 +25,9 @@ namespace OT {
 
   OTMatrixAccessors()
 
+#if SWIG_VERSION < 0x030011
   SquareMatrix __truediv__(NumericalScalar s) { return (*self) / s; }
+#endif
 
 } // SquareMatrix
 } // OT
diff --git a/python/src/SymmetricMatrix.i b/python/src/SymmetricMatrix.i
index c8fb82c..33d807e 100644
--- a/python/src/SymmetricMatrix.i
+++ b/python/src/SymmetricMatrix.i
@@ -35,7 +35,9 @@ namespace OT {
   SymmetricMatrix __rmul__(NumericalScalar s) { return s * (*self); }
   Matrix __rmul__(const Matrix & m) { return m * (*self); }
 
+#if SWIG_VERSION < 0x030011
   SymmetricMatrix __truediv__(NumericalScalar s) { return (*self) / s; }
+#endif
 
 } // SymmetricMatrix
 } // OT
diff --git a/python/src/TriangularComplexMatrix.i b/python/src/TriangularComplexMatrix.i
index 18083ac..97bdb70 100644
--- a/python/src/TriangularComplexMatrix.i
+++ b/python/src/TriangularComplexMatrix.i
@@ -21,7 +21,9 @@ namespace OT {
   TriangularComplexMatrix __rmul__(NumericalComplex s) { return s * (*self); }
   ComplexMatrix __rmul__(const ComplexMatrix & m) { return m * (*self); }
 
+#if SWIG_VERSION < 0x030011
   TriangularComplexMatrix __truediv__(NumericalComplex s) { return (*self) / s; }
+#endif
 
   } // TriangularComplexMatrix
 } // OT
diff --git a/python/src/TriangularMatrix.i b/python/src/TriangularMatrix.i
index 5fb6777..c023370 100644
--- a/python/src/TriangularMatrix.i
+++ b/python/src/TriangularMatrix.i
@@ -21,7 +21,9 @@ namespace OT {
   TriangularMatrix __rmul__(NumericalScalar s) { return s * (*self); }
   Matrix __rmul__(const Matrix & m) { return m * (*self); }
 
+#if SWIG_VERSION < 0x030011
   TriangularMatrix __truediv__(NumericalScalar s) { return (*self) / s; }
+#endif
 
   } // TriangularMatrix
 } // OT