spielwiese
Last change
on this file since 075bc5 was
075bc5,
checked in by Hans Schoenemann <hannes@…>, 5 years ago
|
format
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #include "Singular/libsingular.h" |
---|
2 | // search an ideal for entries with the same lead term |
---|
3 | |
---|
4 | BOOLEAN same_lt(leftv res, leftv arg) |
---|
5 | { |
---|
6 | if ((currRing!=NULL) && (arg!=NULL) && (arg->Typ()==IDEAL_CMD)) |
---|
7 | { |
---|
8 | ideal I=(ideal)arg->Data(); |
---|
9 | int i,j; |
---|
10 | lists L=(lists)omAllocBin(slists_bin); |
---|
11 | L->Init(); |
---|
12 | res->rtyp=LIST_CMD; |
---|
13 | res->data=L; |
---|
14 | for (i=0;i<IDELEMS(I)-1;i++) |
---|
15 | { |
---|
16 | if (I->m[i]!=NULL) |
---|
17 | { |
---|
18 | for(j=i+1;j<IDELEMS(I);j++) |
---|
19 | { |
---|
20 | if (I->m[j]!=NULL) |
---|
21 | { |
---|
22 | if (p_LmCmp(I->m[i],I->m[j],currRing)==0) |
---|
23 | { |
---|
24 | L->Init(2); |
---|
25 | L->m[0].rtyp=INT_CMD; L->m[0].data=(void*)(long)(i+1); |
---|
26 | L->m[1].rtyp=INT_CMD; L->m[1].data=(void*)(long)(j+1); |
---|
27 | return FALSE; |
---|
28 | } |
---|
29 | } |
---|
30 | } |
---|
31 | } |
---|
32 | } |
---|
33 | return FALSE; /* not found */ |
---|
34 | } |
---|
35 | WerrorS("same_lt(ideal)"); |
---|
36 | return TRUE; |
---|
37 | } |
---|
38 | |
---|
39 | extern "C" int mod_init(SModulFunctions* psModulFunctions) |
---|
40 | { |
---|
41 | psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""),"same_lt",FALSE,same_lt); |
---|
42 | return MAX_TOK; |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.