Changeset 60d1183 in git


Ignore:
Timestamp:
Feb 1, 2008, 2:45:37 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
Children:
935bb1bf1fc7cf6828861ed659dcc18157c72dd3
Parents:
31e857fefc0db942580fac2470cb89c397ef32a8
Message:
*hannes: idSect re-organized


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

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    r31e857 r60d1183  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.45 2007-06-14 14:56:40 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.46 2008-02-01 13:45:37 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    10291029ideal idSect (ideal h1,ideal h2)
    10301030{
    1031   ideal first=h2,second=h1,temp,temp1,result;
    1032   int i,j,k,flength,slength,length,rank=si_min(h1->rank,h2->rank);
     1031  int i,j,k,length;
     1032  int flength = idRankFreeModule(h1);
     1033  int slength = idRankFreeModule(h2);
     1034  int rank=si_min(flength,slength);
     1035  if ((idIs0(h1)) || (idIs0(h2)))  return idInit(1,rank);
     1036
     1037  ideal first,second,temp,temp1,result;
    10331038  intvec *w;
    10341039  poly p,q;
    10351040
    1036   if ((idIs0(h1)) && (idIs0(h2)))  return idInit(1,rank);
    10371041  if (IDELEMS(h1)<IDELEMS(h2))
    10381042  {
     
    10401044    second = h2;
    10411045  }
    1042   flength = idRankFreeModule(first);
    1043   slength = idRankFreeModule(second);
     1046  else
     1047  {
     1048    first = h2;
     1049    second = h1;
     1050    int t=flength; flength=slength; slength=t;
     1051  }
    10441052  length  = si_max(flength,slength);
    10451053  if (length==0)
     
    10481056  }
    10491057  j = IDELEMS(first);
    1050   temp = idInit(j /*IDELEMS(first)*/,length+j);
    10511058
    10521059  ring orig_ring=currRing;
     
    10551062
    10561063  while ((j>0) && (first->m[j-1]==NULL)) j--;
     1064  temp = idInit(j /*IDELEMS(first)*/+IDELEMS(second),length+j);
    10571065  k = 0;
    10581066  for (i=0;i<j;i++)
     
    10741082    }
    10751083  }
    1076   pEnlargeSet(&(temp->m),IDELEMS(temp),j+IDELEMS(second)-IDELEMS(temp));
    1077   IDELEMS(temp) = j+IDELEMS(second);
    10781084  for (i=0;i<IDELEMS(second);i++)
    10791085  {
     
    11031109    {
    11041110      if(syz_ring==orig_ring)
    1105         p = pCopy(temp1->m[i]);
     1111      {
     1112        p = temp1->m[i];
     1113      }
    11061114      else
    1107         p = prCopyR(temp1->m[i], syz_ring);
     1115      {
     1116        p = prMoveR(temp1->m[i], syz_ring);
     1117      }
     1118      temp1->m[i]=NULL;
    11081119      while (p!=NULL)
    11091120      {
Note: See TracChangeset for help on using the changeset viewer.