Changeset 80532d7 in git
- Timestamp:
- Mar 12, 1998, 3:32:54 PM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- e0bc8f01c31b06f5bd5223a76007232d262923ac
- Parents:
- 2f58625cdc1cde42e7673759b68e29a39e705314
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/fac_univar.cc
r2f5862 r80532d7 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: fac_univar.cc,v 1.1 6 1998-02-02 08:58:49schmidt Exp $ */2 /* $Id: fac_univar.cc,v 1.17 1998-03-12 14:32:54 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 147 147 return res; 148 148 } 149 150 //{{{ static CanonicalForm norm ( const CanonicalForm & f )151 //{{{ docu152 //153 // norm() - return euclidean norm of f.154 //155 // That is, returns the largest integer smaller or equal156 // norm(f) = sqrt(sum( f[i]^2 )). f should be an univariate157 // polynomial over Z.158 //159 // Used by kbound().160 //161 //}}}162 static CanonicalForm163 norm ( const CanonicalForm & f )164 {165 CFIterator i;166 CanonicalForm sum = 0;167 for ( i = f; i.hasTerms(); i++ ) sum += i.coeff() * i.coeff();168 DEBOUTLN( cerr, "sum = " << sum );169 return sqrt( sum );170 }171 //}}}172 149 173 150 //{{{ static int kBound ( const CanonicalForm & f, int p ) … … 191 168 kBound ( const CanonicalForm & f, int p ) 192 169 { 193 return (int)(f.degree() + (double)(ilog2( norm(f)+1 ) + 1) / (double)ilog2(p)) + 1;170 return (int)(f.degree() + (double)(ilog2( euclideanNorm(f)+1 ) + 1) / (double)ilog2(p)) + 1; 194 171 } 195 172 //}}}
Note: See TracChangeset
for help on using the changeset viewer.