1 |
commit: 88b419c013753ab8a86c6f2f0c0647609b9e446f |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Sep 9 12:43:15 2021 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 9 12:43:15 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=88b419c0 |
7 |
|
8 |
sci-libs/meschach: switch to the cmake github version |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
sci-libs/meschach/Manifest | 4 +- |
13 |
sci-libs/meschach/files/configure.patch | 29 - |
14 |
sci-libs/meschach/files/meschach-2-mbdyn.diff | 906 --------------------- |
15 |
sci-libs/meschach/files/meschach-makefile.patch | 156 ---- |
16 |
sci-libs/meschach/meschach-1.2b.ebuild | 84 -- |
17 |
...11.ebuild => meschach-1.2b_p20170511-r1.ebuild} | 11 +- |
18 |
sci-libs/meschach/metadata.xml | 45 +- |
19 |
7 files changed, 30 insertions(+), 1205 deletions(-) |
20 |
|
21 |
diff --git a/sci-libs/meschach/Manifest b/sci-libs/meschach/Manifest |
22 |
index df80a73fe..9e11ac6f8 100644 |
23 |
--- a/sci-libs/meschach/Manifest |
24 |
+++ b/sci-libs/meschach/Manifest |
25 |
@@ -1,3 +1 @@ |
26 |
-DIST meschach-1.2b_p20170511.tar.gz 577104 BLAKE2B 83b47828c814d4a7f4957f02448babb0961383f61f329431ef74a8ec2800c196d5cb0e1363a258b06f18adccaf39d859e640f01bf7f98b5b0ac634adc5f58beb SHA512 054c9380ff2df4c8c3bda0eb20df2a9da8fe357fd939116a257bb2831d04893aad29999df0d2bd9434173a1246ec18a73779abdadc477f9c2dd9d027446393d1 |
27 |
-DIST meschach_1.2b-14.debian.tar.xz 40664 BLAKE2B 753cdcdf8ecd63be14a294a6607380462df8a74c1cc84fafcfe4140cb10eaeb590dbe12883e2a973691a920b1e7f4efdf884781b49ea947b1132ff213f4a2652 SHA512 9793127a1785fb757b61132db1c471a2ff7949c383870f10d0b24ea2e1dafcb9d9379b61698179f91fdba4405e18e1692efcc26b759b1a5d9519e8c46206636b |
28 |
-DIST meschach_1.2b.orig.tar.gz 220166 BLAKE2B fe38d9887977f45cc54857fe9c33f1eb50d1192ce3cae643127962cfce7657d9890964aabd3690751648a3a850fbbb39c6fb2110f8b4fcd789c7b8efefcec2c5 SHA512 0b8748915739b624aa44b0bf6f2c59aaf3d09f69f9455220e4baeb423c094a89cc25c03d6ced0d58bfd7c5d6626f3995fc853119ab0f7d6af151d8479c326068 |
29 |
+DIST meschach-1.2b_p20170511-r1.tar.gz 577104 BLAKE2B 83b47828c814d4a7f4957f02448babb0961383f61f329431ef74a8ec2800c196d5cb0e1363a258b06f18adccaf39d859e640f01bf7f98b5b0ac634adc5f58beb SHA512 054c9380ff2df4c8c3bda0eb20df2a9da8fe357fd939116a257bb2831d04893aad29999df0d2bd9434173a1246ec18a73779abdadc477f9c2dd9d027446393d1 |
30 |
|
31 |
diff --git a/sci-libs/meschach/files/configure.patch b/sci-libs/meschach/files/configure.patch |
32 |
deleted file mode 100644 |
33 |
index 858196846..000000000 |
34 |
--- a/sci-libs/meschach/files/configure.patch |
35 |
+++ /dev/null |
36 |
@@ -1,29 +0,0 @@ |
37 |
-Bug: https://bugs.gentoo.org/785196 |
38 |
- |
39 |
---- a/configure.in |
40 |
-+++ b/configure.in |
41 |
-@@ -9,16 +9,6 @@ |
42 |
- [extern int test (int i, double x);], |
43 |
- AC_DEFINE(HAVE_PROTOTYPES))])dnl |
44 |
- dnl |
45 |
--dnl Brook Milligan's compiler check |
46 |
--dnl Check for the sun ansi c compiler, acc |
47 |
--define(LOCAL_PROG_ACC, |
48 |
--[AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])dnl |
49 |
--AC_PROGRAM_CHECK(CC, acc, acc, "")])dnl |
50 |
--dnl David Stewart's modified compiler check |
51 |
--define(LOCAL_PROG_CC, |
52 |
--[AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])dnl |
53 |
--AC_PROGRAM_CHECK(CC, acc, acc, cc)])dnl |
54 |
--dnl |
55 |
- dnl |
56 |
- dnl |
57 |
- dnl ---------------------------------------------------------------------- |
58 |
-@@ -29,7 +19,6 @@ |
59 |
- PROGS="" |
60 |
- AC_SUBST(PROGS)dnl |
61 |
- LOCAL_PROG_ACC |
62 |
--AC_PROGRAM_CHECK(CC, cc, cc, gcc) |
63 |
- dnl AC_PROG_CC |
64 |
- AC_PROG_CPP |
65 |
- AC_AIX |
66 |
|
67 |
diff --git a/sci-libs/meschach/files/meschach-2-mbdyn.diff b/sci-libs/meschach/files/meschach-2-mbdyn.diff |
68 |
deleted file mode 100644 |
69 |
index 89db78f73..000000000 |
70 |
--- a/sci-libs/meschach/files/meschach-2-mbdyn.diff |
71 |
+++ /dev/null |
72 |
@@ -1,906 +0,0 @@ |
73 |
---- a/CHANGELOG |
74 |
-+++ b/CHANGELOG |
75 |
-@@ -0,0 +1,10 @@ |
76 |
-+* 2000-04-13 Pierangelo Masarati <masarati@×××××××××××.it> |
77 |
-+ - fixed HUGE_VAL configure |
78 |
-+ - prefixed REAL, DOUBLE and FLOAT with MESCHACH_ to avoid conflicts |
79 |
-+ |
80 |
-+* 2000-??-?? Pierangelo Masarati <masarati@×××××××××××.it> |
81 |
-+ - changed the struct pair in sparse.h to avoid conflicts with C++ stl |
82 |
-+ - added some helpers for adding and subtracting coefs from sparse matrices |
83 |
-+ - WARNING: in C++ the macro `catch' conflicts with the exception handling |
84 |
-+ keyword; I temporarily fixed the problem by #undef-ining it after including |
85 |
-+ meschach headers. |
86 |
---- a/init.c |
87 |
-+++ b/init.c |
88 |
-@@ -59,7 +59,7 @@ |
89 |
- if ( ix == IVNULL ) |
90 |
- error(E_NULL,"iv_zero"); |
91 |
- |
92 |
-- for ( i = 0; i < ix->dim; i++ ) |
93 |
-+ for ( i = ix->dim; i-- > 0; ) |
94 |
- ix->ive[i] = 0; |
95 |
- |
96 |
- return ix; |
97 |
-@@ -77,7 +77,7 @@ |
98 |
- error(E_NULL,"m_zero"); |
99 |
- |
100 |
- A_m = A->m; A_n = A->n; A_me = A->me; |
101 |
-- for ( i = 0; i < A_m; i++ ) |
102 |
-+ for ( i = A_m; i-- > 0; ) |
103 |
- __zero__(A_me[i],A_n); |
104 |
- /* for ( j = 0; j < A_n; j++ ) |
105 |
- A_me[i][j] = 0.0; */ |
106 |
-@@ -97,7 +97,7 @@ |
107 |
- |
108 |
- m_zero(A); |
109 |
- size = min(A->m,A->n); |
110 |
-- for ( i = 0; i < size; i++ ) |
111 |
-+ for ( i = size; i-- > 0; ) |
112 |
- A->me[i][i] = 1.0; |
113 |
- |
114 |
- return A; |
115 |
-@@ -114,7 +114,7 @@ |
116 |
- error(E_NULL,"px_ident"); |
117 |
- |
118 |
- px_size = px->size; px_pe = px->pe; |
119 |
-- for ( i = 0; i < px_size; i++ ) |
120 |
-+ for ( i = px_size; i-- > 0; ) |
121 |
- px_pe[i] = i; |
122 |
- |
123 |
- return px; |
124 |
-@@ -178,7 +178,7 @@ |
125 |
- if ( ! started ) |
126 |
- smrand(3127); |
127 |
- |
128 |
-- for ( i = 0; i < len; i++ ) |
129 |
-+ for ( i = len; i-- > 0; ) |
130 |
- { |
131 |
- inext = (inext >= 54) ? 0 : inext+1; |
132 |
- inextp = (inextp >= 54) ? 0 : inextp+1; |
133 |
-@@ -260,12 +260,28 @@ |
134 |
- if ( ! x ) |
135 |
- error(E_NULL,"v_ones"); |
136 |
- |
137 |
-- for ( i = 0; i < x->dim; i++ ) |
138 |
-+ for ( i = x->dim; i-- > 0; ) |
139 |
- x->ve[i] = 1.0; |
140 |
- |
141 |
- return x; |
142 |
- } |
143 |
- |
144 |
-+/* v_init -- fills x with d's */ |
145 |
-+VEC *v_init(x, d) |
146 |
-+VEC *x; |
147 |
-+Real d; |
148 |
-+{ |
149 |
-+ int i; |
150 |
-+ |
151 |
-+ if ( ! x ) |
152 |
-+ error(E_NULL,"v_ones"); |
153 |
-+ |
154 |
-+ for ( i = x->dim; i-- > 0; ) |
155 |
-+ x->ve[i] = d; |
156 |
-+ |
157 |
-+ return x; |
158 |
-+} |
159 |
-+ |
160 |
- /* m_ones -- fills matrix with one's */ |
161 |
- MAT *m_ones(A) |
162 |
- MAT *A; |
163 |
-@@ -275,8 +291,8 @@ |
164 |
- if ( ! A ) |
165 |
- error(E_NULL,"m_ones"); |
166 |
- |
167 |
-- for ( i = 0; i < A->m; i++ ) |
168 |
-- for ( j = 0; j < A->n; j++ ) |
169 |
-+ for ( i = A->m; i-- > 0; ) |
170 |
-+ for ( j = A->n; j-- > 0; ) |
171 |
- A->me[i][j] = 1.0; |
172 |
- |
173 |
- return A; |
174 |
-@@ -291,7 +307,7 @@ |
175 |
- if ( ! x ) |
176 |
- error(E_NULL,"v_count"); |
177 |
- |
178 |
-- for ( i = 0; i < x->dim; i++ ) |
179 |
-+ for ( i = x->dim; i-- > 0; ) |
180 |
- x->ve[i] = (Real)i; |
181 |
- |
182 |
- return x; |
183 |
---- a/itertort.c |
184 |
-+++ b/itertort.c |
185 |
-@@ -41,10 +41,10 @@ |
186 |
- |
187 |
- /* for iterative methods */ |
188 |
- |
189 |
--#if REAL == DOUBLE |
190 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
191 |
- #define EPS 1e-7 |
192 |
- #define KK 20 |
193 |
--#elif REAL == FLOAT |
194 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
195 |
- #define EPS 1e-5 |
196 |
- #define KK 8 |
197 |
- #endif |
198 |
---- a/machine.h.in |
199 |
-+++ b/machine.h.in |
200 |
-@@ -16,14 +16,15 @@ |
201 |
- #undef MALLOCDECL |
202 |
- #undef NOT_SEGMENTED |
203 |
- #undef HAVE_MEMORY_H |
204 |
--#undef HAVE_COMPLEX_H |
205 |
-+/* #undef HAVE_COMPLEX_H */ |
206 |
- #undef HAVE_MALLOC_H |
207 |
-+#undef HAVE_HUGE_VAL_H |
208 |
- #undef STDC_HEADERS |
209 |
- #undef HAVE_BCOPY |
210 |
- #undef HAVE_BZERO |
211 |
- #undef CHAR0ISDBL0 |
212 |
- #undef WORDS_BIGENDIAN |
213 |
--#undef U_INT_DEF |
214 |
-+/* #undef U_INT_DEF */ |
215 |
- #undef VARARGS |
216 |
- #undef HAVE_PROTOTYPES |
217 |
- #undef HAVE_PROTOTYPES_IN_STRUCT |
218 |
-@@ -53,7 +54,7 @@ |
219 |
- #endif /* HAVE_PROTOTYPES_IN_STRUCT */ |
220 |
- |
221 |
- /* for basic or larger versions */ |
222 |
--#undef COMPLEX |
223 |
-+#undef MESCHACH_COMPLEX |
224 |
- #undef SPARSE |
225 |
- |
226 |
- /* for loop unrolling */ |
227 |
-@@ -131,9 +132,9 @@ |
228 |
- |
229 |
- /* you can choose single, double or long double (if available) precision */ |
230 |
- |
231 |
--#define FLOAT 1 |
232 |
--#define DOUBLE 2 |
233 |
--#define LONG_DOUBLE 3 |
234 |
-+#define MESCHACH_FLOAT 1 |
235 |
-+#define MESCHACH_DOUBLE 2 |
236 |
-+#define MESCHACH_LONG_DOUBLE 3 |
237 |
- |
238 |
- #undef REAL_FLT |
239 |
- #undef REAL_DBL |
240 |
-@@ -149,27 +150,27 @@ |
241 |
- #ifdef REAL_FLT |
242 |
- #define Real float |
243 |
- #define LongReal float |
244 |
--#define REAL FLOAT |
245 |
--#define LONGREAL FLOAT |
246 |
-+#define MESCHACH_REAL MESCHACH_FLOAT |
247 |
-+#define MESCHACH_LONGREAL MESCHACH_FLOAT |
248 |
- #endif |
249 |
- |
250 |
- /* double precision */ |
251 |
- #ifdef REAL_DBL |
252 |
- #define Real double |
253 |
- #define LongReal double |
254 |
--#define REAL DOUBLE |
255 |
--#define LONGREAL DOUBLE |
256 |
-+#define MESCHACH_REAL MESCHACH_DOUBLE |
257 |
-+#define MESCHACH_LONGREAL MESCHACH_DOUBLE |
258 |
- #endif |
259 |
- |
260 |
- |
261 |
- /* machine epsilon or unit roundoff error */ |
262 |
- /* This is correct on most IEEE Real precision systems */ |
263 |
- #ifdef DBL_EPSILON |
264 |
--#if REAL == DOUBLE |
265 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
266 |
- #define MACHEPS DBL_EPSILON |
267 |
--#elif REAL == FLOAT |
268 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
269 |
- #define MACHEPS FLT_EPSILON |
270 |
--#elif REAL == LONGDOUBLE |
271 |
-+#elif MESCHACH_REAL == MESCHACH_LONGDOUBLE |
272 |
- #define MACHEPS LDBL_EPSILON |
273 |
- #endif |
274 |
- #endif |
275 |
-@@ -178,11 +179,11 @@ |
276 |
- #undef D_MACHEPS |
277 |
- |
278 |
- #ifndef MACHEPS |
279 |
--#if REAL == DOUBLE |
280 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
281 |
- #define MACHEPS D_MACHEPS |
282 |
--#elif REAL == FLOAT |
283 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
284 |
- #define MACHEPS F_MACHEPS |
285 |
--#elif REAL == LONGDOUBLE |
286 |
-+#elif MESCHACH_REAL == MESCHACH_LONGDOUBLE |
287 |
- #define MACHEPS D_MACHEPS |
288 |
- #endif |
289 |
- #endif |
290 |
-@@ -208,12 +209,16 @@ |
291 |
- #endif |
292 |
- |
293 |
- /* for non-ANSI systems */ |
294 |
-+#ifndef HAVE_HUGE_VAL_H |
295 |
- #ifndef HUGE_VAL |
296 |
- #define HUGE_VAL HUGE |
297 |
- #else |
298 |
- #ifndef HUGE |
299 |
- #define HUGE HUGE_VAL |
300 |
- #endif |
301 |
-+#endif |
302 |
-+#else |
303 |
-+#define HUGE HUGE_VAL |
304 |
- #endif |
305 |
- |
306 |
- |
307 |
---- a/matlab.h |
308 |
-+++ b/matlab.h |
309 |
-@@ -66,9 +66,9 @@ |
310 |
- |
311 |
- #define ORDER ROW_ORDER |
312 |
- |
313 |
--#if REAL == DOUBLE |
314 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
315 |
- #define PRECISION DOUBLE_PREC |
316 |
--#elif REAL == FLOAT |
317 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
318 |
- #define PRECISION SINGLE_PREC |
319 |
- #endif |
320 |
- |
321 |
-@@ -90,7 +90,7 @@ |
322 |
- #endif |
323 |
- |
324 |
- /* complex variant */ |
325 |
--#ifdef COMPLEX |
326 |
-+#ifdef MESCHACH_COMPLEX |
327 |
- #include "zmatrix.h" |
328 |
- |
329 |
- #ifdef ANSI_C |
330 |
---- a/matrix.h |
331 |
-+++ b/matrix.h |
332 |
-@@ -384,11 +384,17 @@ |
333 |
- /* Initialisation routines -- to be zero, ones, random or identity */ |
334 |
- #ifndef ANSI_C |
335 |
- extern VEC *v_zero(), *v_rand(), *v_ones(); |
336 |
-+/* ANDO 01-13-99 */ |
337 |
-+extern VEC *v_init(); |
338 |
-+/* ODNA 01-13-99 */ |
339 |
- extern MAT *m_zero(), *m_ident(), *m_rand(), *m_ones(); |
340 |
- extern PERM *px_ident(); |
341 |
- extern IVEC *iv_zero(); |
342 |
- #else |
343 |
- extern VEC *v_zero(VEC *), *v_rand(VEC *), *v_ones(VEC *); |
344 |
-+/* ANDO 01-13-99 */ |
345 |
-+extern VEC *v_init(VEC*, Real); |
346 |
-+/* ODNA 01-13-99 */ |
347 |
- extern MAT *m_zero(MAT *), *m_ident(MAT *), *m_rand(MAT *), |
348 |
- *m_ones(MAT *); |
349 |
- extern PERM *px_ident(PERM *); |
350 |
---- a/matrixio.c |
351 |
-+++ b/matrixio.c |
352 |
-@@ -124,9 +124,9 @@ |
353 |
- { j--; dynamic = FALSE; goto redo2; } |
354 |
- if ( (*line == 'f' || *line == 'F') && j < n-1 ) |
355 |
- { j++; dynamic = FALSE; goto redo2; } |
356 |
--#if REAL == DOUBLE |
357 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
358 |
- } while ( *line=='\0' || sscanf(line,"%lf",&mat->me[i][j])<1 ); |
359 |
--#elif REAL == FLOAT |
360 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
361 |
- } while ( *line=='\0' || sscanf(line,"%f",&mat->me[i][j])<1 ); |
362 |
- #endif |
363 |
- fprintf(stderr,"Continue: "); |
364 |
-@@ -168,9 +168,9 @@ |
365 |
- if ( fscanf(fp," row %u:",&dummy) < 1 ) |
366 |
- error(E_FORMAT,"bm_finput"); |
367 |
- for ( j=0; j<n; j++ ) |
368 |
--#if REAL == DOUBLE |
369 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
370 |
- if ((io_code=fscanf(fp,"%lf",&mat->me[i][j])) < 1 ) |
371 |
--#elif REAL == FLOAT |
372 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
373 |
- if ((io_code=fscanf(fp,"%f",&mat->me[i][j])) < 1 ) |
374 |
- #endif |
375 |
- error(io_code==EOF ? 7 : 6,"bm_finput"); |
376 |
-@@ -337,9 +337,9 @@ |
377 |
- { i--; dynamic = FALSE; goto redo; } |
378 |
- if ( (*line == 'f' || *line == 'F') && i < dim-1 ) |
379 |
- { i++; dynamic = FALSE; goto redo; } |
380 |
--#if REAL == DOUBLE |
381 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
382 |
- } while ( *line=='\0' || sscanf(line,"%lf",&vec->ve[i]) < 1 ); |
383 |
--#elif REAL == FLOAT |
384 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
385 |
- } while ( *line=='\0' || sscanf(line,"%f",&vec->ve[i]) < 1 ); |
386 |
- #endif |
387 |
- |
388 |
-@@ -367,9 +367,9 @@ |
389 |
- /* get entries */ |
390 |
- skipjunk(fp); |
391 |
- for ( i=0; i<dim; i++ ) |
392 |
--#if REAL == DOUBLE |
393 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
394 |
- if ((io_code=fscanf(fp,"%lf",&vec->ve[i])) < 1 ) |
395 |
--#elif REAL == FLOAT |
396 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
397 |
- if ((io_code=fscanf(fp,"%f",&vec->ve[i])) < 1 ) |
398 |
- #endif |
399 |
- error(io_code==EOF ? 7 : 6,"bfin_vec"); |
400 |
---- a/meminfo.c |
401 |
-+++ b/meminfo.c |
402 |
-@@ -34,7 +34,7 @@ |
403 |
- #include <stdio.h> |
404 |
- #include "matrix.h" |
405 |
- #include "meminfo.h" |
406 |
--#ifdef COMPLEX |
407 |
-+#ifdef MESCHACH_COMPLEX |
408 |
- #include "zmatrix.h" |
409 |
- #endif |
410 |
- #ifdef SPARSE |
411 |
-@@ -60,7 +60,7 @@ |
412 |
- "SPROW", |
413 |
- "SPMAT" |
414 |
- #endif |
415 |
--#ifdef COMPLEX |
416 |
-+#ifdef MESCHACH_COMPLEX |
417 |
- ,"ZVEC", |
418 |
- "ZMAT" |
419 |
- #endif |
420 |
-@@ -86,7 +86,7 @@ |
421 |
- sprow_free, |
422 |
- sp_free |
423 |
- #endif |
424 |
--#ifdef COMPLEX |
425 |
-+#ifdef MESCHACH_COMPLEX |
426 |
- ,zv_free, |
427 |
- zm_free |
428 |
- #endif |
429 |
---- a/meminfo.h |
430 |
-+++ b/meminfo.h |
431 |
-@@ -58,7 +58,7 @@ |
432 |
- #define TYPE_SPMAT 7 |
433 |
- #endif |
434 |
- |
435 |
--#ifdef COMPLEX |
436 |
-+#ifdef MESCHACH_COMPLEX |
437 |
- #ifdef SPARSE |
438 |
- #define TYPE_ZVEC 8 |
439 |
- #define TYPE_ZMAT 9 |
440 |
---- a/memtort.c |
441 |
-+++ b/memtort.c |
442 |
-@@ -318,7 +318,7 @@ |
443 |
- } |
444 |
- #endif |
445 |
- |
446 |
--#ifdef COMPLEX |
447 |
-+#ifdef MESCHACH_COMPLEX |
448 |
- void stat_test4(par) |
449 |
- int par; |
450 |
- { |
451 |
-@@ -355,7 +355,7 @@ |
452 |
- IVEC *ix = IVNULL, *iy = IVNULL, *iz = IVNULL; |
453 |
- int m,n,i,j,deg,k; |
454 |
- Real s1,s2; |
455 |
--#ifdef COMPLEX |
456 |
-+#ifdef MESCHACH_COMPLEX |
457 |
- ZVEC *zx = ZVNULL, *zy = ZVNULL, *zz = ZVNULL; |
458 |
- ZMAT *zA = ZMNULL, *zB = ZMNULL, *zC = ZMNULL; |
459 |
- complex ONE; |
460 |
-@@ -580,7 +580,7 @@ |
461 |
- #endif /* SPARSE */ |
462 |
- |
463 |
- |
464 |
--#ifdef COMPLEX |
465 |
-+#ifdef MESCHACH_COMPLEX |
466 |
- /* complex stuff */ |
467 |
- |
468 |
- ONE = zmake(1.0,0.0); |
469 |
-@@ -629,7 +629,7 @@ |
470 |
- errmesg("ZMAT resize"); |
471 |
- |
472 |
- zm_free_vars(&zA,&zB,&zC,NULL); |
473 |
--#endif /* COMPLEX */ |
474 |
-+#endif /* MESCHACH_COMPLEX */ |
475 |
- |
476 |
- #endif /* if defined(ANSI_C) || defined(VARARGS) */ |
477 |
- |
478 |
-@@ -647,7 +647,7 @@ |
479 |
- mem_stat_mark(1); |
480 |
- for (i=0; i < 100; i++) { |
481 |
- stat_test1(i); |
482 |
--#ifdef COMPLEX |
483 |
-+#ifdef MESCHACH_COMPLEX |
484 |
- stat_test4(i); |
485 |
- #endif |
486 |
- } |
487 |
-@@ -671,7 +671,7 @@ |
488 |
- |
489 |
- for (i=0; i < 100; i++) { |
490 |
- stat_test1(i); |
491 |
--#ifdef COMPLEX |
492 |
-+#ifdef MESCHACH_COMPLEX |
493 |
- stat_test4(i); |
494 |
- #endif |
495 |
- } |
496 |
-@@ -727,9 +727,9 @@ |
497 |
- |
498 |
- mem_info(); |
499 |
- |
500 |
--#if REAL == FLOAT |
501 |
-+#if MESCHACH_REAL == MESCHACH_FLOAT |
502 |
- printf("# SINGLE PRECISION was used\n"); |
503 |
--#elif REAL == DOUBLE |
504 |
-+#elif MESCHACH_REAL == MESCHACH_DOUBLE |
505 |
- printf("# DOUBLE PRECISION was used\n"); |
506 |
- #endif |
507 |
- |
508 |
-@@ -744,9 +744,9 @@ |
509 |
- #ifdef ANSI_OR_VAR |
510 |
- |
511 |
- printf("# you should get: \n"); |
512 |
--#if (REAL == FLOAT) |
513 |
-+#if (MESCHACH_REAL == MESCHACH_FLOAT) |
514 |
- printf("# type VEC: 276 bytes allocated, 3 variables allocated\n"); |
515 |
--#elif (REAL == DOUBLE) |
516 |
-+#elif (MESCHACH_REAL == MESCHACH_DOUBLE) |
517 |
- printf("# type VEC: 516 bytes allocated, 3 variables allocated\n"); |
518 |
- #endif |
519 |
- printf("# and other types are zeros\n"); |
520 |
---- a/otherio.c |
521 |
-+++ b/otherio.c |
522 |
-@@ -130,9 +130,9 @@ |
523 |
- if ( ! isatty(fileno(fp)) ) |
524 |
- { |
525 |
- skipjunk(fp); |
526 |
--#if REAL == DOUBLE |
527 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
528 |
- if ( (retcode=fscanf(fp,"%lf",&x)) == EOF ) |
529 |
--#elif REAL == FLOAT |
530 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
531 |
- if ( (retcode=fscanf(fp,"%f",&x)) == EOF ) |
532 |
- #endif |
533 |
- error(E_INPUT,"fin_double"); |
534 |
-@@ -148,9 +148,9 @@ |
535 |
- fprintf(stderr,"%s: ",s); |
536 |
- if ( fgets(scratch,MAXLINE,stdin)==NULL ) |
537 |
- error(E_INPUT,"fin_double"); |
538 |
--#if REAL == DOUBLE |
539 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
540 |
- retcode = sscanf(scratch,"%lf",&x); |
541 |
--#elif REAL == FLOAT |
542 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
543 |
- retcode = sscanf(scratch,"%f",&x); |
544 |
- #endif |
545 |
- if ( ( retcode==1 && low > high ) || |
546 |
---- a/rk4.dat |
547 |
-+++ b/rk4.dat |
548 |
-@@ -1,12 +0,0 @@ |
549 |
--# No. of a problem |
550 |
--1 |
551 |
--# Initial time |
552 |
--0 |
553 |
--# Final time |
554 |
--1 |
555 |
--# Solution is x(t) = (cos(t),-sin(t)) |
556 |
--# x(0) = |
557 |
--Vector: dim: 2 |
558 |
--1 0 |
559 |
--# Step size |
560 |
--0.1 |
561 |
---- a/sparse.c |
562 |
-+++ b/sparse.c |
563 |
-@@ -61,25 +61,33 @@ |
564 |
- return r->elt[idx].val; |
565 |
- } |
566 |
- |
567 |
-+void _set(d, s) double* d; double s; { *d = s; } |
568 |
-+void _inc(d, s) double* d; double s; { *d += s; } |
569 |
-+void _dec(d, s) double* d; double s; { *d -= s; } |
570 |
-+ |
571 |
- /* sp_set_val -- sets the (i,j) entry of the sparse matrix A */ |
572 |
--double sp_set_val(A,i,j,val) |
573 |
-+double sp_set_val_(A,i,j,val,f) |
574 |
- SPMAT *A; |
575 |
- int i, j; |
576 |
- double val; |
577 |
-+void (*f)(double*, double); |
578 |
- { |
579 |
- SPROW *r; |
580 |
- int idx, idx2, new_len; |
581 |
- |
582 |
- if ( A == SMNULL ) |
583 |
-- error(E_NULL,"sp_set_val"); |
584 |
-+ error(E_NULL,"sp_set_val_"); |
585 |
- if ( i < 0 || i >= A->m || j < 0 || j >= A->n ) |
586 |
-- error(E_SIZES,"sp_set_val"); |
587 |
-+ error(E_SIZES,"sp_set_val_"); |
588 |
- |
589 |
- r = A->row+i; |
590 |
- idx = sprow_idx(r,j); |
591 |
-- /* printf("sp_set_val: idx = %d\n",idx); */ |
592 |
-+ /* printf("sp_set_val_: idx = %d\n",idx); */ |
593 |
- if ( idx >= 0 ) |
594 |
-- { r->elt[idx].val = val; return val; } |
595 |
-+ { |
596 |
-+ (*f)(&(r->elt[idx].val), val); |
597 |
-+ return r->elt[idx].val; |
598 |
-+ } |
599 |
- /* else */ if ( idx < -1 ) |
600 |
- { |
601 |
- /* Note: this destroys the column & diag access paths */ |
602 |
-@@ -97,7 +105,7 @@ |
603 |
- |
604 |
- r->elt = RENEW(r->elt,new_len,row_elt); |
605 |
- if ( ! r->elt ) /* can't allocate */ |
606 |
-- error(E_MEM,"sp_set_val"); |
607 |
-+ error(E_MEM,"sp_set_val_"); |
608 |
- r->maxlen = 2*r->maxlen+1; |
609 |
- } |
610 |
- for ( idx2 = r->len-1; idx2 >= idx; idx2-- ) |
611 |
-@@ -110,12 +118,40 @@ |
612 |
- ************************************************************/ |
613 |
- r->len++; |
614 |
- r->elt[idx].col = j; |
615 |
-+ |
616 |
-+ /* sbagliato |
617 |
-+ (*f)(&(r->elt[idx].val), val); |
618 |
-+ */ |
619 |
- return r->elt[idx].val = val; |
620 |
- } |
621 |
- /* else -- idx == -1, error in index/matrix! */ |
622 |
- return 0.0; |
623 |
- } |
624 |
- |
625 |
-+double sp_set_val(A,i,j,val) |
626 |
-+SPMAT *A; |
627 |
-+int i, j; |
628 |
-+double val; |
629 |
-+{ |
630 |
-+ return sp_set_val_(A, i, j, val, _set); |
631 |
-+} |
632 |
-+ |
633 |
-+double sp_inc_val(A,i,j,val) |
634 |
-+SPMAT *A; |
635 |
-+int i, j; |
636 |
-+double val; |
637 |
-+{ |
638 |
-+ return sp_set_val_(A, i, j, val, _inc); |
639 |
-+} |
640 |
-+ |
641 |
-+double sp_dec_val(A,i,j,val) |
642 |
-+SPMAT *A; |
643 |
-+int i, j; |
644 |
-+double val; |
645 |
-+{ |
646 |
-+ return sp_set_val_(A, i, j, val, _dec); |
647 |
-+} |
648 |
-+ |
649 |
- /* sp_mv_mlt -- sparse matrix/dense vector multiply |
650 |
- -- result is in out, which is returned unless out==NULL on entry |
651 |
- -- if out==NULL on entry then the result vector is created */ |
652 |
-@@ -612,16 +648,17 @@ |
653 |
- { |
654 |
- int i; |
655 |
- |
656 |
-- if ( ! A ) |
657 |
-- error(E_NULL,"sp_smlt"); |
658 |
-- if ( ! B ) |
659 |
-- B = sp_get(A->m,A->n,5); |
660 |
-- else |
661 |
-- if ( A->m != B->m || A->n != B->n ) |
662 |
-- error(E_SIZES,"sp_smlt"); |
663 |
-+ if (!A) { |
664 |
-+ error(E_NULL, "sp_smlt"); |
665 |
-+ } |
666 |
-+ if (!B) { |
667 |
-+ B = sp_get(A->m, A->n, 5); |
668 |
-+ } else if (A->m != B->m || A->n != B->n) { |
669 |
-+ error(E_SIZES, "sp_smlt"); |
670 |
-+ } |
671 |
- |
672 |
-- for (i=0; i < A->m; i++) { |
673 |
-- sprow_smlt(&(A->row[i]),alpha,0,&(B->row[i]),TYPE_SPMAT); |
674 |
-+ for (i = A->m; i-- > 0; ) { |
675 |
-+ sprow_smlt(&(A->row[i]), alpha, 0, &(B->row[i]), TYPE_SPMAT); |
676 |
- } |
677 |
- return B; |
678 |
- } |
679 |
-@@ -635,15 +672,16 @@ |
680 |
- int i, idx, len; |
681 |
- row_elt *elt; |
682 |
- |
683 |
-- if ( ! A ) |
684 |
-- error(E_NULL,"sp_zero"); |
685 |
-+ if ( ! A ) { |
686 |
-+ error(E_NULL,"sp_zero"); |
687 |
-+ } |
688 |
- |
689 |
-- for ( i = 0; i < A->m; i++ ) |
690 |
-- { |
691 |
-+ for ( i = A->m; i-- > 0; ) { |
692 |
- elt = A->row[i].elt; |
693 |
- len = A->row[i].len; |
694 |
-- for ( idx = 0; idx < len; idx++ ) |
695 |
-- (*elt++).val = 0.0; |
696 |
-+ for ( idx = len; idx-- > 0; ) { |
697 |
-+ (*elt++).val = 0.; |
698 |
-+ } |
699 |
- } |
700 |
- |
701 |
- return A; |
702 |
---- a/sparse.h |
703 |
-+++ b/sparse.h |
704 |
-@@ -63,11 +63,12 @@ |
705 |
- This starts the chain down the columns using the nxt_row and nxt_idx |
706 |
- fields of each entry in each row. */ |
707 |
- |
708 |
--typedef struct pair { int pos; Real val; } pair; |
709 |
-+typedef struct meschach_pair { int pos; Real val; } meschach_pair; |
710 |
- |
711 |
- typedef struct SPVEC { |
712 |
- int dim, max_dim; |
713 |
-- pair *elt; /* elt[max_dim] */ |
714 |
-+ struct { int pos; Real val; } *elt; |
715 |
-+ /* meschach_pair *elt; */ /* elt[max_dim] */ |
716 |
- } SPVEC; |
717 |
- |
718 |
- #define SMNULL ((SPMAT*)NULL) |
719 |
-@@ -98,6 +99,9 @@ |
720 |
- extern SPMAT *sp_get(), *sp_copy(), *sp_copy2(), |
721 |
- *sp_zero(), *sp_resize(), *sp_compact(); |
722 |
- extern double sp_get_val(), sp_set_val(); |
723 |
-+/* ANDO 01-10-99 */ |
724 |
-+extern double sp_inc_val(), sp_dec_val(); |
725 |
-+/* ANDO 01-10-99 */ |
726 |
- extern VEC *sp_mv_mlt(), *sp_vm_mlt(); |
727 |
- extern int sp_free(); |
728 |
- |
729 |
-@@ -132,6 +136,9 @@ |
730 |
- *sp_zero(SPMAT *), *sp_resize(SPMAT *,int,int), |
731 |
- *sp_compact(SPMAT *,double); |
732 |
- double sp_get_val(SPMAT *,int,int), sp_set_val(SPMAT *,int,int,double); |
733 |
-+/* ANDO 01-10-99 */ |
734 |
-+double sp_inc_val(SPMAT *,int,int,double), sp_dec_val(SPMAT *,int,int,double); |
735 |
-+/* ANDO 01-10-99 */ |
736 |
- VEC *sp_mv_mlt(SPMAT *,VEC *,VEC *), *sp_vm_mlt(SPMAT *,VEC *,VEC *); |
737 |
- int sp_free(SPMAT *); |
738 |
- |
739 |
---- a/sparseio.c |
740 |
-+++ b/sparseio.c |
741 |
-@@ -222,9 +222,9 @@ |
742 |
- error(E_INPUT,"sp_finput"); |
743 |
- if ( *line == 'e' || *line == 'E' ) |
744 |
- break; |
745 |
--#if REAL == DOUBLE |
746 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
747 |
- } while ( sscanf(line,"%u %lf",&col,&val) != 2 || |
748 |
--#elif REAL == FLOAT |
749 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
750 |
- } while ( sscanf(line,"%u %f",&col,&val) != 2 || |
751 |
- #endif |
752 |
- col >= n || col <= curr_col ); |
753 |
-@@ -282,9 +282,9 @@ |
754 |
- curr_col = -1; |
755 |
- for ( len = 0; len < MAXSCRATCH; len++ ) |
756 |
- { |
757 |
--#if REAL == DOUBLE |
758 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
759 |
- if ( (ret_val=fscanf(fp,"%u : %lf",&col,&val)) != 2 ) |
760 |
--#elif REAL == FLOAT |
761 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
762 |
- if ( (ret_val=fscanf(fp,"%u : %f",&col,&val)) != 2 ) |
763 |
- #endif |
764 |
- break; |
765 |
---- a/splufctr.c |
766 |
-+++ b/splufctr.c |
767 |
-@@ -56,21 +56,27 @@ |
768 |
- Real max_val, tmp; |
769 |
- static VEC *col_vals=VNULL; |
770 |
- |
771 |
-- if ( ! A || ! px ) |
772 |
-+ if ( ! A || ! px ) { |
773 |
- error(E_NULL,"spLUfctr"); |
774 |
-- if ( alpha <= 0.0 || alpha > 1.0 ) |
775 |
-+ } |
776 |
-+ if ( alpha <= 0.0 || alpha > 1.0 ) { |
777 |
- error(E_RANGE,"alpha in spLUfctr"); |
778 |
-- if ( px->size <= A->m ) |
779 |
-+ } |
780 |
-+ if ( px->size <= A->m ) { |
781 |
- px = px_resize(px,A->m); |
782 |
-+ } |
783 |
- px_ident(px); |
784 |
- col_vals = v_resize(col_vals,A->m); |
785 |
- MEM_STAT_REG(col_vals,TYPE_VEC); |
786 |
- |
787 |
-- m = A->m; n = A->n; |
788 |
-- if ( ! A->flag_col ) |
789 |
-+ m = A->m; |
790 |
-+ n = A->n; |
791 |
-+ if ( ! A->flag_col ) { |
792 |
- sp_col_access(A); |
793 |
-- if ( ! A->flag_diag ) |
794 |
-+ } |
795 |
-+ if ( ! A->flag_diag ) { |
796 |
- sp_diag_access(A); |
797 |
-+ } |
798 |
- A->flag_col = A->flag_diag = FALSE; |
799 |
- if ( ! merge ) { |
800 |
- merge = sprow_get(20); |
801 |
-@@ -87,25 +93,29 @@ |
802 |
- { |
803 |
- r = &(A->row[i]); |
804 |
- idx = sprow_idx(r,k); |
805 |
-- if ( idx < 0 ) |
806 |
-+ if ( idx < 0 ) { |
807 |
- tmp = 0.0; |
808 |
-- else |
809 |
-+ } else { |
810 |
- tmp = r->elt[idx].val; |
811 |
-- if ( fabs(tmp) > max_val ) |
812 |
-+ } |
813 |
-+ if ( fabs(tmp) > max_val ) { |
814 |
- max_val = fabs(tmp); |
815 |
-+ } |
816 |
- col_vals->ve[i] = tmp; |
817 |
- } |
818 |
- |
819 |
-- if ( max_val == 0.0 ) |
820 |
-+ if ( max_val == 0.0 ) { |
821 |
- continue; |
822 |
-+ } |
823 |
- |
824 |
- best_len = n+1; /* only if no possibilities */ |
825 |
- best_i = -1; |
826 |
- for ( i = k; i < m; i++ ) |
827 |
- { |
828 |
- tmp = fabs(col_vals->ve[i]); |
829 |
-- if ( tmp == 0.0 ) |
830 |
-+ if ( tmp == 0.0 ) { |
831 |
- continue; |
832 |
-+ } |
833 |
- if ( tmp >= alpha*max_val ) |
834 |
- { |
835 |
- r = &(A->row[i]); |
836 |
-@@ -171,17 +181,21 @@ |
837 |
- SPROW *r; |
838 |
- row_elt *elt; |
839 |
- |
840 |
-- if ( ! A || ! b ) |
841 |
-+ if ( ! A || ! b ) { |
842 |
- error(E_NULL,"spLUsolve"); |
843 |
-- if ( (pivot != PNULL && A->m != pivot->size) || A->m != b->dim ) |
844 |
-+ } |
845 |
-+ if ( (pivot != PNULL && A->m != pivot->size) || A->m != b->dim ) { |
846 |
- error(E_SIZES,"spLUsolve"); |
847 |
-- if ( ! x || x->dim != A->n ) |
848 |
-+ } |
849 |
-+ if ( ! x || x->dim != A->n ) { |
850 |
- x = v_resize(x,A->n); |
851 |
-+ } |
852 |
- |
853 |
-- if ( pivot != PNULL ) |
854 |
-+ if ( pivot != PNULL ) { |
855 |
- x = px_vec(pivot,b,x); |
856 |
-- else |
857 |
-+ } else { |
858 |
- x = v_copy(b,x); |
859 |
-+ } |
860 |
- |
861 |
- x_ve = x->ve; |
862 |
- lim = min(A->m,A->n); |
863 |
-@@ -191,21 +205,24 @@ |
864 |
- r = &(A->row[i]); |
865 |
- len = r->len; |
866 |
- elt = r->elt; |
867 |
-- for ( idx = 0; idx < len && elt->col < i; idx++, elt++ ) |
868 |
-+ for ( idx = 0; idx < len && elt->col < i; idx++, elt++ ) { |
869 |
- sum -= elt->val*x_ve[elt->col]; |
870 |
-+ } |
871 |
- x_ve[i] = sum; |
872 |
- } |
873 |
- |
874 |
-- for ( i = lim-1; i >= 0; i-- ) |
875 |
-+ for ( i = lim; i-- > 0; ) |
876 |
- { |
877 |
- sum = x_ve[i]; |
878 |
- r = &(A->row[i]); |
879 |
- len = r->len; |
880 |
- elt = &(r->elt[len-1]); |
881 |
-- for ( idx = len-1; idx >= 0 && elt->col > i; idx--, elt-- ) |
882 |
-+ for ( idx = len-1; idx >= 0 && elt->col > i; idx--, elt-- ) { |
883 |
- sum -= elt->val*x_ve[elt->col]; |
884 |
-- if ( idx < 0 || elt->col != i || elt->val == 0.0 ) |
885 |
-+ } |
886 |
-+ if ( idx < 0 || elt->col != i || elt->val == 0.0 ) { |
887 |
- error(E_SING,"spLUsolve"); |
888 |
-+ } |
889 |
- x_ve[i] = sum/elt->val; |
890 |
- } |
891 |
- |
892 |
---- a/sptort.c |
893 |
-+++ b/sptort.c |
894 |
-@@ -39,9 +39,9 @@ |
895 |
- |
896 |
- /* for iterative methods */ |
897 |
- |
898 |
--#if REAL == DOUBLE |
899 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
900 |
- #define EPS 1e-7 |
901 |
--#elif REAL == FLOAT |
902 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
903 |
- #define EPS 1e-3 |
904 |
- #endif |
905 |
- |
906 |
---- a/zmatio.c |
907 |
-+++ b/zmatio.c |
908 |
-@@ -53,18 +53,18 @@ |
909 |
- fprintf(stderr,"real and imag parts: "); |
910 |
- if ( fgets(line,MAXLINE,fp) == NULL ) |
911 |
- error(E_EOF,"z_finput"); |
912 |
--#if REAL == DOUBLE |
913 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
914 |
- io_code = sscanf(line,"%lf%lf",&z.re,&z.im); |
915 |
--#elif REAL == FLOAT |
916 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
917 |
- io_code = sscanf(line,"%f%f",&z.re,&z.im); |
918 |
- #endif |
919 |
- |
920 |
- } while ( io_code != 2 ); |
921 |
- } |
922 |
- else |
923 |
--#if REAL == DOUBLE |
924 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
925 |
- if ( (io_code=fscanf(fp," (%lf,%lf)",&z.re,&z.im)) < 2 ) |
926 |
--#elif REAL == FLOAT |
927 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
928 |
- if ( (io_code=fscanf(fp," (%f,%f)",&z.re,&z.im)) < 2 ) |
929 |
- #endif |
930 |
- error((io_code == EOF) ? E_EOF : E_FORMAT,"z_finput"); |
931 |
-@@ -129,9 +129,9 @@ |
932 |
- if ( (*line == 'f' || *line == 'F') && j < n-1 ) |
933 |
- { j++; dynamic = FALSE; goto redo2; } |
934 |
- } while ( *line=='\0' || |
935 |
--#if REAL == DOUBLE |
936 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
937 |
- sscanf(line,"%lf%lf", |
938 |
--#elif REAL == FLOAT |
939 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
940 |
- sscanf(line,"%f%f", |
941 |
- #endif |
942 |
- &mat->me[i][j].re,&mat->me[i][j].im)<1 ); |
943 |
-@@ -176,9 +176,9 @@ |
944 |
- for ( j=0; j<n; j++ ) |
945 |
- { |
946 |
- /* printf("bzm_finput: j = %d\n", j); */ |
947 |
--#if REAL == DOUBLE |
948 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
949 |
- if ((io_code=fscanf(fp," ( %lf , %lf )", |
950 |
--#elif REAL == FLOAT |
951 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
952 |
- if ((io_code=fscanf(fp," ( %f , %f )", |
953 |
- #endif |
954 |
- &mat->me[i][j].re,&mat->me[i][j].im)) < 2 ) |
955 |
-@@ -239,9 +239,9 @@ |
956 |
- if ( (*line == 'f' || *line == 'F') && i < dim-1 ) |
957 |
- { i++; dynamic = FALSE; goto redo; } |
958 |
- } while ( *line=='\0' || |
959 |
--#if REAL == DOUBLE |
960 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
961 |
- sscanf(line,"%lf%lf", |
962 |
--#elif REAL == FLOAT |
963 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
964 |
- sscanf(line,"%f%f", |
965 |
- #endif |
966 |
- &vec->ve[i].re,&vec->ve[i].im) < 2 ); |
967 |
-@@ -271,9 +271,9 @@ |
968 |
- /* get entries */ |
969 |
- skipjunk(fp); |
970 |
- for ( i=0; i<dim; i++ ) |
971 |
--#if REAL == DOUBLE |
972 |
-+#if MESCHACH_REAL == MESCHACH_DOUBLE |
973 |
- if ((io_code=fscanf(fp," (%lf,%lf)", |
974 |
--#elif REAL == FLOAT |
975 |
-+#elif MESCHACH_REAL == MESCHACH_FLOAT |
976 |
- if ((io_code=fscanf(fp," (%f,%f)", |
977 |
- #endif |
978 |
- &vec->ve[i].re,&vec->ve[i].im)) < 2 ) |
979 |
|
980 |
diff --git a/sci-libs/meschach/files/meschach-makefile.patch b/sci-libs/meschach/files/meschach-makefile.patch |
981 |
deleted file mode 100644 |
982 |
index 701c91246..000000000 |
983 |
--- a/sci-libs/meschach/files/meschach-makefile.patch |
984 |
+++ /dev/null |
985 |
@@ -1,156 +0,0 @@ |
986 |
---- a/configure.in |
987 |
-+++ b/configure.in |
988 |
-@@ -44,14 +44,15 @@ |
989 |
- # and has a different meaning for keyword "complex"! Drew Parsons, 2001. |
990 |
- ##AC_HEADER_CHECK(complex.h, AC_DEFINE(HAVE_COMPLEX_H),) |
991 |
- AC_HEADER_CHECK(malloc.h, AC_DEFINE(HAVE_MALLOC_H),) |
992 |
-+AC_HEADER_CHECK(huge_val.h, AC_DEFINE(HAVE_HUGE_VAL_H),) |
993 |
- AC_HEADER_CHECK(varargs.h, AC_DEFINE(VARARGS),) |
994 |
- AC_DEFINE(NOT_SEGMENTED) |
995 |
- AC_SIZE_T |
996 |
- AC_CONST |
997 |
- AC_WORDS_BIGENDIAN |
998 |
--AC_WITH(complex, AC_DEFINE(COMPLEX)) |
999 |
-+AC_WITH(complex, AC_DEFINE(MESCHACH_COMPLEX)) |
1000 |
- AC_WITH(sparse, AC_DEFINE(SPARSE)) |
1001 |
--AC_WITH(all, AC_DEFINE(COMPLEX)) |
1002 |
-+AC_WITH(all, AC_DEFINE(MESCHACH_COMPLEX)) |
1003 |
- AC_WITH(all, AC_DEFINE(SPARSE)) |
1004 |
- AC_WITH(unroll, AC_DEFINE(VUNROLL)) |
1005 |
- AC_WITH(munroll, AC_DEFINE(MUNROLL)) |
1006 |
---- a/makefile.in |
1007 |
-+++ b/makefile.in |
1008 |
-@@ -18,8 +18,7 @@ |
1009 |
- LIBS = @LIBS@ |
1010 |
- RANLIB = @RANLIB@ |
1011 |
- |
1012 |
-- |
1013 |
--CFLAGS = -O3 -fPIC |
1014 |
-+CFLAGS += -fPIC |
1015 |
- |
1016 |
- |
1017 |
- .c.o: |
1018 |
-@@ -68,7 +67,7 @@ |
1019 |
- |
1020 |
- # Different configurations |
1021 |
- # the dependencies **between** the parts are for dmake |
1022 |
--all: shared static |
1023 |
-+all: shared |
1024 |
- #all: @PROGS@ part1 part2 part3 zpart1 zpart2 shared |
1025 |
- part2: part1 |
1026 |
- part3: part2 |
1027 |
-@@ -77,50 +76,10 @@ |
1028 |
- zpart2: zpart1 |
1029 |
- complex: part1 part2 zpart1 zpart2 |
1030 |
- |
1031 |
-+shared: libmeschach.so |
1032 |
- |
1033 |
--$(LIST1): $(HBASE) |
1034 |
--part1: $(LIST1) |
1035 |
-- ar ru libmeschach.a $(LIST1) |
1036 |
-- $(RANLIB) libmeschach.a |
1037 |
--# $(CC) -shared -o libmeschach.so $(LIST1) |
1038 |
-- |
1039 |
--$(LIST2): $(HBASE) matrix2.h |
1040 |
--part2: $(LIST2) |
1041 |
-- ar ru libmeschach.a $(LIST2) |
1042 |
-- $(RANLIB) libmeschach.a |
1043 |
--# $(CC) -shared -o libmeschach.so $(LIST2) |
1044 |
-- |
1045 |
--$(LIST3): $(HBASE) sparse.h sparse2.h |
1046 |
--part3: $(LIST3) |
1047 |
-- ar ru libmeschach.a $(LIST3) |
1048 |
-- $(RANLIB) libmeschach.a |
1049 |
--# $(CC) -shared -o libmeschach.so $(LIST3) |
1050 |
-- |
1051 |
--$(ZLIST1): $(HBASDE) zmatrix.h |
1052 |
--zpart1: $(ZLIST1) |
1053 |
-- ar ru libmeschach.a $(ZLIST1) |
1054 |
-- $(RANLIB) libmeschach.a |
1055 |
--# $(CC) -shared -o libmeschach.so $(ZLIST1) |
1056 |
-- |
1057 |
--$(ZLIST2): $(HBASE) zmatrix.h zmatrix2.h |
1058 |
--zpart2: $(ZLIST2) |
1059 |
-- ar ru libmeschach.a $(ZLIST2) |
1060 |
-- $(RANLIB) libmeschach.a |
1061 |
--# $(CC) -shared -o libmeschach.so $(ZLIST2) |
1062 |
-- |
1063 |
--$(OLDLIST): $(HBASE) sparse.h sparse2.h |
1064 |
--oldpart: $(OLDLIST) |
1065 |
-- ar ru libmeschach.a $(OLDLIST) |
1066 |
-- $(RANLIB) libmeschach.a |
1067 |
--# $(CC) -shared -o libmeschach.so $(OLDLIST) |
1068 |
-- |
1069 |
--shared: $(ALL_LISTS) |
1070 |
-- $(CC) -shared -o libmeschach.so $(ALL_LISTS) -lc -lm -Wl,-soname -Wl,libmeschach.so.$(vers) |
1071 |
-- |
1072 |
--static: $(ALL_LISTS) |
1073 |
-- ar ru libmeschach.a $(ALL_LISTS) |
1074 |
-- $(RANLIB) libmeschach.a |
1075 |
-- |
1076 |
-+libmeschach.so: $(ALL_LISTS) |
1077 |
-+ $(CC) $(LDFLAGS) -shared -o libmeschach.so $(ALL_LISTS) -lc -lm -Wl,-soname -Wl,libmeschach.so.$(vers) |
1078 |
- |
1079 |
- ####################################### |
1080 |
- |
1081 |
-@@ -199,32 +158,32 @@ |
1082 |
- |
1083 |
- alltorture: torture sptort ztorture memtort itertort mfuntort iotort |
1084 |
- |
1085 |
--torture:torture.o libmeschach.a |
1086 |
-- $(CC) $(CFLAGS) $(DEFS) -o torture torture.o \ |
1087 |
-- libmeschach.a $(LIBS) |
1088 |
--sptort:sptort.o libmeschach.a |
1089 |
-- $(CC) $(CFLAGS) $(DEFS) -o sptort sptort.o \ |
1090 |
-- libmeschach.a $(LIBS) |
1091 |
--memtort: memtort.o libmeschach.a |
1092 |
-- $(CC) $(CFLAGS) $(DEFS) -o memtort memtort.o \ |
1093 |
-- libmeschach.a $(LIBS) |
1094 |
--ztorture:ztorture.o libmeschach.a |
1095 |
-- $(CC) $(CFLAGS) $(DEFS) -o ztorture ztorture.o \ |
1096 |
-- libmeschach.a $(LIBS) |
1097 |
--itertort: itertort.o libmeschach.a |
1098 |
-- $(CC) $(CFLAGS) $(DEFS) -o itertort itertort.o \ |
1099 |
-- libmeschach.a $(LIBS) |
1100 |
-- |
1101 |
--iotort: iotort.o libmeschach.a |
1102 |
-- $(CC) $(CFLAGS) $(DEFS) -o iotort iotort.o \ |
1103 |
-- libmeschach.a $(LIBS) |
1104 |
--mfuntort: mfuntort.o libmeschach.a |
1105 |
-- $(CC) $(CFLAGS) $(DEFS) -o mfuntort mfuntort.o \ |
1106 |
-- libmeschach.a $(LIBS) |
1107 |
--tstmove: tstmove.o libmeschach.a |
1108 |
-- $(CC) $(CFLAGS) $(DEFS) -o tstmove tstmove.o \ |
1109 |
-- libmeschach.a $(LIBS) |
1110 |
--tstpxvec: tstpxvec.o libmeschach.a |
1111 |
-- $(CC) $(CFLAGS) $(DEFS) -o tstpxvec tstpxvec.o \ |
1112 |
-- libmeschach.a $(LIBS) |
1113 |
-+torture:torture.o libmeschach.so |
1114 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o torture torture.o \ |
1115 |
-+ -lmeschach -L. $(LIBS) |
1116 |
-+sptort:sptort.o libmeschach.so |
1117 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o sptort sptort.o \ |
1118 |
-+ -lmeschach -L. $(LIBS) |
1119 |
-+memtort: memtort.o libmeschach.so |
1120 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o memtort memtort.o \ |
1121 |
-+ -lmeschach -L. $(LIBS) |
1122 |
-+ztorture:ztorture.o libmeschach.so |
1123 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o ztorture ztorture.o \ |
1124 |
-+ -lmeschach -L. $(LIBS) |
1125 |
-+itertort: itertort.o libmeschach.so |
1126 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o itertort itertort.o \ |
1127 |
-+ -lmeschach -L. $(LIBS) |
1128 |
-+ |
1129 |
-+iotort: iotort.o libmeschach.so |
1130 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o iotort iotort.o \ |
1131 |
-+ -lmeschach -L. $(LIBS) |
1132 |
-+mfuntort: mfuntort.o libmeschach.so |
1133 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o mfuntort mfuntort.o \ |
1134 |
-+ -lmeschach -L. $(LIBS) |
1135 |
-+tstmove: tstmove.o libmeschach.so |
1136 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o tstmove tstmove.o \ |
1137 |
-+ -lmeschach -L. $(LIBS) |
1138 |
-+tstpxvec: tstpxvec.o libmeschach.so |
1139 |
-+ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) -fPIE -o tstpxvec tstpxvec.o \ |
1140 |
-+ -lmeschach -L. $(LIBS) |
1141 |
- |
1142 |
|
1143 |
diff --git a/sci-libs/meschach/meschach-1.2b.ebuild b/sci-libs/meschach/meschach-1.2b.ebuild |
1144 |
deleted file mode 100644 |
1145 |
index d973fb63a..000000000 |
1146 |
--- a/sci-libs/meschach/meschach-1.2b.ebuild |
1147 |
+++ /dev/null |
1148 |
@@ -1,84 +0,0 @@ |
1149 |
-# Copyright 1999-2021 Gentoo Authors |
1150 |
-# Distributed under the terms of the GNU General Public License v2 |
1151 |
- |
1152 |
-EAPI="7" |
1153 |
- |
1154 |
-inherit autotools eutils toolchain-funcs |
1155 |
- |
1156 |
-MAJOR="$(ver_cut 1)" |
1157 |
-VERSION="$(ver_cut 1-2)" |
1158 |
- |
1159 |
-DESCRIPTION="Meschach is a C-language library of routines for performing matrix computations" |
1160 |
-HOMEPAGE="http://homepage.divms.uiowa.edu/~dstewart/meschach" |
1161 |
-SRC_URI=" |
1162 |
- http://cdn-fastly.deb.debian.org/debian/pool/main/m/meschach/${PN}_${PV}.orig.tar.gz |
1163 |
- http://cdn-fastly.deb.debian.org/debian/pool/main/m/meschach/${PN}_${PV}-14.debian.tar.xz |
1164 |
-" |
1165 |
-LICENSE="meschach" |
1166 |
-SLOT="0" |
1167 |
-KEYWORDS="~amd64" |
1168 |
- |
1169 |
-IUSE="complex +double float munroll old segmem sparse unroll" |
1170 |
-REQUIRED_USE=" |
1171 |
- ^^ ( double float ) |
1172 |
-" |
1173 |
- |
1174 |
-PATCHES=( |
1175 |
- "${WORKDIR}/debian/patches/${PN}_${PV}-13.diff" |
1176 |
- "${WORKDIR}/debian/patches/${PN}_${PV}-13.configure.diff" |
1177 |
- "${FILESDIR}/configure.patch" |
1178 |
- "${FILESDIR}/${PN}-2-mbdyn.diff" |
1179 |
- "${FILESDIR}/${PN}-makefile.patch" |
1180 |
-) |
1181 |
- |
1182 |
-src_prepare() { |
1183 |
- default |
1184 |
- mv configure.in configure.ac || die |
1185 |
- use old && sed -i -- 's/all: shared static/all: oldpart shared static/g' makefile.ac |
1186 |
- tc-export AR CC |
1187 |
- eautoreconf |
1188 |
-} |
1189 |
- |
1190 |
-src_configure() { |
1191 |
- myconf=( |
1192 |
- $(use_with complex) |
1193 |
- $(use_with double) |
1194 |
- $(use_with float) |
1195 |
- $(use_with munroll) |
1196 |
- $(use_with segmem) |
1197 |
- $(use_with sparse) |
1198 |
- $(use_with unroll) |
1199 |
- ) |
1200 |
- econf "${myconf[@]}" |
1201 |
-} |
1202 |
- |
1203 |
-src_compile() { |
1204 |
- emake vers="${VERSION}" all |
1205 |
- emake alltorture |
1206 |
-} |
1207 |
- |
1208 |
-src_install() { |
1209 |
- ln -s "lib${PN}.so" "lib${PN}.so.${MAJOR}" || die |
1210 |
- ln -s "lib${PN}.so.${MAJOR}" "lib${PN}.so.${VERSION}" || die |
1211 |
- dolib.so "lib${PN}.so" |
1212 |
- dolib.so "lib${PN}.so.${MAJOR}" |
1213 |
- dolib.so "lib${PN}.so.${VERSION}" |
1214 |
- |
1215 |
- insinto "/usr/include/${PN}" |
1216 |
- doins *.h |
1217 |
- |
1218 |
- exeinto "/usr/libexec/${PN}" |
1219 |
- doexe iotort |
1220 |
- doexe itertort |
1221 |
- doexe memtort |
1222 |
- doexe mfuntort |
1223 |
- doexe sptort |
1224 |
- doexe torture |
1225 |
- doexe ztorture |
1226 |
- |
1227 |
- insinto "/usr/share/${P}" |
1228 |
- doins *.dat |
1229 |
- |
1230 |
- dodoc -r DOC/. |
1231 |
- einstalldocs |
1232 |
-} |
1233 |
|
1234 |
diff --git a/sci-libs/meschach/meschach-1.2b_p20170511.ebuild b/sci-libs/meschach/meschach-1.2b_p20170511-r1.ebuild |
1235 |
similarity index 84% |
1236 |
rename from sci-libs/meschach/meschach-1.2b_p20170511.ebuild |
1237 |
rename to sci-libs/meschach/meschach-1.2b_p20170511-r1.ebuild |
1238 |
index 8ddb5297b..062d2c971 100644 |
1239 |
--- a/sci-libs/meschach/meschach-1.2b_p20170511.ebuild |
1240 |
+++ b/sci-libs/meschach/meschach-1.2b_p20170511-r1.ebuild |
1241 |
@@ -1,7 +1,7 @@ |
1242 |
# Copyright 1999-2021 Gentoo Authors |
1243 |
# Distributed under the terms of the GNU General Public License v2 |
1244 |
|
1245 |
-EAPI="7" |
1246 |
+EAPI=8 |
1247 |
|
1248 |
inherit cmake |
1249 |
|
1250 |
@@ -21,7 +21,8 @@ LICENSE="meschach" |
1251 |
SLOT="0" |
1252 |
KEYWORDS="~amd64" |
1253 |
|
1254 |
-IUSE="+complex +double munroll old segmem +float +sparse unroll" |
1255 |
+IUSE="+complex +double-precision munroll segmem +single-precision +sparse vunroll" |
1256 |
+#TODO: build old functions, torture |
1257 |
|
1258 |
#PATCHES=( |
1259 |
# "${FILESDIR}/.patch" |
1260 |
@@ -31,12 +32,12 @@ src_configure() { |
1261 |
mycmakeargs=( |
1262 |
-DANDROID_COMPILE=OFF |
1263 |
-DCOMPLEX_OPTION=$(usex complex) |
1264 |
- -DREAL_DBL_OPTION=$(usex double) |
1265 |
- -DREAL_FLT_OPTION=$(usex float) |
1266 |
+ -DREAL_DBL_OPTION=$(usex double-precision) |
1267 |
-DMUNROLL_OPTION=$(usex munroll) |
1268 |
-DSEGMENTED_OPTION=$(usex segmem) |
1269 |
+ -DREAL_FLT_OPTION=$(usex single-precision) |
1270 |
-DSPARSE_OPTION=$(usex sparse) |
1271 |
- -DVUNROLL_OPTION=$(usex unroll) |
1272 |
+ -DVUNROLL_OPTION=$(usex vunroll) |
1273 |
) |
1274 |
cmake_src_configure |
1275 |
} |
1276 |
|
1277 |
diff --git a/sci-libs/meschach/metadata.xml b/sci-libs/meschach/metadata.xml |
1278 |
index fde1c1444..3ba3a8929 100644 |
1279 |
--- a/sci-libs/meschach/metadata.xml |
1280 |
+++ b/sci-libs/meschach/metadata.xml |
1281 |
@@ -1,17 +1,18 @@ |
1282 |
<?xml version="1.0" encoding="UTF-8"?> |
1283 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
1284 |
<pkgmetadata> |
1285 |
- <maintainer type="person"> |
1286 |
- <email>lssndrbarbieri@×××××.com</email> |
1287 |
- <name>Alessandro Barbieri</name> |
1288 |
- </maintainer> |
1289 |
- <upstream> |
1290 |
- <maintainer> |
1291 |
- <email>dstewart@××××××××××.edu</email> |
1292 |
- <name>David Stewart</name> |
1293 |
- </maintainer> |
1294 |
- </upstream> |
1295 |
- <longdescription lang="en"> |
1296 |
+ <maintainer type="person"> |
1297 |
+ <email>lssndrbarbieri@×××××.com</email> |
1298 |
+ <name>Alessandro Barbieri</name> |
1299 |
+ </maintainer> |
1300 |
+ <upstream> |
1301 |
+ <remote-id type="github">yageek/Meschach</remote-id> |
1302 |
+ <maintainer> |
1303 |
+ <email>dstewart@××××××××××.edu</email> |
1304 |
+ <name>David Stewart</name> |
1305 |
+ </maintainer> |
1306 |
+ </upstream> |
1307 |
+ <longdescription lang="en"> |
1308 |
The Meschach Library is a numerical library of C routines for performing |
1309 |
calculations on matrices and vectors. It is intended for solving systems of |
1310 |
linear equations (dense and sparse), solve least squares problems, |
1311 |
@@ -26,15 +27,15 @@ comprises a coherent system. The current version is enhanced with many |
1312 |
features comparing with previous versions. Since the memory requirements |
1313 |
are nontrivial for large problems we have paid more attention to |
1314 |
allocation/deallocation of memory. |
1315 |
- </longdescription> |
1316 |
- <use> |
1317 |
- <flag name="complex">incorporate complex functions.</flag> |
1318 |
- <flag name="double">double precision</flag> |
1319 |
- <flag name="float">single precision</flag> |
1320 |
- <flag name="munroll">unroll low level loops on matrices</flag> |
1321 |
- <flag name="old">build no longer supported functions</flag> |
1322 |
- <flag name="segmem">should be set if you are working with a machine or compiler that does not allow large arrays to be allocated. See README</flag> |
1323 |
- <flag name="sparse">incorporate sparse matrix functions</flag> |
1324 |
- <flag name="unroll">unroll low level loops on vectors</flag> |
1325 |
- </use> |
1326 |
+ </longdescription> |
1327 |
+ <use> |
1328 |
+ <flag name="complex">incorporate complex functions</flag> |
1329 |
+ <flag name="double-precision">double precision</flag> |
1330 |
+ <flag name="munroll">unroll low level loops on matrices</flag> |
1331 |
+ <!--<flag name="old">build no longer supported functions</flag>--> |
1332 |
+ <flag name="segmem">should be set if you are working with a machine or compiler that does not allow large arrays to be allocated. See README</flag> |
1333 |
+ <flag name="single-precision">single precision</flag> |
1334 |
+ <flag name="sparse">incorporate sparse matrix functions</flag> |
1335 |
+ <flag name="vunroll">unroll low level loops on vectors</flag> |
1336 |
+ </use> |
1337 |
</pkgmetadata> |