Changeset e1e8a9 in git
 Timestamp:
 Jul 16, 1997, 12:17:29 PM (27 years ago)
 Branches:
 (u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
 Children:
 179ba9cc40aaa79ff3faad7b425a52b0b10e0b79
 Parents:
 f623b4afe1dacd66dc23ddffa288de1bedb86ad4
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/fac_univar.cc
rf623b4a re1e8a9 1 1 /* emacs edit mode for this file is * C++ * */ 2 /* $Id: fac_univar.cc,v 1. 9 19970619 12:23:16schmidt Exp $ */2 /* $Id: fac_univar.cc,v 1.10 19970716 10:17:29 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 152 152 } 153 153 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 //}}} 163 static CanonicalForm 164 norm ( const CanonicalForm & f ) 156 165 { 157 166 CFIterator i; … … 159 168 for ( i = f; i.hasTerms(); i++ ) sum += i.coeff() * i.coeff(); 160 169 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 //}}} 164 180 static int 165 181 kBound ( const CanonicalForm & f, int p ) 166 182 { 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 //}}} 170 186 171 187 modpk
Note: See TracChangeset
for help on using the changeset viewer.