Changeset 9234fb in git


Ignore:
Timestamp:
Jan 9, 2013, 12:39:10 PM (10 years ago)
Author:
Andreas Steenpass <steenpass@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
c81bf79ced86ab51e160b984ca42699ac44228a0
Parents:
14a45578ff0a670cc8f091fed8b195c50ef51126
git-author:
Andreas Steenpass <steenpass@mathematik.uni-kl.de>2013-01-09 12:39:10+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-02-19 20:27:28+01:00
Message:
add: idKeepFirstK() in ideals.cc

Conflicts:
	Singular/MinorInterface.cc
	kernel/ideals.cc
	kernel/ideals.h
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/MinorInterface.cc

    r14a455 r9234fb  
    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
  • kernel/ideals.cc

    r14a455 r9234fb  
    25592559*/
    25602560
    2561 
    2562 
     2561/// keeps the first k (>= 1) entries of the given ideal
     2562/// (Note that the kept polynomials may be zero.)
     2563void idKeepFirstK(ideal id, const int k)
     2564{
     2565     for (int i = IDELEMS(id)-1; i >= k; i--)
     2566     {
     2567        if (id->m[i] != NULL) pDelete(&id->m[i]);
     2568     }
     2569     pEnlargeSet(&(id->m), IDELEMS(id), k-IDELEMS(id));
     2570     IDELEMS(id) = k;
     2571}
     2572
  • kernel/ideals.h

    r14a455 r9234fb  
    2424}
    2525
     26void idKeepFirstK(ideal ide, const int k);
     27
    2628/// delete an ideal
    2729inline void idDelete (ideal* h, ring r = currRing)
Note: See TracChangeset for help on using the changeset viewer.