Changeset e79e26 in git


Ignore:
Timestamp:
Jan 23, 2014, 1:41:47 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
616d68556ae75bb7c49364150bb827162c506899
Parents:
190da3f8a1812ae3bf31c5c7fe7a441c0452abea
Message:
add: chinese remainder for alg./trans. extensions
Location:
libpolys/polys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/algext.cc

    r190da3 re79e26  
    13791379}
    13801380
     1381number  naChineseRemainder(number *x, number *q,int rl, BOOLEAN sym,const coeffs cf)
     1382{
     1383  poly *P=(poly*)omAlloc(rl*sizeof(poly*));
     1384  number *X=(number *)omAlloc(rl*sizeof(number));
     1385  int i;
     1386  for(i=0;i<rl;i++) P[i]=p_Copy((poly)(x[i]),cf->extRing);
     1387  poly result=p_ChineseRemainder(P,X,q,rl,cf->extRing);
     1388  omFreeSize(X,rl*sizeof(number));
     1389  omFreeSize(P,rl*sizeof(poly*));
     1390  return ((number)result);
     1391}
     1392
     1393
    13811394BOOLEAN naInitChar(coeffs cf, void * infoStruct)
    13821395{
     
    14191432  cf->cfInit         = naInit;
    14201433  cf->cfInit_bigint  = naInit_bigint;
     1434  // cf->cfFarey
     1435  cf->cfChineseRemainder= naChineseRemainder;
    14211436  cf->cfInt          = naInt;
    14221437  cf->cfNeg          = naNeg;
  • libpolys/polys/ext_fields/transext.cc

    r190da3 re79e26  
    23632363}
    23642364
     2365number  ntChineseRemainder(number *x, number *q,int rl, BOOLEAN sym,const coeffs cf)
     2366{
     2367  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
     2368  int i;
     2369
     2370  poly *P=(poly*)omAlloc(rl*sizeof(poly*));
     2371  number *X=(number *)omAlloc(rl*sizeof(number));
     2372
     2373  for(i=0;i<rl;i++) P[i]=p_Copy(NUM((fraction)(x[i])),cf->extRing);
     2374  NUM(result)=p_ChineseRemainder(P,X,q,rl,cf->extRing);
     2375
     2376  for(i=0;i<rl;i++)
     2377  {
     2378    P[i]=p_Copy(DEN((fraction)(x[i])),cf->extRing);
     2379    if (P[i]==NULL) P[i]=p_One(cf->extRing);
     2380  }
     2381  DEN(result)=p_ChineseRemainder(P,X,q,rl,cf->extRing);
     2382
     2383  omFreeSize(X,rl*sizeof(number));
     2384  omFreeSize(P,rl*sizeof(poly*));
     2385  return ((number)result);
     2386}
     2387
    23652388BOOLEAN ntInitChar(coeffs cf, void * infoStruct)
    23662389{
     
    23982421  cf->cfInit         = ntInit;
    23992422  cf->cfInit_bigint  = ntInit_bigint;
     2423  //cf->cfFarey
     2424  cf->cfChineseRemainder = ntChineseRemainder;
    24002425  cf->cfInt          = ntInt;
    24012426  cf->cfNeg          = ntNeg;
  • libpolys/polys/monomials/p_polys.h

    r190da3 re79e26  
    234234{
    235235  p_LmCheckPolyRing2(p, r);
    236   pAssume2(rRing_has_Comp(r));
    237236  if (r->pCompIndex>=0) __p_GetComp(p,r) = c;
    238237  return c;
Note: See TracChangeset for help on using the changeset viewer.