Changeset f16c61c in git for Singular


Ignore:
Timestamp:
Sep 26, 2011, 8:39:08 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
37e36e946ee174d951bb2e0fbae1283480ace5f6
Parents:
69ad7eed9ae02d904a01c114ac5b581e8cd9483e
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-09-26 20:39:08+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:35+01:00
Message:
better test for n_GF while contructing a ring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r69ad7e rf16c61c  
    16591659  {
    16601660    const ring RR = R->cf->extRing;
    1661    
     1661
    16621662    L->m[3].data=(void *) idCopy(RR->minideal, RR);
    16631663//    I->m[0] = pNSet(R->minpoly);
     
    20762076  )
    20772077    return NULL;
     2078  int is_gf_char=0;
    20782079  // 0: char/ cf - ring
    20792080  // 1: list (var)
     
    20832084  // 4: C
    20842085  // 5: D
    2085  
    2086   ring R = (ring) omAlloc0Bin(sip_sring_bin); // why 
    2087    
    2088    
    2089   assume( R->cf == NULL );
    2090  
     2086
     2087  ring R = (ring) omAlloc0Bin(sip_sring_bin); // why
     2088
     2089
     2090  //assume( R->cf == NULL );
     2091
    20912092  // ------------------------------------------------------------------
    20922093  // 0: char:
     
    21052106        Warn("%d is invalid characteristic of ground field. %d is used.", ch, l);
    21062107        ch = l;
    2107       }     
    2108       R->cf = nInitChar(n_Zp, (void*)ch);       
     2108      }
     2109      R->cf = nInitChar(n_Zp, (void*)ch);
    21092110    }
    21102111  }
     
    21122113  {
    21132114    lists LL=(lists)L->m[0].Data();
    2114    
     2115
    21152116#ifdef HAVE_RINGS
    21162117    if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string?
     
    21232124      rComposeC(LL,R); // R, long_R, long_C
    21242125    else
    2125     {     
     2126    {
    21262127      if (LL->m[0].Typ()==INT_CMD)
    2127       {       
     2128      {
    21282129        int ch = (int)(long)LL->m[0].Data();
    2129 
    2130         if(( ch != 0 ) && (ch!=IsPrime(ch))) // TODO: GF-Test ch!
     2130        while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
     2131        if (fftable[is_gf_char]==0) is_gf_char=-1;
     2132
     2133        if(is_gf_char!= -1)
    21312134        {
    21322135          GFInfo param;
    2133        
    2134           param.GFChar = ch; 
     2136
     2137          param.GFChar = ch;
    21352138          param.GFDegree = 1;
    21362139          param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data());
     
    21442147      {
    21452148        ring extRing = rCompose((lists)L->m[0].Data());
    2146        
     2149
    21472150        if (extRing==NULL)
    21482151        {
     
    21542157        {
    21552158          AlgExtInfo extParam;
    2156          
     2159
    21572160          extParam.i = extRing->qideal;
    21582161          extParam.r = extRing;
     
    21602163          extRing->qideal = NULL; // ???
    21612164
    2162           R->cf = nInitChar(n_algExt, (void*)&extParam);
    2163         } else // Transcendental extension
     2165          R->cf = nInitChar(n_algExt, (void*)&extParam);
     2166        }
     2167        else // Transcendental extension
    21642168        {
    21652169          TransExtInfo extParam;
     
    21682172          R->cf = nInitChar(n_transExt, &extParam);
    21692173        }
    2170        
    2171       }     
     2174      }
    21722175    }
    21732176  }
     
    23862389  rComplete(R);
    23872390
    2388 #ifdef HAVE_RINGS 
     2391#ifdef HAVE_RINGS
    23892392  // This was a BUG IN SINGULAR: There is no HABE_RINGS!!!
    23902393
     
    24372440            par_perm_size=rPar(orig_ring);
    24382441            BITSET save_test=test;
    2439            
     2442
    24402443//            if ((orig_ring->minpoly != NULL) || (orig_ring->minideal != NULL))
    24412444//              naSetChar(rInternalChar(orig_ring),orig_ring);
    24422445//            else ntSetChar(rInternalChar(orig_ring),orig_ring);
    2443            
     2446
    24442447            nSetChar(currRing->cf);
    24452448            test=save_test;
     
    28222825  Werror("Sorry: not yet re-factored: see libpolys/polys/clapsing.cc");
    28232826  return FALSE;
    2824 #else   
     2827#else
    28252828  res->data=singclap_irrCharSeries((ideal)u->Data(), currRing);
    28262829  return (res->data==NULL);
     
    49474950  // get ch of ground field
    49484951  int numberOfAllocatedBlocks;
    4949  
     4952
    49504953  // allocated ring
    49514954  R = (ring) omAlloc0Bin(sip_sring_bin);
     
    49554958  assume( pn != NULL );
    49564959  const int P = pn->listLength();
    4957  
     4960
    49584961  if (pn->Typ()==INT_CMD)
    49594962  {
    49604963    int ch = (int)(long)pn->Data();
    4961    
     4964
    49624965    /* parameter? -------------------------------------------------------*/
    49634966    pn = pn->next;
    4964    
     4967
    49654968    if (pn == NULL) // no params!?
    49664969    {
     
    49834986      {
    49844987        GFInfo param;
    4985          
    4986         param.GFChar = ch; 
    4987         param.GFDegree = 1;     
     4988
     4989        param.GFChar = ch;
     4990        param.GFDegree = 1;
    49884991        param.GFPar_name = pn->name;
    4989        
    4990         cf = nInitChar(n_GF, &param);       
     4992
     4993        cf = nInitChar(n_GF, &param);
    49914994      }
    49924995      else // (0/p, a, b, ..., z)
     
    49995002//           goto rInitError;
    50005003//         }
    5001        
     5004
    50025005        char ** names = (char**)omAlloc0(pars * sizeof(char_ptr));
    50035006
     
    50095012
    50105013        TransExtInfo extParam;
    5011        
     5014
    50125015        extParam.r = rDefault( ch, pars, names); // Q/Zp [ p_1, ... p_pars ]
    5013        
     5016
    50145017        cf = nInitChar(n_transExt, &extParam);
    50155018      }
    50165019    }
    5017    
     5020
    50185021//    if (cf==NULL) goto rInitError;
    50195022    assume( cf != NULL );
     
    50705073    else
    50715074      cf=nInitChar(n_Z,NULL);
    5072    
     5075
    50735076    if ((mpz_cmp_ui(modBase, 1) == 0) && (mpz_cmp_ui(modBase, 0) < 0))
    50745077    {
     
    51215124    extParam.r = (ring)pn->Data();
    51225125    extParam.i = (extParam.r->qideal);
    5123    
     5126
    51245127    cf = nInitChar(n_algExt, &extParam);   // Q[a]/<minideal>
    51255128  }
     
    51355138      p = p->next;
    51365139    }
    5137 #endif   
     5140#endif
    51385141    goto rInitError;
    51395142  }
     
    51645167
    51655168  assume( R != NULL );
    5166  
     5169
    51675170  R->cf = cf;
    5168  
     5171
    51695172#ifdef HAVE_RINGS
    51705173  // the following should have beed set already into cf, right?!
Note: See TracChangeset for help on using the changeset viewer.