Changeset 6b4fbf7 in git


Ignore:
Timestamp:
Feb 20, 2006, 12:57:04 PM (18 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '0bc2210f8055033868008a3836878db65ec6f89e')
Children:
3ecd5f3896116e2d2af74944f70fd2d4b7ae5d17
Parents:
aa6d69c2d3807dc274cbd64e632685f1ea81a6d7
Message:
*bricken: slimgb: pair handling


git-svn-id: file:///usr/local/Singular/svn/trunk@8958 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/numbers.h

    raa6d69 r6b4fbf7  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: numbers.h,v 1.4 2005-05-25 13:03:31 bricken Exp $ */
     6/* $Id: numbers.h,v 1.5 2006-02-20 11:57:03 bricken Exp $ */
    77/*
    88* ABSTRACT: interface to coefficient aritmetics
     
    3333#define n_InpMult(a, b, r)    (r)->cf->nInpMult(a,b,r)
    3434#define n_Power(a, b, res, r) (r)->cf->nPower(a,b,res)
    35 
     35#define n_Size(n,r)           (r)->cf->nSize(n)
    3636
    3737/* variables */
  • kernel/tgb.cc

    raa6d69 r6b4fbf7  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.57 2006-02-17 11:32:58 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.58 2006-02-20 11:57:03 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    2222static const int bundle_size=100;
    2323static const int delay_factor=3;
     24int QlogSize(number n);
    2425#if 1
    2526static omBin lm_bin=NULL;
    2627//static const BOOLEAN up_to_radical=TRUE;
    2728
     29static int slim_nsize(number n, ring r) {
     30    if (rField_is_Zp(r)){
     31        return 1;
     32    }
     33 if (rField_is_Q(r)){
     34      return QlogSize(n);
     35
     36  }
     37    else{
     38      return n_Size(n,r);
     39     
     40    }
     41}
    2842static BOOLEAN monomial_root(poly m, ring r){
    2943    BOOLEAN changed=FALSE;
     
    961975  return 0;
    962976}
    963 
     977static wlen_type pair_weighted_length(int i, int j, slimgb_alg* c){
     978    if ((c->is_char0) && (pLexOrder))  {
     979        int c1=slim_nsize(p_GetCoeff(c->S->m[i],c->r),c->r);
     980        int c2=slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r);
     981        wlen_type el1=c->weighted_lengths[i]/c1;
     982        assume(el1!=0);
     983        assume(c->weighted_lengths[j] %c1==0);
     984        wlen_type el2=c->weighted_lengths[i]/c2;
     985        assume(el2!=0);
     986        assume(c->weighted_lengths[j] %c2==0);
     987        //should be * for function fields
     988        return (c1+c2) * (el1+el2-2);
     989       
     990       
     991    }
     992    if (c->is_char0) {
     993        int cs=slim_nsize(p_GetCoeff(c->S->m[i],c->r),c->r)+
     994            slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r);
     995        return (c->lengths[i]+c->lengths[j]-2)*cs;
     996    }
     997    return c->lengths[i]+c->lengths[j]-2;
     998   
     999}
    9641000sorted_pair_node** add_to_basis_ideal_quotient(poly h, int i_pos, int j_pos,slimgb_alg* c, int* ip)
    9651001{
     
    10071043    ENLARGE(c->states, char*);
    10081044    ENLARGE(c->gcd_of_terms,poly);
     1045    //if (c->weighted_lengths!=NULL) {
     1046    ENLARGE(c->weighted_lengths,wlen_type);
     1047    //}
    10091048    //ENLARGE(c->S->m,poly);
    10101049   
     
    10261065
    10271066  c->lengths[i]=pLength(h);
    1028  
     1067 
     1068  //necessary for correct weighted length
     1069 
     1070   if (!rField_is_Zp(c->r)){
     1071    pCleardenom(h);
     1072    pContent(h); //is a duplicate call, but belongs here
     1073   
     1074  }
     1075  else                     
     1076    pNorm(h);
     1077  c->weighted_lengths[i]=pQuality(h, c, c->lengths[i]);
    10291078  c->gcd_of_terms[i]=got;
    10301079 
     
    11231172    s->j=si_min(i,j);
    11241173    assume(s->j==j);
    1125     s->expected_length=c->lengths[i]+c->lengths[j]-2;
     1174    s->expected_length=pair_weighted_length(i,j,c);//c->lengths[i]+c->lengths[j]-2;
    11261175     
    11271176    poly lm=c->tmp_pair_lm[spc];//=pOne_Special();
     
    19021951  h=omalloc(n*sizeof(int));
    19031952  lengths=(int*) h;
    1904  
     1953  weighted_lengths=(wlen_type*)omalloc(n*sizeof(wlen_type));
    19051954  gcd_of_terms=(poly*) omalloc(n*sizeof(poly));
    19061955 
  • kernel/tgb_internal.h

    raa6d69 r6b4fbf7  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb_internal.h,v 1.22 2006-02-17 10:26:35 bricken Exp $ */
     7/* $Id: tgb_internal.h,v 1.23 2006-02-20 11:57:04 bricken Exp $ */
    88/*
    99 * ABSTRACT: tgb internal .h file
     
    9292  ring r;
    9393  int* lengths;
     94  wlen_type* weighted_lengths;
    9495  long* short_Exps;
    9596  kStrategy strat;
     
    152153    HASTREP,
    153154    UNIMPORTANT,
    154     SOONTREP
     155    //SOONTREP
    155156  };
    156157template <class len_type, class set_type>  int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set);
Note: See TracChangeset for help on using the changeset viewer.