Changeset ee03c0 in git for Singular/LIB/ncfactor.lib


Ignore:
Timestamp:
Sep 5, 2013, 5:39:03 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
e9aefc41300f0c74802c31fda85dcd345045a835
Parents:
d91c9d5cb9c28113b83237d7ba450d43b7f75f7d
git-author:
Martin Lee <martinlee84@web.de>2013-09-05 17:39:03+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-09-06 11:28:13+02:00
Message:
fixed version of ncfactor.lib courtesy of aheinle@uwaterloo.ca
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ncfactor.lib

    rd91c9d ree03c0  
    11701170    return(result);
    11711171  }
     1172  dbprint(p,dbprintWhitespace + "We have the following intermediate list of inhomogeneous
     1173factorizations:");
     1174  dbprint(p,result);
    11721175  dbprint(p,dbprintWhitespace +" recursively check factors for irreducibility");
    11731176  list recursivetemp;
     
    12171220                             checkForHomogInhomogInterchangability(result[i],2,size(result[i]));
    12181221  }//applying the interchanges to result
     1222  dbprint(p,dbprintWhitespace + "With interchanges, the result is:");
     1223  dbprint(p,resultWithInterchanges);
    12191224  //now, refine the possible redundant list
    12201225  return( delete_dublicates_noteval(resultWithInterchanges) );
     
    12551260  int p = printlevel-voice+2;
    12561261  string dbprintWhitespace = "";
    1257   int i; int j;
     1262  int i; int j; int k;
    12581263  for (i = 1; i<=voice;i++)
    12591264  {dbprintWhitespace = dbprintWhitespace + " ";}
    1260   if (size(factors) <= 2 || posLeft == posRight - 1)
     1265  if (size(factors) <= 2 || posLeft >= posRight - 1)
    12611266  {//easiest case: There is nothing to swap
    12621267    return (list(factors));
     
    12841289        {//creating a new entry for the resulting list, replacing the swap in factors
    12851290          if (j==i+1)
    1286           {tempSwapsTempEntry = insert(tempSwapsTempEntry, attemptToSwap[1][2]);}
     1291          {
     1292            for (k = size(attemptToSwap[1]); k >=1 ; k--)
     1293            {
     1294              tempSwapsTempEntry = insert(tempSwapsTempEntry, attemptToSwap[1][k]);
     1295            }
     1296            j--; //Because we changed entry i+1 and i
     1297          }
    12871298          else
    12881299          {
    1289             if (j == i)
    1290             {tempSwapsTempEntry = insert(tempSwapsTempEntry, attemptToSwap[1][1]);}
    1291             else
    1292             {tempSwapsTempEntry = insert(tempSwapsTempEntry,factors[j]);}
     1300            tempSwapsTempEntry = insert(tempSwapsTempEntry,factors[j]);
    12931301          }
    12941302        }//creating a new entry for the resulting list, replacing the swap in factors
     
    13101318          {//creating a new entry for the resulting list, replacing the swap in factors
    13111319            if (j==i+1)
    1312             {tempSwapsTempEntry = insert(tempSwapsTempEntry, attemptToSwap[1][2]);}
     1320            {
     1321              for (k = size(attemptToSwap[1]); k >=1 ; k--)
     1322              {
     1323                tempSwapsTempEntry = insert(tempSwapsTempEntry, attemptToSwap[1][k]);
     1324              }
     1325              j--; //Because we changed entry i+1 and i
     1326            }
    13131327            else
    13141328            {
    1315               if (j == i)
    1316               {tempSwapsTempEntry = insert(tempSwapsTempEntry, attemptToSwap[1][1]);}
    1317               else
    1318               {tempSwapsTempEntry = insert(tempSwapsTempEntry,factors[j]);}
     1329              tempSwapsTempEntry = insert(tempSwapsTempEntry,factors[j]);
    13191330            }
    13201331          }//creating a new entry for the resulting list, replacing the swap in factors
     
    13241335    }
    13251336  }//checking within the window posLeft <--> posRight, if there are interchanges possible
    1326 
    13271337  //Now we will recursively call the function for all swapped entries.
    13281338  dbprint(p,dbprintWhitespace+ "Our list of different factorizations is now:");
     
    14341444                           posInhomogPoly-1);
    14351445      }//Inserting factorizations
     1446      dbprint(p,dbprintWhitespace + "Added a factorization to result, namely:");
     1447      dbprint(p, result[1]);
    14361448    }
    14371449  }//going through all by now calculated factorizations
Note: See TracChangeset for help on using the changeset viewer.