Changeset 3bb38d3 in git


Ignore:
Timestamp:
Mar 5, 2007, 8:39:23 PM (17 years ago)
Author:
Simon King <king@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
f3587d92249476f601fedf863d711cd00d783635
Parents:
f097f1d706a913c97d6b90901ad7dd0e830cb1dd
Message:
Mainly "cosmetic" changes


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/finvar.lib

    rf097f1 r3bb38d3  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: finvar.lib,v 1.65 2007-02-24 15:08:04 Singular Exp $"
     2version="$Id: finvar.lib,v 1.66 2007-03-05 19:39:23 king Exp $"
    33category="Invariant theory";
    44info="
     
    50405040  int LastNewIS=-10;           // if the Last New Irr. Sec. was found in degree i-2 then
    50415041                               // we compute TotalReductor again
    5042   int TotalSet = 1;         // It TotalSet is 0, we eventually need to re-compute TotalReductor.
     5042  int NoPP;                    // It NoPP==1, we must not use Power Products
    50435043  ideal Reductor,SaveRed;   // sP union Reductor is a Groebner basis up to degree i-1
    50445044  int SizeSave;
     
    50675067//--------------------- generating secondary invariants ----------------------
    50685068  for (i=2;i<=m;i++)                   // going through dimmat -
    5069   { if ((LastNewIS == i-3) and (UsePP==0))  // We guess that all irreducibles have been found!
     5069  { // Case 1: PP are not required by the user, and we guess that all irreducibles have
     5070    // been found.
     5071    // Afterwards, the use of PP is impossible.
     5072    if ((LastNewIS == i-3) and (UsePP==0)) 
    50705073    { if (v) {"Computing Groebner basis for primaries and previously found irreducibles...";}
     5074      degBound = 0;
    50715075      TotalReductor = groebner(sP+IS);
    5072       TotalSet = 1;
     5076      NoPP = 1;
     5077    }
     5078    // Case 2: The use of PP is impossible, but we did find a new irr. sec. inv.
     5079    // in the preceding degree
     5080    if ((LastNewIS == i-2) and (NoPP==1))
     5081    { degBound = i-1;
     5082      TotalReductor = groebner(TotalReductor+SaveRed); // lift from degree i-2 to degree i-1
     5083      attrib(TotalReductor, "isSB",1);
    50735084    }
    50745085    if (int(dimmat[i,1])<>0)           // when it is == 0 we need to find no
     
    50855096      attrib(Reductor,"isSB",1);
    50865097      attrib(SaveRed,"isSB",1);
    5087 
    5088       if ( TotalSet==0 )
     5098             
     5099      // Case A: We use PP
     5100      if ( NoPP==0 )
    50895101      { if (v)
    50905102        {
    50915103          "  Looking for Power Products...";
    50925104        }
    5093       sP_Reductor = sP;
     5105        sP_Reductor = sP;
    50945106// We start searching for reducible secondary invariants in degree i-1, i.e., those
    50955107// that are power products of irreducible secondary invariants.
     
    51025114// work with their reduction modulo sP --- this allows to detect a secondary invariant
    51035115// without to actually compute it!
    5104       for (k=1;k<i-1;k++)
    5105       { if (int(dimmat[i,1])==counter)
    5106         { break;
    5107         }
    5108         if (typeof(RedISSort[k])<>"none")
    5109         { Mul1 = RedISSort[k];
    5110         }
    5111         else
    5112         { Mul1 = ideal(0);
    5113         }
    5114         if ((int(dimmat[i-k,1])>0) && (Mul1[1]<>0))
    5115         { for (minD=i-k-1;minD>0;minD--)
    5116           { if (int(dimmat[i,1])==counter)
    5117             { break;
    5118             }
    5119             for (k2=1;k2 <= ((attrib(RedSSort[i-k-1][minD],"size")-1) div pieces)+1; k2++)
     5116        for (k=1;k<i-1;k++)
     5117        { if (int(dimmat[i,1])==counter)
     5118          { break;
     5119          }
     5120          if (typeof(RedISSort[k])<>"none")
     5121          { Mul1 = RedISSort[k];
     5122          }
     5123          else
     5124          { Mul1 = ideal(0);
     5125          }
     5126          if ((int(dimmat[i-k,1])>0) && (Mul1[1]<>0))
     5127          { for (minD=i-k-1;minD>0;minD--)
    51205128            { if (int(dimmat[i,1])==counter)
    51215129              { break;
    51225130              }
    5123               Mul2=ideal(0);
    5124               if (attrib(RedSSort[i-k-1][minD],"size")>=k2*pieces)
    5125               { for (k3=1;k3<=pieces;k3++)
    5126                 { Mul2[k3] = RedSSort[i-k-1][minD][((k2-1)*pieces)+k3];
     5131              for (k2=1;k2 <= ((attrib(RedSSort[i-k-1][minD],"size")-1) div pieces)+1; k2++)
     5132              { if (int(dimmat[i,1])==counter)
     5133                { break;
    51275134                }
     5135                Mul2=ideal(0);
     5136                if (attrib(RedSSort[i-k-1][minD],"size")>=k2*pieces)
     5137                { for (k3=1;k3<=pieces;k3++)
     5138                  { Mul2[k3] = RedSSort[i-k-1][minD][((k2-1)*pieces)+k3];
     5139                  }
     5140                }
     5141                else
     5142                { for (k3=1;k3<=(attrib(RedSSort[i-k-1][minD],"size") mod pieces);k3++)
     5143                  { Mul2[k3] = RedSSort[i-k-1][minD][((k2-1)*pieces)+k3];
     5144                  }
     5145                }
     5146                ProdCand = simplify(Mul1*Mul2,4);
     5147                ReducedCandidates = reduce(ProdCand,sP);
     5148                    // sP union SaveRed union Reductor is a homogeneous Groebner basis
     5149                    // up to degree i-1.
     5150                    // We first reduce by sP (which is fixed, so we can do it once for all),
     5151                    // then by SaveRed resp. by Reductor (which is modified during
     5152                    // the computations).
     5153                Indicator = reduce(ReducedCandidates,SaveRed);
     5154                               // If Indicator[ii]==0 then ReducedCandidates it the reduction
     5155                               // of an invariant that is in the algebra generated by primary
     5156                               // invariants and previously computed secondary invariants.
     5157                               // Otherwise ReducedCandidates[ii] is the reduction of an invariant
     5158                               // that we can take as secondary invariant.
     5159                if (size(Indicator)<>0)
     5160                { for (ii=1;ii<=ncols(ProdCand);ii++)     // going through all the power products
     5161                  { helpP = Indicator[ii];
     5162                    if (helpP <> 0)
     5163                    { counter++;
     5164                      saveAttr = attrib(RedSSort[i-1][k],"size")+1;
     5165                      RedSSort[i-1][k][saveAttr] = ReducedCandidates[ii];
     5166                          // By construction, this is the reduction of a reducible s.i.
     5167                          // of degree i-1.
     5168                      attrib(RedSSort[i-1][k],"size",saveAttr);
     5169                      if (v)
     5170                      { "    We found reducible sec. inv. number "+string(counter);
     5171                      }
     5172                      if (int(dimmat[i,1])<>counter)
     5173                      { Reductor = ideal(helpP);
     5174                        attrib(Reductor, "isSB",1);
     5175                        Indicator=reduce(Indicator,Reductor);
     5176                        SizeSave++;
     5177                        SaveRed[SizeSave] = helpP;
     5178                        sP_Reductor[sPOffset+SizeSave] = helpP;
     5179                        attrib(sP_Reductor, "isSB",1);
     5180                          // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
     5181                          // homogeneous polynomial of degree i-1 then G union NF(p,G) is
     5182                          // a homogeneous Groebner basis up to degree i-1. Hence, sP_Reductor
     5183                          // is a homog. GB up to degree i-1.
     5184                        attrib(SaveRed, "isSB",1);
     5185                        attrib(Reductor, "isSB",1);
     5186                      }
     5187                      else
     5188                      { break;
     5189                      }
     5190                    } // new reducible sec. inv. found
     5191                  } // loop through ProdCand
     5192                } // if there is some reducible sec. inv.
     5193                attrib(SaveRed, "isSB",1);
     5194                attrib(Reductor, "isSB",1);
    51285195              }
    5129               else
    5130               { for (k3=1;k3<=(attrib(RedSSort[i-k-1][minD],"size") mod pieces);k3++)
    5131                 { Mul2[k3] = RedSSort[i-k-1][minD][((k2-1)*pieces)+k3];
    5132                 }
    5133               }
    5134               ProdCand = simplify(Mul1*Mul2,4);
    5135               ReducedCandidates = reduce(ProdCand,sP);
    5136                   // sP union SaveRed union Reductor is a homogeneous Groebner basis
    5137                   // up to degree i-1.
    5138                   // We first reduce by sP (which is fixed, so we can do it once for all),
    5139                   // then by SaveRed resp. by Reductor (which is modified during
    5140                   // the computations).
    5141               Indicator = reduce(ReducedCandidates,SaveRed);
    5142                              // If Indicator[ii]==0 then ReducedCandidates it the reduction
    5143                              // of an invariant that is in the algebra generated by primary
    5144                              // invariants and previously computed secondary invariants.
    5145                              // Otherwise ReducedCandidates[ii] is the reduction of an invariant
    5146                              // that we can take as secondary invariant.
    5147               if (size(Indicator)<>0)
    5148               { for (ii=1;ii<=ncols(ProdCand);ii++)     // going through all the power products
    5149                 { helpP = Indicator[ii];
    5150                   if (helpP <> 0)
    5151                   { counter++;
    5152                     saveAttr = attrib(RedSSort[i-1][k],"size")+1;
    5153                     RedSSort[i-1][k][saveAttr] = ReducedCandidates[ii];
    5154                         // By construction, this is the reduction of a reducible s.i.
    5155                         // of degree i-1.
    5156                     attrib(RedSSort[i-1][k],"size",saveAttr);
    5157                     if (v)
    5158                     {
    5159                       "    We found reducible sec. inv. number "+string(counter);
    5160                     }
    5161                     if (int(dimmat[i,1])<>counter)
    5162                     { Reductor = ideal(helpP);
    5163                       attrib(Reductor, "isSB",1);
    5164                       Indicator=reduce(Indicator,Reductor);
    5165                       SizeSave++;
    5166                       SaveRed[SizeSave] = helpP;
    5167                       sP_Reductor[sPOffset+SizeSave] = helpP;
    5168                       attrib(sP_Reductor, "isSB",1);
    5169                         // Lemma: If G is a homogeneous Groebner basis up to degree i-1 and p is a
    5170                         // homogeneous polynomial of degree i-1 then G union NF(p,G) is
    5171                         // a homogeneous Groebner basis up to degree i-1. Hence, sP_Reductor
    5172                         // is a homog. GB up to degree i-1.
    5173                       attrib(SaveRed, "isSB",1);
    5174                       attrib(Reductor, "isSB",1);
    5175                     }
    5176                     else
    5177                     { break;
    5178                     }
    5179                   } // new reducible sec. inv. found
    5180                 } // loop through ProdCand
    5181               } // if there is some reducible sec. inv.
    5182               attrib(SaveRed, "isSB",1);
    5183               attrib(Reductor, "isSB",1);
    51845196            }
    51855197          }
    51865198        }
    5187       }
    5188     } // if TotalSet==0
    5189     else
    5190     { if (v) {"  We don't compute Power Products!"; }
     5199        TotalReductor = sP_Reductor; 
     5200      } // if NoPP==0
     5201      else
     5202      { if (v) {"  We don't compute Power Products!"; }
    51915203// Instead of computing Power Products, we can compute a Groebner basis of the ideal
    51925204// generated by the primary and previously found irr. sec. invariants up to degree i-2. An invariant
     
    51955207// Hence, if we find an invariant outside this ideal, it is an irreducible secondary
    51965208// invariant of degree i-1.
    5197 }
    5198       // The remaining sec. inv. are irreducible!
    5199       if (int(dimmat[i,1])<>counter)   // need more than all the power products
     5209    }  // dealing with reducible sec. inv.
     5210    // The remaining sec. inv. are irreducible!
     5211    // Reason: If we use PP, TotalReductor detects the <<P>>-module generated by
     5212    //         all secondaries
     5213    //         If we don't, TotalReductor detects the algebra <<P union IS>>
     5214    if (int(dimmat[i,1])<>counter)   // need more than all the power products
    52005215                                       // or work without power products
    52015216      { if (v)
    52025217        { "  Looking for irreducible secondary invariants in degree ", i-1;
    52035218        }
    5204         if (TotalSet==0)
    5205         { mon = kbase(sP_Reductor,i-1);
    5206         }
    5207         else
    5208         { mon = kbase(TotalReductor,i-1);
    5209         }
     5219        mon = kbase(TotalReductor,i-1);
    52105220        ii = ncols(mon);
    52115221        if (mon[1]<>0)
    52125222        { if ((i>IrrSwitch) or (ii>200))  // use sparse algorithm
    5213           { if (TotalSet==0 && ii+counter==int(dimmat[i,1])) // then we can use all of mon
     5223          { if (NoPP==0 && ii+counter==int(dimmat[i,1])) // then we can use all of mon
    52145224            { B=normalize(evaluate_reynolds(REY,mon));
    52155225              IS=IS+B;
     
    52235233              { RedISSort[i-1] = NF(B,sP);
    52245234              }
    5225               TotalSet=0;  // i.e., TotalReductor needs to be re-computed
    52265235              if (v) {"    We found "+string(size(B))+" irred. sec. inv.";}
    52275236            }
     
    52355244                  { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[j+1..j+MonStep])));
    52365245                    B[j+1..j+MonStep] = tmp[1..MonStep];
    5237                     tmp = reduce(tmp,sP);
    5238                     ReducedCandidates[j+1..j+MonStep] = tmp[1..MonStep];
    5239                     if (TotalSet == 0)
    5240                     { tmp = reduce(tmp,SaveRed);
     5246                    if (NoPP == 0)  // we are still working with PowerProducts,
     5247                                    // hence, we need to store NF(sec.inv.,sP)
     5248                    { tmp = reduce(tmp,sP);
     5249                      ReducedCandidates[j+1..j+MonStep] = tmp[1..MonStep];
     5250                      tmp = reduce(tmp,SaveRed);
    52415251                    }
    52425252                    else
     
    52495259                  { ideal tmp = normalize(evaluate_reynolds(REY,ideal(mon[j+1..ii])));
    52505260                    B[j+1..ii] = tmp[1..ii-j];
    5251                     tmp = reduce(tmp,sP);
    5252                     ReducedCandidates[j+1..ii] = tmp[1..ii-j];
    5253                     if (TotalSet == 0)
    5254                     { tmp = reduce(tmp,SaveRed);
     5261                    if (NoPP == 0)
     5262                    { tmp = reduce(tmp,sP);
     5263                      ReducedCandidates[j+1..ii] = tmp[1..ii-j];
     5264                      tmp = reduce(tmp,SaveRed);
    52555265                    }
    52565266                    else
     
    52645274                helpP = Indicator[j];
    52655275                if (helpP <>0)                     // B[j] should be added
    5266                 { TotalSet=0;  // i.e., TotalReductor needs to be re-computed
    5267                   counter++; irrcounter++;
     5276                { counter++; irrcounter++;
    52685277                  IS=IS,B[j];
    52695278                  saveAttr = attrib(RedSSort[i-1][i-1],"size")+1;
    5270                   RedSSort[i-1][i-1][saveAttr] = ReducedCandidates[j];
    5271                   attrib(RedSSort[i-1][i-1],"size",saveAttr);
    5272                   if (typeof(RedISSort[i-1]) <> "none")
    5273                   { RedISSort[i-1][irrcounter] = ReducedCandidates[j];
    5274                   }
    5275                   else
    5276                   { RedISSort[i-1] = ideal(ReducedCandidates[j]);
     5279                  if (NoPP==0)   // we will still be working with Power Products
     5280                  { RedSSort[i-1][i-1][saveAttr] = ReducedCandidates[j];
     5281                    attrib(RedSSort[i-1][i-1],"size",saveAttr);
     5282                    if (typeof(RedISSort[i-1]) <> "none")
     5283                    { RedISSort[i-1][irrcounter] = ReducedCandidates[j];
     5284                    }
     5285                    else
     5286                    { RedISSort[i-1] = ideal(ReducedCandidates[j]);
     5287                    }
    52775288                  }
    52785289                  if (v)
     
    52975308          }  // if i>IrrSwitch
    52985309          else  // use fast algorithm
    5299           { if (TotalSet == 0)
    5300             { B=sort_of_invariant_basis(sP_Reductor,REY,i-1,int(dimmat[i,1])*6);
    5301             }
    5302             else
    5303             { B=sort_of_invariant_basis(TotalReductor,REY,i-1,int(dimmat[i,1])*6);
    5304             }
     5310          { B=sort_of_invariant_basis(TotalReductor,REY,i-1,int(dimmat[i,1])*6);
    53055311                                       // B is a linearly independent set of reynolds
    53065312                                       // images of monomials that do not occur
     
    53085314                                       // by primary and previously found irreducible
    53095315                                       // secondary invariants.
    5310             if (TotalSet==0 && ncols(B)+counter==int(dimmat[i,1])) // then we can take all of B
     5316            if (NoPP==0 && ncols(B)+counter==int(dimmat[i,1])) // then we can take all of B
    53115317            { IS=IS+B;
    53125318              saveAttr = attrib(RedSSort[i-1][i-1],"size")+int(dimmat[i,1]);
     
    53325338                helpP = Indicator[j];
    53335339                if (helpP <>0)                     // B[j] should be added
    5334                 { TotalSet=0;  // i.e., TotalReductor needs to be re-computed
     5340                { NoPP=0;  // i.e., TotalReductor needs to be re-computed
    53355341                  counter++; irrcounter++;
    53365342                  IS=IS,B[j];
     
    68456851  int Max = vdim(sP);
    68466852  if (Max<0)
    6847   { "ERROR:   The second parameter ought to be the Reynolds operator.";
     6853  { "ERROR:   The first parameter ought to be a matrix of primary invariants.";
    68486854    return();
    68496855  }
     
    82208226    counter = 0; // counts generators in degree d
    82218227    OrbSums = orbit_sums(kbase(sG,d),M);
    8222     RedSums = reduce(OrbSums,sG);
    8223     sGoffset=ncols(sG);
    82248228    OrbSize = ncols(OrbSums);
    82258229    if (v)
    82268230    { "  We have "+string(OrbSize)+" orbit sums of degree "+string(d);
    82278231    }
     8232    RedSums = reduce(OrbSums,sG);
     8233    sGoffset=ncols(sG);
    82288234// loop through orbit_sum, and select generators among them
    82298235    for (i=1;i<=OrbSize;i++)
Note: See TracChangeset for help on using the changeset viewer.