Changeset 5dc4ea in git


Ignore:
Timestamp:
Sep 18, 1997, 11:58:26 AM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1a5daea04547872672e8d5c6d19ac391e34ca05e
Parents:
741512c3f18910d2025325eadcbef56647da00d0
Message:
* hannes: changes to naLcm, naNormalize
* greuel/hannes: changes to deform.lib invar.lib(Header) matrix.lib
     prim_dec.lib primdec.lib


git-svn-id: file:///usr/local/Singular/svn/trunk@730 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/deform.lib

    r741512c r5dc4ea  
    1 // $Id: deform.lib,v 1.2 1997-04-28 19:27:15 obachman Exp $
     1// $Id: deform.lib,v 1.3 1997-09-18 09:58:22 Singular Exp $
    22//(BM/GMG, last modified 22.06.96)
    33///////////////////////////////////////////////////////////////////////////////
     
    4242            ideal jetJ - defining the miniversal base space (in `na`)
    4343            ideal jetF - defining miniversal total space (in `na`)
    44 NOTE:    printlevel >=0: display dimT1,T2 and explain created objects (default)
     44NOTE:    printlevel >=0: display dimT1,T2 and miniversal equations (default)
    4545         printlevel >=1: show partial + final result during computation
    4646         printlevel >=2: show also memory and time usage
     
    7272   id = simplify(id,10);
    7373   int @rowR = size(id);
    74    if( @rowR<=1 )
    75    {
    76       "// hypersurface, use proc deform from sing.lib";
    77       return();
    78    }
     74   //if( @rowR<=1 )
     75   //{
     76   //   "// hypersurface, use proc deform from sing.lib";
     77   //   return();
     78   //}
    7979//------- change ordering if not correct --------------------------------------
    8080   @t1=1;
     
    221221   }
    222222//---------  end loop and final output ---------------------------------------
    223 dbprint(p-1,"","// ___ Equations of miniversal base space ___",jetJ,
    224             "","// ___ Equations of miniversal total space ___",jetF);
    225 dbprint(p,"","// Result belongs to ring "+@na+".",
    226        "// Equations of total space of miniversal deformation are ",
    227        "// given by jetF, equations of miniversal base space by jetJ.",
     223dbprint(p,"","// ___ Equations of miniversal base space (jetJ) ___",jetJ,
     224          "","// ___ Equations of miniversal total space (jetF) ___",jetF);
     225dbprint(p,"","// Equations of base space of miniversal deformation are given",
     226       "// by the ideal jetJ, equations of miniversal total space by jetF.",
     227       "// Both are defined in the ring "+@na+" created in 'miniversal'.",
    228228       "// Make "+@na+" the basering and list objects defined in "+@na+" by typing:",
    229        "   setring "+@na+"; show("+@na+");","   listvar(ideal);");
     229       "// setring "+@na+";  show("+@na+");  listvar(ideal);");
    230230  kill @On;
    231231  return();
  • Singular/LIB/invar.lib

    r741512c r5dc4ea  
    1 // $Id: invar.lib,v 1.2 1997-09-10 07:52:55 Singular Exp $
     1// $Id: invar.lib,v 1.3 1997-09-18 09:58:24 Singular Exp $
    22///////////////////////////////////////////////////////
    33// invar.lib
    44// algorithm for computing the ring of invariants under
    5 // the action of the additive group
     5// the action of the additive group (C,+)
    66// written by Gerhard Pfister
    77//////////////////////////////////////////////////////
    88
    9 LIBRARY: invar.lib PROCEDURE FOR COMPUTING INVARIANTS UNDER C+-ACTIONS
     9LIBRARY: invar.lib PROCEDURE FOR COMPUTING INVARIANTS UNDER (C,+)-ACTIONS
    1010
    1111  invariantRing(matrix m,poly p,poly q,int choose)
  • Singular/LIB/matrix.lib

    r741512c r5dc4ea  
    1 // $Id: matrix.lib,v 1.3 1997-08-12 14:01:08 Singular Exp $
     1// $Id: matrix.lib,v 1.4 1997-09-18 09:58:24 Singular Exp $
    22// (GMG/BM, last modified 22.06.96)
    33///////////////////////////////////////////////////////////////////////////////
     
    1212 is_complex(c);         1 if list c is a complex, 0 if not
    1313 outer(A,B);            matrix, outer product of matrices A and B
     14 power(A,n);            matrix/intmat, n-th power of matrix/intmat A
    1415 skewmat(n[,id]);       generic skew-symmetric nxn matrix [entries from id]
    1516 submat(A,r,c);         submatrix of A with rows/cols specified by intvec r/c
     
    265266////////////////////////////////////////////////////////////////////////////////
    266267
     268proc power ( A, int n)
     269USAGE:   power(A,n);  A a square-matrix of type intmat or matrix, n=integer
     270RETURN:  inmat resp. matrix, the n-th power of A
     271NOTE:    for intamt and big n the result may be wrong because of int overflow
     272EXAMPLE: example power; shows an example
     273{
     274//---------------------------- type checking ----------------------------------
     275   if( typeof(A)!="matrix" and typeof(A)!="intmat" )
     276   {
     277      "// no matrix or intmat!";
     278      return (A);
     279   }
     280   if( ncols(A) != nrows(A) )
     281   {
     282      "// not a suare matrix!";
     283      return();
     284   }
     285//---------------------------- trivial cases ----------------------------------
     286   int ii;
     287   if( n <= 0 )
     288   {
     289      if( typeof(A)=="matrix" )
     290      {
     291         return (unitmat(nrows(A)));
     292      }
     293      if( typeof(A)=="intmat" )
     294      {
     295         intmat B[nrows(A)][nrows(A)];
     296         for( ii=1; ii<=nrows(A); ii++ )
     297         {
     298            B[ii,ii] = 1;
     299         }
     300         return (B);
     301      }
     302   }
     303   if( n == 1 ) { return (A); }
     304//---------------------------- sub procedure ----------------------------------
     305   proc matpow (A, int n)
     306   {
     307      def B = A*A;
     308      int ii= 2;
     309      int jj= 4;
     310      while( jj <= n )
     311      {
     312         B=B*B;
     313         ii=jj;
     314         jj=2*jj;
     315      }
     316      return(B,n-ii);
     317   }
     318//----------------------------- main program ----------------------------------
     319   list L = matpow(A,n);
     320   def B  = L[1];
     321   ii     = L[2];
     322   while( ii>=2 )
     323   {
     324      L = matpow(A,ii);
     325      B = B*L[1];
     326      ii= L[2];
     327   }
     328   if( ii == 0) { return(B); }
     329   if( ii == 1) { return(A*B); }
     330}
     331example
     332{ "EXAMPLE:"; echo = 2;
     333   intmat A[3][3]=1,2,3,4,5,6,7,8,9;
     334   print(power(A,3));"";
     335   ring r=0,(x,y,z),dp;
     336   matrix B[4][4]=0,x,y,z,0,0,y,z,0,0,0,z,x,y,z,0;
     337   print(power(B,3));"";
     338   matrix C[3][3]=1,2,3,4,5,6,7,8,9;
     339   power(C,50);
     340}
     341////////////////////////////////////////////////////////////////////////////////
     342
    267343proc skewmat (int n, list #)
    268344USAGE:   skewmat(n[,id]);  n integer, id ideal
  • Singular/LIB/prim_dec.lib

    r741512c r5dc4ea  
    1 // $Id: prim_dec.lib,v 1.5 1997-08-12 17:14:45 Singular Exp $
     1// $Id: prim_dec.lib,v 1.6 1997-09-18 09:58:25 Singular Exp $
    22///////////////////////////////////////////////////////
    33// pseudoprimdec.lib
     
    77//////////////////////////////////////////////////////
    88
    9 LIBRARY: prim_dec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (II)
     9LIBRARY: prim_dec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (S/Y)
    1010
    1111  min_ass_prim_charsets (ideal I, int choose)
  • Singular/LIB/primdec.lib

    r741512c r5dc4ea  
    1 // $Id: primdec.lib,v 1.4 1997-09-10 10:55:39 Singular Exp $
     1// $Id: primdec.lib,v 1.5 1997-09-18 09:58:26 Singular Exp $
    22///////////////////////////////////////////////////////
    33// primdec.lib
     
    77//////////////////////////////////////////////////////
    88
    9 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (I)
     9LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (G/T/Z)
    1010
    1111  minAssPrimes (ideal I, list choose)
  • Singular/longalg.cc

    r741512c r5dc4ea  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.11 1997-09-16 13:45:32 Singular Exp $ */
     4/* $Id: longalg.cc,v 1.12 1997-09-18 09:58:20 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    5454/* procedure variables */
    5555static numberfunc
    56                 nacMult, nacSub, nacAdd, nacDiv, nacGcd, nacLcm;
     56                nacMult, nacSub, nacAdd, nacDiv, nacIntDiv, nacGcd, nacLcm;
    5757#ifdef LDEBUG
    5858static void     (*nacDBDelete)(number *a,char *f,int l);
     
    7979static int napExpi(int i, alg a, alg b);
    8080
     81static number nadGcd( number a, number b) { return nacInit(1); }
    8182/*2
    8283*  sets the appropriate operators
     
    114115      nacMult        = nlMult;
    115116      nacDiv         = nlDiv;
     117      nacIntDiv      = nlIntDiv;
    116118      nacInvers      = nlInvers;
    117119      nacNormalize   = nlNormalize;
     
    145147      nacMult        = npMult;
    146148      nacDiv         = npDiv;
     149      nacIntDiv      = npDiv;
    147150      nacInvers      = npInvers;
    148151      nacNormalize   = nDummy2;
     
    154157      nacIsOne       = npIsOne;
    155158      nacIsMOne      = npIsMOne;
    156       nacGcd         = ndGcd;
    157       nacLcm         = ndGcd;
     159      nacGcd         = nadGcd;
     160      nacLcm         = nadGcd;
    158161    }
    159162  }
     
    167170
    168171/*============= procedure for polynomials: napXXXX =======================*/
     172
     173#define napSetCoeff(p,n) {nacDelete(&((p)->ko));(p)->ko=n;}
     174#define napIter(A) A=(A)->ne
     175
    169176
    170177/*3
     
    20162023  }
    20172024#endif
     2025  /* remove common factors from z and n */
     2026  x=p->z;
     2027  y=p->n;
     2028  if(!nacGreaterZero(napGetCoeff(y)))
     2029  {
     2030    x=napNeg(x);
     2031    y=napNeg(y);
     2032  }
     2033  number g=nacCopy(napGetCoeff(x));
     2034  napIter(x);
     2035  while (x!=NULL)
     2036  {
     2037    number d=nacGcd(g,napGetCoeff(x));
     2038    if(nacIsOne(d))
     2039    {
     2040      nacDelete(&g);
     2041      nacDelete(&d);
     2042      return;
     2043    }
     2044    nacDelete(&g);
     2045    g = d;
     2046    napIter(x);
     2047  }
     2048  while (y!=NULL)
     2049  {
     2050    number d=nacGcd(g,napGetCoeff(y));
     2051    if(nacIsOne(d))
     2052    {
     2053      nacDelete(&g);
     2054      nacDelete(&d);
     2055      return;
     2056    }
     2057    nacDelete(&g);
     2058    g = d;
     2059    napIter(y);
     2060  }
     2061  x=p->z;
     2062  y=p->n;
     2063  while (x!=NULL)
     2064  {
     2065    number d = nacIntDiv(napGetCoeff(x),g);
     2066    napSetCoeff(x,d);
     2067    napIter(x);
     2068  }
     2069  while (y!=NULL)
     2070  {
     2071    number d = nacIntDiv(napGetCoeff(y),g);
     2072    napSetCoeff(y,d);
     2073    napIter(y);
     2074  }
     2075  nacDelete(&g);
    20182076}
    20192077
Note: See TracChangeset for help on using the changeset viewer.