Changeset 63da27 in git


Ignore:
Timestamp:
Sep 23, 2010, 4:39:36 PM (14 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ef8e31eb483d52603fe20fe9d261320e2fd2b4ee
Parents:
0879467b3486695745e782f3a4ad5ef36e73127d
Message:
fixed: conformance with Singular rules



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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/multigrading.lib

    r087946 r63da27  
    11///////////////////////////////////////////////////////////////////
    2 Version="$Id: multigrading.lib 0.1 2010-02-13$";
     2version="$Id$";
    33category="Combinatorial Commutative Algebra";
    44info="
     
    1212OVERVIEW: using this library allows one can virtually add multigrading to Singular.
    1313For more see http://code.google.com/p/convex-singular/wiki/Multigrading
    14 
    15 NOTE: this is a proof of concept using Singular attributes.
    16 
    17 REFERENCE:
    18 E. Miller, B. Sturmfels: 'Combinatorial Commutative Algebra',
    19 M. Kreuzer, L. Robbiano: 'Computational Commutative Algebra'
     14For theoretical references see:
     15E. Miller, B. Sturmfels: 'Combinatorial Commutative Algebra' and
     16M. Kreuzer, L. Robbiano: 'Computational Commutative Algebra'.
     17
     18NOTE: 'mDegBasis' relies on 4ti2 for computing Hilbert Bases.
     19
     20PROCEDURES:
     21setBaseMultigrading(M,T); attach multiweights/torsion matrices to the basering
     22getVariableWeights([R]);  get matrix of multidegrees of vars attached to a ring
     23getTorsion([R]);          get torsion matrix attached to a ring
     24
     25setModuleGrading(M,v);    attach multiweights of units to a module and return it
     26getModuleGrading(M);      get multiweights of module units (attached to M)
     27
     28mDeg(A);                  compute the multidegree of A
     29mDegBasis(d);             compute all monomials of multidegree d
     30mDegPartition(p);         compute the multigraded-homogenous components of p
     31
     32isTorsionFree();          test whether the current multigrading is torsion free
     33isTorsionElement(p);      test whether p has zero multidegree
     34isHomogenous(a);          test whether 'a' is multigraded-homogenous
     35
     36equalMDeg(e1,e2[,V]);     test whether e1==e2 in the current multigrading
     37
     38mDegGroebner(M);          compute the multigraded GB/SB of M
     39mDegSyzygy(M);            compute the multigraded syzygies of M
     40mDegResolution(M,l[,m]);  compute the multigraded resolution of M
     41
     42defineHomogenous(p);      get a torsion matrix wrt which p becomes homogenous
     43pushForward(f);           find the finest grading on the image ring, homogenizing f
     44
     45hermite(A);               compute the Hermite Normal Form of a matrix
     46
     47hilbertSeries(M);         compute the multigraded Hilbert Series of M
     48
     49           (parameters in square brackets [] are optional)
    2050
    2151KEYWORDS:  multigradeding, multidegree, multiweights, multigraded-homogenous
    22 
    23 
    24 REQUIRES: 4ti2 for Hilbert Bases needed for mDegBasis
    25 
    26 PROCEDURES:
    27 setBaseMultigrading(M,T) attach multiweights/torsion matrices to the basering
    28 getVariableWeights([R])  get matrix of multidegrees of vars attached to a ring
    29 getTorsion([R])          get torsion matrix attached to a ring
    30 
    31 setModuleGrading(M,v)    attach multiweights of units to a module and return it
    32 getModuleGrading(M)      get multiweights of module units (attached to M)
    33 
    34 mDeg(A)                  compute the multidegree of A
    35 mDegBasis(d)             compute all monomials of multidegree d
    36 mDegPartition(p)         compute the multigraded-homogenous components of p
    37 
    38 isTorsionFree()          test whether the current multigrading is torsion free
    39 isTorsionElement(p)      test whether p has zero multidegree
    40 isHomogenous(a)          test whether 'a' is multigraded-homogenous
    41 
    42 equalMDeg(e1,e2[,V])     test whether e1==e2 in the current multigrading
    43 
    44 mDegGroebner(M)          compute the multigraded GB/SB of M
    45 mDegSyzygy(M)            compute the multigraded syzygies of M
    46 mDegResolution(M,l[,m])  compute the multigraded resolution of M
    47 
    48 defineHomogenous(p)      get a torsion matrix wrt which p becomes homogenous
    49 pushForward(f)           find the finest grading on the image ring, homogenizing f
    50 
    51 hermite(A)               compute the Hermite Normal Form of a matrix
    52 
    53 hilbertSeries(M)         compute the multigraded Hilbert Series of M
    54 
    55            (parameters in square brackets [] are optional)
    5652";
    5753
     
    5955// newMap(map F, intmat Q, list #)
    6056
    61 
    62 
    6357LIB "standard.lib"; // for groebner
    6458
    6559/******************************************************/
    6660proc setBaseMultigrading(intmat M, list #)
    67 "USAGE:   setBaseMultigrading(M[, T])
    68 PURPOSE: attach M abd T to the basering, where M is the matrix of the weights of variables, L is the torsion
     61"USAGE: setBaseMultigrading(M[, T]); M, T are integer matrices
     62PURPOSE: attaches weights of variables and torsion to the basering.
     63NOTE: M encodes the weights of variables column-wise.
     64The torsion is given by the lattice spanned by the columns of the integer
     65matrix T in Z^nrows(M) over Z.
    6966RETURN: nothing
    7067EXAMPLE: example setBaseMultigrading; shows an example
     
    990987/******************************************************/
    991988proc equalMDeg(intvec exp1, intvec exp2, list #)
    992 "USAGE: equalMDeg(exp1, exp2[, V]) where exp1,exp2 are exponents of terms [, V is multidegree of module components];
    993 PURPOSE: Tests if the exponent vectors of two monomials represent the same multidegree.
     989"USAGE: equalMDeg(exp1, exp2[, V]); intvec exp1, exp2, intmat V
     990PURPOSE: Tests if the exponent vectors of two monomials (given by exp1 and exp2)
     991represent the same multidegree.
     992NOTE: the integer matrix V encodes multidegrees of module components,
     993if module component is present in exp1 and exp2
    994994"
    995995{
     
    10121012    if( (size(#) == 0) or (typeof(#[1])!="intmat") )
    10131013    {
    1014       ERROR("Sorry: wrong or missing module-unit-weights-matrix!");
     1014      ERROR("Sorry: wrong or missing module-unit-weights-matrix V!");
    10151015    }
    10161016    intmat V = #[1];
     
    15441544      while( size(tt) > 0 )
    15451545      {
    1546 
    1547         if( equalMDeg( leadexp(tt), m, V  ) ) // TODO: we make no caching of matrices (M,T,H,V), which remain the same!
     1546        // TODO: we make no caching of matrices (M,T,H,V), which remain the same!
     1547        if( equalMDeg( leadexp(tt), m, V  ) )
    15481548        {
    15491549          mp = mp + lead(tt); // "mp", mp;
     
    18501850   j=system("sh","hilbert -q -n sing4ti2"); ////////// be quiet + no loggin!!!
    18511851
    1852    j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g |sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted");
     1852   j=system("sh", "awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil " +
     1853                "| sed s/[\\\ \\\t\\\v\\\f]/,/g " +
     1854                "| sed s/,+/,/g|sed s/,,/,/g " +
     1855                "| sed s/,,/,/g " +
     1856                "> sing4ti2.converted" );
    18531857   if( defined(keepfiles) <= 0)
    18541858   {
     
    18961900
    18971901   ring r=0,(x1,x2,x3,x4,x5,x6,x7,x8,x9),dp;
    1898    intmat M[7][9]=1,1,1,-1,-1,-1,0,0,0,1,1,1,0,0,0,-1,-1,-1,0,1,1,-1,0,0,-1,0,0,1,0,1,0,-1,0,0,-1,0,1,1,0,0,0,-1,0,0,-1,0,1,1,0,-1,0,0,0,-1,1,1,0,0,-1,0,-1,0,0;
     1902   intmat M[7][9]=
     1903      1, 1, 1, -1, -1, -1, 0, 0, 0,
     1904      1, 1, 1,  0,  0,  0,-1,-1,-1,
     1905      0, 1, 1, -1,  0,  0,-1, 0, 0,
     1906      1, 0, 1,  0, -1,  0, 0,-1, 0,
     1907      1, 1, 0,  0,  0, -1, 0, 0,-1,
     1908      0, 1, 1,  0, -1,  0, 0, 0,-1,
     1909      1, 1, 0,  0, -1,  0,-1, 0, 0;
    18991910   hilbert4ti2intmat(M);
    19001911   hermite(M);
Note: See TracChangeset for help on using the changeset viewer.