Skip to content

Commit

Permalink
Merge pull request oscar-system#72 from hannes14/hs/scHilbWeighted
Browse files Browse the repository at this point in the history
Hs/sc hilb weighted
  • Loading branch information
hannes14 authored and fingolfin committed Jun 6, 2023
2 parents e6396d5 + b6b5d07 commit f693c76
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions deps/src/ideals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@ void singular_define_ideals(jlcxx::Module & Singular)
return std::make_tuple(res, factors);
});

Singular.method("id_DivRem", [](ideal m, ideal sm, ring o, int flag) {
const ring origin = currRing;
rChangeCurrRing(o);
ideal factors;
ideal res = idDivRem(sm, m, factors, NULL,flag);
rChangeCurrRing(origin);
return std::make_tuple(res, factors);
});

Singular.method("id_DivRem_Unit", [](ideal m, ideal sm, ring o) {
const ring origin = currRing;
rChangeCurrRing(o);
Expand All @@ -353,6 +362,16 @@ void singular_define_ideals(jlcxx::Module & Singular)
return std::make_tuple(res, factors, unit);
});

Singular.method("id_DivRem_Unit", [](ideal m, ideal sm, ring o, int flag) {
const ring origin = currRing;
rChangeCurrRing(o);
ideal factors;
ideal unit;
ideal res = idDivRem(sm, m, factors, &unit, flag);
rChangeCurrRing(origin);
return std::make_tuple(res, factors, unit);
});

Singular.method("id_Lift", [](ideal m, ideal sm, ring o) {
const ring origin = currRing;
rChangeCurrRing(o);
Expand Down Expand Up @@ -601,6 +620,22 @@ void singular_define_ideals(jlcxx::Module & Singular)
delete v;
rChangeCurrRing(origin);
});
Singular.method("scHilbWeighted", [](ideal I, ring r, jlcxx::ArrayRef<int> weights, jlcxx::ArrayRef<int> shifts, jlcxx::ArrayRef<int> a) {
intvec * w = to_intvec(weights);
intvec * sh = to_intvec(shifts);
const ring origin = currRing;
rChangeCurrRing(r);
intvec *v=hFirstSeries(I,sh,r->qideal,w);
delete sh;
delete w;
int * content = v->ivGetVec();
for(int j = 0; j < v->length(); j++)
{
a.push_back(content[j]);
}
delete v;
rChangeCurrRing(origin);
});
Singular.method("id_Homogen", id_Homogen);
Singular.method("id_HomModule", [](jlcxx::ArrayRef<int> weights, ideal I, ring r) {
intvec* w = NULL;
Expand Down

0 comments on commit f693c76

Please sign in to comment.