Changeset 85fd90 in git


Ignore:
Timestamp:
Sep 28, 2011, 5:48:27 PM (13 years ago)
Author:
Burcin Erocal <burcin@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d56ad872d739d42e59b1beb8ccc89be2a204530d
Parents:
32cc7e437ee85bf7d555756eb824eadce50d50c7
git-author:
Burcin Erocal <burcin@erocal.org>2011-09-28 17:48:27+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:41+01:00
Message:
Fix rChangeCurrRing and make the interpreter pass precision info to real/complex coeffs constructor.
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r32cc7e r85fd90  
    50255025  && ((strcmp(pn->name,"real")==0) || (strcmp(pn->name,"complex")==0)))
    50265026  {
     5027    LongComplexInfo param;
    50275028    BOOLEAN complex_flag=(strcmp(pn->name,"complex")==0);
    50285029    const int ch=0;
    50295030    if ((pn->next!=NULL) && (pn->next->Typ()==INT_CMD))
    50305031    {
    5031       WarnS("not implemented: size for real/complex");
    50325032      float_len=(int)(long)pn->next->Data();
    50335033      float_len2=float_len;
     
    50365036      {
    50375037        float_len2=(int)(long)pn->next->Data();
    5038         WarnS("not implemented: size for real/complex");
    50395038        pn=pn->next;
    50405039      }
    50415040    }
    5042     if ((pn->next==NULL) && complex_flag)
    5043     {
    5044       pn->next=(leftv)omAlloc0Bin(sleftv_bin);
    5045       pn->next->name=omStrDup("i");
    5046     }
    5047     else
    5048       WarnS("not implemented: name for i (complex)");
    5049     cf=nInitChar(complex_flag ? n_long_C: n_long_R,NULL);
     5041    // set the parameter name
     5042    if (complex_flag) {
     5043      if (pn->next == NULL)
     5044        param.par_name=(const char*)"i"; //default to i
     5045      else
     5046        param.par_name = (const char*)pn->next->name;
     5047    }
     5048
     5049    param.float_len = float_len;
     5050    param.float_len2 = float_len2;
     5051    cf=nInitChar(complex_flag ? n_long_C: n_long_R, (void*)&param);
    50505052
    50515053    assume( cf != NULL );
  • kernel/polys.cc

    r32cc7e r85fd90  
    1010ideal currQuotient = NULL;
    1111
     12/* -------------------------------------------------------- */
     13/*2
     14* change all global variables to fit the description of the new ring
     15*/
     16
     17void p_SetGlobals(const ring r, BOOLEAN complete)
     18{
     19// // //  if (r->ppNoether!=NULL) p_Delete(&r->ppNoether,r); // ???
     20
     21  if (complete)
     22  {
     23    test &= ~ TEST_RINGDEP_OPTS;
     24    test |= r->options;
     25  }
     26}
     27
    1228void rChangeCurrRing(ring r)
    1329{
    1430   currRing = r;
    1531   currQuotient = r->qideal;
    16    test &= ~ TEST_RINGDEP_OPTS;
    17    test |= r->options;
     32   //------------ global variables related to coefficients ------------
     33   nSetChar(r->cf);
     34   //------------ global variables related to polys -------------------
     35   p_SetGlobals(r);
    1836}
     37/*
     38
     39/// internally changes the gloabl ring and resets the relevant
     40/// global variables:
     41/// SHOULD BE DEPRECATED NOW...?
     42void rChangeCurrRing(ring r)
     43{
     44 // if (!rMinpolyIsNULL(currRing))
     45 // {
     46 //   omCheckAddr(currRing->cf->minpoly);
     47 // }
     48  //------------ set global ring vars --------------------------------
     49  //currRing = r;
     50  //currQuotient=NULL;
     51  if (r != NULL)
     52  {
     53    rTest(r);
     54    //------------ set global ring vars --------------------------------
     55    //currQuotient=r->qideal;
     56
     57    //------------ global variables related to coefficients ------------
     58    nSetChar(r->cf);
     59
     60    //------------ global variables related to polys -------------------
     61    p_SetGlobals(r);
     62    //------------ global variables related to factory -----------------
     63  }
     64}
     65*/
  • kernel/polys.h

    r32cc7e r85fd90  
    1313
    1414extern ring currRing;
    15 extern void rChangeCurrRing(ring r);
     15void rChangeCurrRing(ring r);
     16
     17void p_SetGlobals(const ring r, BOOLEAN complete = TRUE);
    1618
    1719#include <coeffs/numbers.h>
  • libpolys/polys/monomials/p_polys.cc

    r32cc7e r85fd90  
    29582958}
    29592959
    2960 /* -------------------------------------------------------- */
    2961 /*2
    2962 * change all global variables to fit the description of the new ring
    2963 */
    2964 
    2965 void p_SetGlobals(const ring r, BOOLEAN complete)
    2966 {
    2967 // // //  if (r->ppNoether!=NULL) p_Delete(&r->ppNoether,r); // ???
    2968 
    2969   if (complete)
    2970   {
    2971     test &= ~ TEST_RINGDEP_OPTS;
    2972     test |= r->options;
    2973   }
    2974 }
    29752960//
    29762961// resets the pFDeg and pLDeg: if pLDeg is not given, it is
  • libpolys/polys/monomials/p_polys.h

    r32cc7e r85fd90  
    18901890
    18911891/*-------------ring management:----------------------*/
    1892 void p_SetGlobals(const ring r, BOOLEAN complete = TRUE);
    18931892
    18941893// resets the pFDeg and pLDeg: if pLDeg is not given, it is
  • libpolys/polys/monomials/ring.cc

    r32cc7e r85fd90  
    102102//  return FALSE;
    103103//}
    104 
    105 /*
    106 
    107 /// internally changes the gloabl ring and resets the relevant
    108 /// global variables:
    109 /// SHOULD BE DEPRECATED NOW...?
    110 void rChangeCurrRing(ring r)
    111 {
    112  // if (!rMinpolyIsNULL(currRing))
    113  // {
    114  //   omCheckAddr(currRing->cf->minpoly);
    115  // }
    116   //------------ set global ring vars --------------------------------
    117   //currRing = r;
    118   //currQuotient=NULL;
    119   if (r != NULL)
    120   {
    121     rTest(r);
    122     //------------ set global ring vars --------------------------------
    123     //currQuotient=r->qideal;
    124 
    125     //------------ global variables related to coefficients ------------
    126     nSetChar(r->cf);
    127 
    128     //------------ global variables related to polys -------------------
    129     p_SetGlobals(r);
    130     //------------ global variables related to factory -----------------
    131   }
    132 }
    133 */
    134104
    135105ring rDefault(const coeffs cf, int N, char **n,int ord_size, int *ord, int *block0, int *block1)
Note: See TracChangeset for help on using the changeset viewer.