Changeset e78f35 in git for Singular/MinorInterface.cc


Ignore:
Timestamp:
Feb 19, 2013, 8:32:57 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
2a3743b6431021631dff0bb9d7b7888a205302b1bc03ea6301177ce6360abcfc3922ff0edc5f9a73
Parents:
26e817f3b4db82c0b0a5376b16c2e9648ecf55e3d81e39d347055cad093a2ae53302e036ae2a449c
Message:
Merge pull request #280 from malex984/adapting_commits_from_master_minors

Adapting commits from master minors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/MinorInterface.cc

    r26e817f re78f35  
    190190  /* before we return the result, let's omit zero generators
    191191     in iii which come after the computed minors */
    192   ideal jjj;
    193   if (collectedMinors == 0) jjj = idInit(1);
    194   else                      jjj = idCopyFirstK(iii, collectedMinors);
    195   idDelete(&iii);
     192  idKeepFirstK(iii, collectedMinors);
    196193  delete[] myColumnIndices;
    197194  delete[] myRowIndices;
    198   return jjj;
     195  return(iii);
    199196}
    200197
     
    542539    else
    543540    { /* k == 0, i.e., all minors are requested */
    544       int minorCount = 1;
    545       for (int i = rowCount - minorSize + 1; i <= rowCount; i++)
    546         minorCount = minorCount * i;
    547       for (int i = 2; i <= minorSize; i++) minorCount = minorCount / i;
    548       for (int i = columnCount - minorSize + 1; i <= columnCount; i++)
    549         minorCount = minorCount * i;
    550       for (int i = 2; i <= minorSize; i++) minorCount = minorCount / i;
    551       /* now: minorCount =   (rowCount over minorSize)
    552                            * (columnCount over minorSize) */
     541      int minorCount = binom(rowCount, minorSize);
     542      minorCount *= binom(columnCount, minorSize);
    553543      if      ((minorSize >= 3) && (vars <= 4)
    554544               && (minorCount >= 100))                           c = true;
Note: See TracChangeset for help on using the changeset viewer.