Changeset af598e in git for libpolys/polys/simpleideals.cc


Ignore:
Timestamp:
May 4, 2011, 7:50:23 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
107b6a63f83a561264dff51b21ba9a08c2b381f8
Parents:
02c42db0b19db524ec869930bffc30346b16abed
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-05-04 19:50:23+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:35+01:00
Message:
ADD: factory-related wrappers (clapsing.cc/.h)
FIX: ring-dependent fixes for some factory-dependent code
TODO: finish fixing clapsing.cc/.h
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/simpleideals.cc

    r02c42d raf598e  
    1111#include "config.h"
    1212#include <misc/auxiliary.h>
     13
     14#include <omalloc/omalloc.h>
     15
    1316#include <misc/options.h>
    14 #include <omalloc/omalloc.h>
    15 #include <polys/monomials/p_polys.h>
    16 #include <polys/weight.h>
    17 #include <polys/matpol.h>
    1817#include <misc/intvec.h>
    19 #include <polys/simpleideals.h>
     18
     19#include <coeffs/longrat.h>
     20 
     21#include "monomials/p_polys.h"
     22#include "weight.h"
     23#include "matpol.h"
     24#include "simpleideals.h"
    2025#include "sbuckets.h"
    2126
     
    16641669
    16651670#ifdef HAVE_FACTORY
     1671#if 0
    16661672poly id_GCD(poly f, poly g, const ring r)
    16671673{
     
    16701676  ideal I=idInit(2,1); I->m[0]=f; I->m[1]=g;
    16711677  intvec *w = NULL;
     1678
    16721679  ideal S=idSyzygies(I,testHomog,&w);
     1680
    16731681  if (w!=NULL) delete w;
    16741682  poly gg=pTakeOutComp(&(S->m[0]),2);
     
    16801688}
    16811689#endif
     1690#endif
    16821691
    16831692/*2
     
    16891698*/
    16901699#ifdef HAVE_FACTORY
    1691 ideal idChineseRemainder(ideal *xx, number *q, int rl, const ring r)
     1700ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring R)
    16921701{
    16931702  int cnt=IDELEMS(xx[0])*xx[0]->nrows;
     
    17081717        h=xx[j]->m[i];
    17091718        if ((h!=NULL)
    1710         &&((r==NULL)||(pLmCmp(r,h)==-1)))
     1719        &&((r==NULL)||(p_LmCmp(r,h,R)==-1)))
    17111720          r=h;
    17121721      }
    17131722      if (r==NULL) break;
    1714       h=pHead(r);
     1723      h=p_Head(r, R);
    17151724      for(j=rl-1;j>=0;j--)
    17161725      {
    17171726        hh=xx[j]->m[i];
    1718         if ((hh!=NULL) && (pLmCmp(r,hh)==0))
     1727        if ((hh!=NULL) && (p_LmCmp(r,hh, R)==0))
    17191728        {
    1720           x[j]=pGetCoeff(hh);
    1721           hh=pLmFreeAndNext(hh);
     1729          x[j]=p_GetCoeff(hh, R);
     1730          hh=p_LmFreeAndNext(hh, R);
    17221731          xx[j]->m[i]=hh;
    17231732        }
    17241733        else
    1725           x[j]=nlInit(0, r);
    1726       }
    1727       number n=nlChineseRemainder(x,q,rl);
     1734          x[j]=nlInit(0, R->cf); // is R->cf really n_Q???
     1735      }
     1736       
     1737      number n=nlChineseRemainder(x,q,rl); // kernel/clapconv.cc
     1738
    17281739      for(j=rl-1;j>=0;j--)
    17291740      {
    17301741        x[j]=NULL; // nlInit(0...) takes no memory
    17311742      }
    1732       if (nlIsZero(n)) pDelete(&h);
     1743      if (nlIsZero(n, R->cf)) p_Delete(&h, R);
    17331744      else
    17341745      {
    1735         pSetCoeff(h,n);
     1746        p_SetCoeff(h,n, R);
    17361747        //Print("new mon:");pWrite(h);
    1737         res_p=pAdd(res_p,h);
     1748        res_p=p_Add_q(res_p, h, R);
    17381749      }
    17391750    }
     
    17411752  }
    17421753  omFree(x);
    1743   for(i=rl-1;i>=0;i--) idDelete(&(xx[i]));
     1754  for(i=rl-1;i>=0;i--) id_Delete(&(xx[i]), R);
    17441755  omFree(xx);
    17451756  return result;
Note: See TracChangeset for help on using the changeset viewer.