Changeset df39c9 in git


Ignore:
Timestamp:
Feb 8, 2007, 4:20:54 PM (17 years ago)
Author:
Simon King <king@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
8b2345a5e557bd889ff1e0f5110102e0b4ae3c0c
Parents:
302a5d7a57af9072b9b2e8d50715cd8780fae77e
Message:
New version of finvar.lib.
- New algorithm for irred_secondary_char0.
  In high degrees, irreducible secondary invariants are computed without power
  products, i.e., without generating reducible secondary invariants. In some examples,
  this improves the performance by a factor of more than 1000. Particularly useful if
  the total number of secondary invariants is astronomic (>200000), while the number
  and the degrees of irreducible secondary invariants are relatively small.
- New function irred_secondary_no_molien. Computes irreducible secondary
  invariants using the Reynolds operator (hence, in the non-modular case)
  but without Molien series. In all degrees, irreducible secondary invariants are computed
  without generating reducible secondary invariants.
- mild improvements in secondary_char0, secondary_charp and secondary_and_irreducibles_no_molien.
- invariant_ring and invariant_ring_random now return irreducible secondary
  invariants also in characteristic p>0, in the non-modular case.


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/finvar.lib

    r302a5d rdf39c9  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: finvar.lib,v 1.58 2007-02-02 13:25:09 Singular Exp $"
     2version="$Id: finvar.lib,v 1.59 2007-02-08 15:20:54 king Exp $"
    33category="Invariant theory";
    44info="
     
    3838 power_products()                  exponents for power products
    3939 secondary_char0()                 secondary invariants (s.i.) in char 0
    40  irred_secondary_char0()           irreducible secondary invariants in char 0
    41  secondary_charp()                 secondary invariants in char p
    42  secondary_no_molien()             secondary invariants, without Molien series
     40 irred_secondary_char0()           irreducible s.i. in char 0
     41 secondary_charp()                 s.i. in char p, with Molien series and
     42                                   Reynolds operator
     43 secondary_no_molien()             s.i., without Molien series but with
     44                                   Reynolds operator
     45 irred_secondary_no_molien()       irreducible s.i., without Molien series
    4346                                   but with Reynolds operator
    4447 secondary_and_irreducibles_no_molien() s.i. & irreducible s.i., without M.s.
    45  secondary_not_cohen_macaulay()    s.i. when invariant ring not Cohen-Macaulay
     48 secondary_not_cohen_macaulay()    s.i. when the invariant ring is not Cohen-Macaulay
    4649 orbit_variety()                   ideal of the orbit variety
    4750 rel_orbit_variety()               ideal of a relative orbit variety (new version)
     
    43054308  m=nrows(dimmat);                     // m-1 is the highest degree
    43064309  if (v)
    4307   { "  In degree 0 we have: 1";
     4310  { "In degree 0 we have: 1";
    43084311    "";
    43094312  }
     
    43214324    {                                  // elements in the current degree (i-1)
    43224325      if (v)
    4323       { "  Searching in degree "+string(i-1)+", we need to find "+string(int(dimmat[i,1]))+" invariant(s)...";
     4326      { "Searching in degree "+string(i-1)+", we need to find "+string(int(dimmat[i,1]))+" invariant(s)...";
    43244327      }
    43254328      TEST=sP;
     
    44684471{
    44694472 //----------  Internal parameters, whose choice might improve the performance -----
    4470   int pieces = 15;   // For generating reducible secondaries, blocks of #pieces# secondaries
     4473  int pieces = 3;   // For generating reducible secondaries, blocks of #pieces# secondaries
    44714474                     // are formed.
    44724475                     // If this parameter is small, the memory consumption will decrease.
     
    45664569  }
    45674570  if (v)
    4568   { "  In degree 0 we have: 1";
     4571  { "In degree 0 we have: 1";
    45694572    "";
    45704573  }
     
    45804583                           // This is the only explicit Groebner basis computation!
    45814584  ideal Reductor,SaveRed;  // sP union Reductor is a Groebner basis up to degree i-1
     4585ideal sP_Reductor;          // will contain sP union Reductor.
     4586int sPOffset = ncols(sP);
    45824587  int SizeSave;
    45834588
     
    45854590                      // minimal degree of a non-constant invariant factor.
    45864591  list ISSort;        // irr. sec. inv. sorted by degree
     4592int NrIS;
    45874593
    45884594  poly helpP;
    45894595  ideal helpI;
    45904596  ideal Indicator;        // will tell us which candidates for sec. inv. we can choose
    4591   ideal ReducedCandidates;
     4597//  ideal ReducedCandidates;
    45924598  int helpint;
    45934599  int k,k2,k3,minD;
     
    46084614    {                                  // elements in the current degree (i-1)
    46094615      if (v)
    4610       { "  Searching in degree "+string(i-1)+", we need to find "+string(int(dimmat[i,1]))+
     4616      { "Searching in degree "+string(i-1)+", we need to find "+string(int(dimmat[i,1]))+
    46114617        " invariant(s)...";
    46124618        "  Looking for Power Products...";
    46134619      }
     4620sP_Reductor = sP;
    46144621      counter = 0;                       // we'll count up to dimmat[i,1]
    46154622      Reductor = ideal(0);
     
    46604667                ProdCand = simplify(Mul1*Mul2,4);
    46614668//              else { ProdCand = Mul1*Mul2;}
    4662               ReducedCandidates = reduce(ProdCand,sP);
     4669//              ReducedCandidates = reduce(ProdCand,sP);
    46634670                  // sP union SaveRed union Reductor is a homogeneous Groebner basis
    46644671                  // up to degree i-1.
    4665                   // We first reduce by sP (which is fixed, so we can do it once for all),
    4666                   // then by SaveRed resp. by Reductor (which is modified during
    4667                   // the computations).
    4668               Indicator = reduce(ReducedCandidates,SaveRed);
    4669                              // If Indicator[ii]==0 then ReducedCandidates it the reduction
    4670                              // of an invariant that is in the algebra generated by primary
    4671                              // invariants and previously computed secondary invariants.
    4672                              // Otherwise ProdCand[ii] can be taken as secondary invariant.
     4672//              Indicator = reduce(ReducedCandidates,SaveRed);
     4673              Indicator = reduce(ProdCand,sP_Reductor);
     4674                             // If Indicator[ii]<>0 then ProdCand[ii] can be taken as secondary invariant.
    46734675              if (size(Indicator)<>0)
    46744676              { for (ii=1;ii<=ncols(ProdCand);ii++)     // going through all the power products
     
    46814683                    attrib(SSort[i-1][k],"size",saveAttr);
    46824684                    if (v)
    4683                     { "We found",counter, " of", int(dimmat[i,1])," secondaries in degree",i-1;
     4685                    { "    We found",counter, "of", int(dimmat[i,1]),"secondaries in degree",i-1;
    46844686                    }
    46854687                    if (int(dimmat[i,1])<>counter)
    46864688                    { Reductor = ideal(helpP);
    4687                         // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
    4688                         // homogeneous polynomial of degree i-1 then G union NF(p,G) is
    4689                         // a homogeneous Groebner basis up to degree i-1.
    46904689                      attrib(Reductor, "isSB",1);
    4691                         // if Reductor becomes too large, we reduce the whole of Indicator by
    4692                         // it, save it in SaveRed, and work with a smaller Reductor. This turns
    4693                         // out to save a little time.
    46944690                      Indicator=reduce(Indicator,Reductor);
    46954691                      SizeSave++;
    46964692                      SaveRed[SizeSave] = helpP;
     4693sP_Reductor[sPOffset+SizeSave] = helpP;
     4694attrib(sP_Reductor, "isSB",1);
     4695                        // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
     4696                        // homogeneous polynomial of degree i-1 then G union NF(p,G) is
     4697                        // a homogeneous Groebner basis up to degree i-1. Hence, sP_Reductor
     4698                        // is a homog. GB up to degree i-1.
    46974699                      attrib(SaveRed, "isSB",1);
     4700                      attrib(Reductor, "isSB",1);
    46984701                    }
    46994702                    else
     
    47094712      }
    47104713
     4714NrIS = int(dimmat[i,1])-counter;
    47114715      // The remaining sec. inv. are irreducible!
    4712       if (int(dimmat[i,1])<>counter)   // need more than all the power products
     4716      if (NrIS>0)   // need more than all the power products
    47134717      { if (v)
    4714         { "There are irreducible secondary invariants in degree ", i-1," !";
    4715         }
    4716         mon = kbase(sP,i-1);
     4718        { "  There are ",NrIS,"irreducible secondary invariants in degree ", i-1;
     4719        }
     4720        mon = kbase(sP_Reductor,i-1);
    47174721//        mon = ideal(mon[ncols(mon)..1]);
    47184722        ii = ncols(mon);
    47194723        if ((i>IrrSwitch) or (ii>200)) // use sparse algorithm
    4720         { if (counter==0 && ii==int(dimmat[i,1])) // then we can use all of mon
     4724        { if (ii+counter==int(dimmat[i,1])) // then we can use all of mon
    47214725          { B=normalize(evaluate_reynolds(REY,mon));
    47224726            IS=IS+B;
     
    47304734            { ISSort[i-1] = B;
    47314735            }
    4732             if (v) {"  We found: "; print(B);}
     4736            if (v) {"    We found all",NrIS,"irreducibles in degree ",i-1;}
    47334737          }
    47344738          else
     
    47414745                { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[j+1..j+MonStep])));
    47424746                  B[j+1..j+MonStep] = tmp[1..MonStep];
    4743                   tmp = reduce(tmp,sP);
    4744                   ReducedCandidates[j+1..j+MonStep] = tmp[1..MonStep];
    4745                   tmp = reduce(tmp,SaveRed);
     4747//                  tmp = reduce(tmp,sP);
     4748//                  ReducedCandidates[j+1..j+MonStep] = tmp[1..MonStep];
     4749                  tmp = reduce(tmp,sP_Reductor);
    47464750                  Indicator[j+1..j+MonStep] = tmp[1..MonStep];
    47474751                  kill tmp;
     
    47504754                { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[j+1..ii])));
    47514755                  B[j+1..ii] = tmp[1..ii-j];
    4752                   tmp = reduce(tmp,sP);
    4753                   ReducedCandidates[j+1..ii] = tmp[1..ii-j];
    4754                   tmp = reduce(tmp,SaveRed);
     4756//                  tmp = reduce(tmp,sP);
     4757//                  ReducedCandidates[j+1..ii] = tmp[1..ii-j];
     4758                  tmp = reduce(tmp,sP_Reductor);
    47554759                  Indicator[j+1..ii] = tmp[1..ii-j];
    47564760                  kill tmp;
     
    47714775                { ISSort[i-1] = ideal(B[j]);
    47724776                }
    4773                 if (v)
    4774                 { "  We found the irreducible sec. inv. "+string(B[j]);
     4777                if (v) 
     4778                { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1;
    47754779                }
    47764780                Reductor = ideal(helpP);
     
    47804784                SaveRed[SizeSave] = helpP;
    47814785                attrib(SaveRed, "isSB",1);
     4786sP_Reductor[sPOffset+SizeSave] = helpP;
     4787attrib(sP_Reductor, "isSB",1);
    47824788              }
    47834789              B[j]=0;
    4784               ReducedCandidates[j]=0;
     4790//              ReducedCandidates[j]=0;
    47854791              Indicator[j]=0;
    47864792            }
     
    47884794        }  // if i>IrrSwitch
    47894795        else  // use fast algorithm
    4790         { B=sort_of_invariant_basis(sP,REY,i-1,int(dimmat[i,1])*6);
     4796        { B=sort_of_invariant_basis(sP_Reductor,REY,i-1,int(dimmat[i,1])*6);
    47914797                                       // B contains
    47924798                                       // images of kbase(sP,i-1) under the
     
    48044810            { ISSort[i-1] = B;
    48054811            }
    4806             if (v) {"  We found: "; print(B);}
     4812            if (v) {"    We found all",NrIS,"irreducibles in degree ",i-1;}
    48074813          }
    48084814          else
     
    48104816            j=0;                         // j goes through all of B -
    48114817            // Compare the comments on the computation of reducible sec. inv.!
    4812             ReducedCandidates = reduce(B,sP);
    4813             Indicator = reduce(ReducedCandidates,SaveRed);
     4818//            ReducedCandidates = reduce(B,sP);
     4819            Indicator = reduce(B,sP_Reductor);
    48144820            while (int(dimmat[i,1])<>counter)
    48154821            { j++;
     
    48274833                { ISSort[i-1] = ideal(B[j]);
    48284834                }
    4829                 if (v)
    4830                 { "  We found the irreducible sec. inv. "+string(B[j]);
     4835                if (v) 
     4836                { "    We found", irrcounter,"of", NrIS,"irr. sec. inv. in degree ",i-1;
    48314837                }
    48324838                Reductor = ideal(helpP);
     
    48364842                SaveRed[SizeSave] = helpP;
    48374843                attrib(SaveRed, "isSB",1);
     4844sP_Reductor[sPOffset+SizeSave] = helpP;
     4845attrib(sP_Reductor, "isSB",1);
    48384846              }
    48394847              B[j]=0;
    4840               ReducedCandidates[j]=0;
     4848//              ReducedCandidates[j]=0;
    48414849              Indicator[j]=0;
    48424850            }
     
    48924900proc irred_secondary_char0 (matrix P, matrix REY, matrix M, list #)
    48934901"
    4894 USAGE:    irred_secondary_char0(P,REY,M[,v]);
     4902USAGE:    irred_secondary_char0(P,REY,M[,v][,\"PP\"]);
    48954903@*          P: a 1xn <matrix> with homogeneous primary invariants, where
    48964904               n is the number of variables of the basering;
     
    49004908               Molien series;
    49014909@*          v: an optional <int>;
     4910@*          \"PP\": if this string occurs as (optional) parameter, then in
     4911               all degrees power products of irr. sec. inv. will be computed.
    49024912RETURN:   Irreducible homogeneous secondary invariants of the invariant ring
    49034913          (type <matrix>)
     
    49154925          independent modulo the primary invariants using Groebner basis techniques
    49164926          (see paper \"Fast Computation of Secondary Invariants\" by S. King).
    4917           The size of this set
    4918           can be read off from the Molien series. Here, only irreducible secondary
    4919           invariants are explicitly computed, which saves time and memory.
     4927          The size of this set can be read off from the Molien series. Here, only
     4928          irreducible secondary invariants are explicitly computed, which saves time and
     4929          memory.
     4930@*        Moreover, if no irr. sec. inv. in degree d-1 have been found and unless the last
     4931          optional paramter \"PP\" is used, a Groebner basis of primary invariants and
     4932          irreducible secondary invariants up to degree d-2 is computed, which allows to
     4933          detect irr. sec. inv. in degree d without computing power products.
    49204934@*        There are three internal parameters \"pieces\", \"MonStep\" and \"IrrSwitch\".
    49214935          The default values of the parameters should be fine in most cases. However,
     
    49274941"
    49284942{ //----------  Internal parameters, whose choice might improve the performance -----
    4929   int pieces = 15;   // For generating reducible secondaries, blocks of #pieces# secondaries
     4943  int pieces = 3;    // For generating reducible secondaries, blocks of #pieces# secondaries
    49304944                     // are formed.
    49314945                     // If this parameter is small, the memory consumption will decrease.
    49324946  int MonStep = 15;  // The Reynolds operator is applied to blocks of #MonStep# monomials.
    49334947                     // If this parameter is small, the memory consumption will decrease.
    4934   int IrrSwitch = 7; // Up to degree #IrrSwitch#-1, we use a method for generating
    4935                      // irreducible secondaries that tends to produce a smaller output
    4936                      // (which is good for subsequent computations). However, this method
    4937                      // needs to much memory in high degrees, and so we use a sparser method
    4938                      // from degree #IrrSwitch# on.
     4948  int IrrSwitch = 7; // Up to degree #IrrSwitch#-1, or if there are few monomials in kbase(sP,i-1),
     4949                     // we use a method for generating irreducible secondaries that tends to
     4950                     // produce a smaller output (which is good for subsequent computations).
     4951                     // However, this method needs to much memory in high degrees, and so we
     4952                     // use a sparser method from degree #IrrSwitch# upwards.
    49394953
    49404954  def br=basering;
     
    49474961  int i;
    49484962  if (size(#)>0)
    4949   { if (typeof(#[size(#)])=="int")
    4950     { int v=#[size(#)];
     4963  { if (typeof(#[1])=="int")
     4964    { int v=#[1];
    49514965    }
    49524966    else
     
    49564970  else
    49574971  { int v=0;
     4972  }
     4973
     4974  int UsePP;
     4975  if (size(#)>0)
     4976  { if (typeof(#[size(#)])=="string")
     4977    { if (#[size(#)]=="PP")
     4978      { UsePP = 1;
     4979      }
     4980      else
     4981      { "ERROR:   If the last optional parameter is a string, it should be \"PP\".";
     4982        return(matrix(ideal()),matrix(ideal()));
     4983      }
     4984    }
    49584985  }
    49594986  int n=nvars(br);                // n is the number of variables, as well
     
    49955022  m=nrows(dimmat);                     // m-1 is the highest degree
    49965023  if (v)
    4997   { "We need to find";
     5024  { "There are";
    49985025    for (j=1;j<=m;j++)
    49995026     { if (int(dimmat[j,1])<>1)
     
    50065033  }
    50075034  if (v)
    5008   { "  In degree 0 we have: 1";
     5035  { "In degree 0 we have: 1";
    50095036    "";
    50105037  }
     
    50195046  option(redSB);
    50205047  ideal sP = groebner(ideal(P));
     5048ideal TotalReductor = sP;        // will eventually be groebner(ideal(P)+IS)
     5049ideal sP_Reductor;          // will contain sP union Reductor.
     5050int sPOffset = ncols(sP);
     5051int LastNewIS=-10;           // if the Last New Irr. Sec. was found in degree i-2 then
     5052                           // we compute TotalReductor again
     5053int TotalSet = 1;         // It TotalSet is 0, we eventually need to re-compute TotalReductor.
    50215054  ideal Reductor,SaveRed;  // sP union Reductor is a Groebner basis up to degree i-1
    50225055  int SizeSave;
     
    50455078//--------------------- generating secondary invariants ----------------------
    50465079  for (i=2;i<=m;i++)                   // going through dimmat -
    5047   { if (int(dimmat[i,1])<>0)           // when it is == 0 we need to find no
     5080  {
     5081if ((LastNewIS == i-3) and (UsePP==0))
     5082{ if (v) {"Computing Groebner basis for primaries and previously found irreducibles...";}
     5083  TotalReductor = groebner(sP+IS);
     5084  TotalSet = 1;
     5085}
     5086    if (int(dimmat[i,1])<>0)           // when it is == 0 we need to find no
    50485087    {                                  // elements in the current degree (i-1)
    50495088      if (v)
    5050       { "  Searching in degree "+string(i-1)+", we need to find "+
    5051         string(int(dimmat[i,1]))+" invariant(s)...";
    5052         "  Looking for Power Products...";
     5089      { "Searching in degree "+string(i-1)+". There are "+
     5090        string(int(dimmat[i,1]))+" secondary invariant(s)...";
    50535091      }
    50545092      counter = 0;                       // we'll count up to dimmat[i,1]
     
    50605098      attrib(SaveRed,"isSB",1);
    50615099
     5100if ( TotalSet==0 )
     5101{
     5102      if (v)
     5103      {
     5104        "  Looking for Power Products...";
     5105      }
     5106sP_Reductor = sP;
    50625107// We start searching for reducible secondary invariants in degree i-1, i.e., those
    50635108// that are power products of irreducible secondary invariants.
     
    51265171                    attrib(RedSSort[i-1][k],"size",saveAttr);
    51275172                    if (v)
    5128                     { "We found",counter, " of", int(dimmat[i,1])," secondaries in degree",i-1;
     5173                    {
     5174                      "    We found reducible sec. inv. number "+string(counter);
    51295175                    }
    51305176                    if (int(dimmat[i,1])<>counter)
    51315177                    { Reductor = ideal(helpP);
    5132                         // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
    5133                         // homogeneous polynomial of degree i-1 then G union NF(p,G) is
    5134                         // a homogeneous Groebner basis up to degree i-1.
    51355178                      attrib(Reductor, "isSB",1);
    5136                         // if Reductor becomes too large, we reduce the whole of Indicator by
    5137                         // it, save it in SaveRed, and work with a smaller Reductor. This turns
    5138                         // out to save a little time.
    51395179                      Indicator=reduce(Indicator,Reductor);
    51405180                      SizeSave++;
    51415181                      SaveRed[SizeSave] = helpP;
     5182sP_Reductor[sPOffset+SizeSave] = helpP;
     5183attrib(sP_Reductor, "isSB",1);
     5184                        // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
     5185                        // homogeneous polynomial of degree i-1 then G union NF(p,G) is
     5186                        // a homogeneous Groebner basis up to degree i-1. Hence, sP_Reductor
     5187                        // is a homog. GB up to degree i-1.
    51425188                      attrib(SaveRed, "isSB",1);
    51435189                      attrib(Reductor, "isSB",1);
     
    51465192                    { break;
    51475193                    }
    5148                   }
    5149                 }
    5150               }
     5194                  } // new reducible sec. inv. found
     5195                } // loop through ProdCand
     5196              } // if there is some reducible sec. inv.
    51515197              attrib(SaveRed, "isSB",1);
    51525198              attrib(Reductor, "isSB",1);
     
    51555201        }
    51565202      }
     5203} // if TotalSet==0
     5204else
     5205{ if (v) {"  We don't compute Power Products!"; }
     5206// Instead of computing Power Products, we can compute a Groebner basis of the ideal
     5207// generated by the primary and previously found irr. sec. invariants up to degree i-2. An invariant
     5208// polynomial of degree i-1 belongs to this ideal if and only if it belongs to the sub-algebra
     5209// generated by primary and irreducible secondary invariants up to degree i-2.
     5210// Hence, if we find an invariant outside this ideal, it is an irreducible secondary
     5211// invariant of degree i-1.
     5212}
    51575213
    51585214      // The remaining sec. inv. are irreducible!
    51595215      if (int(dimmat[i,1])<>counter)   // need more than all the power products
     5216                                       // or work without power products
    51605217      { if (v)
    5161         { "There are irreducible secondary invariants in degree ", i-1," !";
    5162         }
    5163         mon = kbase(sP,i-1);
     5218        { "  Looking for irreducible secondary invariants in degree ", i-1;
     5219        }
     5220//        mon = kbase(sP,i-1);
     5221        if (TotalSet==0)
     5222        { mon = kbase(sP_Reductor,i-1);
     5223        }
     5224        else
     5225        { mon = kbase(TotalReductor,i-1);
     5226        }
    51645227        ii = ncols(mon);
    5165         if ((i>IrrSwitch) or (ii>200))  // use sparse algorithm
    5166         { if (counter==0 && ii==int(dimmat[i,1])) // then we can use all of mon
     5228if (mon[1]<>0)
     5229      { if ((i>IrrSwitch) or (ii>200))  // use sparse algorithm
     5230        { if (TotalSet==0 && ii+counter==int(dimmat[i,1])) // then we can use all of mon
    51675231          { B=normalize(evaluate_reynolds(REY,mon));
    51685232            IS=IS+B;
     
    51765240            { RedISSort[i-1] = NF(B,sP);
    51775241            }
    5178             if (v) {"  We found: "; print(B);}
     5242            TotalSet=0;  // i.e., TotalReductor needs to be re-computed
     5243//            if (v) {"  We found: "; print(B);}
     5244            if (v) {"    We found "+string(size(B))+" irred. sec. inv.";}
    51795245          }
    51805246          else
     
    51825248            j=0;                         // j goes through all of mon -
    51835249          // Compare the comments on the computation of reducible sec. inv.!
    5184             while (int(dimmat[i,1])<>counter)
     5250while (j < ii) // we can break the loop if counter==int(dimmat[i,1])
     5251// while (int(dimmat[i,1])<>counter)
    51855252            { if ((j mod MonStep) == 0)
    51865253              { if ((j+MonStep) <= ii)
     
    51895256                  tmp = reduce(tmp,sP);
    51905257                  ReducedCandidates[j+1..j+MonStep] = tmp[1..MonStep];
     5258if (TotalSet == 0)
     5259{
    51915260                  tmp = reduce(tmp,SaveRed);
     5261}
     5262else
     5263{
     5264                  tmp = reduce(tmp,TotalReductor);
     5265}
    51925266                  Indicator[j+1..j+MonStep] = tmp[1..MonStep];
    51935267                  kill tmp;
     
    51985272                  tmp = reduce(tmp,sP);
    51995273                  ReducedCandidates[j+1..ii] = tmp[1..ii-j];
     5274if (TotalSet == 0)
     5275{
    52005276                  tmp = reduce(tmp,SaveRed);
     5277}
     5278else
     5279{
     5280                  tmp = reduce(tmp,TotalReductor);
     5281}
    52015282                  Indicator[j+1..ii] = tmp[1..ii-j];
    52025283                  kill tmp;
     
    52065287              helpP = Indicator[j];
    52075288              if (helpP <>0)                     // B[j] should be added
    5208               { counter++; irrcounter++;
     5289              { TotalSet=0;  // i.e., TotalReductor needs to be re-computed
     5290                counter++; irrcounter++;
    52095291                IS=IS,B[j];
    52105292                saveAttr = attrib(RedSSort[i-1][i-1],"size")+1;
     
    52185300                }
    52195301                if (v)
    5220                 { "  We found the irreducible sec. inv. "+string(B[j]);
     5302                { //"  We found the irreducible sec. inv. "+string(B[j]);
     5303                  "    We found irred. sec. inv. number "+string(irrcounter);
    52215304                }
    52225305                Reductor = ideal(helpP);
     
    52275310                attrib(SaveRed, "isSB",1);
    52285311                attrib(Reductor, "isSB",1);
     5312LastNewIS = i-1;
     5313if (int(dimmat[i,1])==counter) { break; }
    52295314              }
    52305315              mon[j]=0;
     
    52365321        }  // if i>IrrSwitch
    52375322        else  // use fast algorithm
    5238         { B=sort_of_invariant_basis(sP,REY,i-1,int(dimmat[i,1])*6);
     5323        { if (TotalSet == 0)
     5324          { B=sort_of_invariant_basis(sP_Reductor,REY,i-1,int(dimmat[i,1])*6);
     5325          }
     5326          else
     5327          { B=sort_of_invariant_basis(TotalReductor,REY,i-1,int(dimmat[i,1])*6);
     5328          }
     5329//        B=sort_of_invariant_basis(sP,REY,i-1,int(dimmat[i,1])*6);
    52395330                                       // B is a set of
    52405331                                       // images of kbase(sP,i-1) under the
     
    52425333                                       // independent and that do not reduce to
    52435334                                       // 0 modulo sP -
    5244           if (counter==0 && ncols(B)==int(dimmat[i,1])) // then we can take all of B
     5335          if (TotalSet==0 && ncols(B)+counter==int(dimmat[i,1])) // then we can take all of B
    52455336          { IS=IS+B;
    52465337            saveAttr = attrib(RedSSort[i-1][i-1],"size")+int(dimmat[i,1]);
     
    52535344            { RedISSort[i-1] = B;
    52545345            }
    5255             if (v) {"  We found: ";print(B);}
     5346//            if (v) {"  We found: ";print(B);}
     5347            if (v) {"    We found "+string(size(B))+" irred. sec. inv.";}
    52565348          }
    52575349          else
     
    52665358              helpP = Indicator[j];
    52675359              if (helpP <>0)                     // B[j] should be added
    5268               { counter++; irrcounter++;
     5360              { TotalSet=0;  // i.e., TotalReductor needs to be re-computed
     5361                counter++; irrcounter++;
    52695362                IS=IS,B[j];
    52705363                saveAttr = attrib(RedSSort[i-1][i-1],"size")+1;
     
    52785371                }
    52795372                if (v)
    5280                 { "  We found the irreducible sec. inv. "+string(B[j]);
     5373                { //"  We found the irreducible sec. inv. "+string(B[j]);
     5374                  "    We found irred. sec. inv. number "+string(irrcounter);
    52815375                }
    52825376                Reductor = ideal(helpP);
     
    52875381                attrib(SaveRed, "isSB",1);
    52885382                attrib(Reductor, "isSB",1);
     5383LastNewIS = i-1;
     5384if (int(dimmat[i,1])==counter) { break; }
    52895385              }
    52905386              B[j]=0;
     
    52945390          }
    52955391        } // i<=IrrSwitch
     5392} // if mon[1]<>0
    52965393      } // Computation of irreducible secondaries
    52975394      if (v)
     
    54245521  }
    54255522  if (v)
    5426   { "  In degree 0 we have: 1";
     5523  { "In degree 0 we have: 1";
    54275524    "";
    54285525  }
     
    54415538    {                                  // elements in the current degree (i-1)
    54425539      if (v)
    5443       { "  Searching in degree "+string(i-1)+", we need to find "+string(deg_dim_vec[i])+" invariant(s)...";
     5540      { "Searching in degree "+string(i-1)+", we need to find "+string(deg_dim_vec[i])+" invariant(s)...";
    54445541      }
    54455542      TEST=sP;
     
    55875684{
    55885685 //----------  Internal parameters, whose choice might improve the performance -----
    5589   int pieces = 15;   // For generating reducible secondaries, blocks of #pieces# secondaries
     5686  int pieces = 3;   // For generating reducible secondaries, blocks of #pieces# secondaries
    55905687                     // are formed.
    55915688                     // If this parameter is small, the memory consumption will decrease.
     
    56955792  }
    56965793  if (v)
    5697   { "  In degree 0 we have: 1";
     5794  { "In degree 0 we have: 1";
    56985795    "";
    56995796  }
     
    57105807                           // This is the only explicit Groebner basis computation!
    57115808  ideal Reductor,SaveRed;  // sP union Reductor is a Groebner basis up to degree i-1
     5809ideal sP_Reductor;          // will contain sP union Reductor.
     5810int sPOffset = ncols(sP);
    57125811  int SizeSave;
    57135812
     
    57155814                      // minimal degree of a non-constant invariant factor.
    57165815  list ISSort;        // irr. sec. inv. sorted by degree
     5816int NrIS;
    57175817
    57185818  poly helpP;
     
    57385838    {                                  // elements in the current degree (i-1)
    57395839      if (v)
    5740       { "  Searching in degree "+string(i-1)+", we need to find "+string(deg_dim_vec[i])+
     5840      { "Searching in degree "+string(i-1)+", we need to find "+string(deg_dim_vec[i])+
    57415841        " invariant(s)...";
    57425842        "  Looking for Power Products...";
     
    57445844      counter = 0;                       // we'll count up to deg_dim_vec[i]
    57455845      Reductor = ideal(0);
     5846sP_Reductor = sP;
    57465847      helpint = 0;
    57475848      SaveRed = Reductor;
     
    58115912                    attrib(SSort[i-1][k],"size",saveAttr);
    58125913                    if (v)
    5813                     { "We found",counter, " of", deg_dim_vec[i]," secondaries in degree",i-1;
     5914                    { "    We found", counter, "of", deg_dim_vec[i], "secondaries in degree",i-1;
    58145915                    }
    58155916                    if (deg_dim_vec[i]<>counter)
    58165917                    { Reductor = ideal(helpP);
     5918                      attrib(Reductor, "isSB",1);
     5919                      Indicator=reduce(Indicator,Reductor);
     5920                      SizeSave++;
     5921sP_Reductor[sPOffset+SizeSave] = helpP;
     5922attrib(sP_Reductor, "isSB",1);
    58175923                        // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
    58185924                        // homogeneous polynomial of degree i-1 then G union NF(p,G) is
    5819                         // a homogeneous Groebner basis up to degree i-1.
    5820                       attrib(Reductor, "isSB",1);
    5821                         // if Reductor becomes too large, we reduce the whole of Indicator by
    5822                         // it, save it in SaveRed, and work with a smaller Reductor. This turns
    5823                         // out to save a little time.
    5824                       Indicator=reduce(Indicator,Reductor);
    5825                       SizeSave++;
     5925                        // a homogeneous Groebner basis up to degree i-1. Hence, sP_Reductor
     5926                        // is a homog. GB up to degree i-1.
    58265927                      SaveRed[SizeSave] = helpP;
    58275928                      attrib(SaveRed, "isSB",1);
     
    58395940      }
    58405941
     5942NrIS = deg_dim_vec[i]-counter;
    58415943      // The remaining sec. inv. are irreducible!
    5842       if (deg_dim_vec[i]<>counter)   // need more than all the power products
     5944      if (NrIS>0)   // need more than all the power products
    58435945      { if (v)
    5844         { "There are irreducible secondary invariants in degree ", i-1," !";
    5845         }
    5846         mon = kbase(sP,i-1);
     5946        { "  There are ",NrIS,"irreducible secondary invariants in degree ", i-1;
     5947        }
     5948        mon = kbase(sP_Reductor,i-1);
    58475949        ii = ncols(mon);
    58485950//        mon = ideal(mon[ncols(mon)..1]);
     
    58605962            { ISSort[i-1] = B;
    58615963            }
    5862             if (v) {"  We found: "; print(B);}
     5964            if (v) {"    We found all",NrIS,"irreducibles in degree ",i-1;}
    58635965          }
    58645966          else
     
    59016003                { ISSort[i-1] = ideal(B[j]);
    59026004                }
    5903                 if (v)
    5904                 { "  We found the irreducible sec. inv. "+string(B[j]);
     6005                if (v) 
     6006                { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1;
    59056007                }
    59066008                Reductor = ideal(helpP);
     
    59346036            { ISSort[i-1] = B;
    59356037            }
    5936             if (v) {"  We found: "; print(B);}
     6038            if (v) {"    We found all",NrIS,"irreducibles in degree ",i-1;}
    59376039          }
    59386040          else
     
    59576059                { ISSort[i-1] = ideal(B[j]);
    59586060                }
    5959                 if (v)
    5960                 { "  We found the irreducible sec. inv. "+string(B[j]);
     6061                if (v) 
     6062                { "    We found", irrcounter,"of", NrIS ,"irr. sec. inv. in degree ",i-1;
    59616063                }
    59626064                Reductor = ideal(helpP);
     
    60406142          hence the number of secondary invariants is the product of the degrees of
    60416143          primary invariants divided by the group order.
     6144          <secondary_and_irreducible_no_molien> should usually be faster and of more useful
     6145          functionality.
     6146SEE ALSO: secondary_and_irreducible_no_molien
    60426147EXAMPLE:  example secondary_no_molien; shows an example
    60436148"
     
    61236228  { "  We need to find "+string(max)+" secondary invariants.";
    61246229    "";
    6125     "  In degree 0 we have: 1";
     6230    "In degree 0 we have: 1";
    61266231    "";
    61276232  }
     
    61606265    if (deg_vec[k]<>i)
    61616266    { if (v)
    6162       { "  Searching in degree "+string(i)+"...";
     6267      { "Searching in degree "+string(i)+"...";
    61636268      }
    61646269      mon = kbase(sP,i);
     
    61946299            S[counter] = B[j];
    61956300            if (v)
    6196             { "  We found sec. inv. number "+string(counter)+" in degree "+string(i);
     6301            { "    We found sec. inv. number "+string(counter)+" in degree "+string(i);
    61976302            }
    61986303            if (counter == max) {break;}
     
    62266331            S[counter] = B[j];
    62276332            if (v)
    6228             { "  We found sec. inv. number "+string(counter)+" in degree "+string(i);
     6333            { "    We found sec. inv. number "+string(counter)+" in degree "+string(i);
    62296334            }
    62306335            if (counter == max) {break;}
     
    62926397EXAMPLE: example secondary_and_irreducibles_no_molien; shows an example
    62936398"
    6294 { int pieces = 15;   // For generating reducible secondaries, blocks of #pieces# secondaries
     6399{ int pieces = 3;    // For generating reducible secondaries, blocks of #pieces# secondaries
    62956400                     // are formed.
    62966401                     // If this parameter is small, the memory consumption will decrease.
     
    63766481  { "  We need to find "+string(max)+" secondary invariants.";
    63776482    "";
    6378     "  In degree 0 we have: 1";
     6483    "In degree 0 we have: 1";
    63796484    "";
    63806485  }
     
    64296534    if (deg_vec[l]<>i-1)
    64306535    { if (v)
    6431       { "  Searching in degree "+string(i-1);
     6536      { "Searching in degree "+string(i-1);
    64326537        "  Looking for Power Products...";
    64336538      }
     
    64996604                    attrib(SSort[i-1][k],"size",saveAttr);
    65006605                    if (v)
    6501                     { "We found sec. inv. number",counter, " in degree",i-1;
     6606                    { "    We found sec. inv. number",counter, "in degree",i-1;
    65026607                    }
    65036608                    if (max<>counter)
     
    65306635      if (max<>counter)
    65316636      { if (v)
    6532         { "Looking for irreducible secondary invariants in degree ", i-1;
     6637        { "  Looking for irreducible secondary invariants in degree ", i-1;
    65336638        }
    65346639        mon = kbase(sP,i-1);
     
    65756680              }
    65766681              if (v)
    6577               { "  We found the irreducible sec. inv. "+string(B[j]);
     6682              { "    We found irreducible sec. inv. number", irrcounter, "in degree", i-1;
    65786683              }
    65796684              if (counter == max) { break; }
     
    66186723              }
    66196724              if (v)
    6620               { "  We found the irreducible sec. inv. "+string(B[j]);
     6725              { "    We found irreducible sec. inv. number", irrcounter, "in degree", i-1;
    66216726              }
    66226727              Reductor = ideal(helpP);
     
    66846789         matrix S,IS=secondary_and_irreducibles_no_molien(L[1..2],intvec(1,2),1);
    66856790         print(S);
     6791         print(IS);
     6792}
     6793///////////////////////////////////////////////////////////////////////////////
     6794
     6795proc irred_secondary_no_molien (matrix P, matrix REY, list #)
     6796"USAGE:   irred_secondary_no_molien(P,REY[,deg_vec,v]);
     6797         P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix>
     6798         representing the Reynolds operator, deg_vec: an optional <intvec>
     6799         listing some degrees where no irreducible secondary invariants can
     6800         be found, v: an optional <int>
     6801ASSUME:  n is the number of variables of the basering, g the size of the group,
     6802         REY is the 1st return value of group_reynolds(), reynolds_molien() or
     6803         the second one of primary_invariants()
     6804RETURN:  Irreducible secondary invariants of the invariant ring (type <matrix>)
     6805DISPLAY: information if v does not equal 0
     6806THEORY:  Irred. secondary invariants are calculated by finding a basis (in terms of
     6807         monomials) of the basering modulo primary and previously found secondary
     6808         invariants, mapping those to invariants with the Reynolds operator. Among
     6809         these images we pick a maximal subset that is linearly independent modulo
     6810         the primary and previously found secondary invariants, using Groebner basis
     6811         techniques.
     6812EXAMPLE: example irred_secondary_no_molien; shows an example
     6813"
     6814{ int MonStep = 29;
     6815
     6816  def br=basering;
     6817 //------------------ checking input and setting verbose ----------------------
     6818  if (size(#)==1 or size(#)==2)
     6819  { if (typeof(#[size(#)])=="int")
     6820    { if (size(#)==2)
     6821      { if (typeof(#[size(#)-1])=="intvec")
     6822        { intvec deg_vec=#[size(#)-1];
     6823        }
     6824        else
     6825        { "ERROR:   the third parameter should be an <intvec>";
     6826          return();
     6827        }
     6828      }
     6829      int v=#[size(#)];
     6830    }
     6831    else
     6832    { if (size(#)==1)
     6833      { if (typeof(#[size(#)])=="intvec")
     6834        { intvec deg_vec=#[size(#)];
     6835          int v=0;
     6836        }
     6837        else
     6838        { "ERROR:   the third parameter should be an <intvec>";
     6839          return();
     6840        }
     6841      }
     6842      else
     6843      { "ERROR:   wrong list of parameters";
     6844        return();
     6845      }
     6846    }
     6847  }
     6848  else
     6849  { if (size(#)>2)
     6850    { "ERROR:   there are too many parameters";
     6851      return();
     6852    }
     6853    int v=0;
     6854  }
     6855  int n=nvars(basering);               // n is the number of variables, as well
     6856                                       // as the size of the matrices, as well
     6857                                       // as the number of primary invariants,
     6858                                       // we should get
     6859  if (ncols(P)<>n)
     6860  { "ERROR:   The first parameter ought to be the matrix of the primary";
     6861    "         invariants."
     6862    return();
     6863  }
     6864  if (ncols(REY)<>n)
     6865  { "ERROR:   The second parameter ought to be the Reynolds operator.";
     6866    return();
     6867  }
     6868  if (char(br)<>0)
     6869  { if (nrows(REY) mod char(br) == 0)
     6870    { "ERROR:   We need to be in the non-modular case.";
     6871      return();
     6872    }
     6873  }
     6874  if (v && voice==2)
     6875  { "";
     6876  }
     6877  if (defined(deg_vec)<>voice)
     6878  { intvec deg_vec;
     6879  }
     6880  int l=1;
     6881
     6882 //-------------------------- initializing variables --------------------------
     6883
     6884  int dgb = degBound;
     6885  degBound = 0;
     6886  int d,block, counter, totalcount, monsize,i,j, fin,hlp;
     6887  poly helpP,lmp;
     6888  block = 1;
     6889  ideal mon, MON, Inv, IS,RedInv, NewIS, NewReductor;
     6890  int NewIScounter;
     6891  ideal sP = slimgb(ideal(P));
     6892  int Max = vdim(sP);
     6893  if (Max<0)
     6894  { "ERROR:   The second parameter ought to be the Reynolds operator.";
     6895    return();
     6896  }
     6897  ideal sIS = sP;   // sIS will be a Groebner basis up to degree d of P+irred. sec. inv.
     6898  while (totalcount < Max)
     6899  { d++;
     6900    if (deg_vec[l]<>d)
     6901    { if (v) { "Searching irred. sec. inv. in degree "+string(d); }
     6902      NewIS = ideal();
     6903      NewIScounter=0;
     6904      MON = kbase(sP,d);
     6905      mon = kbase(sIS,d);
     6906      monsize=ncols(mon);
     6907      totalcount = totalcount + ncols(MON);
     6908      if (mon[1]<>0)
     6909      {
     6910        if (v) { "  We have "+string(monsize)+" candidates for irred. secondaries";}
     6911        block=0; // Loops through the monomials
     6912        while (block<monsize)
     6913        { if ((block mod MonStep) == 0)
     6914          { if ((block+MonStep) <= monsize)
     6915            { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[block+1..block+MonStep])));
     6916              Inv[block+1..block+MonStep] = tmp[1..MonStep];
     6917              tmp = reduce(tmp,sIS);
     6918              RedInv[block+1..block+MonStep] = tmp[1..MonStep];
     6919              kill tmp;
     6920            }
     6921            else
     6922            { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[block+1..monsize])));
     6923              Inv[block+1..monsize] = tmp[1..monsize-block];
     6924              tmp = reduce(tmp,sIS);
     6925              RedInv[block+1..monsize] = tmp[1..monsize-block];
     6926              kill tmp;
     6927            }
     6928          }
     6929          block++;
     6930          helpP = RedInv[block];
     6931          if (helpP<>0)
     6932          { counter++; // found new irr. sec. inv.!
     6933            if (v) { "    We found irred. sec. inv. number "+string(counter)+" in degree "+string(d); }
     6934            IS[counter] = Inv[block];
     6935            sIS = sIS,helpP;
     6936            attrib(sIS,"isSB",1);
     6937            NewIScounter++;
     6938            NewIS[NewIScounter] = helpP;
     6939// for permutation of variables, the following might yield a speed-up;
     6940// however, for general group actions it does not work:
     6941//          for (i=block;i<=monsize;i++)
     6942//          { if (Inv[block]<>reduce(Inv[block],std(mon[i])))
     6943//            { mon[i] = 0;
     6944//            }
     6945//          }
     6946
     6947            mon[block]=0;
     6948            Inv[block]=0;
     6949            RedInv[block]=0;
     6950            NewReductor[1]=helpP;
     6951            attrib(NewReductor,"isSB",1);
     6952            RedInv = reduce(RedInv,NewReductor);
     6953          }
     6954        } // loop through monomials
     6955      } // if mon[1]<>0
     6956      if (totalcount < Max)
     6957      { if (NewIScounter==0)
     6958        { if (fin==0)
     6959          { degBound = 0;
     6960            sIS = groebner(sIS);
     6961            fin=1; 
     6962          }
     6963        }
     6964        else
     6965        { degBound = d+1;
     6966          sIS = groebner(sIS+NewIS); 
     6967          degBound = 0;
     6968          fin = 0;
     6969        }
     6970      }
     6971      attrib(sIS,"isSB",1);
     6972    } // if degree d is not excluded by deg_vec
     6973    else
     6974    { if (size(deg_vec)==l)
     6975      { l=1;
     6976      }
     6977      else
     6978      { l++;
     6979      }
     6980    }
     6981  } // loop through degree
     6982  degBound = dgb;
     6983  return(matrix(IS));
     6984}
     6985
     6986example
     6987{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
     6988         ring R=3,(x,y,z),dp;
     6989         matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
     6990         list L=primary_invariants(A,intvec(1,1,0));
     6991         // In that example, there are no secondary invariants
     6992         // in degree 1 or 2.
     6993         matrix IS=irred_secondary_no_molien(L[1..2],intvec(1,2),1);
    66866994         print(IS);
    66876995}
     
    68817189RETURN:  primary and secondary invariants (both of type <matrix>) generating
    68827190         the invariant ring with respect to the matrix group generated by the
    6883          matrices in the input and irreducible secondary invariants (type
    6884          <matrix>) if the Molien series was available
     7191         matrices in the input, and irreducible secondary invariants if we are
     7192         in the non-modular case.
    68857193DISPLAY: information about the various stages of the program if the third flag
    68867194         does not equal 0
     
    69777285          list l=primary_charp_no_molien(L[1],v);
    69787286          if (size(l)==2)
    6979           { matrix S=secondary_no_molien(l[1],L[1],l[2],v);
     7287          { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],l[2],v);
    69807288          }
    69817289          else
    6982           { matrix S=secondary_no_molien(l[1],L[1],v);
     7290          { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],v);
    69837291          }
    6984           return(l[1],S);
     7292          return(l[1],S,IS);
    69857293        }
    69867294      }
     
    70037311    { list l=primary_char0_no_molien(L[1],v);
    70047312      if (size(l)==2)
    7005       { matrix S=secondary_no_molien(l[1],L[1],l[2],v);
     7313      { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],l[2],v);
    70067314      }
    70077315      else
    7008       { matrix S=secondary_no_molien(l[1],L[1],v);
    7009       }
    7010       return(l[1],S);
     7316      { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],v);
     7317      }
     7318      return(l[1],S,IS);
    70117319    }
    70127320    else
     
    70147322      { list l=primary_charp_no_molien(L[1],v); // case
    70157323        if (size(l)==2)
    7016         { matrix S=secondary_no_molien(l[1],L[1],l[2],v);
     7324        { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],l[2],v);
    70177325        }
    70187326        else
    7019         { matrix S=secondary_no_molien(l[1],L[1],v);
    7020         }
    7021         return(l[1],S);
     7327        { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],v);
     7328        }
     7329        return(l[1],S,IS);
    70227330      }
    70237331      else                             // the modular case
     
    70987406         among the coefficients)
    70997407RETURN:  primary and secondary invariants (both of type <matrix>) generating
    7100          invariant ring with respect to the matrix group generated by the
    7101          matrices in the input and irreducible secondary invariants (type
    7102          <matrix>) if the Molien series was available
     7408         the invariant ring with respect to the matrix group generated by the
     7409         matrices in the input, and irreducible secondary invariants if we are
     7410         in the non-modular case.
    71037411DISPLAY: information about the various stages of the program if the third flag
    71047412         does not equal 0
     
    72127520          list l=primary_charp_no_molien_random(L[1],max,v);
    72137521          if (size(l)==2)
    7214           { matrix S=secondary_no_molien(l[1],L[1],l[2],v);
     7522          { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],l[2],v);
    72157523          }
    72167524          else
    7217           { matrix S=secondary_no_molien(l[1],L[1],v);
     7525          { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],v);
    72187526          }
    7219           return(l[1],S);
     7527          return(l[1],S,IS);
    72207528        }
    72217529      }
     
    72387546    { list l=primary_char0_no_molien_random(L[1],max,v);
    72397547      if (size(l)==2)
    7240       { matrix S=secondary_no_molien(l[1],L[1],l[2],v);
     7548      { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],l[2],v);
    72417549      }
    72427550      else
    7243       { matrix S=secondary_no_molien(l[1],L[1],v);
    7244       }
    7245       return(l[1],S);
     7551      { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],v);
     7552      }
     7553      return(l[1],S,IS);
    72467554    }
    72477555    else
     
    72497557      { list l=primary_charp_no_molien_random(L[1],max,v); // case
    72507558        if (size(l)==2)
    7251         { matrix S=secondary_no_molien(l[1],L[1],l[2],v);
     7559        { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],l[2],v);
    72527560        }
    72537561        else
    7254         { matrix S=secondary_no_molien(l[1],L[1],v);
    7255         }
    7256         return(l[1],S);
     7562        { matrix S,IS=secondary_and_irreducibles_no_molien(l[1],L[1],v);
     7563        }
     7564        return(l[1],S,IS);
    72577565      }
    72587566      else                             // the modular case
Note: See TracChangeset for help on using the changeset viewer.