source: git/Singular/LIB/standard.lib @ 03645f4

fieker-DuValspielwiese
Last change on this file since 03645f4 was 0fbdd1, checked in by Hans Schönemann <hannes@…>, 27 years ago
* hannes/greuel: all.lib: update homolog.lib: changed printing inout.lib: added showrec, changed show ring.lib: added substitute,copyring,swapvars,extendring1 sing.lib: changed spectrum, T1, codim standard.lib: changed help git-svn-id: file:///usr/local/Singular/svn/trunk@709 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.2 KB
Line 
1// $Id: standard.lib,v 1.4 1997-09-12 07:40:37 Singular Exp $
2///////////////////////////////////////////////////////////////////////////////
3
4LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
5
6 stdfglm(ideal[,ord])   standard basis of the ideal via fglm [and ordering ord]
7 stdhilbert(ideal)      standard basis of the ideal using the Hilbert function
8///////////////////////////////////////////////////////////////////////////////
9
10proc stdfglm (ideal i, list #)
11USAGE:   stdfglm(i[,s]); i ideal, s string (any allowed ordstr of a ring)
12RETURN:  stdfglm(i): standard basis of i in the basering, calculated via fglm
13                     from ordering "dp" to the ordering of the basering.
14         stdfglm(i,s): standard basis of i in the basering, calculated via
15                     fglm from ordering s to the ordering of the basering.
16EXAMPLE: example stdfglm; shows an example
17{
18   string os;
19   def dr= basering;
20   if( (size(#)==0) or (typeof(#[1]) != "string") )
21   {
22     os = "dp(" + string( nvars(dr) ) + ")";
23     if ( (find( ordstr(dr), os ) != 0) and (find( ordstr(dr), "a") == 0) )
24     {
25       os= "Dp";
26     }
27     else
28     {
29       os= "dp";
30     }
31   }
32   else { os = #[1]; }
33   execute "ring sr="+charstr(dr)+",("+varstr(dr)+"),"+os+";";
34   ideal i= fetch(dr,i);
35   intvec opt= option(get);
36   option(redSB);
37   i=std(i);
38   option(set,opt);
39   setring dr;
40   return (fglm(sr,i));
41}
42example
43{ "EXAMPLE:"; echo = 2;
44   ring r  = 0,(x,y,z),lp;
45   ideal i = y3+x2, x2y+x2, x3-x2, z4-x2-y;
46   ideal i1= stdfglm(i);         //uses fglm from "dp" to "lp"
47   i1;     
48   ideal i2= stdfglm(i,"Dp");    //uses fglm from "Dp" to "lp"
49   i2;
50}
51///////////////////////////////////////////////////////////////////////////////
52
53proc stdhilbert(ideal i,list #)
54USAGE:   stdhilbert(i);  i ideal
55         stdhilbert(i,v); i homogeneous ideal, v intvec (the Hilbert function)
56RETURN:  stdhilbert(i): a standard basis of i (computing v internally)
57         stdhilbert(i,v): standard basis of i, using the given Hilbert function
58EXAMPLE: example stdhilbert; shows an example
59{
60   def R=basering;
61
62   if((homog(i)==1)||(ordstr(basering)[1]=="d"))
63   {
64      if ((size(#)!=0)&&(homog(i)==1))
65      {
66         return(std(i,#[1]));
67      }
68
69      return(std(i));
70   }
71 
72   execute "ring S = ("+charstr(R)+"),("+varstr(R)+",@t),dp;";
73   ideal i=homog(imap(R,i),@t);
74   intvec v=hilb(std(i),1);
75   execute "ring T = ("+charstr(R)+"),("+varstr(R)+",@t),("+ordstr(R)+");";
76   ideal i=fetch(S,i);
77   ideal a=std(i,v);
78   setring R;
79   map phi=T,maxideal(1),1;
80   ideal a=phi(a);
81
82   int k,j;
83   poly m;
84   int c=size(i);
85
86   for(j=1;j<c;j++)
87   {
88     if(deg(a[j])==0)
89     {
90       a=ideal(1);
91       return(a);
92     }
93     if(deg(a[j])>0)
94     {
95       m=lead(a[j]);
96       for(k=j+1;k<=c;k++)
97       {
98          if(size(lead(a[k])/m)>0)
99          {
100            a[k]=0;
101          }
102       }
103     }
104   }
105   return(simplify(a,2));   
106}
107example
108{ "EXAMPLE:"; echo = 2;
109   ring  r = 0,(x,y,z),lp;
110   ideal i = y3+x2, x2y+x2, x3-x2, z4-x2-y;
111   ideal i1= stdhilbert(i); i1;
112   // is in this case equivalent to:
113   intvec v=1,0,0,-3,0,1,0,3,-1,-1;
114   ideal i2=stdhilbert(i,v);
115}
116///////////////////////////////////////////////////////////////////////////////
117
Note: See TracBrowser for help on using the repository browser.