929 |
929 |
CoCoA_ASSERT( IsIndet(h) );
|
930 |
930 |
CoCoA_ASSERT( IsOne(wdeg(h)[0]) );
|
931 |
931 |
const BigInt d = wdeg(v)[0];
|
932 |
|
const vector<ModuleElem>& e(gens(owner(v)));
|
|
932 |
const vector<ModuleElem> e(gens(owner(v)));
|
933 |
933 |
ModuleElem resv(owner(v));
|
934 |
934 |
for (long i=0; i<NumCompts(v); ++i)
|
935 |
935 |
resv += e[i]*(homog(v[i],h)*power(h,d-wdeg(v)[0])); // and shifts ???
|
936 |
|
-- src/AlgebraicCore/PolyRing.C.orig 2022-03-22 08:26:06.000000000 -0600
|
|
936 |
++ src/AlgebraicCore/PolyRing.C 2023-03-08 11:49:52.713964463 -0700
|
... | ... | |
303 |
303 |
if (deg(f) == 0) return abs(LC(f));
|
304 |
304 |
const long x_ind = UnivariateIndetIndex(f);
|
305 |
305 |
if (x_ind < 0) CoCoA_THROW_ERROR(ERR::BadArg, "FixedDivisor: expected univariate poly");
|
306 |
|
const ring& k = CoeffRing(P);
|
|
306 |
const ring k = CoeffRing(P);
|
307 |
307 |
const BigInt cont = ConvertTo<BigInt>(content(f)); // requires coeffs to be integers!
|
308 |
308 |
vector<RingElem> EvalPt(NumIndets(P), zero(k)); // initially all zeroes
|
309 |
309 |
long x_lo = 0;
|
310 |
|
-- src/AlgebraicCore/SparsePolyOps-hilbert.C.orig 2022-03-22 08:26:11.000000000 -0600
|
|
310 |
++ src/AlgebraicCore/SparsePolyOps-hilbert.C 2023-03-08 11:55:12.644610530 -0700
|
... | ... | |
144 |
144 |
RingElem HilbertNumQuot(const ideal& I)
|
145 |
145 |
{
|
146 |
146 |
if (!IsHomog(I)) CoCoA_THROW_ERROR("not homogeneous", "HilbertNumQuot");
|
147 |
|
const PolyRing& QQt = RingQQt(1);
|
|
147 |
const PolyRing QQt = RingQQt(1);
|
148 |
148 |
if (IsZero(I)) return one(QQt);
|
149 |
149 |
DenseUPolyRing HSRing = StartPoincareQQt((int)NumIndets(RingOf(I)));
|
150 |
150 |
TermList TL = NewLPPTList(GBasis(I));
|
151 |
|
-- src/AlgebraicCore/SparsePolyOps-ideal-ZeroDim.C.orig 2022-03-22 11:31:37.348200939 -0600
|
|
151 |
++ src/AlgebraicCore/SparsePolyOps-ideal-ZeroDim.C 2023-03-08 11:51:30.001633163 -0700
|
... | ... | |
209 |
209 |
bool IsPrimary_0dimFin(const ideal& I)
|
210 |
210 |
{
|
211 |
211 |
VerboseLog VERBOSE("IsPrimary_0dimFin");
|
212 |
|
const ring& K = CoeffRing(RingOf(I));
|
|
212 |
const ring K = CoeffRing(RingOf(I));
|
213 |
213 |
if (!IsFiniteField(K))
|
214 |
214 |
CoCoA_THROW_ERROR("CoeffRing must be finite field", "IsPrimary_0dimFin");
|
215 |
215 |
if (!IsZeroDim(I))
|
216 |
|
-- src/AlgebraicCore/SparsePolyOps-MinPoly.C.orig 2022-03-22 08:26:11.000000000 -0600
|
|
216 |
++ src/AlgebraicCore/SparsePolyOps-MinPoly.C 2023-03-08 11:53:35.222925314 -0700
|
... | ... | |
151 |
151 |
CoCoA_THROW_ERROR("arguments must be in the same ring", "MultiplicationMat");
|
152 |
152 |
if (!IsZeroDim(I))
|
153 |
153 |
CoCoA_THROW_ERROR("ideal must be 0-dimensional", "MultiplicationMat");
|
154 |
|
const vector<PPMonoidElem>& x_PPM = indets(PPM(P));
|
155 |
|
const vector<RingElem>& x_P = indets(P);
|
|
154 |
const vector<PPMonoidElem> x_PPM = indets(PPM(P));
|
|
155 |
const vector<RingElem> x_P = indets(P);
|
156 |
156 |
vector<PPMonoidElem> QB = QuotientBasisSorted(I);
|
157 |
157 |
// std::map<PPMonoidElem, long> QBPosn = QBPositions(QB);
|
158 |
158 |
RingElem f = NF(f_orig, I);
|
... | ... | |
288 |
288 |
if (RM==Rx)
|
289 |
289 |
// TODO: convert M into matrix of coefficients (if possible)
|
290 |
290 |
CoCoA_THROW_ERROR(ERR::NYI, "MinPoly");
|
291 |
|
const ring& K = CoeffRing(Rx);
|
|
291 |
const ring K = CoeffRing(Rx);
|
292 |
292 |
// If (IsZZ(R) or IsQQ(R)) Then
|
293 |
293 |
// M := CanonicalHom(R, K)( M );
|
294 |
294 |
// R := K;
|
... | ... | |
347 |
347 |
|
348 |
348 |
//if R = RingOf(X) then return MinPolyInKx(M, X); endif;
|
349 |
349 |
|
350 |
|
const ring& K = CoeffRing(owner(x));
|
|
350 |
const ring K = CoeffRing(owner(x));
|
351 |
351 |
// const vector<PPMonoidElem> QB = QuotientBasisSorted(I);
|
352 |
352 |
const long LenQB = len(QuotientBasis(I)); // multiplicity
|
353 |
353 |
LinDepMill ILD(K, LenQB);
|
... | ... | |
419 |
419 |
// const double T = CpuTime();
|
420 |
420 |
const ring& P = owner(f_orig);
|
421 |
421 |
const ring& P_x = owner(x);
|
422 |
|
const ring& K = CoeffRing(P);
|
|
422 |
const ring K = CoeffRing(P);
|
423 |
423 |
// fare tutti i controlli sugli anelli
|
424 |
424 |
if (K != CoeffRing(P_x))
|
425 |
425 |
CoCoA_THROW_ERROR("incompatible coeff rings", "MinPolyQuotDef");
|
... | ... | |
476 |
476 |
// const double T = CpuTime();
|
477 |
477 |
const ring& P = owner(f_orig);
|
478 |
478 |
const ring& P_x = owner(x);
|
479 |
|
const ring& K = CoeffRing(P);
|
|
479 |
const ring K = CoeffRing(P);
|
480 |
480 |
RingHom psi = CoeffEmbeddingHom(P);
|
481 |
481 |
// fare tutti i controlli sugli anelli
|
482 |
482 |
if (K != CoeffRing(P_x))
|
... | ... | |
491 |
491 |
//VERBOSE(99) << f_orig << std::flush;
|
492 |
492 |
//---- "MultiplicationMat" fxQB
|
493 |
493 |
double U = CpuTime();
|
494 |
|
const vector<RingElem>& x_P = indets(P);
|
495 |
|
const vector<PPMonoidElem>& x_PPM = indets(PPM(P));
|
|
494 |
const vector<RingElem> x_P = indets(P);
|
|
495 |
const vector<PPMonoidElem> x_PPM = indets(PPM(P));
|
496 |
496 |
vector<RingElem> fxQB(len(QB));
|
497 |
497 |
for (long j=0; j<len(QB); ++j)
|
498 |
498 |
{
|
499 |
|
-- src/AlgebraicCore/SparsePolyOps-RealRadical.C.orig 2022-03-22 08:26:11.000000000 -0600
|
|
499 |
++ src/AlgebraicCore/SparsePolyOps-RealRadical.C 2023-03-08 11:50:32.642415464 -0700
|
... | ... | |
70 |
70 |
|
71 |
71 |
const RingHom coeff = CoeffEmbeddingHom(P);
|
72 |
72 |
RingElem g = f;
|
73 |
|
const RingElem& x = indet(P,var);
|
|
73 |
const RingElem x = indet(P,var);
|
74 |
74 |
const int s = sign(LC(g));
|
75 |
75 |
while (true)
|
76 |
76 |
{
|
77 |
|
-- src/AlgebraicCore/SparsePolyOps-RingElem.C.orig 2022-03-22 08:26:11.000000000 -0600
|
|
77 |
++ src/AlgebraicCore/SparsePolyOps-RingElem.C 2023-03-08 11:52:17.335987587 -0700
|
... | ... | |
1312 |
1312 |
else
|
1313 |
1313 |
PushBack(OddPart, coeff(it), power(pp,d/2)); // integer division!
|
1314 |
1314 |
}
|
1315 |
|
const RingElem& x = indet(P, IndetIndex);
|
|
1315 |
const RingElem x = indet(P, IndetIndex);
|
1316 |
1316 |
// Fiddle answer so that LC is positive.
|
1317 |
1317 |
RingElem ans = power(EvenPart,2) - x*power(OddPart,2);
|
1318 |
1318 |
if (sign(LC(ans)) < 0) ans *= -1;
|
... | ... | |
1339 |
1339 |
const int d = deg(PP(it));
|
1340 |
1340 |
PushBack(part[d%3], coeff(it), power(pp, d/3)); // integer division!
|
1341 |
1341 |
}
|
1342 |
|
const RingElem& x = indet(P, IndetIndex);
|
|
1342 |
const RingElem x = indet(P, IndetIndex);
|
1343 |
1343 |
const RingElem part012 = part[0]*part[1]*part[2];
|
1344 |
1344 |
// Fiddle answer so that LC is positive.
|
1345 |
1345 |
RingElem ans = power(part[0],3) + x*(power(part[1],3)-3*part012 + x*power(part[2],3));
|
1346 |
|
-- src/AlgebraicCore/SparsePolyOps-SturmSeq.C.orig 2022-03-22 08:26:11.000000000 -0600
|
|
1346 |
++ src/AlgebraicCore/SparsePolyOps-SturmSeq.C 2023-03-08 11:51:05.216971191 -0700
|
... | ... | |
80 |
80 |
if (IsZero(f)) CoCoA_THROW_ERROR(ERR::NotNonZero, FnName);
|
81 |
81 |
const int var = UnivariateIndetIndex(f);
|
82 |
82 |
if (var < 0) CoCoA_THROW_ERROR(ERR::NotUnivariate, FnName);
|
83 |
|
const RingElem& x = indet(P,var);
|
|
83 |
const RingElem x = indet(P,var);
|
84 |
84 |
vector<RingElem> seq; seq.reserve(1+deg(f));
|
85 |
85 |
RingElem prev = f*ConvertTo<BigInt>(CommonDenom(f));
|
86 |
86 |
// ??? SLUG: remove content from prev???
|
87 |
|
-- src/AlgebraicCore/submodule.C.orig 2022-03-22 08:26:18.000000000 -0600
|
|
87 |
++ src/AlgebraicCore/submodule.C 2023-03-08 11:54:35.950097079 -0700
|
... | ... | |
501 |
501 |
{
|
502 |
502 |
if (!IsSparsePolyRing(RingOf(M)))
|
503 |
503 |
CoCoA_THROW_ERROR(ERR::NYI, "SubmoduleImpl::IsContained");
|
504 |
|
const vector<ModuleElem>& g = gens(M);
|
|
504 |
const vector<ModuleElem> g = gens(M);
|
505 |
505 |
for (long i=0; i < len(g); ++i)
|
506 |
506 |
if (!IsElem(g[i], N)) return false;
|
507 |
507 |
return true;
|
... | ... | |
516 |
516 |
CoCoA_THROW_ERROR(ERR::ZeroGradingDim, "IsHomog(submodule)");
|
517 |
517 |
if (IsZero(M)) return true;
|
518 |
518 |
// Now we know I is non-trivial.
|
519 |
|
const vector<ModuleElem>& GB = TidyGens(M);
|
|
519 |
const vector<ModuleElem> GB = TidyGens(M);
|
520 |
520 |
const long GBsize = len(GB); // MUST BE A REDUCED GBASIS !!!
|
521 |
521 |
for (long i=0; i < GBsize; ++i)
|
522 |
522 |
if (!IsHomog(GB[i])) return false;
|
... | ... | |
535 |
535 |
if (GradingDim(P)==0)
|
536 |
536 |
CoCoA_THROW_ERROR(ERR::ZeroGradingDim, "LT(submodule)");
|
537 |
537 |
const vector<ModuleElem>& e = gens(AmbientFreeModule(M));
|
538 |
|
const vector<ModuleElem>& GB = TidyGens(M);
|
|
538 |
const vector<ModuleElem> GB = TidyGens(M);
|
539 |
539 |
vector<ModuleElem> LTs;
|
540 |
540 |
const long GBsize = len(GB);
|
541 |
541 |
for (long i=0; i < GBsize; ++i)
|
542 |
|
-- src/AlgebraicCore/TmpF5.C.orig 2022-03-22 08:26:13.000000000 -0600
|
|
542 |
++ src/AlgebraicCore/TmpF5.C 2023-03-08 11:56:12.101835237 -0700
|
... | ... | |
38 |
38 |
{
|
39 |
39 |
public: // data members
|
40 |
40 |
int m;
|
41 |
|
const PPMonoid& myPPM;
|
|
41 |
const PPMonoid myPPM;
|
42 |
42 |
SparsePolyRing env;
|
43 |
43 |
public:
|
44 |
44 |
cF5_t(const vector<RingElem> &I);
|
45 |
|
-- src/AlgebraicCore/TmpF5Mat.C.orig 2022-03-22 08:26:13.000000000 -0600
|
|
45 |
++ src/AlgebraicCore/TmpF5Mat.C 2023-03-08 11:57:39.116700618 -0700
|
... | ... | |
438 |
438 |
|
439 |
439 |
class matrF5_t{
|
440 |
440 |
private:
|
441 |
|
const PPMonoid& myPPM;
|
|
441 |
const PPMonoid myPPM;
|
442 |
442 |
SparsePolyRing env;
|
443 |
443 |
public:
|
444 |
444 |
unsigned int curr_deg,curr_poly,red2zero,n_indets,max_gen_deg;
|
445 |
|
const vector<PPMonoidElem> &PPMindets;
|
|
445 |
const vector<PPMonoidElem> PPMindets;
|
446 |
446 |
vector<PPMonoidElem> mtPPMindets;
|
447 |
447 |
vector<RingElem> gens;
|
448 |
448 |
GB_t GB;
|
449 |
|
-- src/tests/test-FreeModule1.C.orig 2022-03-22 08:26:43.000000000 -0600
|
|
449 |
++ src/tests/test-FreeModule1.C 2023-03-08 11:58:15.228229733 -0700
|
... | ... | |
49 |
49 |
const long dim = 4;
|
50 |
50 |
const FreeModule F = NewFreeModule(R, dim);
|
51 |
51 |
const vector<ModuleElem>& e = gens(F);
|
52 |
|
const vector<RingElem>& x = indets(R);
|
|
52 |
const vector<RingElem> x = indets(R);
|
53 |
53 |
CoCoA_ASSERT_ALWAYS(len(e) == dim);
|
54 |
54 |
// This does not yet compile
|
55 |
55 |
// for (long i=0; i < dim; ++i)
|
56 |
|
-- src/tests/test-hilbert1.C.orig 2022-03-22 08:26:43.000000000 -0600
|
|
56 |
++ src/tests/test-hilbert1.C 2023-03-08 12:00:10.242929948 -0700
|
... | ... | |
50 |
50 |
|
51 |
51 |
ideal NewQueenMovesFrom(SparsePolyRing P, long Csb, long sq1, long sq2)
|
52 |
52 |
{
|
53 |
|
ConstRefRingElem x = CsbSquareIndet(P, Csb, sq1, sq2);
|
|
53 |
const RingElemAlias x = CsbSquareIndet(P, Csb, sq1, sq2);
|
54 |
54 |
vector<RingElem> g;
|
55 |
55 |
for ( long i=sq2+1 ; i<=Csb ; ++i )
|
56 |
56 |
g.push_back(x * CsbSquareIndet(P, Csb, sq1, i));
|
57 |
|
-- src/tests/test-RootBound1.C.orig 2022-03-22 08:26:43.000000000 -0600
|
|
57 |
++ src/tests/test-RootBound1.C 2023-03-08 12:00:55.026486230 -0700
|
... | ... | |
78 |
78 |
CoCoA_ASSERT_ALWAYS(IsMonomial(f) || B > 0);
|
79 |
79 |
|
80 |
80 |
const ring& P = owner(f);
|
81 |
|
const ring& k = CoeffRing(P);
|
|
81 |
const ring k = CoeffRing(P);
|
82 |
82 |
const long index = UnivariateIndetIndex(f);
|
83 |
83 |
|
84 |
84 |
const RingElem g = Fstar(f);
|
... | ... | |
109 |
109 |
// Check that bound is invariant if poly is multiplied by a power of x
|
110 |
110 |
const ring& P = owner(f);
|
111 |
111 |
const long index = UnivariateIndetIndex(f);
|
112 |
|
const RingElem& x = indet(P,index);
|
|
112 |
const RingElem x = indet(P,index);
|
113 |
113 |
|
114 |
114 |
for (int k=1; k < 20; ++k)
|
115 |
115 |
CoCoA_ASSERT_ALWAYS(RootBound2(f*power(x,k)) == B);
|
... | ... | |
145 |
145 |
GlobalManager CoCoAFoundations;
|
146 |
146 |
|
147 |
147 |
ring P = NewPolyRing(RingQQ(), symbols("x,y"));
|
148 |
|
const RingElem& x = indet(P,0);
|
|
148 |
const RingElem x = indet(P,0);
|
149 |
149 |
|
150 |
150 |
// Linear polynomials
|
151 |
151 |
CheckUPB(x);
|
152 |
|
-- src/tests/test-RootBound2.C.orig 2022-03-22 08:26:43.000000000 -0600
|
|
152 |
++ src/tests/test-RootBound2.C 2023-03-08 12:01:19.089247820 -0700
|
... | ... | |
66 |
66 |
CoCoA_ASSERT_ALWAYS(IsMonomial(f) || B > 0);
|
67 |
67 |
|
68 |
68 |
const ring& P = owner(f);
|
69 |
|
const ring& k = CoeffRing(P);
|
|
69 |
const ring k = CoeffRing(P);
|
70 |
70 |
const long index = UnivariateIndetIndex(f);
|
71 |
71 |
|
72 |
72 |
const RingElem radf = radical(f);
|
... | ... | |
98 |
98 |
// Check that bound is invariant if poly is multiplied by a power of x
|
99 |
99 |
const ring& P = owner(f);
|
100 |
100 |
const long index = UnivariateIndetIndex(f);
|
101 |
|
const RingElem& x = indet(P,index);
|
|
101 |
const RingElem x = indet(P,index);
|
102 |
102 |
|
103 |
103 |
for (int k=1; k < 20; ++k)
|
104 |
104 |
CoCoA_ASSERT_ALWAYS(RootBound2(f*power(x,k)) == B);
|