Changeset 3dbe0bf in git for libpolys


Ignore:
Timestamp:
Apr 26, 2011, 10:24:03 AM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b9f50b373314e74e83c7c060a651dd2913e1f033')
Children:
6c084af83f830337d6cc5d88e05a66c74d9350f8
Parents:
52f218be00b6571557f2177e33ab01e695c1cd26
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-04-26 10:24:03+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:28+01:00
Message:
rSum: test for equal coeffs
mod_raw: simplified
Location:
libpolys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    r52f218 r3dbe0bf  
    6060   BOOLEAN has_simple_Alloc;
    6161   /// TRUE, if std should make polynomials monic (if nInvers is cheap)
    62    /// if false, then a gcd routine is required for a content computation
     62   /// if false, then a gcd routine is used for a content computation
    6363   BOOLEAN has_simple_Inverse;
    6464
  • libpolys/polys/monomials/ring.cc

    r52f218 r3dbe0bf  
    808808  /* check coeff. field =====================================================*/
    809809
    810   TODO(Hans, switch to the use of ->cf);
    811   assume( tmpR.cf !=NULL ); // ???!
    812  
    813   if ((rFieldType(r1)==rFieldType(r2))
    814   && (rInternalChar(r1)==rInternalChar(r2)))
    815   {
    816     if (rField_is_Q(r1)||rField_is_Zp(r1)||rField_is_GF(r1)) /*Q, Z/p, GF(p,n)*/
    817     {
    818       if (r1->cf->parameter!=NULL)
    819       {
    820         if (!vartest || (strcmp(r1->cf->parameter[0],r2->cf->parameter[0])==0)) /* 1 par */
    821         {
    822           //tmpR.parameter=(char **)omAllocBin(char *);
    823           //tmpR.parameter[0]=omStrDup(r1->cf->parameter[0]);
    824           //tmpR.P=1;
    825         }
    826         else
    827         {
    828           WerrorS("GF(p,n)+GF(p,n)");
    829           return -1;
    830         }
    831       }
    832       tmpR.cf->ch=r1->cf->ch;
    833     }
    834     else if (rField_is_Extension(r1)) /* Q(a),Z/p(a) */
    835     {
    836       if (r1->cf->minpoly!=NULL)
    837       {
    838         if (r2->cf->minpoly!=NULL)
    839         {
    840           // HANNES: TODO: delete nSetChar
    841          
    842           // TODO: eliminate rChangeCurrRing
    843 //        rChangeCurrRing(r1);
    844            
    845           if ((!vartest || (strcmp(r1->cf->parameter[0],r2->cf->parameter[0])==0)) /* 1 par */
    846               && n_Equal(r1->cf->minpoly,r2->cf->minpoly, r1->cf))
    847           {
    848             //tmpR.parameter=(char **)omAllocBin(char *);
    849             //tmpR.parameter[0]=omStrDup(r1->cf->parameter[0]);
    850             //tmpR.minpoly=n_Copy(r1->cf->minpoly, r1->cf);
    851             //tmpR.P=1;
    852             // HANNES: TODO: delete nSetChar
    853           }
    854           else
    855           {
    856             // HANNES: TODO: delete nSetChar
    857             WerrorS("different minpolys");
    858             return -1;
    859           }
    860         }
    861         else
    862         {
    863           if ((!vartest || (strcmp(r1->cf->parameter[0],r2->cf->parameter[0])==0)) /* 1 par */
    864               && (rPar(r2)==1))
    865           {
    866             //tmpR.parameter=(char **)omAllocBin(char *);
    867             //tmpR.parameter[0]=omStrDup(r1->cf->parameter[0]);
    868             //tmpR.P=1;
    869             //tmpR.minpoly=n_Copy(r1->cf->minpoly, r1->cf);
    870           }
    871           else
    872           {
    873             WerrorS("different parameters and minpoly!=0");
    874             return -1;
    875           }
    876         }
    877       }
    878       else /* r1->cf->minpoly==NULL */
    879       {
    880         if (r2->cf->minpoly!=NULL)
    881         {
    882           if ((!vartest || (strcmp(r1->cf->parameter[0],r2->cf->parameter[0])==0)) /* 1 par */
    883               && (rPar(r1)==1))
    884           {
    885             //tmpR.parameter=(char **)omAllocBin(char *);
    886             //tmpR.parameter[0]=omStrDup(r1->cf->parameter[0]);
    887             //tmpR.P=1;
    888             //tmpR.minpoly=n_Copy(r2->cf->minpoly, r2->cf);
    889           }
    890           else
    891           {
    892             WerrorS("different parameters and minpoly!=0");
    893             return -1;
    894           }
    895         }
    896         else
    897         {
    898           int len=rPar(r1)+rPar(r2);
    899           tmpR.cf->parameter=(char **)omAlloc0(len*sizeof(char *));
    900           int i;
    901           for (i=0;i<rPar(r1);i++)
    902           {
    903             tmpR.cf->parameter[i]=omStrDup(r1->cf->parameter[i]);
    904           }
    905           int j,l;
    906           for(j=0;j<rPar(r2);j++)
    907           {
    908             if (vartest)
    909             {
    910               for(l=0;l<i;l++)
    911               {
    912                 if(strcmp(tmpR.cf->parameter[l],r2->cf->parameter[j])==0)
    913                   break;
    914               }
    915             }
    916             else
    917               l=i;
    918             if (l==i)
    919             {
    920               tmpR.cf->parameter[i]=omStrDup(r2->cf->parameter[j]);
    921               i++;
    922             }
    923           }
    924           if (i!=len)
    925           {
    926             tmpR.cf->parameter=(char**)omReallocSize(tmpR.cf->parameter,
    927                                                  len*sizeof(char *),
    928                                                  i*sizeof(char *));
    929           }
    930           tmpR.cf->P=i;
    931         }
    932       }
    933     }
    934     #ifdef HAVE_RINGS
    935     else if (rField_is_Ring(r1)||rField_is_Ring(r2))
    936     {
    937       if (r1->ringtype != r2->ringtype)
    938       {
    939         Werror("rSumInternal not yet implemented for %s",
    940                "different coefficient rings");
    941         return -1;
    942       }
    943       else
    944       {
    945         tmpR.ch        = rInternalChar(r1);
    946         tmpR.ringtype  = r1->ringtype;
    947         if (r1->ringflaga != NULL)
    948         {
    949           omBin tmpBin = omGetSpecBin(sizeof(mpz_t));
    950           tmpR.ringflaga = (int_number)omAllocBin(tmpBin);
    951           mpz_init_set(tmpR.ringflaga, (int_number)r1->ringflaga);
    952         }
    953         tmpR.ringflagb = r1->ringflagb;
    954         tmpR.nr2mModul = r1->nr2mModul;
    955         if (r1->nrnModul != NULL)
    956         {
    957           omBin tmpBin = omGetSpecBin(sizeof(mpz_t));
    958           tmpR.nrnModul = (int_number)omAllocBin(tmpBin);
    959           mpz_init_set(tmpR.nrnModul, (int_number)r1->nrnModul);
    960         }
    961       }
    962     }
    963     #endif
    964   }
    965   else /* r1->cf->ch!=r2->cf->ch */
     810  if (r1->cf==r2->cf)
     811  {
     812    tmpR.cf=r1->cf;
     813    r1->cf->ref++;
     814  }
     815  else /* different type */
    966816  {
    967817    if (r1->cf->ch<-1) /* Z/p(a) */
  • libpolys/polys/templates/mod_raw.cc

    r52f218 r3dbe0bf  
    187187#define HAVE_ELF_SYSTEM
    188188#endif
    189    
    190    
    191 #if defined(ix86Mac_darwin)
    192 #define HAVE_ELF_SYSTEM
    193 #endif
    194 
    195 #if defined(x86_64Mac_darwin)
    196 #define HAVE_ELF_SYSTEM
    197 #endif
    198189
    199190#if defined(SunOS_5)
     
    201192#endif
    202193
    203 #if defined(__ELF__)
    204 #define HAVE_ELF_SYSTEM
    205 #endif
    206 
    207    
    208194#if defined(HAVE_ELF_SYSTEM)
    209195#include <dlfcn.h>
     196#define DL_IMPLEMENTED
    210197
    211198static void* kernel_handle = NULL;
     
    220207    Werror("module %s already loaded",filename);
    221208  return NULL;
    222 // alternative 
     209// alternative
    223210//    return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL));
    224211}
     
    250237 *****************************************************************************/
    251238#if defined(HPUX_9) || defined(HPUX_10)
     239#define DL_IMPLEMENTED
    252240#include <dl.h>
    253241
     
    293281
    294282/*****************************************************************************
    295  * SECTION AIX-4                                                             *
    296  *****************************************************************************/
    297 #ifdef AIX_4
    298 #define DL_NOT_IMPLEMENTED
    299 #endif
    300 
    301 /*****************************************************************************
    302  * SECTION Sun3OS-4                                                          *
    303  *****************************************************************************/
    304 #ifdef Sun3OS_4
    305 #define DL_NOT_IMPLEMENTED
    306 #endif
    307 
    308 /*****************************************************************************
    309  * SECTION SunOS-4                                                         *
    310  *****************************************************************************/
    311 #if defined(SunOS_4)
    312 #define DL_NOT_IMPLEMENTED
    313 #endif
    314 
    315 /*****************************************************************************
    316283 * SECTION generic: dynamic madules not available
    317284 *****************************************************************************/
    318 #ifdef DL_NOT_IMPLEMEMENTED
     285#ifndef DL_IMPLEMENTED
    319286
    320287void *dynl_open(char *filename)
Note: See TracChangeset for help on using the changeset viewer.