File: no-qd.patch

package info (click to toggle)
phcpack 2.4.90%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 142,196 kB
  • sloc: ada: 945,280; cpp: 214,980; ansic: 59,304; python: 51,902; makefile: 3,660; lisp: 444; javascript: 352
file content (453 lines) | stat: -rw-r--r-- 18,594 bytes parent folder | download
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
Description: Don't link against non-DFSG QD library.
Author: Doug Torrance <dtorrance@debian.org>
Bug: https://github.com/janverschelde/PHCpack/issues/53
Last-Update: 2021-07-09

--- a/src/Objects/makefile_unix
+++ b/src/Objects/makefile_unix
@@ -4106,7 +4106,7 @@
             $(ADALIB)/libgnat_pic.a $(ADALIB)/libgnarl_pic.a \
             -Wl,-no-whole-archive -lrt
 
-phcpy2c3.so: parameter.o lib2path.o
+phcpy2c3.so: parameter.o lib2path_d.o
 	/bin/rm -f -r phcpy2c2.o phcpy2c2.a phcpy2c3.o phcpy2c3.a
 	$(gpp) -Dcompilewgpp=1 -static -c -fPIC -O3 $(PHCLib)/syscon.c
 	$(gpp) -Dcompilewgpp=1 -static -c -fPIC -O3 $(PHCLib)/tabform.c
@@ -4158,7 +4158,7 @@
 	ar ruv phcpy2c3.a *.o
 	ranlib phcpy2c3.a
 	$(gpp) -shared -o ../Python/PHCpy3/phcpy/phcpy2c3.so -lm \
-            -Wl,-whole-archive phcpy2c3.a $(QD_LIB)/libqd.a \
+            -Wl,-whole-archive phcpy2c3.a \
             -lgnat -lgnarl \
             -Wl,-no-whole-archive -lrt
 
--- a/src/GPU/Path/Complex/complexH.h
+++ b/src/GPU/Path/Complex/complexH.h
@@ -5,7 +5,6 @@
 #define __COMPLEXH_H__
 
 #include <iostream>
-#include <qd/qd_real.h>
 #include <stdlib.h>
 
 using namespace std;
@@ -23,12 +22,8 @@
       complexH operator= ( const complexH& );
       complexH operator= ( const int& );
       complexH operator= ( const double& );
-      complexH operator= ( const dd_real& );
-      complexH operator= ( const qd_real& );
 
       complexH ( const double&, const double& );
-      complexH ( const dd_real&, const dd_real& );
-      complexH ( const qd_real&, const qd_real& );
 
       complexH ( const int& );
       complexH ( const double& );
@@ -40,12 +35,6 @@
       void init ( const double&, const double& );
       // define a complex number with a tuple of doubles
 
-      void init ( const dd_real&, const dd_real& );
-      // define a complex number with a tuple of double doubles
-
-      void init ( const qd_real&, const qd_real& );
-      // define a complex number with a tuple of quad doubles
-
       // operators for complex arithmetic are below
       complexH operator+ ( const complexH& );
       void     operator+= ( const complexH& );
--- a/src/GPU/Path/Complex/complexH.cpp
+++ b/src/GPU/Path/Complex/complexH.cpp
@@ -56,24 +56,6 @@
    return *this;
 }
 
-template <class T>
-complexH<T> complexH<T>::operator=(const dd_real& a)
-{
-   real = a;
-   imag = 0.0;
-
-   return *this;
-}
-
-template <class T>
-complexH<T> complexH<T>::operator=(const qd_real& a)
-{
-   real = a;
-   imag = 0.0;
-
-   return *this;
-}
-
 template<class T>
 inline complexH<T>::complexH(const double& a, const double& b )
 {
@@ -81,34 +63,6 @@
    imag = b;
 }
 
