Changeset 5222d2a in git


Ignore:
Timestamp:
Dec 22, 2013, 11:25:06 PM (10 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ca326f706fd98143096fe2915a0c449e430c157d
Parents:
88c726094b0406a43f64b51105e892d707306874
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2013-12-22 23:25:06+01:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:02+01:00
Message:
new: ttpReduce
Files:
1 added
1 edited
1 copied
2 moved

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/gfanlib/tropical.cc

    r88c726 r5222d2a  
    55#include <bbcone.h>
    66
    7 #include <initialReduction.h>
     7#include <ppinitialReduction.h>
     8#include <ttinitialReduction.h>
    89
    910poly initial(poly p)
     
    469470  p->iiAddCproc("","reduceInitially3",FALSE,reduceInitially3);
    470471  p->iiAddCproc("","reduceInitially4",FALSE,reduceInitially4);
     472  p->iiAddCproc("","ttpReduce",FALSE,pReduce);
    471473#endif //NDEBUG
    472474  p->iiAddCproc("","reduceInitially",FALSE,reduceInitially);
  • dyn_modules/callgfanlib/ttinitialReduction.cc

    r88c726 r5222d2a  
    77#include <map>
    88#include <set>
     9
     10#define KEEP_COEFF_SMALL 1
    911
    1012/***
     
    2729    for (gCache = g; gCache; pIter(gCache))
    2830      if (p_LeadmonomDivisibleBy(gCache,toBeChecked,currRing)) break;
    29     if (gCache)
    30     {
    31       n_Power(p,p_GetExp(toBeChecked,1,currRing)-p_GetExp(gCache,1,currRing),&pPower,currRing->cf);
    32       coeff = n_Mult(p_GetCoeff(toBeChecked,currRing),pPower,currRing->cf);
    33       p_SetCoeff(gCache,n_Add(p_GetCoeff(gCache,currRing),coeff,currRing->cf),currRing);
    34       n_Delete(&pPower,currRing->cf); n_Delete(&coeff,currRing->cf);
    35       toBeChecked=p_LmDeleteAndNext(toBeChecked,currRing);
    36     }
    37     else
     31    if (!gCache)
    3832    {
    3933      if (n_DivBy(p_GetCoeff(toBeChecked,currRing),p,currRing->cf))
     
    6155      else
    6256      {
     57#ifdef KEEP_COEFF_SMALL
     58        if (n_Greater(p_GetCoeff(toBeChecked,currRing),p,currRing->cf))
     59        {
     60          coeff = n_IntDiv(p_GetCoeff(toBeChecked,currRing),p,currRing->cf);
     61          p_SetCoeff(toBeChecked,
     62                     n_IntMod(p_GetCoeff(toBeChecked,currRing),p,currRing->cf),
     63                     currRing);
     64          subst = p_LmInit(toBeChecked,currRing);
     65          p_AddExp(subst,1,1,currRing);
     66          p_SetCoeff(subst,coeff,currRing);
     67          p_Setm(subst,currRing); pTest(subst);
     68          pNext(toBeChecked)=p_Add_q(pNext(toBeChecked),subst,currRing);
     69          pTest(toBeChecked);
     70        }
     71#endif
    6372        pNext(gEnd)=toBeChecked;
    6473        pIter(gEnd); pIter(toBeChecked);
     
    7281
    7382#ifndef NDEBUG
    74 BOOLEAN pReduce(leftv res, leftv args)
     83BOOLEAN ttpReduce(leftv res, leftv args)
    7584{
    7685  leftv u = args;
     
    97106
    98107
     108#if 0
    99109/***
    100110 * reduces h initially with respect to g,
     
    598608  return TRUE;
    599609}
     610
     611#endif
Note: See TracChangeset for help on using the changeset viewer.