Changeset 07fefd in git


Ignore:
Timestamp:
Nov 29, 2022, 11:58:20 AM (2 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
82410da1bb6e5c5036500137a8c9494ad341946c
Parents:
a1848a8b477dcf2db252b506e9fd7ceba77fd0548b6880871eb7f0dea5b3bbc2efc8c11035bf5d3b
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2022-11-29 11:58:20+01:00
git-committer:
GitHub <noreply@github.com>2022-11-29 11:58:20+01:00
Message:
Merge pull request #1164 from ssalone/BugFix_symNsym

Bug fix symNsym: fix and some comments corrected
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/chern.lib

    ra1848a r07fefd  
    177177          as well a non-symmetric remainder
    178178EXAMPLE:  example symNsym; shows an example
    179 NOTE:     constants are not considered symmetric
     179NOTE:     constants are considered symmetric
    180180"
    181181{
     
    215215  list l=symm(list(A@(1..nV) )); // symmetric functions in A@(i)
    216216  intvec v=leadexp(f), 0; // the exponent of the leading monomial
     217  int exponent;
     218  // We proceed as if the initial polynomial were symmetric.
     219  // Under this assumption the leading monomial will always be of the form
     220  // A@(1)^n1 * A@(2)^n2 * ... * A@(nV)^nnV, n1 >= n2 >= ... >= nnV.
     221  // Everything which contradicts this assumption is considered as a part of the remainder.
    217222  while(v[N1]!=0)
    218223  {
    219224    mon=leadcoef(f); // leading coefficient of f
    220225    monc=mon;
    221     for(i=1; v[N1+i-1]!=0 ;i++ )
    222     {
    223       mon = mon*c@(i)^( v[N1+i-1]-v[N1+i] );
    224       monc = monc*l[i]^( v[N1+i-1]-v[N1+i] ); // has the same leading coefficient as f
    225     }
    226     rez1=rez1+mon; // add a monomial
    227     f=f-monc; // subtract the monomial
     226    for(i=1; i<=nV && mon !=0 ;i++ )
     227    {
     228      exponent = v[N1+i-1]-v[N1+i];
     229      if( exponent >=0 ) // symmetric case
     230      {
     231        mon = mon*c@(i)^exponent;
     232        monc = monc*l[i]^exponent; // has the same leading coefficient as f
     233      }
     234      else // not the symmetric case
     235      {
     236        mon=0;
     237        monc=0;
     238      }
     239    }
     240    if(mon==0) // not the symmetric case
     241    {
     242      rez2=rez2+lead(f);
     243      f=f-lead(f);
     244    }
     245    else // symmetric case
     246    {
     247      rez1=rez1+mon; // add a monomial
     248      f=f-monc; // subtract the monomial
     249    }
    228250    v=leadexp(f), 0;
    229251  }
     
    245267  list l=c(1..3);
    246268  // The symmetric part of f = 3x2 + 3y2 + 3z2 + 7xyz + y
    247   // in terms of the elemenatary symmetric functions c(1), c(2), c(3)
     269  // in terms of the elementary symmetric functions c(1), c(2), c(3)
    248270  // and the remainder
    249271  poly f = 3x2 + 3y2 + 3z2 + 7xyz + y;
    250272  print( symNsym(f, l) );
    251   // Take a symmetrix polynomial in variables x and z
     273  // Take a symmetric polynomial in variables x and z
    252274  f=x2+xz+z2;
    253275  // Express it in terms of the elementary the symmetric functions
     
    24792501  print( cProj(1) );
    24802502
    2481   // the coefficients of the total Chern class of the complex projective line
     2503  // the coefficients of the total Chern class of the complex projective plane
    24822504  print( cProj(2) );
    24832505
    2484   // the coefficients of the total Chern class of the complex projective line
     2506  // the coefficients of the total Chern class of the complex projective space
     2507  // of dimension three
    24852508  print( cProj(3) );
    24862509}
Note: See TracChangeset for help on using the changeset viewer.