-template<class T>
-inline complexH<T>::complexH(const dd_real& a, const dd_real& b )
-{
-   real = a;
-   imag = b;
-}
-
-template<class T>
-inline complexH<T>::complexH(const qd_real& a, const qd_real& b )
-{
-   real = a;
-   imag = b;
-}
-
-template<>
-inline complexH<qd_real>::complexH(const char* a)
-{
-   real = qd_real(a);
-   imag = 0.0;
-}
-
-template<>
-inline complexH<dd_real>::complexH(const char* a)
-{
-   real = dd_real(a);
-   imag = 0.0;
-}
-
 template<>
 inline complexH<double>::complexH(const char* a)
 {
@@ -117,20 +71,6 @@
 }
 
 template<>
-inline complexH<qd_real>::complexH(const char* a, const char* b)
-{
-   real = qd_real(a);
-   imag = qd_real(b);
-}
-
-template<>
-inline complexH<dd_real>::complexH(const char* a, const char* b)
-{
-   real = dd_real(a);
-   imag = dd_real(b);
-}
-
-template<>
 inline complexH<double>::complexH(const char* a, const char* b)
 {
    real = atof(a);
@@ -160,21 +100,6 @@
    imag = temp.imag;
 }
 
-template <class T>
-void complexH<T>::init(const dd_real& a, const dd_real& b)
-{
-   real = a;
-   imag = b;
-}
-
-template <class T>
-void complexH<T>::init(const qd_real& a, const qd_real& b)
-{
-   real = a;
-   imag = b;
-}
-
-
 /*template <class T>
 __device__ complexH<T> complexH<T>::operator+(complexH<T> a)
 {
--- a/src/GPU/Path/Host2/newton_host.h
+++ b/src/GPU/Path/Host2/newton_host.h
@@ -18,16 +18,6 @@
  * Returns the largest sum_norm of the first dim numbers in sol.
  */
 
-double max_norm ( complexH<dd_real>* sol, int dim );
-/*
- * Returns the largest sum_norm of the first dim numbers in sol.
- */
-
-double max_norm ( complexH<qd_real>* sol, int dim );
-/*
- * Returns the largest sum_norm of the first dim numbers in sol.
- */
-
 template <class ComplexType, class RealType>
 bool CPU_Newton
  ( Workspace<ComplexType>& workspace_cpu,
--- a/src/GPU/Path/Host2/newton_host.tpp
+++ b/src/GPU/Path/Host2/newton_host.tpp
@@ -16,28 +16,6 @@
    return max_delta;
 }
 
