DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SternBrocot.cpp
1 
32 
33 #include "DGtal/arithmetic/SternBrocot.h"
35 
36 #include <iostream>
37 
38 using namespace std;
39 
40 
41 
43 // class Common
45 
49 namespace DGtal
50 {
51  template <typename TInteger, typename TQuotient>
54 
55  template <>
58 
59  template <>
62 
63  template <>
66 
67 #ifdef WITH_BIGINTEGER
68  template <>
71 
72  template <>
75 
76  template <>
79 
80 #endif
81 
82 // template<>
83 // DGtal::SternBrocot<int32_t,int32_t>::Quotient
84 // DGtal::SternBrocot<int32_t,int32_t>::nbFractions = 0;
85 // template<>
86 // DGtal::SternBrocot<int64_t,int32_t>::Quotient
87 // DGtal::SternBrocot<int64_t,int32_t>::nbFractions = 0;
88 // template<>
89 // DGtal::SternBrocot<int64_t,int64_t>::Quotient
90 // DGtal::SternBrocot<int64_t,int64_t>::nbFractions = 0;
91 
92 // // Constant definitions in SternBrocot specializations.
93 // // DGtal::SternBrocot<int32_t,int32_t>
94 // template<>
95 // DGtal::SternBrocot<int32_t,int32_t>::Node
96 // DGtal::SternBrocot<int32_t,int32_t>::myVirtualZeroOverOne
97 // ( 0, 1, 0, -2,
98 // 0, 0, 0, &myOneOverZero,
99 // &myOneOverZero );
100 
101 // template<>
102 // DGtal::SternBrocot<int32_t,int32_t>::Node
103 // DGtal::SternBrocot<int32_t,int32_t>::myOneOverZero
104 // ( 1, 0, 0, -1,
105 // // &myVirtualZeroOverOne, 0, &myOneOverOne, 0,
106 // &myZeroOverOne, 0, &myOneOverOne, 0,
107 // &myZeroOverOne );
108 
109 // template<>
110 // DGtal::SternBrocot<int32_t,int32_t>::Node
111 // DGtal::SternBrocot<int32_t,int32_t>::myZeroOverOne
112 // ( 0, 1, 0, 0,
113 // // &myVirtualZeroOverOne, &myOneOverZero,
114 // &myZeroOverOne, &myOneOverZero,
115 // 0, &myOneOverOne,
116 // &myOneOverZero );
117 
118 // template<>
119 // DGtal::SternBrocot<int32_t,int32_t>::Node
120 // DGtal::SternBrocot<int32_t,int32_t>::myOneOverOne
121 // ( 1, 1, 1, 0,
122 // &myZeroOverOne, &myOneOverZero, 0, 0,
123 // &myOneOverOne );
124 
125 // // Constant definitions in SternBrocot specializations.
126 // // DGtal::SternBrocot<int64_t,int32_t>
127 // template<>
128 // DGtal::SternBrocot<int64_t,int32_t>::Node
129 // DGtal::SternBrocot<int64_t,int32_t>::myVirtualZeroOverOne
130 // ( 0, 1, 0, -2,
131 // 0, 0, 0, &myOneOverZero,
132 // &myOneOverZero );
133 
134 // template<>
135 // DGtal::SternBrocot<int64_t,int32_t>::Node
136 // DGtal::SternBrocot<int64_t,int32_t>::myOneOverZero
137 // ( 1, 0, 0, -1,
138 // // &myVirtualZeroOverOne, 0, &myOneOverOne, 0,
139 // &myZeroOverOne, 0, &myOneOverOne, 0,
140 // &myZeroOverOne );
141 
142 // template<>
143 // DGtal::SternBrocot<int64_t,int32_t>::Node
144 // DGtal::SternBrocot<int64_t,int32_t>::myZeroOverOne
145 // ( 0, 1, 0, 0,
146 // // &myVirtualZeroOverOne, &myOneOverZero,
147 // &myZeroOverOne, &myOneOverZero,
148 // 0, &myOneOverOne,
149 // &myOneOverZero );
150 
151 // template<>
152 // DGtal::SternBrocot<int64_t,int32_t>::Node
153 // DGtal::SternBrocot<int64_t,int32_t>::myOneOverOne
154 // ( 1, 1, 1, 0,
155 // &myZeroOverOne, &myOneOverZero, 0, 0,
156 // &myOneOverOne );
157 
158 // // Constant definitions in SternBrocot specializations.
159 // // DGtal::SternBrocot<int64_t,int64_t>
160 // template<>
161 // DGtal::SternBrocot<int64_t,int64_t>::Node
162 // DGtal::SternBrocot<int64_t,int64_t>::myVirtualZeroOverOne
163 // ( 0, 1, 0, -2,
164 // 0, 0, 0, &myOneOverZero,
165 // &myOneOverZero );
166 
167 // template<>
168 // DGtal::SternBrocot<int64_t,int64_t>::Node
169 // DGtal::SternBrocot<int64_t,int64_t>::myOneOverZero
170 // ( 1, 0, 0, -1,
171 // // &myVirtualZeroOverOne, 0, &myOneOverOne, 0,
172 // &myZeroOverOne, 0, &myOneOverOne, 0,
173 // &myZeroOverOne );
174 
175 // template<>
176 // DGtal::SternBrocot<int64_t,int64_t>::Node
177 // DGtal::SternBrocot<int64_t,int64_t>::myZeroOverOne
178 // ( 0, 1, 0, 0,
179 // // &myVirtualZeroOverOne, &myOneOverZero,
180 // &myZeroOverOne, &myOneOverZero,
181 // 0, &myOneOverOne,
182 // &myOneOverZero );
183 
184 // template<>
185 // DGtal::SternBrocot<int64_t,int64_t>::Node
186 // DGtal::SternBrocot<int64_t,int64_t>::myOneOverOne
187 // ( 1, 1, 1, 0,
188 // &myZeroOverOne, &myOneOverZero, 0, 0,
189 // &myOneOverOne );
190 
191 // #ifdef WITH_BIGINTEGER
192 // template<>
193 // DGtal::SternBrocot<BigInteger,int64_t>::Quotient
194 // DGtal::SternBrocot<BigInteger,int64_t>::nbFractions = 0;
195 // template<>
196 // DGtal::SternBrocot<BigInteger,int32_t>::Quotient
197 // DGtal::SternBrocot<BigInteger,int32_t>::nbFractions = 0;
198 // template<>
199 // DGtal::SternBrocot<BigInteger,BigInteger>::Quotient
200 // DGtal::SternBrocot<BigInteger,BigInteger>::nbFractions = 0;
201 
202 // // Constant definitions in SternBrocot specializations.
203 // // DGtal::SternBrocot<BigInteger,int64_t>
204 // template<>
205 // DGtal::SternBrocot<BigInteger,int64_t>::Node
206 // DGtal::SternBrocot<BigInteger,int64_t>::myVirtualZeroOverOne
207 // ( 0, 1, 0, -2,
208 // 0, 0, 0, &myOneOverZero,
209 // &myOneOverZero );
210 
211 // template<>
212 // DGtal::SternBrocot<BigInteger,int64_t>::Node
213 // DGtal::SternBrocot<BigInteger,int64_t>::myOneOverZero
214 // ( 1, 0, 0, -1,
215 // // &myVirtualZeroOverOne, 0, &myOneOverOne, 0,
216 // &myZeroOverOne, 0, &myOneOverOne, 0,
217 // &myZeroOverOne );
218 
219 // template<>
220 // DGtal::SternBrocot<BigInteger,int64_t>::Node
221 // DGtal::SternBrocot<BigInteger,int64_t>::myZeroOverOne
222 // ( 0, 1, 0, 0,
223 // // &myVirtualZeroOverOne, &myOneOverZero,
224 // &myZeroOverOne, &myOneOverZero,
225 // 0, &myOneOverOne,
226 // &myOneOverZero );
227 
228 // template<>
229 // DGtal::SternBrocot<BigInteger,int64_t>::Node
230 // DGtal::SternBrocot<BigInteger,int64_t>::myOneOverOne
231 // ( 1, 1, 1, 0,
232 // &myZeroOverOne, &myOneOverZero, 0, 0,
233 // &myOneOverOne );
234 
235 // // Constant definitions in SternBrocot specializations.
236 // // DGtal::SternBrocot<BigInteger,int32_t>
237 // template<>
238 // DGtal::SternBrocot<BigInteger,int32_t>::Node
239 // DGtal::SternBrocot<BigInteger,int32_t>::myVirtualZeroOverOne
240 // ( 0, 1, 0, -2,
241 // 0, 0, 0, &myOneOverZero,
242 // &myOneOverZero );
243 
244 // template<>
245 // DGtal::SternBrocot<BigInteger,int32_t>::Node
246 // DGtal::SternBrocot<BigInteger,int32_t>::myOneOverZero
247 // ( 1, 0, 0, -1,
248 // // &myVirtualZeroOverOne, 0, &myOneOverOne, 0,
249 // &myZeroOverOne, 0, &myOneOverOne, 0,
250 // &myZeroOverOne );
251 
252 // template<>
253 // DGtal::SternBrocot<BigInteger,int32_t>::Node
254 // DGtal::SternBrocot<BigInteger,int32_t>::myZeroOverOne
255 // ( 0, 1, 0, 0,
256 // // &myVirtualZeroOverOne, &myOneOverZero,
257 // &myZeroOverOne, &myOneOverZero,
258 // 0, &myOneOverOne,
259 // &myOneOverZero );
260 
261 // template<>
262 // DGtal::SternBrocot<BigInteger,int32_t>::Node
263 // DGtal::SternBrocot<BigInteger,int32_t>::myOneOverOne
264 // ( 1, 1, 1, 0,
265 // &myZeroOverOne, &myOneOverZero, 0, 0,
266 // &myOneOverOne );
267 
268 // // Constant definitions in SternBrocot specializations.
269 // // DGtal::SternBrocot<BigInteger,BigInteger>
270 // template<>
271 // DGtal::SternBrocot<BigInteger,BigInteger>::Node
272 // DGtal::SternBrocot<BigInteger,BigInteger>::myVirtualZeroOverOne
273 // ( 0, 1, 0, -2,
274 // 0, 0, 0, &myOneOverZero,
275 // &myOneOverZero );
276 
277 // template<>
278 // DGtal::SternBrocot<BigInteger,BigInteger>::Node
279 // DGtal::SternBrocot<BigInteger,BigInteger>::myOneOverZero
280 // ( 1, 0, 0, -1,
281 // // &myVirtualZeroOverOne, 0, &myOneOverOne, 0,
282 // &myZeroOverOne, 0, &myOneOverOne, 0,
283 // &myZeroOverOne );
284 
285 // template<>
286 // DGtal::SternBrocot<BigInteger,BigInteger>::Node
287 // DGtal::SternBrocot<BigInteger,BigInteger>::myZeroOverOne
288 // ( 0, 1, 0, 0,
289 // // &myVirtualZeroOverOne, &myOneOverZero,
290 // &myZeroOverOne, &myOneOverZero,
291 // 0, &myOneOverOne,
292 // &myOneOverZero );
293 
294 // template<>
295 // DGtal::SternBrocot<BigInteger,BigInteger>::Node
296 // DGtal::SternBrocot<BigInteger,BigInteger>::myOneOverOne
297 // ( 1, 1, 1, 0,
298 // &myZeroOverOne, &myOneOverZero, 0, 0,
299 // &myOneOverOne );
300 
301 
302 
303 // // const DGtal::BigInteger SternBrocot<DGtal::BigInteger>::ONE = 1;
304 // // const DGtal::BigInteger SternBrocot<DGtal::BigInteger>::ZERO = 0;
305 // #endif
306 
307 }