From e8dd4337c5fadc50bda12735ee6dab24ecb98cff Mon Sep 17 00:00:00 2001 From: Hans Schoenemann Date: Wed, 17 Jan 2024 16:54:38 +0100 Subject: [PATCH 1/5] update to Singular_jll v403.214.1400 --- Project.toml | 2 +- deps/src/singular.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a864c7c49..fe2953596 100644 --- a/Project.toml +++ b/Project.toml @@ -29,7 +29,7 @@ Pidfile = "1.3" Pkg = "1.6" Random = "1.6" RandomExtensions = "0.4.2" -Singular_jll = "~403.212.1202" +Singular_jll = "~403.214.1400" Statistics = "1.6" julia = "1.6" lib4ti2_jll = "1.6.10" diff --git a/deps/src/singular.cpp b/deps/src/singular.cpp index a7dbe0742..8c0f12e6c 100644 --- a/deps/src/singular.cpp +++ b/deps/src/singular.cpp @@ -64,6 +64,13 @@ JLCXX_MODULE define_julia_module(jlcxx::Module & Singular) Singular.set_const("n_Zp", n_Zp); Singular.set_const("n_GF", n_GF); Singular.set_const("n_transExt", n_transExt); + Singular.set_const("n_Nemo_AnticNumberField", n_Nemo_AnticNumberField); + Singular.set_const("n_Nemo_QQField", n_Nemo_QQField); + Singular.set_const("n_Nemo_ZZRing", n_Nemo_ZZRing); + Singular.set_const("n_Nemo_FqPolyRepField", n_Nemo_FqPolyRepField); + Singular.set_const("n_Nemo_fqPolyRepField", n_Nemo_fqPolyRepField); + Singular.set_const("n_Nemo_Field", n_Nemo_Field); + Singular.set_const("n_Nemo_Ring", n_Nemo_Ring); Singular.set_const("n_unknown", n_unknown); Singular.add_type("number"); Singular.add_type<__mpz_struct>("__mpz_struct"); From d69bac48eb17cd7c39e8e03042cb8f059ab679cd Mon Sep 17 00:00:00 2001 From: Hans Schoenemann Date: Wed, 17 Jan 2024 17:42:10 +0100 Subject: [PATCH 2/5] fix: prune --- deps/src/ideals.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/src/ideals.cpp b/deps/src/ideals.cpp index 7acf12ffd..9f6cb0683 100644 --- a/deps/src/ideals.cpp +++ b/deps/src/ideals.cpp @@ -100,12 +100,16 @@ auto id_prune_map_helper(sip_sideal * I, ring R) return std::make_tuple(s, TT); } -auto id_prune_map_v_helper(sip_sideal * I, int* v, ring R) +auto id_prune_map_v_helper(sip_sideal * I, jlcxx::ArrayRef a, ring R) { auto origin = currRing; rChangeCurrRing(R); ideal T; + int *v=omAlloc(I->rank*siseof(int)); ideal s = idMinEmbedding_with_map_v(I, NULL, T, v); + for (int j = 0; j < I->rank; j++) + a.push_back(v[j]); + omFreeSize(v,I->rank*siseof(int)); matrix TT = id_Module2Matrix(T, currRing); rChangeCurrRing(origin); return std::make_tuple(s, TT); From 1b324f12c4def2e9cc41aa30ebfdcc459328fe07 Mon Sep 17 00:00:00 2001 From: Hans Schoenemann Date: Wed, 17 Jan 2024 17:44:52 +0100 Subject: [PATCH 3/5] fix: prune --- src/module/module.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/module/module.jl b/src/module/module.jl index d41ddb988..af52fb695 100644 --- a/src/module/module.jl +++ b/src/module/module.jl @@ -402,7 +402,8 @@ and the transformation matrix of id to R. """ function prune_with_map(I::smodule{spoly{T}}) where T <: Nemo.FieldElem R = base_ring(I) - r, TT_ptr = GC.@preserve I R libSingular.id_prune_map(I.ptr, R.ptr) + a = Vector{Int32}() + r, TT_ptr = GC.@preserve I R libSingular.id_prune_map_v(I.ptr, a, R.ptr) return smodule{spoly{T}}(R, r),smatrix{spoly{T}}(R,TT_ptr) end From bd4f723bed4b6780502fb9bd7d4118180c5f57aa Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 18 Jan 2024 17:00:16 +0100 Subject: [PATCH 4/5] Apply suggestions from code review --- deps/src/ideals.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/src/ideals.cpp b/deps/src/ideals.cpp index 9f6cb0683..babb3b787 100644 --- a/deps/src/ideals.cpp +++ b/deps/src/ideals.cpp @@ -105,11 +105,11 @@ auto id_prune_map_v_helper(sip_sideal * I, jlcxx::ArrayRef a, ring R) auto origin = currRing; rChangeCurrRing(R); ideal T; - int *v=omAlloc(I->rank*siseof(int)); + int *v=omAlloc(I->rank*sizeof(int)); ideal s = idMinEmbedding_with_map_v(I, NULL, T, v); for (int j = 0; j < I->rank; j++) a.push_back(v[j]); - omFreeSize(v,I->rank*siseof(int)); + omFreeSize(v,I->rank*sizeof(int)); matrix TT = id_Module2Matrix(T, currRing); rChangeCurrRing(origin); return std::make_tuple(s, TT); From a466d6dea8428e5bc6b551e1e66f14fe36a07f68 Mon Sep 17 00:00:00 2001 From: ederc Date: Thu, 18 Jan 2024 21:06:58 +0100 Subject: [PATCH 5/5] converts to int * --- deps/src/ideals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/src/ideals.cpp b/deps/src/ideals.cpp index babb3b787..5834b7216 100644 --- a/deps/src/ideals.cpp +++ b/deps/src/ideals.cpp @@ -105,7 +105,7 @@ auto id_prune_map_v_helper(sip_sideal * I, jlcxx::ArrayRef a, ring R) auto origin = currRing; rChangeCurrRing(R); ideal T; - int *v=omAlloc(I->rank*sizeof(int)); + int *v = (int *)omAlloc(I->rank*sizeof(int)); ideal s = idMinEmbedding_with_map_v(I, NULL, T, v); for (int j = 0; j < I->rank; j++) a.push_back(v[j]);