-double max_norm ( complexH<dd_real>* sol, int dim )
-{
-   double max_delta = sum_norm(sol[0].real.x[0],sol[0].imag.x[0]);
-   for(int k=1; k<dim; k++)
-   {
-      double tmp_delta = sum_norm(sol[k].real.x[0],sol[k].imag.x[0]);
-      if(tmp_delta>max_delta) max_delta = tmp_delta;
-   }
-   return max_delta;
-}
-
-double max_norm ( complexH<qd_real>* sol, int dim )
-{
-   double max_delta = sum_norm(sol[0].real.x[0],sol[0].imag.x[0]);
-   for(int k=1; k<dim; k++)
-   {
-      double tmp_delta = sum_norm(sol[k].real.x[0],sol[k].imag.x[0]);
-      if(tmp_delta>max_delta) max_delta = tmp_delta;
-   }
-   return max_delta;
-}
-
 template <class ComplexType, class RealType>
 bool CPU_Newton 
  ( Workspace<ComplexType>& workspace_cpu,
--- a/src/GPU/Path/Host2/lib2path_d.h
+++ b/src/GPU/Path/Host2/lib2path_d.h
@@ -34,10 +34,6 @@
 
 void lib2path_read_standard_sys
  ( int verbose, PolySys<complexH<double>,double>& sys );
-void lib2path_read_dobldobl_sys
- ( int verbose, PolySys<complexH<dd_real>,dd_real>& sys );
-void lib2path_read_quaddobl_sys
- ( int verbose, PolySys<complexH<qd_real>,qd_real>& sys );
 /*
  * DESCRIPTION :
  *   Reads a polynomial system from the systems container
--- a/src/GPU/Path/Host2/mgs_host.h
+++ b/src/GPU/Path/Host2/mgs_host.h
@@ -10,6 +10,8 @@
 #ifndef __MGS2_H__
 #define __MGS2_H__
 
+#include <cmath> // for sqrt
+
 template <class ComplexType, class RealType>
 void CPU_normalize_and_reduce
  ( ComplexType** v, int rows, int cols, int pivot );
--- a/src/Mod/phcpy2c3.c
+++ b/src/Mod/phcpy2c3.c
@@ -9650,18 +9650,6 @@
 extern int standard_ade_manypaths
  ( int verbose, double regamma, double imgamma );
 
-extern int dobldobl_ade_newton ( int verbose );
-extern int dobldobl_ade_onepath
- ( int verbose, double regamma, double imgamma );
-extern int dobldobl_ade_manypaths
- ( int verbose, double regamma, double imgamma );
-
-extern int quaddobl_ade_newton ( int verbose );
-extern int quaddobl_ade_onepath
- ( int verbose, double regamma, double imgamma );
-extern int quaddobl_ade_manypaths
- ( int verbose, double regamma, double imgamma );
-
 static PyObject *py2c_ade_newton_d ( PyObject *self, PyObject *args )
 {
    int fail,verbose;
@@ -9673,28 +9661,6 @@
    return Py_BuildValue("i",fail);
 }
 
-static PyObject *py2c_ade_newton_dd ( PyObject *self, PyObject *args )
-{
-   int fail,verbose;
-
-   initialize();
-   if(!PyArg_ParseTuple(args,"i",&verbose)) return NULL;
-   fail = dobldobl_ade_newton(verbose);
-
-   return Py_BuildValue("i",fail);
-}
-
-static PyObject *py2c_ade_newton_qd ( PyObject *self, PyObject *args )
-{
-   int fail,verbose;
-
-   initialize();
-   if(!PyArg_ParseTuple(args,"i",&verbose)) return NULL;
-   fail = quaddobl_ade_newton(verbose);
-
-   return Py_BuildValue("i",fail);
-}
-
 static PyObject *py2c_ade_onepath_d ( PyObject *self, PyObject *args )
 {
    int fail,verbose;
@@ -9707,30 +9673,6 @@
    return Py_BuildValue("i",fail);
 }
 
-static PyObject *py2c_ade_onepath_dd ( PyObject *self, PyObject *args )
-{
-   int fail,verbose;
-   double reg,img;
-
-   initialize();
-   if(!PyArg_ParseTuple(args,"idd",&verbose,&reg,&img)) return NULL;
-   fail = dobldobl_ade_onepath(verbose,reg,img);
-
-   return Py_BuildValue("i",fail);
-}
-
-static PyObject *py2c_ade_onepath_qd ( PyObject *self, PyObject *args )
-{
-   int fail,verbose;
-   double reg,img;
-
-   initialize();
-   if(!PyArg_ParseTuple(args,"idd",&verbose,&reg,&img)) return NULL;
-   fail = quaddobl_ade_onepath(verbose,reg,img);
-
-   return Py_BuildValue("i",fail);
-}
-
 static PyObject *py2c_ade_manypaths_d ( PyObject *self, PyObject *args )
 {
    int fail,verbose;
@@ -9743,30 +9685,6 @@
    return Py_BuildValue("i",fail);
 }
 
-static PyObject *py2c_ade_manypaths_dd ( PyObject *self, PyObject *args )
-{
-   int fail,verbose;
-   double reg,img;
-
-   initialize();
-   if(!PyArg_ParseTuple(args,"idd",&verbose,&reg,&img)) return NULL;
-   fail = dobldobl_ade_manypaths(verbose,reg,img);
-
-   return Py_BuildValue("i",fail);
-}
-
-static PyObject *py2c_ade_manypaths_qd ( PyObject *self, PyObject *args )
-{
-   int fail,verbose;
-   double reg,img;
-
-   initialize();
-   if(!PyArg_ParseTuple(args,"idd",&verbose,&reg,&img)) return NULL;
-   fail = quaddobl_ade_manypaths(verbose,reg,img);
-
-   return Py_BuildValue("i",fail);
-}
-
 /* For the parameter tuning we need the default path parameters,
  * provided by the lib2path function below,
  * see lib2path.h for its specification. */
@@ -9822,15 +9740,6 @@
    int max_it, double err_min_round_off,
    int max_it_refine, double err_min_round_off_refine );
 
