SHA256
1
0
forked from pool/normaliz

Accepting request 1154020 from science

- Update to release 3.10.2

OBS-URL: https://build.opensuse.org/request/show/1154020
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/normaliz?expand=0&rev=24
This commit is contained in:
Dominique Leuenberger 2024-03-01 22:39:08 +00:00 committed by Git OBS Bridge
commit c35fbb1bba
5 changed files with 18 additions and 97 deletions

View File

@ -1,91 +0,0 @@
From e8d64832cbbd9c847452186f2da23fed6fb0a0d3 Mon Sep 17 00:00:00 2001
From: Doug Torrance <dtorrance@piedmont.edu>
Date: Tue, 19 Dec 2023 08:15:16 -0500
Subject: [PATCH] Add FLINT 3 support
The various coefficient getting/setting functions that use GMP
integers/rationals directly have been removed, and so we need to
convert from GMP <-> FLINT separately.
Closes: #412
---
configure.ac | 2 +-
source/libnormaliz/HilbertSeries.cpp | 10 ++++++++--
source/libnormaliz/vector_operations.h | 10 ++++++++--
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index e3779ca2..feb90500 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,7 +226,7 @@ AS_CASE([$with_flint],
AS_IF([test "x$with_flint" != xno],
[AC_MSG_CHECKING([whether flint headers and library are available])
FLINT_LIBS="-lflint -lmpfr"
- AX_CHECK_LIBRARY([FLINT], [flint/flint.h], [flint], [fmpz_poly_set_coeff_mpz],[],[],[$GMP_LIBS])
+ AX_CHECK_LIBRARY([FLINT], [flint/flint.h], [flint], [fmpz_poly_set_coeff_fmpz],[],[],[$GMP_LIBS])
AS_IF([test x$ax_cv_have_FLINT = xyes],
[
CPPFLAGS="$CPPFLAGS $FLINT_CPPFLAGS"
diff --git a/source/libnormaliz/HilbertSeries.cpp b/source/libnormaliz/HilbertSeries.cpp
index f536a590..1420f6d7 100644
--- a/source/libnormaliz/HilbertSeries.cpp
+++ b/source/libnormaliz/HilbertSeries.cpp
@@ -72,7 +72,10 @@ void flint_poly(fmpz_poly_t flp, const vector<mpz_class>& nmzp) {
slong n = (slong)nmzp.size();
fmpz_poly_fit_length(flp, n);
for (size_t i = 0; i < nmzp.size(); ++i) {
- fmpz_poly_set_coeff_mpz(flp, (slong)i, nmzp[i].get_mpz_t());
+ fmpz_t fc;
+ fmpz_init(fc);
+ fmpz_set_mpz(fc, nmzp[i].get_mpz_t());
+ fmpz_poly_set_coeff_fmpz(flp, (slong)i, fc);
}
}
@@ -80,9 +83,12 @@ void nmz_poly(vector<mpz_class>& nmzp, const fmpz_poly_t flp) {
size_t n = (size_t)fmpz_poly_length(flp);
nmzp.resize(n);
mpz_t c;
+ fmpz_t fc;
mpz_init(c);
+ fmpz_init(fc);
for (size_t i = 0; i < nmzp.size(); ++i) {
- fmpz_poly_get_coeff_mpz(c, flp, i);
+ fmpz_poly_get_coeff_fmpz(fc, flp, i);
+ fmpz_get_mpz(c, fc);
nmzp[i] = mpz_class(c);
}
mpz_clear(c);
diff --git a/source/libnormaliz/vector_operations.h b/source/libnormaliz/vector_operations.h
index d7b15230..3996bcf7 100644
--- a/source/libnormaliz/vector_operations.h
+++ b/source/libnormaliz/vector_operations.h
@@ -547,7 +547,10 @@ inline void vector2fmpq_poly(fmpq_poly_t flp, const std::vector<mpq_class>& poly
fmpq_poly_fit_length(flp, n);
for (size_t i = 0; i < poly_vector.size(); ++i) {
- fmpq_poly_set_coeff_mpq(flp, (slong)i, poly_vector[i].get_mpq_t());
+ fmpq_t fcurrent_coeff;
+ fmpq_init(fcurrent_coeff);
+ fmpq_set_mpq(fcurrent_coeff, poly_vector[i].get_mpq_t());
+ fmpq_poly_set_coeff_fmpq(flp, (slong)i, fcurrent_coeff);
}
}
@@ -560,8 +563,11 @@ inline void fmpq_poly2vector(std::vector<mpq_class>& poly_vector, const fmpq_pol
poly_vector.resize(length);
for (slong i = 0; i < length; i++) {
mpq_t current_coeff;
+ fmpq_t fcurrent_coeff;
mpq_init(current_coeff);
- fmpq_poly_get_coeff_mpq(current_coeff, flp, (slong)i);
+ fmpq_init(fcurrent_coeff);
+ fmpq_poly_get_coeff_fmpq(fcurrent_coeff, flp, (slong)i);
+ fmpq_get_mpq(current_coeff, fcurrent_coeff);
poly_vector[i] = mpq_class(current_coeff);
}
}
--
2.43.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:365e1d1e2a338dc4df1947a440e606bb66dd261307e617905e8eca64eaafcf6e
size 6795274

3
normaliz-3.10.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f649a8eae5535c18df15e8d35fc055fd0d7dbcbdd451e8876f4a47061481f07
size 6919225

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Fri Mar 1 12:13:49 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Update to release 3.10.2
* Special input types and computation goals for fusion rings
* Refined management of computations on an HPC for the patching
version of project-and-lift algorithm for lattice points
(used for fusion rings)
* Processing of lists of input files
* Orbit versions of (dual) face lattice and f-vector
* Full implementation of SingleLatticePoint
- Delete 0001-Add-FLINT-3-support.patch (fixed upstream)
-------------------------------------------------------------------
Sat Dec 23 13:42:28 UTC 2023 - Jan Engelhardt <jengelh@inai.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package normaliz
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,7 +18,7 @@
Name: normaliz
%define lname libnormaliz3
Version: 3.10.1
Version: 3.10.2
Release: 0
Summary: Tools for computations in affine monoids and rational cones
License: GPL-3.0-or-later
@ -26,7 +26,6 @@ Group: Productivity/Scientific/Math
URL: https://www.normaliz.uni-osnabrueck.de/
Source: https://github.com/Normaliz/Normaliz/releases/download/v%version/%name-%version.tar.gz
Patch1: 0001-Add-FLINT-3-support.patch
BuildRequires: e-antic-devel >= 1.0.1
BuildRequires: flint-devel
BuildRequires: gcc-c++