Changeset 3939bc in git for Singular/LIB/standard.lib


Ignore:
Timestamp:
May 29, 1998, 5:02:06 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1d4300694bf8c8b67ec71e837ab58b13264fedf7
Parents:
311499b3c35b89d435a5b5b44c51e0ace5b13c6c
Message:
* hannes: changed res->nres, resu->res


git-svn-id: file:///usr/local/Singular/svn/trunk@2009 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/standard.lib

    r311499 r3939bc  
    1 // $Id: standard.lib,v 1.16 1998-05-25 21:28:33 obachman Exp $
     1// $Id: standard.lib,v 1.17 1998-05-29 15:02:02 Singular Exp $
    22//////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.16 1998-05-25 21:28:33 obachman Exp $";
     4version="$Id: standard.lib,v 1.17 1998-05-29 15:02:02 Singular Exp $";
    55info="
    66LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
     
    88 stdfglm(ideal[,ord])   standard basis of the ideal via fglm [and ordering ord]
    99 stdhilb(ideal)         standard basis of the ideal using the Hilbert function
    10  groebner(ideal/module) standard basis of ideal or module using a 
    11                         heuristically choosen method 
     10 groebner(ideal/module) standard basis of ideal or module using a
     11                        heuristically choosen method
    1212";
    1313
     
    126126proc groebner(def i, list #)
    127127"USAGE: groebner(i[, wait]) i -- ideal/module; wait -- int
    128 RETURNS: Standard basis of ideal or module which is computed using a 
    129          heuristically choosen method: 
     128RETURNS: Standard basis of ideal or module which is computed using a
     129         heuristically choosen method:
    130130         If the ordering of the current ring is a local ordering, or
    131131         if it is a non-block ordering and the current ring has no
    132          parameters, then std(i) is returned. 
     132         parameters, then std(i) is returned.
    133133         Otherwise, i is mapped into a ring with no parameters and
    134134         ordering dp, where its Hilbert series is computed. This is
     
    136136         original ring.
    137137NOTE: If a 2nd argument 'wait' is given, then the computation proceeds
    138       at most 'wait' seconds. That is, if no result could be computed in 
    139       'wait' seconds, then the computation is interrupted, 0 is returned, 
    140       a warning message is displayed, and the global variable 
    141       'groebner_error' is defined. 
     138      at most 'wait' seconds. That is, if no result could be computed in
     139      'wait' seconds, then the computation is interrupted, 0 is returned,
     140      a warning message is displayed, and the global variable
     141      'groebner_error' is defined.
    142142EXAMPLE: example groebner; shows an example"
    143143{
     
    153153        int wait = #[1];
    154154        int j = 10;
    155        
     155
    156156        string bs = nameof(basering);
    157157        link l_fork = "MPtcp:fork";
     
    160160        int pid = read(l_fork);
    161161        write(l_fork, quote(groebner(eval(i))));
    162        
     162
    163163        // sleep in small intervalls for appr. one second
    164164        if (wait > 0)
     
    170170          }
    171171        }
    172        
     172
    173173        // sleep in intervalls of one second from now on
    174174        j = 1;
     
    178178          j = j + 1;
    179179        }
    180        
     180
    181181        if (status(l_fork, "read", "ready"))
    182182        {
     
    226226    return(std(i));
    227227  }
    228    
     228
    229229  int IsSimple_P;
    230230  if (system("nblocks") <= 2)
     
    265265    option(mem);
    266266  }
    267    
     267
    268268  // construct ring in which first std computation is done
    269269  string varstr_P = varstr(P);
    270270  string parstr_P = parstr(P);
    271   int is_homog = (homog(i) && (npars_P == 0)); 
    272    
     271  int is_homog = (homog(i) && (npars_P == 0));
     272
    273273  string ri = "ring Phelp =" + string(char(P)) + ",(" + varstr_P;
    274274  // parameters are converted to ring variables
     
    287287  // change the ring
    288288  execute(ri);
    289    
     289
    290290  // get ideal from previous ring
    291291  if (is_homog)
     
    298298    ideal qh=homog(imap(P,i),@t);
    299299  }
    300    
     300
    301301  // compute std and hilbert series
    302302  if (p_opt)
     
    322322    // additional variables were introduced
    323323    // need another intermediate ring
    324     ri = "ring Phelp1 =" + string(char(P)) 
     324    ri = "ring Phelp1 =" + string(char(P))
    325325      + ",(" + varstr(Phelp) + "),(" + ordstr_P;
    326      
     326
    327327    // for lp without parameters, we do not need a block ordering
    328328    if ( ! (IsSimple_P && (npars_P + is_homog < 2) && find(ordstr_P, "l")))
     
    332332    }
    333333    ri = ri + ");";
    334      
     334
    335335    // change to intermediate ring
    336336    execute(ri);
     
    348348      qh = subst(qh, @t, 1);
    349349    }
    350      
     350
    351351    // go back to original ring
    352352    setring P;
     
    370370  "EXAMPLE: "; echo = 2;
    371371  ring r = 0, (a,b,c,d), lp;
    372   option(prot); 
     372  option(prot);
    373373  ideal i = a+b+c+d, ab+ad+bc+cd, abc+abd+acd+bcd, abcd-1; // cyclic 4
    374374  groebner(i);
     
    384384
    385385//////////////////////////////////////////////////////////////////////////
    386 proc resu(list #)
     386proc res(list #)
    387387{
    388388   def P=basering;
    389389   list result;
    390390   def m=#[1]; //the ideal or module
    391    
     391
    392392   int i=#[2]; //the length of the resolution
    393393               //if size(#)>2 a minimal resolution is computed
     
    414414      setring P;
    415415      result=imap(Phelp,re);
    416       return(result);   
     416      return(result);
    417417   }
    418418
     
    439439   setring P;
    440440   result=imap(Phelp,re);
    441    return(result);     
     441   return(result);
    442442}
    443443
    444444proc minresu(list #)
    445445{
    446    return(resu(#[1],#[2],1));
    447 }
     446   return(res(#[1],#[2],1));
     447}
Note: See TracChangeset for help on using the changeset viewer.