Changeset ad82f6 in git


Ignore:
Timestamp:
Sep 22, 2008, 6:27:17 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
Children:
d97aa56019829e7ee4d56c080928c7930fabeca9
Parents:
8492bd5dbfc42db0b4dbc2cf846ce087318ce006
Message:
*hannes: psr


git-svn-id: file:///usr/local/Singular/svn/trunk@11067 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_algorithm.cc

    r8492bd5 rad82f6  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_algorithm.cc,v 1.13 2008-06-19 15:58:18 Singular Exp $ */
     2/* $Id: cf_algorithm.cc,v 1.14 2008-09-22 16:27:17 Singular Exp $ */
    33
    44//{{{ docu
     
    3030#include "cf_iter.h"
    3131#include "ftmpl_functions.h"
     32
     33void out_cf(char *s1,const CanonicalForm &f,char *s2);
    3234
    3335//{{{ CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
     
    109111}
    110112#else
    111 psr ( const CanonicalForm &rr, const CanonicalForm &vv, const Variable & x ){
     113psr ( const CanonicalForm &rr, const CanonicalForm &vv, const Variable & x )
     114{
    112115  CanonicalForm r=rr, v=vv, l, test, lu, lv, t, retvalue;
    113116  int dr, dv, d,n=0;
     
    115118
    116119  dr = degree( r, x );
    117   dv = degree( v, x );
    118   if (dv <= dr) {l=LC(v,x); v = v -l*power(x,dv);}
    119   else { l = 1; }
    120   d= dr-dv+1;
    121   while ( ( dv <= dr  ) && ( r != r.genZero()) )
     120  if (dr>0)
    122121  {
    123     test = power(x,dr-dv)*v*LC(r,x);
    124     if ( dr == 0 ) { r= CanonicalForm(0); }
    125     else { r= r - LC(r,x)*power(x,dr); }
    126     r= l*r -test;
    127     dr= degree(r,x);
    128     n+=1;
     122    dv = degree( v, x );
     123    if (dv <= dr) {l=LC(v,x); v = v -l*power(x,dv);}
     124    else { l = 1; }
     125    d= dr-dv+1;
     126    //out_cf("psr(",rr," ");
     127    //out_cf("",vv," ");
     128    //printf(" var=%d\n",x.level());
     129    while ( ( dv <= dr  ) && ( !r.isZero()) )
     130    {
     131      test = power(x,dr-dv)*v*LC(r,x);
     132      if ( dr == 0 ) { r= CanonicalForm(0); }
     133      else { r= r - LC(r,x)*power(x,dr); }
     134      r= l*r -test;
     135      dr= degree(r,x);
     136      n+=1;
     137    }
     138    r= power(l, d-n)*r;
    129139  }
    130   r= power(l, d-n)*r;
    131140  return r;
    132141}
Note: See TracChangeset for help on using the changeset viewer.