Changeset 6ccd426 in git


Ignore:
Timestamp:
May 14, 2010, 3:10:31 PM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
830743981da9efd7be7056e1a0b5e320ea114eee
Parents:
7019c8f07f02f8eb0e06dd6cc2a707f095f60dd7
Message:
restructuring algebraic extensions and rational function fields

git-svn-id: file:///usr/local/Singular/svn/trunk@12783 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 added
1 deleted
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/AlgebraicExt.cc

    r7019c8 r6ccd426  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id$ */
     4/* $Id: AlgebraicExt.cc 12469 2010-05-14 10:39:49Z frank $ */
    55/*
    6 * ABSTRACT:   algebraic numbers
     6* ABSTRACT: elements of an algebraic extension field
     7*
     8* This field has the form K(a), where K is itself a field,
     9* and a is algebraic over K. The elements in K(a) can be
     10* treated as a specific type of number, see numbers.h.
     11* This implementation declares a global variable 'nacRing'
     12* which is a valid SINGULAR ring representing K[a]. Like-
     13* wise, the minimal polynomial of a over K is stored in
     14* the global variable 'naMinimalPoly'.
    715*/
    816
     
    1927#include "ideals.h"
    2028#include "ring.h"
     29
    2130#ifdef HAVE_FACTORY
    2231#include "factory.h"
     
    2433#include "clapconv.h"
    2534#endif
    26 #include "longalg.h"
     35/* HAVE_FACTORY */
     36
     37#include "AlgebraicExt.h"
    2738
    2839struct snaIdeal
     
    3142  napoly *liste;
    3243};
    33 typedef struct snaIdeal * naIdeal;
    34 
    35 naIdeal naI=NULL;
     44
     45typedef struct snaIdeal* naIdeal;
     46
     47naIdeal naI = NULL;
    3648
    3749omBin snaIdeal_bin = omGetSpecBin(sizeof(snaIdeal));
     
    100112  if (r->minpoly!=NULL)
    101113  {
    102     naMinimalPoly=((lnumber)r->minpoly)->z;
     114    naMinimalPoly=r->minpoly;
    103115    #ifdef LDEBUG
    104116    omCheckAddr(naMinimalPoly);
     
    232244  do
    233245  {
    234     napSetExp(qq,1, p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing));
     246    napSetExp(qq,p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing));
    235247    napSetm(qq);
    236248    pGetCoeff(qq) = nacDiv(pGetCoeff(a), pGetCoeff(g));
     
    262274  do
    263275  {
    264     napSetExp(qq,1, p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing));
     276    napSetExp(qq, p_GetExp(a,1,nacRing) - p_GetExp(g,1,nacRing));
    265277    p_Setm(qq,nacRing);
    266278    pGetCoeff(qq) = nacDiv(pGetCoeff(a), pGetCoeff(g));
     
    498510    {
    499511      s = eati(s, &j);
    500       napAddExp(ex,i+1,j);
     512      napAddExp(ex,j);
    501513    }
    502514    else
    503       napAddExp(ex,i+1,1);
     515      napAddExp(ex,1);
    504516  }
    505517  return s;
     
    511523  {
    512524    s+=strlen(naParNames[i]);
    513     napSetExp(ex,i+1,1);
     525    napSetExp(ex,1);
    514526  }
    515527  return s;
     
    745757    if (pNext(y)==NULL)
    746758    {
    747       napSetExp(g,1, napExp(x, y));
     759      napSetExp(g,napExp(x, y));
    748760      p_Setm(g,nacRing);
    749761      return g;
     
    769781    p_Delete(&y,nacRing);
    770782    p_LmDelete(&h,nacRing);
    771     napSetExp(g,1, napExp(a, b));
     783    napSetExp(g,napExp(a, b));
    772784    p_Setm(g,nacRing);
    773785    return g;
     
    781793  for (i=(naNumbOfPar-1); i>=0; i--)
    782794  {
    783     napSetExp(x,i+1, napExpi(i,a,b));
     795    napSetExp(x,napExpi(i,a,b));
    784796    p_Setm(x,nacRing);
    785797  }
     
    845857      pGetCoeff(h) = nacCopy(pGetCoeff(q));
    846858      for (j=naNumbOfPar; j>0; j--)
    847         napSetExp(h,j, p_GetExp(q,j,nacRing) - p_GetExp(naI->liste[i],j,nacRing));
     859        napSetExp(h,p_GetExp(q,j,nacRing) - p_GetExp(naI->liste[i],j,nacRing));
    848860      p_Setm(h,nacRing);
    849861      h = p_Mult_q(h, napCopy(naI->liste[i]),nacRing);
     
    924936  l->s = 2;
    925937  l->z = p_ISet(1,nacRing);
    926   napSetExp(l->z,i,1);
     938  napSetExp(l->z,1);
    927939  p_Setm(l->z,nacRing);
    928940  l->n = NULL;
     
    972984void naDelete(number *p, const ring r)
    973985{
    974   if ((*p)!=r->minpoly)
     986  if (((napoly)(*p))!=r->minpoly)
    975987  {
    976988    lnumber l = (lnumber) * p;
     
    18611873  }
    18621874  /* normalize all coefficients in n and z (if in Q) */
    1863   if (norm) 
     1875  if (norm)
    18641876  {
    18651877    naCoefNormalize(pp);
     
    18811893        while (xx != NULL)
    18821894        {
    1883           napAddExp(xx,i+1, -m);
     1895          napAddExp(xx, -m);
    18841896          pIter(xx);
    18851897        }
    18861898        while (yy != NULL)
    18871899        {
    1888           napAddExp(yy,i+1, -m);
     1900          napAddExp(yy, -m);
    18891901          pIter(yy);
    18901902        }
     
    22362248  int i;
    22372249  for(i=1;i<=naParsToCopy;i++)
    2238     napSetExp(a,i,napGetExpFrom(p,i,naMapRing));
     2250    napSetExp(a,napGetExpFrom(p,naMapRing));
    22392251  p_Setm(a,nacRing);
    22402252  pGetCoeff(w) = nacMap(pGetCoeff(p));
     
    22462258    pIter(a);
    22472259    for(i=1;i<=naParsToCopy;i++)
    2248       napSetExp(a,i,napGetExpFrom(p,i,naMapRing));
     2260      napSetExp(a,napGetExpFrom(p,naMapRing));
    22492261    p_Setm(a,nacRing);
    22502262    pGetCoeff(a) = nacMap(pGetCoeff(p));
     
    22692281      if (par_perm!=NULL) e=par_perm[i-1];
    22702282      else                e=-i;
    2271       int ee=napGetExpFrom(p,i,src_ring);
     2283      int ee=napGetExpFrom(p,src_ring);
    22722284      if (e<0)
    2273         napSetExp(w,-e,ee);
     2285        napSetExp(w,ee);
    22742286      else if (ee>0)
    22752287        not_null=FALSE;
     
    24522464    for(i=0;i<P;i++)
    24532465    {
    2454       if(napGetExpFrom(za,i+1,oldRing)!=0)
     2466      if(napGetExpFrom(za,oldRing)!=0)
    24552467      {
    24562468        if(par_perm==NULL)
     
    24582470          if ((rPar(currRing)>=i) && (pa!=NULL))
    24592471          {
    2460             napSetExp(pa,i+1,napGetExpFrom(za,i+1,oldRing));
     2472            napSetExp(pa,napGetExpFrom(za,oldRing));
    24612473            p_Setm(pa,nacRing);
    24622474          }
     
    24682480        }
    24692481        else if(par_perm[i]>0)
    2470           pSetExp(p,par_perm[i],napGetExpFrom(za,i+1,oldRing));
     2482          pSetExp(p,par_perm[i],napGetExpFrom(za,oldRing));
    24712483        else if((par_perm[i]<0)&&(pa!=NULL))
    24722484        {
    2473           napSetExp(pa,-par_perm[i], napGetExpFrom(za,i+1,oldRing));
     2485          napSetExp(pa,napGetExpFrom(za,oldRing));
    24742486          p_Setm(pa,nacRing);
    24752487        }
     
    25282540
    25292541#ifdef LDEBUG
    2530 BOOLEAN naDBTest(number a, const char *f,const int l)
     2542BOOLEAN naDBTest(number a, const char *f, const int l)
    25312543{
    25322544  lnumber x=(lnumber)a;
  • kernel/RatFunctField.cc

    r7019c8 r6ccd426  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id$ */
     4/* $Id: RatFunctField.cc 12469 2010-05-14 10:39:49Z frank $ */
    55/*
    6 * ABSTRACT:   algebraic numbers
     6* ABSTRACT: elements of a rational function field
     7*
     8* This field has the form K(t_1, t_2, ..., t_m), where K is
     9* itself a field, and the t_i are transcendental over K.
     10* The elements in K(t_1, t_2, ..., t_m) can be treated as a
     11* specific type of number, see numbers.h.
    712*/
    813
     
    2429#include "clapconv.h"
    2530#endif
    26 #include "longalg.h"
    27 
    28 struct snaIdeal
     31#include "RatFunctField.h"
     32
     33struct snratIdeal
    2934{
    3035  int anz;
    31   napoly *liste;
     36  poly *liste;
    3237};
    33 typedef struct snaIdeal * naIdeal;
    34 
    35 naIdeal naI=NULL;
    36 
    37 omBin snaIdeal_bin = omGetSpecBin(sizeof(snaIdeal));
    38 
    39 int naNumbOfPar;
    40 napoly naMinimalPoly;
    41 #define naParNames (currRing->parameter)
    42 static int naIsChar0;
    43 static ring naMapRing;
     38
     39typedef struct snratIdeal* nratIdeal;
     40
     41nratIdeal nratI = NULL;
     42
     43omBin snratIdeal_bin = omGetSpecBin(sizeof(snratIdeal));
     44
     45int nratNumbOfPar;
     46#define nratParNames (currRing->parameter)
     47static int nratIsChar0;
     48static ring nratMapRing;
    4449
    4550#ifdef LDEBUG
    46 #define naTest(a) naDBTest(a,__FILE__,__LINE__)
    47 BOOLEAN naDBTest(number a, const char *f,const int l);
     51  #define nratTest(a) nratDBTest(a,__FILE__,__LINE__)
     52  BOOLEAN nratDBTest(number a, const char *f,const int l);
    4853#else
    49 #define naTest(a)
     54  #define nratTest(a)
    5055#endif
    51 
    52 number (*naMap)(number from);
     56/* LDEBUG */
     57
     58number (*nratMap)(number from);
    5359/* procedure variables */
    5460static numberfunc
Note: See TracChangeset for help on using the changeset viewer.