-extern int quaddobl_ademanypaths_with_parameters
- ( int verbose, double regamma, double imgamma,
-   int max_step, int n_predictor,
-   double step_increase, double step_decrease,
-   double max_delta_t, double max_delta_t_end, double min_delta_t,
-   double err_max_res, double err_max_delta_x, double err_max_first_delta_x,
-   int max_it, double err_min_round_off,
-   int max_it_refine, double err_min_round_off_refine );
-
 static PyObject *py2c_ade_manypaths_d_pars ( PyObject *self, PyObject *args )
 {
    int fail,verbose,max_step,n_predictor,max_it,max_it_refine;
@@ -9855,53 +9764,6 @@
    return Py_BuildValue("i",fail);
 }
 
-static PyObject *py2c_ade_manypaths_dd_pars ( PyObject *self, PyObject *args )
-{
-   int fail,verbose,max_step,n_predictor,max_it,max_it_refine;
-   double reg,img,step_increase,step_decrease;
-   double max_delta_t,max_delta_t_end,min_delta_t;
-   double err_max_res,err_max_delta_x,err_max_first_delta_x;
-   double err_min_round_off,err_min_round_off_refine;
- 
-   initialize();
-   if(!PyArg_ParseTuple(args,"iddiiddddddddidid",&verbose,&reg,&img,
-      &max_step,&n_predictor,&step_increase,&step_decrease,
-      &max_delta_t,&max_delta_t_end,&min_delta_t,&err_max_res,
-      &err_max_delta_x,&err_max_first_delta_x,&max_it,&err_min_round_off,
-      &max_it_refine,&err_min_round_off_refine)) return NULL;
-
-   fail = dobldobl_ademanypaths_with_parameters(verbose,reg,img,
-      max_step,n_predictor,step_increase,step_decrease,
-      max_delta_t,max_delta_t_end,min_delta_t,err_max_res,
-      err_max_delta_x,err_max_first_delta_x,max_it,err_min_round_off,
-      max_it_refine,err_min_round_off_refine);
-
-   return Py_BuildValue("i",fail);
-}
-
-static PyObject *py2c_ade_manypaths_qd_pars ( PyObject *self, PyObject *args )
-{
-   int fail,verbose,max_step,n_predictor,max_it,max_it_refine;
-   double reg,img,step_increase,step_decrease;
-   double max_delta_t,max_delta_t_end,min_delta_t;
-   double err_max_res,err_max_delta_x,err_max_first_delta_x;
-   double err_min_round_off,err_min_round_off_refine;
- 
-   initialize();
-   if(!PyArg_ParseTuple(args,"iddiiddddddddidid",&verbose,&reg,&img,
-      &max_step,&n_predictor,&step_increase,&step_decrease,
-      &max_delta_t,&max_delta_t_end,&min_delta_t,&err_max_res,
-      &err_max_delta_x,&err_max_first_delta_x,&max_it,&err_min_round_off,
-      &max_it_refine,&err_min_round_off_refine)) return NULL;
-
-   fail = quaddobl_ademanypaths_with_parameters(verbose,reg,img,
-      max_step,n_predictor,step_increase,step_decrease,
-      max_delta_t,max_delta_t_end,min_delta_t,err_max_res,
-      err_max_delta_x,err_max_first_delta_x,max_it,err_min_round_off,
-      max_it_refine,err_min_round_off_refine);
-
-   return Py_BuildValue("i",fail);
-}
 
 static PyMethodDef phcpy2c3_methods[] = 
 {
@@ -11845,30 +11707,12 @@
     "Tracks one solution path with algorithmic differentation\n in double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the standard solutions container must holds valid solution.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
    {"py2c_ade_manypaths_d", py2c_ade_manypaths_d, METH_VARARGS,
     "Tracks many solution paths with algorithmic differentation\n in double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the standard solutions container holds valid solutions.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_newton_dd", py2c_ade_newton_dd, METH_VARARGS,
-    "Runs Newton's method with algorithmic differentation\n in double double precision on the data in the systems and solutions container.\n The dobldobl systems container must contain a valid polynomial system\n and the dobldobl solutions container must hold a valid solution.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_onepath_dd", py2c_ade_onepath_dd, METH_VARARGS,
-    "Tracks one solution path with algorithmic differentation\n in double double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the dobldobl solutions container must holds valid solution.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_manypaths_dd", py2c_ade_manypaths_dd, METH_VARARGS,
-    "Tracks many solution paths with algorithmic differentation\n in double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the dobldobl solutions container holds valid solutions.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_newton_qd", py2c_ade_newton_qd, METH_VARARGS,
-    "Runs Newton's method with algorithmic differentation\n in quad double precision on the data in the systems and solutions container.\n The quaddobl systems container must contain a valid polynomial system\n and the quaddobl solutions container must hold a valid solution.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_onepath_qd", py2c_ade_onepath_qd, METH_VARARGS,
-    "Tracks one solution path with algorithmic differentation\n in quad double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the quaddobl solutions container must holds valid solution.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_manypaths_qd", py2c_ade_manypaths_qd, METH_VARARGS,
-    "Tracks many solution paths with algorithmic differentation\n in quad double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the quaddobl solutions container holds valid solutions.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n On return is the failure code, which equals zero if all went well."},
    {"py2c_get_default_path_parameters", 
      py2c_get_default_path_parameters, METH_VARARGS, 
     "Given the working precision (16, 32, or 64), returns the default values\n of the path parameters, for the path trackers with algorithmic differentiation."},
    {"py2c_ade_manypaths_d_pars",
      py2c_ade_manypaths_d_pars, METH_VARARGS,
     "Tracks many solution paths with algorithmic differentation\n in double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the standard solutions container holds valid solutions.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n Other input parameters are the real and imaginary parts of the gamma constant.\n Then, the 14 values of the path parameters has to be provided.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_manypaths_dd_pars",
-     py2c_ade_manypaths_dd_pars, METH_VARARGS,
-    "Tracks many solution paths with algorithmic differentation\n in double double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the dobldobl solutions container holds valid solutions.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n Other input parameters are the real and imaginary parts of the gamma constant.\n Then, the 14 values of the path parameters has to be provided.\n On return is the failure code, which equals zero if all went well."},
-   {"py2c_ade_manypaths_qd_pars",
-     py2c_ade_manypaths_qd_pars, METH_VARARGS,
-    "Tracks many solution paths with algorithmic differentation\n in quad double precision on the data in the systems and solutions container.\n The start and target systems must have been defined\n and the quaddobl solutions container holds valid solutions.\n On entry is the verbose flag, which equals zero if no output is wanted,\n or 1 if extra information should be written to screen.\n Other input parameters are the real and imaginary parts of the gamma constant.\n Then, the 14 values of the path parameters has to be provided.\n On return is the failure code, which equals zero if all went well."},
    {NULL, NULL, 0, NULL} 
 };