diff --git a/Project.toml b/Project.toml index 93da1b4eb..93e7e5363 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.210.1000" +Singular_jll = "~403.211.1100" Statistics = "1.6" julia = "1.6" lib4ti2_jll = "1.6.10" diff --git a/deps/src/ideals.cpp b/deps/src/ideals.cpp index a8f710f72..b69f97f1d 100644 --- a/deps/src/ideals.cpp +++ b/deps/src/ideals.cpp @@ -89,12 +89,12 @@ auto id_mres_map_helper(sip_sideal * I, int n, ring R) return std::make_tuple(s, TT); } -auto id_prune_map_helper(sip_sideal * I, ring R) +auto id_prune_map_v_helper(sip_sideal * I, int* v, ring R) { auto origin = currRing; rChangeCurrRing(R); ideal T; - ideal s = idMinEmbedding_with_map(I, NULL, T); + ideal s = idMinEmbedding_with_map_v(I, NULL, T, v); matrix TT = id_Module2Matrix(T, currRing); rChangeCurrRing(origin); return std::make_tuple(s, TT); @@ -404,7 +404,7 @@ void singular_define_ideals(jlcxx::Module & Singular) Singular.method("id_res", &id_res_helper); Singular.method("id_mres_map", &id_mres_map_helper); - Singular.method("id_prune_map", &id_prune_map_helper); + Singular.method("id_prune_map_v", &id_prune_map_v_helper); Singular.method("id_Slimgb", &id_Slimgb_helper); diff --git a/src/module/module.jl b/src/module/module.jl index 10336b7d6..4a52d84df 100644 --- a/src/module/module.jl +++ b/src/module/module.jl @@ -396,16 +396,20 @@ function mres_with_map(I::smodule{spoly{T}}, max_length::Int) where T <: Nemo.Fi end @doc raw""" - prune_with_map(id::smodule{spoly{T}}) where T <: Nemo.FieldElem + prune_with_map(I::smodule{spoly{T}}) where T <: Nemo.FieldElem -Returns the module R minimally embedded in a free module such that the -corresponding factor modules are isomorphic -and the transformation matrix of id to R. +Returns the module N minimally embedded in a free module such that the +corresponding factor modules are isomorphic. Returns +the transformation matrix M of I to N, and a map of generators A: +R^n/I -- M --> R^n/N -- A --> R^n'/A(N). +A maps as: gen(i) -> gen(A[i]) """ 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) - return smodule{spoly{T}}(R, r),smatrix{spoly{T}}(R,TT_ptr) + n = rank(I) + A = Array{Int}(undef, n) + r, TT_ptr = GC.@preserve I R libSingular.id_prune_v_map(I.ptr, A, R.ptr) + return smodule{spoly{T}}(R, r),smatrix{spoly{T}}(R,TT_ptr),A end @doc raw"""