Changeset 805b2d5 in git for Singular


Ignore:
Timestamp:
Mar 10, 2009, 7:15:13 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4bd32dfef92ec9f5ed8dceee82d14318ae147107')
Children:
808b4e3d84e15799d00c2dbe5ac2b08aefa48d3f
Parents:
ecf319831bc643539b3751c9a97ccf85d1bca4df
Message:
*levandov: numerous bugfixes and improvements in vct2str mod2str lst2str


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/freegb.lib

    recf3198 r805b2d5  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: freegb.lib,v 1.18 2009-03-06 20:54:45 levandov Exp $";
     2version="$Id: freegb.lib,v 1.19 2009-03-10 18:15:13 levandov Exp $";
    33category="Noncommutative";
    44info="
     
    2121vct2str(M[, n]);   convert a vector into a word in free algebra
    2222lieBracket(a,b[, N]);    compute Lie bracket ab-ba of two letterplace polynomials
    23 serreRelations(A,z);          compute the ideal of Serre's relations associated to a generalized Cartan matrix A
    24 isVar(p);             check whether p is a power of a single variable
    25 adem(i,j);            compute the ideal of Adem relations for i<2j in char 0
     23serreRelations(A,z);   compute the ideal of Serre's relations associated to a generalized Cartan matrix A
     24isVar(p);                   check whether p is a power of a single variable
     25ademRelations(i,j);    compute the ideal of Adem relations for i<2j in char 0
    2626
    2727SEE ALSO: LETTERPLACE
     
    136136{
    137137  // skips zeros in a vector, producing another vector
     138  if ( (v[1]==0) || (v==0) ) { return(vector(0)); }
    138139  int sv = nrows(v);
    139140  int sw = size(v);
     
    170171  if ( size(#)>0 )
    171172  {
     173    if ( typeof(#[1]) != "int")
     174    {
     175      ERROR("Second argument of type int expected");
     176    }
    172177    if (#[1])
    173178    {
     
    177182  int i;
    178183  int s    = size(L);
     184  if (s<1) { return(list(""));}
    179185  list N;
    180186  for(i=1; i<=s; i++)
     
    212218"
    213219{
     220  if (size(M)==0) { return(""); }
    214221  // returns a string
    215222  // a sentence in words built from M
     
    218225  if ( size(#)>0 )
    219226  {
     227    if ( typeof(#[1]) != "int")
     228    {
     229      ERROR("Second argument of type int expected");
     230    }
    220231    if (#[1])
    221232    {
     
    236247    else
    237248    {
    238       t = t + "+" + mp;
     249      if (mp != "")
     250      {
     251         t = t + "+" + mp;
     252      }
    239253    }
    240254  }
     
    262276"
    263277{
     278  if (v==0) { return(""); }
    264279  // if #[1] = 1, use * between generators
    265280  int useStar = 0;
     
    275290  // produces a string for it
    276291  v = skip0(v);
     292  if (v==0) { return(string(""));}
    277293  number cf = leadcoef(v[1]);
    278294  int s = size(v);
     
    284300    if (p==0)
    285301    {
    286       err = "Error: monomial expected at" + string(i+1);
    287       dbprint(ppl,err);
    288       return("_");
     302      err = "Error: monomial expected at nonzero position " + string(i+1);
     303      ERROR(err+" in vct2str");
     304      //      dbprint(ppl,err);
     305      //      return("_");
    289306    }
    290307    if (p==1)
     
    324341  {
    325342    scf = string(cf);
    326     if (cf == 1)
     343    if ( (cf == 1) && (size(vs)>0) )
    327344    {
    328345      scf = "";
     
    348365"USAGE:  isVar(p);  poly p
    349366RETURN:  int
    350 PURPOSE: checks whether p is a power of a single variable from the basering.
    351 @* Returns the exponent or 0 is p is not a power of  a single variable.
     367PURPOSE: check, whether leading monomial of p is a power of a single variable
     368@* from the basering. Returns the exponent or 0 if p is multivariate.
    352369EXAMPLE: example isVar; shows examples
    353370"
     
    381398  poly f = xy+1;
    382399  isVar(f);
    383   poly g = xy;
     400  poly g = y^3;
    384401  isVar(g);
    385   poly h = y^3;
     402  poly h = 7*x^3;
    386403  isVar(h);
    387404  poly i = 1;
     
    15061523end older procs and tests */
    15071524
    1508 proc adem(int i, int j)
    1509 "USAGE:  adem(i,j); i,j int
     1525proc ademRelations(int i, int j)
     1526"USAGE:  ademRelations(i,j); i,j int
    15101527RETURN:  ring (and exports ideal)
    15111528ASSUME: there are at least i+j variables in the basering
    15121529PURPOSE: compute the ideal of Adem relations for i<2j in characteristic 0
    15131530@*  the ideal is exported under the name AdemRel in the output ring
    1514 EXAMPLE: example adem; shows examples
     1531EXAMPLE: example ademRelations; shows examples
    15151532"
    15161533{
     
    15451562{
    15461563  "EXAMPLE:"; echo = 2;
    1547   def A = adem(2,5);
     1564  def A = ademRelations(2,5);
    15481565  setring A;
    15491566  AdemRel;
     
    25262543  return(0);
    25272544}
     2545
     2546// alias libs for compatibility with older examples
     2547proc freegbRing(int d)
     2548{
     2549  return(makeLetterplaceRing(d));
     2550}
     2551
     2552proc freegbasis( list L, int n)
     2553{
     2554  return(freeGBasis(L, n));
     2555}
Note: See TracChangeset for help on using the changeset viewer.