Changeset 917fb5 in git for Singular/LIB/solve.lib


Ignore:
Timestamp:
Jul 6, 1999, 5:33:00 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
8e7ed6b81b8840e62d72f281eef096b71dc1b37e
Parents:
ce7ba606241efb95de4d1ab5581428b7143b3be2
Message:
* hannes: removed pause; (scanner.l, febase.*)
          introduced pause([string]) (standard.lib)


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/solve.lib

    rce7ba6 r917fb5  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: solve.lib,v 1.8 1999-07-06 11:33:13 obachman Exp $";
     3version="$Id: solve.lib,v 1.9 1999-07-06 15:32:57 Singular Exp $";
    44info="
    55LIBRARY: solve.lib     PROCEDURES TO SOLVE POLYNOMIAL SYSTEMS
     
    2121         l>0: defines precision of fractional part if ground field is Q
    2222         m=0,1,2: number of iterations for approximation of roots (default=2)
    23 ASSUME:  i is a zerodimensional ideal with 
    24          nvars(basering) = ncols(i) = number of vars actually occuring in i 
     23ASSUME:  i is a zerodimensional ideal with
     24         nvars(basering) = ncols(i) = number of vars actually occuring in i
    2525RETURN:  list of all (complex) roots of the polynomial system i = 0,
    2626         of type number if the ground field is the complex numbers,
     
    3333  int prec=30;
    3434
    35   if ( size(#) >= 1 ) 
    36     {
    37       typ= #[1];
    38       if ( typ < 0 || typ > 1 )
    39         {
    40           ERROR("Valid values for second parameter k are:
    41           0: use sparse Resultant (default)
    42           1: use Macaulay Resultant");
    43         }
    44     }
    45   if ( size(#) >= 2 ) 
    46     {
    47       prec= #[2];
    48       if ( prec == 0 ) { prec = 30; }
    49       if ( prec < 0 )
    50         {
    51           ERROR("Third parameter l must be positive!");
    52         }
    53     }
    54   if ( size(#) >= 3 ) 
    55     {
    56       polish= #[3];
    57       if ( polish < 0 || polish > 2 )
    58         {
    59           ERROR("Valid values for fourth parameter m are:
    60           0,1,2: number of iterations for approximation of roots");
    61         }
    62     }
    63 
    64   if ( size(#) > 3 ) 
    65     {
    66       ERROR("only three parameters allowed!");
    67     }
     35  if ( size(#) >= 1 )
     36  {
     37    typ= #[1];
     38    if ( typ < 0 || typ > 1 )
     39    {
     40      ERROR("Valid values for second parameter k are:
     41      0: use sparse Resultant (default)
     42      1: use Macaulay Resultant");
     43    }
     44  }
     45  if ( size(#) >= 2 )
     46  {
     47    prec= #[2];
     48    if ( prec == 0 ) { prec = 30; }
     49    if ( prec < 0 )
     50    {
     51      ERROR("Third parameter l must be positive!");
     52    }
     53  }
     54  if ( size(#) >= 3 )
     55  {
     56    polish= #[3];
     57    if ( polish < 0 || polish > 2 )
     58    {
     59      ERROR("Valid values for fourth parameter m are:
     60      0,1,2: number of iterations for approximation of roots");
     61    }
     62  }
     63
     64  if ( size(#) > 3 )
     65  {
     66    ERROR("only three parameters allowed!");
     67  }
    6868
    6969  int digits= system("setFloatDigits",prec);
    7070
    7171  return(uressolve(gls,typ,polish));
    72  
     72
    7373}
    7474example
     
    8181  // result is a list (x,y)-coordinates as strings
    8282
    83   pause;
    84   // now with complex coefficient field, precision is 10 digits 
     83  pause();
     84  // now with complex coefficient field, precision is 10 digits
    8585  ring rsc= (real,10,I),(x,y),lp;
    8686  ideal i = (2+3*I)*x2 + (0.35+I*45.0e-2)*y2 - 8, x2 + xy + (42.7)*y2;
     
    104104  int prec=30;
    105105
    106   if ( size(#) >= 1 ) 
    107     {
    108       prec= #[1];
    109       if ( prec == 0 ) { prec = 30; }
    110       if ( prec < 0 )
    111         {
    112           ERROR("Fisrt parameter must be positive!");
    113         }
    114     }
    115   if ( size(#) >= 2 ) 
    116     {
    117       polish= #[2];
    118       if ( polish < 0 || polish > 2 )
    119         {
    120           ERROR("Valid values for third parameter are:
    121           0,1,2: number of iterations for approximation of roots");
    122         }
    123     }
    124   if ( size(#) > 2 ) 
    125     {
    126       ERROR("only two parameters allowed!");
    127     }
     106  if ( size(#) >= 1 )
     107  {
     108    prec= #[1];
     109    if ( prec == 0 ) { prec = 30; }
     110    if ( prec < 0 )
     111    {
     112      ERROR("Fisrt parameter must be positive!");
     113    }
     114  }
     115  if ( size(#) >= 2 )
     116  {
     117    polish= #[2];
     118    if ( polish < 0 || polish > 2 )
     119    {
     120      ERROR("Valid values for third parameter are:
     121      0,1,2: number of iterations for approximation of roots");
     122    }
     123  }
     124  if ( size(#) > 2 )
     125  {
     126    ERROR("only two parameters allowed!");
     127  }
    128128
    129129  int digits= system("setFloatDigits",prec);
    130130
    131131  return(laguerre(f,polish));
    132  
     132
    133133}
    134134example
     
    140140  laguerre_solve(f);
    141141
    142   pause;
     142  pause();
    143143  // Now with 10 digits precision:
    144144  laguerre_solve(f,10);
    145145
    146   pause;
     146  pause();
    147147  // Now with complex coefficients, precision is 20 digits:
    148148  ring rsc= (real,20,I),x,lp;
     
    158158         k=1: resultant matrix of Macaulay (k=0 is default)
    159159ASSUME:  nvars(basering) = ncols(i)-1 = number of vars actually occuring in i,
    160          for k=1 i must be homogeneous 
    161 RETURN:  module representing the multipolynomial resultant matrix 
     160         for k=1 i must be homogeneous
     161RETURN:  module representing the multipolynomial resultant matrix
    162162EXAMPLE: example mp_res_mat; shows an example
    163163"
     
    165165  int typ=2;
    166166
    167   if ( size(#) == 1 ) 
    168     {
    169       typ= #[1];
    170       if ( typ < 0 || typ > 1 )
    171         {
    172           ERROR("Valid values for third parameter are:
    173           0: sparse resultant (default)
    174           1: Macaulay resultant");
    175         }
    176     }
    177   if ( size(#) > 1 ) 
    178     {
    179       ERROR("only two parameters allowed!");
    180     }
     167  if ( size(#) == 1 )
     168  {
     169    typ= #[1];
     170    if ( typ < 0 || typ > 1 )
     171    {
     172      ERROR("Valid values for third parameter are:
     173      0: sparse resultant (default)
     174      1: Macaulay resultant");
     175    }
     176  }
     177  if ( size(#) > 1 )
     178  {
     179    ERROR("only two parameters allowed!");
     180  }
    181181
    182182  return(mpresmat(i,typ));
    183  
     183
    184184}
    185185example
     
    194194  det(m);
    195195
    196   pause;
     196  pause();
    197197  // compute resultant matrix (Macaulay resultant matrix)
    198198  ring rdq= (0,u0,u1,u2),(x0,x1,x2),lp;
     
    204204  det(m);
    205205
    206   pause;
     206  pause();
    207207  // compute numerical sparse resultant matrix
    208208  setring rsq;
     
    219219ASSUME:  ground field K is the rational numbers,
    220220         p and v consist of numbers of the ground filed K, p must have
    221          n elements, v must have N=(d+1)^n elements where n=nvars(basering) 
    222          and d=deg(f) (f is the unknown polynomial in K[x1,...,xn]) 
     221         n elements, v must have N=(d+1)^n elements where n=nvars(basering)
     222         and d=deg(f) (f is the unknown polynomial in K[x1,...,xn])
    223223COMPUTE: polynomial f with values given by v at points p1,..,pN derived from p;
    224224         more precisely: consider p as point in K^n and v as N elements in K,
     
    251251}
    252252///////////////////////////////////////////////////////////////////////////////
    253 
    254 
    255 
    256 
    257 
    258 
Note: See TracChangeset for help on using the changeset viewer.