Changeset e1e8a9 in git


Ignore:
Timestamp:
Jul 16, 1997, 12:17:29 PM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
Children:
179ba9cc40aaa79ff3faad7b425a52b0b10e0b79
Parents:
f623b4afe1dacd66dc23ddffa288de1bedb86ad4
Message:
	* fac_univar.cc (norm, dnorm): function dnorm replaced by norm
	(kBound): uses ilog2() and norm() now


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

Legend:

Unmodified
Added
Removed
  • factory/fac_univar.cc

    rf623b4a re1e8a9  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_univar.cc,v 1.9 1997-06-19 12:23:16 schmidt Exp $ */
     2/* $Id: fac_univar.cc,v 1.10 1997-07-16 10:17:29 schmidt Exp $ */
    33
    44#include <config.h>
     
    152152}
    153153
    154 static double
    155 dnorm ( const CanonicalForm & f )
     154//{{{ static CanonicalForm norm ( const CanonicalForm & f )
     155//{{{ docu
     156//
     157// norm() - return euclidean norm of f.
     158//
     159// That, is norm(f) = sqrt(sum( f[i]^2 )).  f should be an
     160// univariate poly over Z.
     161//
     162//}}}
     163static CanonicalForm
     164norm ( const CanonicalForm & f )
    156165{
    157166    CFIterator i;
     
    159168    for ( i = f; i.hasTerms(); i++ ) sum += i.coeff() * i.coeff();
    160169    DEBOUTLN( cerr, "sum = " << sum );
    161     return sqrt( cf2double( sum ) );
    162 }
    163 
     170    return sqrt( sum );
     171}
     172//}}}
     173
     174//{{{ static int kBound ( const CanonicalForm & f, int p )
     175//{{{ docu
     176//
     177// kBound() - return bound of coefficients of factors of f (???).
     178//
     179//}}}
    164180static int
    165181kBound ( const CanonicalForm & f, int p )
    166182{
    167     DEBOUTLN( cerr, "lc(f) = " << lc(f) );
    168     return (int)((f.degree()*log(2)+log( fabs(cf2double(lc(f))) )+log( dnorm( f ) )) / log( (double)p ) + 0.5) + 1;
    169 }
     183    return (int)(f.degree() + (double)(ilog2( abs(lc(f)) * norm(f) ) + 1) / (double)ilog2(p)) + 1;
     184}
     185//}}}
    170186
    171187modpk
Note: See TracChangeset for help on using the changeset viewer.