Changeset abb4919 in git


Ignore:
Timestamp:
Jan 9, 2007, 11:35:28 AM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
18739516b73f47dc5e237129de66197ffbdf47ec
Parents:
699ece64eb7bed7070edb4e5608ea2526b119f8f
Message:
*hannes: renameing


git-svn-id: file:///usr/local/Singular/svn/trunk@9649 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
1 added
5 moved

Legend:

Unmodified
Added
Removed
  • Singular/LIB/aksaka.lib

    r699ece rabb4919  
    11//CM, last modified 10.12.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: ASK.lib,v 1.3 2006-12-15 14:15:51 Singular Exp $";
     3version="$Id: aksaka.lib,v 1.1 2007-01-09 10:31:48 Singular Exp $";
    44category="Teaching";
    55info="
    6 LIBRARY: ASK.lib
     6LIBRARY: aksaka.lib
    77         Procedures for primality testing after Agrawal, Saxena, Kayal
    88AUTHORS: Christoph Mang
     
    2424";
    2525
    26 LIB "krypto.lib";
     26LIB "crypto.lib";
    2727LIB "ntsolve.lib";
    2828
     
    3131//   FAST (MODULAR) EXPONENTIATION                           //
    3232//                                                           //
    33 /////////////////////////////////////////////////////////////// 
     33///////////////////////////////////////////////////////////////
    3434proc schnellexpt(number a,number m,number n)
    3535"USAGE: schnellexpt(a,m,n);
     
    7373////////////////////////////////////////////////////////////////////////////
    7474proc coeffmod(poly f,number n)
    75 "USAGE: coeffmod(f,n); 
     75"USAGE: coeffmod(f,n);
    7676ASSUME: poly f depends on at most var(1) of the basering
    77 RETURN: poly f modulo number n 
    78 NOTE:   at first the coefficients of the monomials of the poly f are 
    79         determined, then their remainder modulo n is calculated, 
    80         after that the poly 'is put together' again 
     77RETURN: poly f modulo number n
     78NOTE:   at first the coefficients of the monomials of the poly f are
     79        determined, then their remainder modulo n is calculated,
     80        after that the poly 'is put together' again
    8181EXAMPLE:example coeffmod; shows an example
    8282"
    83 { 
     83{
    8484  matrix M=coeffs(f,var(1));         //Bestimmung der Polynomkoeffizienten
    8585  int i=1;
     
    8888
    8989  while(i<=o)
    90     {           
     90    {
    9191      g=g+(leadcoef(M[i,1]) mod n)*var(1)^(i-1) ;
    92                      // umwandeln der Koeffizienten in numbers, 
    93                      // Berechnung der Reste dieser numbers modulo n, 
    94                      // poly mit neuen Koeffizienten wieder zusammensetzen 
     92                     // umwandeln der Koeffizienten in numbers,
     93                     // Berechnung der Reste dieser numbers modulo n,
     94                     // poly mit neuen Koeffizienten wieder zusammensetzen
    9595      i=i+1;
    9696    }
     
    9898}
    9999example
    100 { "EXAMPLE:"; echo = 2;                           
     100{ "EXAMPLE:"; echo = 2;
    101101   ring R = 0,x,dp;
    102102   poly f=2457*x4+52345*x3-98*x2+5;
    103103   number n=3;
    104104   coeffmod(f,n);
    105 } 
     105}
    106106//////////////////////////////////////////////////////////////////////////
    107107proc powerpolyX(number q,number n,poly a,poly r)
    108 "USAGE: powerpolyX(q,n,a,r); 
    109 RETURN: the q-th power of poly a modulo poly r and number n         
     108"USAGE: powerpolyX(q,n,a,r);
     109RETURN: the q-th power of poly a modulo poly r and number n
    110110EXAMPLE:example powerpolyX; shows an example
    111111"
    112112{
    113113  ideal I=std(r);
    114    
     114
    115115   if(q==1){return(coeffmod(reduce(a,I),n));}
    116116   if((q mod 5)==0){return(coeffmod(reduce(powerpolyX(q/5,n,a,r)^5,I),n));}
     
    120120
    121121  return(coeffmod(reduce(a*powerpolyX(q-1,n,a,r),I),n));
    122 } 
    123 example
    124 { "EXAMPLE:"; echo = 2;                             
     122}
     123example
     124{ "EXAMPLE:"; echo = 2;
    125125   ring R=0,x,dp;
    126126   poly a=3*x3-x2+5;
     
    470470}
    471471
    472 
  • Singular/LIB/arcpoint.lib

    r699ece rabb4919  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: arcAtPoint.lib,v 1.3 2006-07-31 12:15:57 Singular Exp $";
     2version="$Id: arcpoint.lib,v 1.1 2007-01-09 10:31:48 Singular Exp $";
    33//-*- mode:C++;-*-
    44
    55category="Singularities";
    66info="
    7 LIBRARY:  arcAtPoint.lib        Truncations of arcs at a singular point
     7LIBRARY:  arcpoint.lib          Truncations of arcs at a singular point
    88AUTHOR:   Nadine Cremer         cremer@mathematik.uni-kl.de
    99
  • Singular/LIB/atkins.lib

    r699ece rabb4919  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: AtkinsTest.lib,v 1.8 2007-01-08 14:08:49 Singular Exp $";
     2version="$Id: atkins.lib,v 1.1 2007-01-09 10:31:48 Singular Exp $";
    33category="Teaching";
    44info="
    5 LIBRARY:  AtkinsTest.lib     Procedures for teaching cryptography
    6 AUTHOR:                      Stefan Steidel, Stefan.Steidel@gmx.de
     5LIBRARY:  atkins.lib     Procedures for teaching cryptography
     6AUTHOR:                  Stefan Steidel, Stefan.Steidel@gmx.de
    77
    88NOTE: The library contains auxiliary procedures to compute the elliptic
     
    3232";
    3333
    34 LIB "krypto.lib";
     34LIB "crypto.lib";
    3535LIB "general.lib";
    3636LIB "ntsolve.lib";
  • Singular/LIB/crypto.lib

    r699ece rabb4919  
    11//GP, last modified 28.6.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: krypto.lib,v 1.5 2006-12-22 12:06:28 pfister Exp $";
     3version="$Id: crypto.lib,v 1.1 2007-01-09 10:31:49 Singular Exp $";
    44category="Teaching";
    55info="
    6 LIBRARY:  krypto.lib     Procedures for teaching cryptography
     6LIBRARY:  crypto.lib     Procedures for teaching cryptography
    77AUTHOR:                  Gerhard Pfister, pfister@mathematik.uni-kl.de
    88
  • Singular/LIB/modstd.lib

    r699ece rabb4919  
    1 
    21//GP, last modified 23.10.06
    32///////////////////////////////////////////////////////////////////////////////
    4 version="$Id: modStd.lib,v 1.2 2006-12-22 14:03:17 pfister Exp $";
     3version="$Id: modstd.lib,v 1.1 2007-01-09 10:31:49 Singular Exp $";
    54category="Commutative Algebra";
    65info="
    7 LIBRARY: modStd.lib  Grobner basis of ideals
     6LIBRARY: modstd.lib  Grobner basis of ideals
    87AUTHORS: A. Hashemi,     Amir.Hashemi@lip6.fr
    98@*       G. Pfister      pfister@mathematik.uni-kl.de
     
    1211NOTE:
    1312 A library for computing the Grobner basis of an ideal in the polynomial
    14  ring over the rational numbers using modular methods.The procedures are 
     13 ring over the rational numbers using modular methods.The procedures are
    1514 inspired by the following paper:
    1615 Elizabeth A. Arnold:
    17  Modular Algorithms for Computing Groebner Bases , Journal of Symbolic 
     16 Modular Algorithms for Computing Groebner Bases , Journal of Symbolic
    1817 Computation , April 2003, Volume 35, (4), p. 403-419.
    1918
     
    2120PROCEDURES:
    2221modStd(I,1);   compute the reduced Groebner basis of I using modular methods
    23 modS(I,L);     liftings to Q of Groebner bases of I mod p for p in L 
     22modS(I,L);     liftings to Q of Groebner bases of I mod p for p in L
    2423primeList(n);  list of n primes  <= 2134567879 in decreasing order
    2524";
    2625
    27 LIB "krypto.lib";
     26LIB "crypto.lib";
    2827///////////////////////////////////////////////////////////////////////////////
    2928proc modStd(ideal I,list #)
     
    3433         it is not tested whether the result contains I.
    3534         if #[1]=1:
    36          a Groebner basis which contains I if no warning appears; 
    37          if I is homogeneous it is a Groebner basis of I 
    38 NOTE:    the procedure computes the reduced Groebner basis of I (over the 
    39          rational numbers) by using  modular methods. If #[1]=1 and a 
     35         a Groebner basis which contains I if no warning appears;
     36         if I is homogeneous it is a Groebner basis of I
     37NOTE:    the procedure computes the reduced Groebner basis of I (over the
     38         rational numbers) by using  modular methods. If #[1]=1 and a
    4039         warning appears then the result is a Groebner basis with no defined
    41          relation to I; this is a sign that not enough prime numbers have 
     40         relation to I; this is a sign that not enough prime numbers have
    4241         been used. For further experiments see procedure modS.
    4342EXAMPLE: example modStd; shows an example
     
    5655  ideal J,cT,lT,K;
    5756  ideal I0=I;
    58  
     57
    5958  for (j=1;j<=size(L);j++)
    6059  {
     
    102101      TT[k]=T[k][j];
    103102    }
    104     J[j]=liftPoly(TT,L); 
     103    J[j]=liftPoly(TT,L);
    105104  }
    106105  //=========== chooses more primes up to the moment the result becomes stable
     
    156155    J=std(J);
    157156    I0=reduce(I0,J);
    158     if(size(I0)>0){"WARNING: The input ideal is not contained 
     157    if(size(I0)>0){"WARNING: The input ideal is not contained
    159158                        in the ideal generated by the standardbasis";}
    160159  }
     
    168167   ideal J=modStd(I);
    169168   J;
    170 }   
     169}
    171170///////////////////////////////////////////////////////////////////////////////
    172171proc modS(ideal I, list L)
     
    235234    }
    236235    J[j]=liftPoly(TT,L);
    237  
     236
    238237  }
    239238  attrib(J,"isSB",1);
     
    247246   ideal J=modS(I,L);
    248247   J;
    249 }   
    250 /////////////////////////////////////////////////////////////////////////////// 
     248}
     249///////////////////////////////////////////////////////////////////////////////
    251250proc liftPoly(list T, list L)
    252251"USAGE:  liftPoly(T,L); T list of polys, L list of primes
     
    260259   list TT;
    261260   number n;
    262  
     261
    263262   number N=L[1];
    264263   for(i=2;i<=size(L);i++)
     
    290289     }
    291290     n=chineseR(TT,L);
    292      n=Farey(N,n);   
     291     n=Farey(N,n);
    293292     result=result+n*p;
    294293   }
     
    300299   list T=x2+7000x+13000,x2+100x+147y+40,x2+120x+191y+10,x2+x+67y+100;
    301300   liftPoly(T,L);
    302 }   
     301}
    303302///////////////////////////////////////////////////////////////////////////////
    304303proc Farey (number P, number N)
    305304"USAGE:  Farey (P,N); P, N number;
    306 RETURN:  a rational number a/b such that a/b=N mod P 
     305RETURN:  a rational number a/b such that a/b=N mod P
    307306         and |a|,|b|<(P/2)^{1/2}
    308307"
     
    316315   {
    317316        if (2*N^2<P){return(N/B);}
    318         D=E mod N;
    319         C=A-(E-E mod N)/N*B;
    320         E=N;
    321         N=D;
    322         A=B;
    323         B=C;
     317        D=E mod N;
     318        C=A-(E-E mod N)/N*B;
     319        E=N;
     320        N=D;
     321        A=B;
     322        B=C;
    324323   }
    325324   return(0);
     
    329328   ring R = 0,x,dp;
    330329   Farey(32003,12345);
    331 }   
     330}
    332331///////////////////////////////////////////////////////////////////////////////
    333332proc chineseR(list T,list L)
    334333"USAGE:  chineseRem(T,L);
    335334RETURN: x such that x = T[i] mod L[i]
    336 NOTE:   chinese remainder theorem 
     335NOTE:   chinese remainder theorem
    337336EXAMPLE:example chineseRem; shows an example
    338337"
     
    370369   ring R = 0,x,dp;
    371370   chineseRem(list(24,15,7),list(2,3,5));
    372 }   
     371}
    373372///////////////////////////////////////////////////////////////////////////////
    374373proc primeList(int n)
    375374"USAGE:  primeList(n);
    376 RETURN: the list of n greatest primes  <= 2134567879   
     375RETURN: the list of n greatest primes  <= 2134567879
    377376EXAMPLE:example primList; shows an example
    378377"
     
    393392   size(L);
    394393   L[size(L)];
    395 }   
     394}
    396395///////////////////////////////////////////////////////////////////////////////
    397396/*
Note: See TracChangeset for help on using the changeset viewer.