Changeset 75f83c in git


Ignore:
Timestamp:
Sep 21, 2023, 4:28:05 PM (8 months ago)
Author:
slap <slaplagne@…>
Branches:
(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
70a5104457d3ea96b77d515e712f8a3fbb0b7144
Parents:
5bb58e4c13fe299469984183890384cb6dd543b0
git-author:
slap <slaplagne@gmail.com>2023-09-21 16:28:05+02:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2023-11-07 16:30:30+01:00
Message:
Tidying up the optimization approach

Added some comments and remove prints.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/integralbasis.lib

    r5bb58e r75f83c  
    11861186}
    11871187
     1188// We compute the Puiseux segments using Hensel lifting.
     1189// The segments are order according to the initial exponent from
     1190// smaller to larger.
     1191// The classes of Puiseux expansions are grouped matching the
     1192// Puiseux segments.
     1193
    11881194proc getSegments(poly f, list classes, list slopes, int globOrder)
    11891195{
     
    12081214  int locOrder = maxOrder;
    12091215
     1216  // If loc == 1, we remove the component outside the origin.
    12101217  if(loc == 1)
    12111218  {
     
    12291236    for(i = 1; i <= size(fSegment); i++)
    12301237    {
     1238      // We compute the newton poly of each polynomial to find out the
     1239      // corresponding slope
    12311240      list l = newtonpoly(fSegment[i]);
    1232       "l(", i , ") = ", l;
    1233      
    12341241      slopeSegment = number(l[2][1]) / number(l[1][2]);
     1242
     1243      // We look for all classes with same slope as each segment
    12351244      classesNew = list();
    1236        
    1237       // We look for all classes with same slope as this segment
    12381245      for(j = 1; j <= size(classes); j++)
    12391246      {
     
    12441251        }
    12451252      } 
     1253     
     1254      // We put everything together
    12461255      out[i] = list(fSegment[i], slopeSegment, classesNew);
    12471256    }
     
    12511260  out = sortSegments(out);
    12521261 
    1253  
    1254   "output of getSegments: "; out;
    1255   //~;
    12561262  return(out);
    12571263}
     
    12611267proc sortSegments(list segment);
    12621268{
    1263   //"START - integralbasis.lib - sortFactors - 1";
     1269  //"START - integralbasis.lib - sortSegments - 1";
    12641270  int i, j;
    12651271  int n = size(segment);
     
    12811287
    12821288
    1283 // We compute the local integral at f by exhaustive search
    1284 // See "Direct approach in the combinatorial paper
     1289// We compute the local integral basis at f by exhaustive search
     1290// See "Direct approach in the combinatorial paper.
    12851291proc ibSegment(poly f, list classes, int degExpand)
    12861292{
     
    12911297  intvec degPolySet;
    12921298  intvec vy = (0,1);
    1293   // We get all the possible polynomials, includign the full polys
     1299 
     1300  // We get all the possible polynomials, including the full polys
    12941301  list bF = buildFactors(classes);
    12951302 
     
    13001307  for(i = 1; i <= size(classes); i++)
    13011308  {
     1309    // We put everything in a list, with no repeated elements
    13021310    for(j = 1; j <= size(bF[1][i]); j++)
    13031311    {
     
    13071315      }
    13081316    }
     1317    // We compute the full polynomial up to the integrality exponent
    13091318    pGround = buildPolyGroundXRootClass(classes[i], degExpand);
    13101319    if(in_array(polySet, pGround) == 0)
     
    13301339    }
    13311340  }
    1332   "polySet = "; polySet;
    1333   "degPolySet = "; degPolySet;
    1334   "ordExpAtPoly = "; ordExpAtPoly;
    1335   ~;
     1341  //"polySet = "; polySet;
     1342  //"degPolySet = "; degPolySet;
     1343  //"ordExpAtPoly = "; ordExpAtPoly;
     1344  //~;
    13361345 
    13371346  // We compute the integral basis by exhaustive search
     
    13411350}
    13421351 
     1352// For each degree up to the degree of f, with compute the best
     1353// possible product of factors by checking exhaustively all possible
     1354// combinations such that the product has the correct degree.
    13431355proc ibExhaustive(list polySet, intvec degPolySet, list ordExpAtPoly, int degF)
    13441356{
     
    13551367    // The best element of degree d;
    13561368    oMax  = 0;
     1369   
     1370    // We generate the list of all possible combinations
    13571371    c = summandsFac(degPolySet, d);
     1372   
     1373    // We compute the valuation of each combination,
     1374    // and we keep the largest one.
    13581375    for(i = 1; i <= size(c); i++)
    13591376    {
     
    13751392    "---";
    13761393  }
    1377   "ib computation finished!";
    1378   ib;
     1394  //"ib computation finished!";
     1395  //ib;
    13791396  return(ib);
    13801397}
     
    14061423}
    14071424
    1408 
     1425// List of intvecs suchs that the sum of each coordinate times the degree
     1426// given in degPolySet equals degTotal
     1427// This is used to compute a product of factors such that the total
     1428// degree is equal to degTotal
    14091429proc summandsFac(intvec degPolySet, int degTotal)
    14101430{
     
    14351455}
    14361456 
    1437 
     1457//We implement the optimization approach from scratch
    14381458proc optiBase(list ibSeg, list segmentSlope)
    14391459{
     
    15521572  dbprint(dbg, "---- Degree of expansions: ", degExpand);
    15531573
     1574
     1575  // Optimization algorithm from scratch
    15541576  if(optimize == 1)
    15551577  {
     
    15751597    IOut[1] = var(1)^intExp;
    15761598
    1577     // We convery to ib shape
     1599    // We convert to ib shape
    15781600    for(i = 1; i <= size(ib); i++)
    15791601    {
Note: See TracChangeset for help on using the changeset viewer.