Skip to content

Commit 94bbea8

Browse files
author
Matthias Koeppe
committed
1 parent b002b63 commit 94bbea8

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
--- a/source/libnormaliz/vector_operations.h
2+
+++ b/source/libnormaliz/vector_operations.h
3+
@@ -547,7 +547,10 @@
4+
5+
fmpq_poly_fit_length(flp, n);
6+
for (size_t i = 0; i < poly_vector.size(); ++i) {
7+
- fmpq_poly_set_coeff_mpq(flp, (slong)i, poly_vector[i].get_mpq_t());
8+
+ fmpq_t fcurrent_coeff;
9+
+ fmpq_init(fcurrent_coeff);
10+
+ fmpq_set_mpq(fcurrent_coeff, poly_vector[i].get_mpq_t());
11+
+ fmpq_poly_set_coeff_fmpq(flp, (slong)i, fcurrent_coeff);
12+
}
13+
}
14+
15+
@@ -560,8 +563,11 @@
16+
poly_vector.resize(length);
17+
for (slong i = 0; i < length; i++) {
18+
mpq_t current_coeff;
19+
+ fmpq_t fcurrent_coeff;
20+
mpq_init(current_coeff);
21+
- fmpq_poly_get_coeff_mpq(current_coeff, flp, (slong)i);
22+
+ fmpq_init(fcurrent_coeff);
23+
+ fmpq_poly_get_coeff_fmpq(fcurrent_coeff, flp, (slong)i);
24+
+ fmpq_get_mpq(current_coeff, fcurrent_coeff);
25+
poly_vector[i] = mpq_class(current_coeff);
26+
}
27+
}
28+
--- a/source/libnormaliz/HilbertSeries.cpp
29+
+++ b/source/libnormaliz/HilbertSeries.cpp
30+
@@ -72,7 +72,10 @@
31+
slong n = (slong)nmzp.size();
32+
fmpz_poly_fit_length(flp, n);
33+
for (size_t i = 0; i < nmzp.size(); ++i) {
34+
- fmpz_poly_set_coeff_mpz(flp, (slong)i, nmzp[i].get_mpz_t());
35+
+ fmpz_t fc;
36+
+ fmpz_init(fc);
37+
+ fmpz_set_mpz(fc, nmzp[i].get_mpz_t());
38+
+ fmpz_poly_set_coeff_fmpz(flp, (slong)i, fc);
39+
}
40+
}
41+
42+
@@ -80,9 +83,12 @@
43+
size_t n = (size_t)fmpz_poly_length(flp);
44+
nmzp.resize(n);
45+
mpz_t c;
46+
+ fmpz_t fc;
47+
mpz_init(c);
48+
+ fmpz_init(fc);
49+
for (size_t i = 0; i < nmzp.size(); ++i) {
50+
- fmpz_poly_get_coeff_mpz(c, flp, i);
51+
+ fmpz_poly_get_coeff_fmpz(fc, flp, i);
52+
+ fmpz_get_mpz(c, fc);
53+
nmzp[i] = mpz_class(c);
54+
}
55+
mpz_clear(c);

0 commit comments

Comments
 (0)