From af26d3cb5913a5fc3507743db6d438b738888cc7 Mon Sep 17 00:00:00 2001 From: Nelynx Date: Mon, 24 Mar 2025 15:31:51 +0100 Subject: [PATCH] add correct multiplication by units --- .singularhistory | 40 ++++++++++++++++++++++++++++++++++++++++ AeCodPruebas.lib | 29 ++++++++++++++++------------- example.c | 7 +++++++ example2.c | 7 +++++++ example3.c | 7 +++++++ 5 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 .singularhistory create mode 100644 example.c create mode 100644 example2.c create mode 100644 example3.c diff --git a/.singularhistory b/.singularhistory new file mode 100644 index 0000000..0973726 --- /dev/null +++ b/.singularhistory @@ -0,0 +1,40 @@ +quit; +quit; +quit; +quit; +quit; +ring r = 0,(X(1..30)),ds; +ideal i = maxideal(50); +qring Q = i; +setring Q; +reduce(x(1)^51); +reduce(X(1)^51); +reduce(X(1)^51,ideal(0)); +reduce(X(1)^51,std(ideal(0))); +basering; +Q = std(Q); +nameof(basering); +std(X(1)^51); +setring r; +qring q2 = std(maxideal(50)); +setring q2; +reduce(X(1)^51,std(0)); +basering; +quit; +ring r = 0,(x(1..8)),ds; +ideal i = maxideal(50); +ring r = 0,(x(1..8)),ds; +ideal i = maxideal(10); +i; +qring q = std(i); +ring r = 0,(x(1..)),ds; +ideal i = maxideal(5); +ring r = 0,(x(1..3)),ds; +ideal i = maxideal(20); +ideal i = maxideal(40); +qring q = std(i); +basering; +setring r; +ring r = 0,(x(1..6)),ds; +ideal i = maxideal(40); +qring q = std(i); diff --git a/AeCodPruebas.lib b/AeCodPruebas.lib index 66d5855..02cd842 100644 --- a/AeCodPruebas.lib +++ b/AeCodPruebas.lib @@ -354,14 +354,10 @@ proc GenerateOYModule(matrix GOX, matrix GOY, list #) M = M + MatrixToVector(auxcol); // Convert to GOX if (MalgrFormToOX(auxcol) != col and flag_unit == 0) { + print("Warning: a unit has been used for the MalgrForm of the target module. Computations might not be accurate."); flag_unit = 1; } } - if (flag_unit ==1) - { - print("Warning: a unit has been used for the MalgrForm of the target module. Computations might not be accurate."); - flag_unit = -1; - } } // Convert GOX to an O_n -module @@ -377,7 +373,14 @@ proc GenerateOYModule(matrix GOX, matrix GOY, list #) col = submat(GOX,intvec(1..a),intvec(i)); // Pick the next generator in GOX for (j=1; j<= m; j++) { - M = M + MatrixToVector(MalgrFormVect(Gens[j]*col)); + if (s>0) + { + M = M + MatrixToVector(MalgrFormVect(Gens[j]*col, mappingf^k)); // Convert to GOX + } + else + { + M = M + MatrixToVector(MalgrFormVect(Gens[j]*col)); + } } } @@ -592,10 +595,10 @@ proc MalgrFormPoly(poly h, list #) if (s == 0) { - if (check[1,1] - h != 0) - { - print("Some conversions use a unit. Answer might not be accurate"); - } + if (check[1,1] - h != 0) + { + print("Some conversions use a unit. Answer might not be accurate"); + } } return(v); @@ -655,14 +658,14 @@ proc MalgrFormVect(matrix v, list #) option(redSB); option(redTail); option(redThrough); - rv = system("reduce_bound", v, K, maxibound); + rv = system("reduce_bound", module(v), K*freemodule(a), maxibound); } else { option(redTail); option(redThrough); - rv = reduce(v,K); // Obtain Malgrange form as a sum. This should be a polynomial only in X's and - // the elements of Gens in "linear" form + rv = reduce(v,K); // Obtain Malgrange form as a sum. This should be a polynomial only in X's and + // the elements of Gens in "linear" form } poly prod = 1; diff --git a/example.c b/example.c new file mode 100644 index 0000000..cc2c638 --- /dev/null +++ b/example.c @@ -0,0 +1,7 @@ +LIB"AeCodPruebas.lib"; +ring r = 0,(x,y),ds; + +ideal f = x,xy+y6+y9; + +AeNormal(f); +quit; \ No newline at end of file diff --git a/example2.c b/example2.c new file mode 100644 index 0000000..4fa96d4 --- /dev/null +++ b/example2.c @@ -0,0 +1,7 @@ +LIB"AeCodPruebas.lib"; +ring r = 0,(x,y,z),ds; + +ideal f = x,y,yz+z6+z8,z3+xz; + +AeNormal(f, maxideal(2)); +quit; \ No newline at end of file diff --git a/example3.c b/example3.c new file mode 100644 index 0000000..240f20b --- /dev/null +++ b/example3.c @@ -0,0 +1,7 @@ +LIB"AeCodPruebas.lib"; +ring r = 0,(x,y),ds; + +ideal f = x,y2,y3+x2y; + +AeNormal(f); +quit; \ No newline at end of file