Changeset 28c487 in git


Ignore:
Timestamp:
Apr 7, 2011, 5:00:38 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '0bc2210f8055033868008a3836878db65ec6f89e')
Children:
f9e6d7592f3b35aaff38fe73f121615de78b162c
Parents:
c0b2e03243dcc8b84e3afb3a38cac55b6bb590c8
Message:
new version of monomialideal.lib

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/monomialideal.lib

    rc0b2e03 r28c487  
     1// last modified:  10.06.2010
    12//////////////////////////////////////////////////////////////////////////////
    23version = "$Id$";
    34category = "Commutative algebra";
    45info = "
    5 LIBRARY: monomialideal.lib   Primary and irreducible decompositions of
    6                              monomial ideals
    7 AUTHORS: I.Bermejo,          ibermejo@ull.es
    8 @*       E.Garcia-Llorente,  evgarcia@ull.es
    9 @*       Ph.Gimenez,         pgimenez@agt.uva.es
     6LIBRARY: monomialideal.lib   Primary and irreducible decompositions of monomial
     7                             ideals
     8AUTHORS: I.Bermejo,           ibermejo@ull.es
     9@*       E.Garcia-Llorente,   evgarcia@ull.es
     10@*       Ph.Gimenez,          pgimenez@agt.uva.es
    1011
    1112OVERVIEW:
    12  A library for computing a primary and the irreducible decomposition of
    13  a monomial ideal using several methods.@*
    14  In addition, taking advantage of the fact that the ideals under
    15  consideration are monomial, the library offers some basic operations
    16  on ideals which are Groebner free in the monomial case (radical,
    17  intersection, ideal quotient...). Note, however, that the general
    18  Singular kernel commands for these operations are usually faster.
    19  In a future edition of Singular, the specialized algorithms will also
    20  be implemented in the Singular kernel.
    21 
    22  Literature: Miller, Ezra  and Sturmfels, Bernd: Combinatorial Commutative
    23              Algebra, Springer 2004
     13 A library for computing a primary and the irreducible decompositions of a
     14 monomial ideal using several methods.
     15 In this library we also take advantage of the fact that the ideal is
     16 monomial to make some computations that are Grobner free in this case
     17 (radical, intersection, quotient...).
    2418
    2519PROCEDURES:
    26  isMonomial(id);        checks whether an ideal id is monomial
    27  minbaseMon(id);        computes the minimal monomial generating set of a
    28                         monomial ideal id
    29  gcdMon(f,g);           computes the gcd of two monomials f, g
    30  lcmMon(f,g);           computes the lcm of two monomials f, g
    31  membershipMon(f,id);   checks whether a polynomial f belongs to a monomial
    32                         ideal id
    33  intersectMon(id1,id2); intersection of monomial ideals id1 and id2
    34  quotientMon(id1,id2);  quotient ideal id1:id2
    35  radicalMon(id);        computes the radical of a monomial ideal id
    36  isprimeMon(id);        checks whether a monomial ideal id is prime
    37  isprimaryMon(id);      checks whether a monomial ideal id is primary
    38  isirreducibleMon(id);  checks whether a monomial ideal id is irreducible
    39  isartinianMon(id);     checks whether a monomial ideal id is artininan
    40  isgenericMon(id);      checks whether a monomial ideal id is generic, i.e.,
    41                         no two minimal generators of it agree in the exponent
    42                         of any variable that actually appears in both of them
    43  dimMon(id);            dimension of a monomial ideal id
    44  irreddecMon(id,..);    computes the irreducible decomposition of a monomial
    45                         ideal id
    46  primdecMon(id,..);     computes a minimal primary decomposition of a monomial
    47                         ideal id
     20 isMonomial(id);       checks whether an ideal id is monomial
     21 minbaseMon(id);       computes the minimal monomial generating set of a
     22                       monomial ideal id
     23 gcdMon(f,g);          computes the gcd of two monomials f, g
     24 lcmMon(f,g);          computes the lcm of two monomials f, g
     25 membershipMon(f,id);  checks whether a polynomial f belongs to a monomial
     26                       ideal id
     27 intersectMon(id1,id2);intersection of monomial ideals id1 and id2
     28 quotientMon(id1,id2); quotient ideal id1:id2
     29 radicalMon(id);       computes the radical of a monomial ideal id
     30 isprimeMon(id);       checks whether a monomial ideal id is prime
     31 isprimaryMon(id);     checks whether a monomial ideal id is primary
     32 isirreducibleMon(id); checks whether a monomial ideal id is irreducible
     33 isartinianMon(id);    checks whether a monomial ideal id is artininan
     34 isgenericMon(id);     checks whether a monomial ideal id is generic
     35 dimMon(id);           dimension of a monomial ideal id
     36 irreddecMon(id,..);   computes the irreducible decomposition of a monomial
     37                       ideal id
     38 primdecMon(id,..);    computes a minimal primary decomposition of a monomial
     39                       ideal id
    4840";
    49 
    5041LIB "poly.lib";  // Para "maxdeg1" en "isprimeMon"
    51 
    5242//---------------------------------------------------------------------------
    5343//-----------------------   INTERNOS    -------------------------------------
    5444//---------------------------------------------------------------------------
    55 
    5645/////////////////////////////////////////////////////////////////////////////
     46//
    5747static proc checkIdeal (ideal I)
    5848"
    5949USAGE:    checkIdeal (I); I ideal.
    60 RETURN:   1, if the given generators of I are monomials; 0, otherwise.
     50RETURN:   1, if ideal is generated by monomials; 0, otherwise.
    6151"
    6252// Aqui NO estoy quitando el caso de que el ideal sea el trivial.
     
    7363  return (1);
    7464}
    75 
    7665/////////////////////////////////////////////////////////////////////////////
    77 static proc quotientIdealMon (ideal I, poly f)
     66//
     67static proc quotientIdealMon (ideal I,poly f)
    7868"
    7969USAGE:    quotientIdealMon(I,f); I ideal, f polynomial.
    8070RETURN:   an ideal, the quotient ideal I:(f).
    81 ASSUME:   I is an ideal given by a list of monomials and f is a monomial
     71ASSUME:   I is an ideal generated by a list of monomials and f is a monomial
    8272          of the basering.
    8373"
     
    10696  return ( minbase(J) );
    10797}
    108 
    10998/////////////////////////////////////////////////////////////////////////////
     99//
    110100static proc soporte (poly f)
    111101"
     
    140130  return(sop);
    141131}
    142 
    143132/////////////////////////////////////////////////////////////////////////////
     133//
    144134static proc irredAux (ideal I)
    145135"
    146136USAGE:    irredAux (I); I ideal.
    147 RETURN:   1, if I is irreducible; otherwise, an intvec whose first entry is
     137RETURN:   1, if I is irreducible; otherwise, an intvec whose fist entry is
    148138          the position of a generator which is the product of more than one
    149           variable, the next entries are the indices of those variables.
     139          variable, the next entries are the indexes of those variables.
    150140ASSUME:   I is a monomial ideal of the basering K[x(1)..x(n)] and it is
    151141          generated by its minimal monomial generators.
    152142NOTE:     This procedure is a modification of isirreducibleMon to give
    153           more information when the ideal is not irreducible.
     143          more information when ideal is not irreducible.
    154144"
    155145{
     
    182172  return(1);
    183173}
    184 
    185 /////////////////////////////////////////////////////////////////////////////
    186 static proc contents (ideal I, ideal J)
     174//////////////////////////////////////////////////////////////////////
     175//
     176static proc contents (ideal I,ideal J)
    187177"
    188178USAGE:    contents (I,J); I,J ideals.
    189179RETURN:   1, if I is contained in J; 0, otherwise.
    190 ASSUME:   I, J are monomial ideals of the basering.
     180ASSUME:   I,J are monomial ideals of the basering.
    191181"
    192182{
     
    207197  return(1);
    208198}
    209 
    210199/////////////////////////////////////////////////////////////////////////////
    211 static proc equal (ideal I, ideal J)
     200//
     201static proc equal (ideal I,ideal J)
    212202"
    213203USAGE:    equal (I,J); I,J ideals.
    214204RETURN:   1, if I and J are the same ideal; 0, otherwise.
    215 ASSUME:   I, J are monomial ideals of the basering and are defined by their
     205ASSUME:   I,J are monomial ideals of the basering and are defined by their
    216206          minimal monomial generators.
    217207"
     
    222212  // Si no tienen el mismo numero de generadores, no pueden ser iguales; ya
    223213  // que vienen dados por el sistema minimal de generadores.
    224   if (ncols(I) <> ncols(J))
     214  if (size(I) <> size(J))
    225215  {
    226216    return(0);
     
    243233  //return(1);
    244234}
    245 
    246235/////////////////////////////////////////////////////////////////////////////
     236//
    247237static proc radicalAux (ideal I)
    248238"
     
    279269  return (rad);
    280270}
    281 
    282271/////////////////////////////////////////////////////////////////////////////
     272//
    283273static proc primAux (ideal I)
    284274"
     
    287277          0, the second is the index of one variable such that a power of it
    288278          does not appear as a generator of I, the rest of the elements are
    289           the position in the ideal of those elements of I which are product
    290           of more than one variable.
     279          the situation in the ideal of that elements of I which
     280          are product of more than one variable.
    291281ASSUME:   I is a monomial ideal of the basering K[x(1)..x(n)].
    292 NOTE:     This procedure detects if the ideal is primary. When the
     282NOTE:     This procedure detects if the ideal is primary, when the
    293283          ideal is not primary, it gives some additional information.
    294284"
     
    346336  return (1);
    347337}
    348 
    349338/////////////////////////////////////////////////////////////////////////////
    350 static proc maxExp (ideal I, intvec v)
     339//
     340static proc maxExp (ideal I,intvec v)
    351341"
    352342USAGE:    maxExp (I,v); I ideal, v integer vector.
     
    356346          variable considered is v[2].
    357347          If the ideal I is primary, it returns 0.
    358 NOTE:     The elements of the vector suggest what variable and which
     348NOTE:     The elements of the vector shows what variable and what
    359349          generators we must consider to look for the greatest power
    360350          of this variable.
     
    381371  return (max);
    382372}
    383 
    384373/////////////////////////////////////////////////////////////////////////////
     374//
    385375static proc irredundant (list l)
    386376"
     
    388378RETURN:   a list such that the intersection of the elements in that list has
    389379          no redundant component.
    390 ASSUME:   The elements of l are monomial ideals of the basering.
     380ASSUME:   elements of l are monomial ideals of the basering.
    391381"
    392382{
     
    419409  return (l);
    420410}
    421 
    422411/////////////////////////////////////////////////////////////////////////////
    423 static proc alexDif (intvec v, ideal I)
     412//
     413static proc alexDif (intvec v,ideal I)
    424414"
    425415USAGE:    alexDif (v,I); v, intvec; I, ideal.
     
    428418ASSUME:   I is a monomial ideal of the basering K[x(1),...,x(n)] given by
    429419          its minimal monomial generators and v is an integer vector with
    430           n entries s.t. monomial(v) is a multiple of all minimal monomial
     420          n entries s.t.monomial(v) is a multiple of all minimal monomial
    431421          generators of I.
    432422"
     
    461451  return (l);
    462452}
    463 
    464453/////////////////////////////////////////////////////////////////////////////
     454//
    465455static proc irredPrimary (list l1)
    466456"
     
    513503  return (l3);
    514504}
    515 
    516505/////////////////////////////////////////////////////////////////////////////
     506//
    517507static proc isMinimal (ideal I)
    518508"
    519509USAGE:    isMinimal (I); I ideal.
    520 RETURN:   1, if the given generators of I are the minimal ones;
     510RETURN:   1, if the generators of I are the minimal ones;
    521511          0 & minimal generators of I, otherwise.
    522 ASSUME:   I is an ideal of the basering given by monomial generators.
     512ASSUME:   I is an ideal of the basering generated by monomials.
    523513"
    524514{
     
    559549        I = J;
    560550        i--;
    561         sizI = ncols(I);
     551        sizI = size(I);
    562552      }
    563553    }
     
    572562  }
    573563}
    574 
    575564/////////////////////////////////////////////////////////////////////////////
     565//
    576566static proc isMonomialGB (ideal I)
    577567"
     
    579569RETURN:   a list, 1 & the minimal generators of I, if I is a monomial ideal;
    580570          0, otherwise.
    581 ASSUME:   I is an ideal of the basering whose given generators are not
     571ASSUME:   I is an ideal of the basering which is not generated by
    582572          monomials.
    583 NOTE:     This procedure is NOT Groebner free and should be used only if the
    584           given generators are not monomials. (Use the proc checkIdeal first.)
     573NOTE:     this procedure is NOT Grobner free and should be used only if the
     574          ideal has non-monomial generators (use first checkIdeal)
    585575"
    586576{
     
    610600  }
    611601}
    612 
    613602/////////////////////////////////////////////////////////////////////////////
    614603//
     
    616605// WARNING: this is not a test, when the answer is 1 and the decompositions
    617606//          may not coincide but it is fast and easy and when the answer is
    618 //          0 the decompositions do not coincide.
    619 //
    620 proc areEqual(list l1, list l2)
     607//          0 the decomposition do not coincide.
     608//
     609proc areEqual(list l1,list l2)
    621610{
    622611  int i,j,sizIdeal;
     
    647636  return (equal(l1Ideal,l2Ideal));
    648637}
    649 
    650638/////////////////////////////////////////////////////////////////////////////
    651639//-------------------------------------------------------------------------//
     
    653641//-------------------------------------------------------------------------//
    654642/////////////////////////////////////////////////////////////////////////////
    655 
    656 /////////////////////////////////////////////////////////////////////////////
     643//
    657644proc isMonomial (ideal I)
    658 "USAGE:   isMonomial (I); I ideal
    659 RETURN:   1, if I is a monomial ideal; 0, otherwise.
     645"USAGE:    isMonomial (I); I ideal.
     646RETURN:   1, if I is monomial ideal; 0, otherwise.
    660647ASSUME:   I is an ideal of the basering.
    661648EXAMPLE:  example isMonomial; shows some examples.
     
    694681 isMonomial(J);
    695682}
    696 
    697683/////////////////////////////////////////////////////////////////////////////
     684//
    698685proc minbaseMon (ideal I)
    699 "USAGE:   minbaseMon (I); I ideal.
     686"USAGE:    minbaseMon (I); I ideal.
    700687RETURN:   an ideal, the minimal monomial generators of I.
    701           -1 if the given generators of I are not monomials
     688          (-1 if the generators of I are not monomials)
    702689ASSUME:   I is an  ideal generated by a list of monomials of the basering.
    703690EXAMPLE:  example minbaseMon; shows an example.
     
    711698  if (control == 0)
    712699  {
    713     ERROR ("the ideal is not monomial");
     700    return (-1);
    714701  }
    715702  // Quitamos los ceros del sistema de generadores.
     
    758745 minbaseMon(I);
    759746}
    760 
    761747/////////////////////////////////////////////////////////////////////////////
    762 proc gcdMon (poly f, poly g)
    763 "USAGE:   gcdMon (f,g); f,g polynomials.
     748//
     749proc gcdMon (poly f,poly g)
     750"USAGE:    gcdMon (f,g); f,g polynomials.
    764751RETURN:   a monomial, the greatest common divisor of f and g.
    765752ASSUME:   f and g are monomials of the basering.
     
    804791  gcdMon(f,g);
    805792}
    806 
    807793/////////////////////////////////////////////////////////////////////////////
    808 proc lcmMon (poly f, poly g)
    809 "USAGE:   lcmMon (f,g); f, g polynomials.
     794//
     795proc lcmMon (poly f,poly g)
     796"USAGE:    lcmMon (f,g); f,g polynomials.
    810797RETURN:   a monomial,the least common multiple of f and g.
    811798ASSUME:   f,g are monomials of the basering.
     
    849836  lcmMon(f,g);
    850837}
    851 
    852 /////////////////////////////////////////////////////////////////////////////
    853 proc membershipMon(poly f, ideal I)
    854 "USAGE:   membershipMon(f, I); f polynomial, I ideal.
     838//////////////////////////////////////////////////////////////////////
     839//
     840proc membershipMon(poly f,ideal I)
     841"USAGE:    membershipMon(f,I); f polynomial, I ideal.
    855842RETURN:   1, if f lies in I; 0 otherwise.
    856           -1 if I and f are nonzero and I is not a monomial ideal
     843          (-1 if I and f are nonzero and I is not a monomial ideal)
    857844ASSUME:   I is a monomial ideal of the basering.
    858845EXAMPLE:  example membershipMon; shows some examples
     
    951938 membershipMon(g,I);
    952939}
    953 
    954 /////////////////////////////////////////////////////////////////////////////
    955 proc intersectMon (ideal I, ideal J)
    956 "USAGE:   intersectMon (I, J); I, J ideals.
     940//////////////////////////////////////////////////////////////////////
     941//
     942proc intersectMon (ideal I,ideal J)
     943"USAGE:    intersectMon (I,J); I,J ideals.
    957944RETURN:   an ideal, the intersection of I and J.
    958945          (it returns -1 if I or J are not monomial ideals)
    959946ASSUME:   I,J are monomial ideals of the basering.
    960947NOTE:     the minimal monomial generating set is returned.
    961           USING THE SINGULAR COMMAND 'intersect' IS USUALLY FASTER
    962948EXAMPLE:  example intersectMon; shows some examples
    963949"
     
    10371023 intersectMon (I,J);
    10381024}
    1039 
    1040 /////////////////////////////////////////////////////////////////////////////
    1041 proc quotientMon (ideal I, ideal J)
    1042 "USAGE:   quotientMon (I, J); I, J ideals.
     1025//////////////////////////////////////////////////////////////////////
     1026//
     1027proc quotientMon (ideal I,ideal J)
     1028"USAGE:    quotientMon (I,J); I,J ideals.
    10431029RETURN:   an ideal, the quotient I:J.
    10441030          (returns -1 if I or J is not monomial)
    1045 ASSUME:   I, J are monomial ideals of the basering.
     1031ASSUME:   I,J are monomial ideals of the basering.
    10461032NOTE:     the minimal monomial generating set is returned.
    10471033EXAMPLE:  example quotientMon; shows an example.
     
    10841070    {
    10851071      ERROR ("the second ideal is not monomial.");
     1072      return (-1);
    10861073    }
    10871074    else
     
    11191106 quotientMon (I,J);
    11201107}
    1121 
    1122 /////////////////////////////////////////////////////////////////////////////
     1108//////////////////////////////////////////////////////////////////////
     1109//
    11231110proc radicalMon(ideal I)
    1124 "USAGE:   radicalMon(I); I ideal
     1111"USAGE:    radicalMon(I); I ideal
    11251112RETURN:   an ideal, the radical ideal of the ideal I.
    11261113          (returns -1 if I is not a monomial ideal)
    11271114ASSUME:   I is a monomial ideal of the basering.
    1128 NOTE:     The minimal monomial generating set is returned.
     1115NOTE:     the minimal monomial generating set is returned.
    11291116EXAMPLE:  example radicalMon; shows an example.
    11301117"
     
    11861173 radicalMon(I);
    11871174}
    1188 
    1189 /////////////////////////////////////////////////////////////////////////////
     1175//////////////////////////////////////////////////////////////////////
     1176//
    11901177proc isprimeMon (ideal I)
    1191 "USAGE:   isprimeMon (I); I ideal
     1178"USAGE:    isprimeMon (I); I ideal
    11921179RETURN:   1, if I is prime; 0, otherwise.
    11931180          (returns -1 if I is not a monomial ideal)
     
    12361223 isprimeMon (J);
    12371224}
    1238 
    1239 /////////////////////////////////////////////////////////////////////////////
     1225//////////////////////////////////////////////////////////////////////
     1226//
    12401227proc isprimaryMon (ideal I)
    1241 "USAGE:   isprimaryMon (I); I ideal
     1228"USAGE:    isprimaryMon (I); I ideal
    12421229RETURN:   1, if I is primary; 0, otherwise.
    12431230          (returns -1 if I is not a monomial ideal)
     
    13381325 isprimaryMon (J);
    13391326}
    1340 
    1341 /////////////////////////////////////////////////////////////////////////////
     1327//////////////////////////////////////////////////////////////////////
     1328//
    13421329proc isirreducibleMon (ideal I)
    1343 "USAGE:   isirreducibleMon(I); I ideal
     1330"USAGE:    isirreducibleMon(I); I ideal
    13441331RETURN:   1, if I is irreducible; 0, otherwise.
    1345           returns -1 if I is not a monomial ideal
     1332          (return -1 if I is not a monomial ideal)
    13461333ASSUME:   I is a monomial ideal of the basering.
    13471334EXAMPLE:  example isirreducibleMon; shows some examples
     
    13941381 isirreducibleMon (J);
    13951382}
    1396 
    1397 /////////////////////////////////////////////////////////////////////////////
     1383//////////////////////////////////////////////////////////////////////
     1384//
    13981385proc isartinianMon (ideal I)
    1399 "USAGE:   isartinianMon(I); I ideal.
     1386"USAGE:    isartinianMon(I); I ideal.
    14001387RETURN:   1, if ideal is artinian; 0, otherwise.
    1401           returns -1 if ideal I is not a monmomial ideal
     1388          (return -1 if ideal I is not a monmomial ideal).
    14021389ASSUME:   I is a monomial ideal of the basering.
    14031390EXAMPLE:  example isartinianMon; shows some examples
     
    14621449 isartinianMon (J);
    14631450}
    1464 
    1465 /////////////////////////////////////////////////////////////////////////////
     1451//////////////////////////////////////////////////////////////////////
     1452//
    14661453proc isgenericMon (ideal I)
    1467 "USAGE:   isgenericMon(I); I ideal.
     1454"USAGE:    isgenericMon(I); I ideal.
    14681455RETURN:   1, if ideal is generic; 0, otherwise.
    1469           returns -1 if ideal I is not a monomial ideal
     1456          (return -1 if ideal I is not a monomial ideal)
    14701457ASSUME:   I is a monomial ideal of the basering.
    14711458EXAMPLE:  example isgenericMon; shows some examples.
     
    15331520 isgenericMon (J);
    15341521}
    1535 
    1536 /////////////////////////////////////////////////////////////////////////////
     1522//////////////////////////////////////////////////////////////////////
     1523//
    15371524proc dimMon (ideal I)
    1538 "USAGE:  dimMon (I); I ideal
     1525"USAGE:   dimMon (I); I ideal
    15391526RETURN:  an integer, the dimension of the affine variety defined by
    15401527         the ideal I.
    1541          returns -1 if I is not a monomial ideal
     1528         (returns -1 if I is not a monomial ideal)
    15421529ASSUME:  I is a monomial ideal of the basering.
    15431530EXAMPLE: example dimMon; shows some examples.
     
    16401627 dimMon (J);
    16411628}
    1642 
    16431629/////////////////////////////////////////////////////////////////////////////
    16441630//-------------------------------------------------------------------------//
     
    16461632//-------------------------------------------------------------------------//
    16471633/////////////////////////////////////////////////////////////////////////////
    1648 
    1649 //////////////////////////////////////////////////////////////////////
     1634//
    16501635// METODO 1: Metodo directo para descomp. irreducible (ver Vasconcelos)
    16511636//
     
    16561641// (Vasconcelos)                                                    //
    16571642//////////////////////////////////////////////////////////////////////
     1643//
    16581644static proc irredDec1 (ideal I)
    16591645{
     
    17211707  return (l2);
    17221708}
    1723 
    17241709//////////////////////////////////////////////////////////////////////
    17251710// La siguiente funcion va a obtener una descomposicion primaria    //
    17261711// minimal a partir de la irreducible anterior.                     //
    17271712//////////////////////////////////////////////////////////////////////
     1713//
    17281714static proc primDec1 (ideal I)
    17291715{
     
    17361722  return (l2);
    17371723}
    1738 
    1739 //////////////////////////////////////////////////////////////////////
     1724//
    17401725// METODO 2: Metodo directo para descomp. primaria (ver Vasconcelos)
    17411726//
     
    17461731//  hace uso de esta (Vasconcelos).                                 //
    17471732//////////////////////////////////////////////////////////////////////
     1733//
    17481734static proc primDec2 (ideal I)
    17491735{
     
    17971783  return (l2);
    17981784}
    1799 //////////////////////////////////////////////////////////////////////
     1785//
    18001786// METODO 3: via dual de Alexander y doble dual (Miller)
    18011787//
     
    18051791// ideal de partida (Miller)                                        //
    18061792//////////////////////////////////////////////////////////////////////
     1793//
    18071794static proc irredDec3 (ideal I)
    18081795{
     
    18351822  return (l);
    18361823}
    1837 
    18381824//////////////////////////////////////////////////////////////////////
    18391825// En este caso hallamos una descomposicion primaria minimal usando //
    18401826// la irreducible irredundante del procedimiento anterior.          //
    18411827//////////////////////////////////////////////////////////////////////
     1828//
    18421829static proc primDec3 (ideal I)
    18431830{
     
    18501837  return (l2);
    18511838}
    1852 
    1853 //////////////////////////////////////////////////////////////////////
     1839//
    18541840// METODO 4: via dual de Alexander y cociente (Miller)
    18551841//
     
    18591845// Alexander (con el cociente) (Miller)                             //
    18601846//////////////////////////////////////////////////////////////////////
     1847//
    18611848static proc irredDec4 (ideal I)
    18621849{
     
    19071894  return (L);
    19081895}
    1909 
    19101896//////////////////////////////////////////////////////////////////////
    19111897// Ahora hallamos una descomposicion primaria irredundante usando   //
     
    19131899// ideal monomial dado por sus generadores minimales.               //
    19141900//////////////////////////////////////////////////////////////////////
     1901//
    19151902static proc primDec4 (ideal I)
    19161903{
     
    19231910  return (l2);
    19241911}
    1925 
    1926 //////////////////////////////////////////////////////////////////////
     1912//
    19271913// METODO 5: un misterio!!
    19281914//
     
    19321918// irreducibles del ideal 1-1.                                      //
    19331919//////////////////////////////////////////////////////////////////////
     1920//
    19341921static proc irredDec5 (ideal I)
    19351922{
     
    20152002  return (facets);
    20162003}
    2017 
    20182004//////////////////////////////////////////////////////////////////////
    20192005// Ahora hallamos una descomposicion primaria irredundante usando   //
     
    20212007// ideal monomial dado por sus generadores minimales.               //
    20222008//////////////////////////////////////////////////////////////////////
     2009//
    20232010static proc primDec5 (ideal I)
    20242011{
     
    20312018  return (l2);
    20322019}
    2033 
    2034 //////////////////////////////////////////////////////////////////////
     2020//
    20352021// METODO 6: via complejo de Scarf (Milovsky)
    20362022//
     
    20432029// generadores del ideal.                                           //
    20442030//////////////////////////////////////////////////////////////////////
     2031//
    20452032static proc maximoExp(ideal I,int i)
    20462033{
     
    20602047  return(max);
    20612048}
    2062 
    20632049//////////////////////////////////////////////////////////////////////
    20642050// Esta funcion estudia si un ideal monomial dado por su sistema    //
     
    20672053// que han sido introducidos.                                       //
    20682054//////////////////////////////////////////////////////////////////////
     2055//
    20692056static proc artinian (ideal I)
    20702057{
     
    21502137  }
    21512138}
    2152 
    21532139//////////////////////////////////////////////////////////////////////
    21542140// En este caso vamos primero a chequear si el ideal es o no        //
     
    21562142// pues estos son una aplicacion biyectiva.                         //
    21572143//////////////////////////////////////////////////////////////////////
     2144//
    21582145static proc generic (ideal I)
    21592146{
     
    22192206  }
    22202207}
    2221 
    22222208//////////////////////////////////////////////////////////////////////
    22232209// Esta funci?n obtiene una descomposicion irreducible del ideal    //
     
    22252211// generico que le asociamos.                                       //
    22262212//////////////////////////////////////////////////////////////////////
     2213//
    22272214static proc nonGeneric (EXP,NEWEXP,Faces,sizI)
    22282215{
     
    22592246  return (newFaces);
    22602247}
    2261 
    22622248//////////////////////////////////////////////////////////////////////
    22632249// Este procedimiento va a dar una faceta inicial para el complejo  //
     
    22652251// y generico (evidentemente I dado por la bse minimal)             //
    22662252//////////////////////////////////////////////////////////////////////
     2253//
    22672254static proc initialFacet (ideal I)
    22682255{
     
    23512338  return (face);
    23522339}
    2353 
    23542340//////////////////////////////////////////////////////////////////////
    23552341// La funcion que sigue devuelve las facetas adyacentes a una dada  //
    23562342// en el complejo de Scarf asociado a I.                            //
    23572343//////////////////////////////////////////////////////////////////////
     2344//
    23582345static proc adyacency (list l1, ideal I)
    23592346{
     
    25152502  return(l2);
    25162503}
    2517 
    25182504//////////////////////////////////////////////////////////////////////
    25192505// Metodo que calcula la descomposicion irreducible de un ideal     //
    25202506// monomial usando el complejo de Scarf (Milowski)                  //
    25212507//////////////////////////////////////////////////////////////////////
     2508//
    25222509static proc ScarfMethod (ideal I)
    25232510{
     
    26662653  }
    26672654  // Generico
    2668   sizI = ncols(I);
     2655  sizI = size(I);
    26692656  if (genericlist[1] == 0)
    26702657  {
     
    26942681  return(Faces);
    26952682}
    2696 
    26972683//////////////////////////////////////////////////////////////////////
    26982684// Devuelve una descomposicion primaria minimal de un ideal         //
    26992685// monomial via el complejo de Scarf.                               //
    27002686//////////////////////////////////////////////////////////////////////
     2687//
    27012688static proc scarfMethodPrim (ideal I)
    27022689{
     
    27102697  return (l2);
    27112698}
    2712 
    2713 //////////////////////////////////////////////////////////////////////
     2699//
    27142700// METODO 7: algoritmo de etiquetas (Roune)
    27152701//
     
    27192705// algoritmo de etiquetas de B. Roune.                              //
    27202706//////////////////////////////////////////////////////////////////////
     2707//
    27212708static proc phi (list F)
    27222709{
     
    27492736  return (listphi);
    27502737}
    2751 
    2752 /////////////////////////////////////////////////////////////////////////////
     2738//////////////////////////////////////////////////////////////////////
     2739//
    27532740static proc pi(poly f)
    27542741{
     
    27682755  return (f);
    27692756}
    2770 
    2771 /////////////////////////////////////////////////////////////////////////////
     2757//////////////////////////////////////////////////////////////////////
     2758//
    27722759static proc conditionComplex (intvec posActual,ideal I,ideal S)
    27732760{
     
    28262813  return (0);
    28272814}
    2828 
    2829 /////////////////////////////////////////////////////////////////////////////
     2815//////////////////////////////////////////////////////////////////////
     2816//
    28302817static proc findFaces (ideal I)
    28312818{
     
    28792866  return (F);
    28802867}
    2881 
    28822868//////////////////////////////////////////////////////////////////////
    28832869// La siguiente funcion calcula la descomposicion en irreducibles de//
     
    28852871// metodo de Bjarke Roune.                                          //
    28862872//////////////////////////////////////////////////////////////////////
     2873//
    28872874static proc labelAlgorithm(ideal I)
    28882875{
     
    29552942  return (facets);
    29562943}
    2957 
    29582944//////////////////////////////////////////////////////////////////////
    29592945// Devuelve una descomposicion primaria minimal de un ideal monomial//
    29602946// dado.                                                            //
    29612947//////////////////////////////////////////////////////////////////////
    2962 static proc labelAlgPrim (ideal I)
     2948//
     2949static proc  labelAlgPrim (ideal I)
    29632950{
    29642951  // VARIABLES
     
    29712958  return (l2);
    29722959}
    2973 
    2974 //////////////////////////////////////////////////////////////////////
     2960//
    29752961// METODO 8: Gao-Zhu
    29762962//
    29772963//////////////////////////////////////////////////////////////////////
     2964//
    29782965static proc divide (intvec v, intvec w, int k)
    29792966{
     
    30002987  return (1);
    30012988}
    3002 
    3003 /////////////////////////////////////////////////////////////////////////////
     2989//////////////////////////////////////////////////////////////////////
     2990//                                        //
     2991//////////////////////////////////////////////////////////////////////
     2992//
    30042993static proc incrementalAlg (ideal I)
    30052994{
     
    30923081  {
    30933082    expartI = leadexp(artI[1]);
    3094     if (ncols(artI) <> 1)
    3095     {
    3096       artI = artI[2..ncols(artI)];
     3083    if (size(artI) <> 1)
     3084    {
     3085      artI = artI[2..size(artI)];
    30973086    }
    30983087    // Hay que distinguir T_1 y T_2. Para ello se comparar vectores
     
    32103199  return (facets);
    32113200}
    3212 
    3213 /////////////////////////////////////////////////////////////////////////////
     3201//////////////////////////////////////////////////////////////////////
     3202//
    32143203static proc  incrementalAlgPrim (ideal I)
    32153204{
     
    32233212  return (l2);
    32243213}
    3225 
    3226 //////////////////////////////////////////////////////////////////////
     3214//
    32273215// METODO 9: slice algorithm (Roune)
    32283216//
     
    32303218// SLICE ALGORITHM (B.Roune)                                        //
    32313219//////////////////////////////////////////////////////////////////////
     3220//
    32323221static proc divideMon (poly f , poly g)
    32333222{
     
    32453234  //return (1);
    32463235}
    3247 
    3248 /////////////////////////////////////////////////////////////////////////////
     3236//////////////////////////////////////////////////////////////////////
     3237//
    32493238static proc pivot (ideal I , poly lcmMin, ideal S)
    32503239{
     
    33093298  }
    33103299}
    3311 
    3312 /////////////////////////////////////////////////////////////////////////////
     3300//////////////////////////////////////////////////////////////////////
     3301//
    33133302static proc simplification (I)
    33143303{
     
    34313420  return (lcmMi,I);
    34323421}
    3433 
    3434 /////////////////////////////////////////////////////////////////////////////
     3422//////////////////////////////////////////////////////////////////////
     3423//
    34353424static proc con (ideal I , ideal S , poly q)
    34363425{
     
    35433532  return (con(I1,S1,p*q),con(I,S2,q));
    35443533}
    3545 
    3546 /////////////////////////////////////////////////////////////////////////////
     3534//////////////////////////////////////////////////////////////////////
     3535//
    35473536static proc irredDecMonSlice (ideal I)
    35483537{
     
    35653554  {
    35663555    artI = sort(artI)[1];
    3567     int sizartI = ncols(artI);
     3556    int sizartI = size(artI);
    35683557    for (i = 1 ; i <= sizartI - 1 ; i ++)
    35693558    {
     
    35893578  poly comp;
    35903579  intvec exp;
    3591   int sizIrred = ncols(irredDec);
     3580  int sizIrred = size(irredDec);
    35923581  ideal auxIdeal;
    35933582  for (i = 1 ; i <= sizIrred ; i ++)
     
    36213610  return (components);
    36223611}
    3623 
    3624 /////////////////////////////////////////////////////////////////////////////
     3612//////////////////////////////////////////////////////////////////////
     3613//
    36253614static proc primDecMonSlice (ideal I)
    36263615{
     
    36343623  return (l2);
    36353624}
    3636 
    36373625//////////////////////////////////////////////////////////////////////
    36383626//                                                                  //
     
    36413629//////////////////////////////////////////////////////////////////////
    36423630//////////////////////////////////////////////////////////////////////
    3643 
    3644 /////////////////////////////////////////////////////////////////////////////
     3631//
    36453632proc irreddecMon
    3646 "USAGE:   irreddecMon (I[,alg]); I ideal, alg string.
     3633"USAGE:    irreddecMon (I[,alg]); I ideal, alg string.
    36473634RETURN:   list, the irreducible components of the monomial ideal I.
    36483635          (returns -1 if I is not a monomial ideal).
    36493636ASSUME:   I is a monomial ideal of the basering k[x(1)..x(n)].
    3650 NOTE:     This procedure returns the irreducible decomposition of I,
    3651           i.e., the unique irredundant decomposition of I into irreducible
    3652           monomial ideals.
     3637NOTE:     This procesure returns the irreducible decomposition of I.
    36533638          One may call the procedure with different algorithms using
    36543639          the optional argument 'alg':
     
    37483733 irreddecMon(I,"sr");
    37493734}
    3750 
    3751 /////////////////////////////////////////////////////////////////////////////
     3735//////////////////////////////////////////////////////////////////////
     3736//
    37523737proc primdecMon
    3753 "USAGE:   primdecMon (I[,alg]); I ideal, alg string
     3738"USAGE:    primdecMon (I[,alg]); I ideal, alg string
    37543739RETURN:   list, the components in a minimal primary decomposition of I.
    37553740          (returns -1 if I is not a monomial ideal).
    37563741ASSUME:   I is a monomial ideal of the basering k[x(1)..x(n)].
    3757 NOTE:     This procedure returns a minimal primary decomposition of I.
     3742NOTE:     This procesure returns a minimal primary decomposition of I.
    37583743          One may call the procedure with different algorithms using
    37593744          the optional argument 'alg':
Note: See TracChangeset for help on using the changeset viewer.