Kioustelidis_bound_1 Class Reference

#include <contfrac.hpp>

List of all members.

Public Member Functions


Detailed Description

Definition at line 33 of file contfrac.hpp.


Constructor & Destructor Documentation

Kioustelidis_bound_1 (  )  [inline]

Constructor

Definition at line 39 of file contfrac.hpp.

00039 {}


Member Function Documentation

long foo ( IT  first,
IT  last 
) [inline]

Definition at line 56 of file contfrac.hpp.

References mmx::abs(), assert, mmx::max(), and mmx::sign().

Referenced by Kioustelidis_bound_1::lower(), and Kioustelidis_bound_1::upper().

00057             {
00058                 typedef typename std::iterator_traits<IT>::difference_type     size_type;
00059         
00060                 size_type deg = std::distance( first, last);
00061                 assert( deg > 0 );
00062 
00063                 int s = sign( *(last-1));
00064                 long lan = bitsize( *(last-1));
00065 
00066                 bool first_time = true;
00067                 long maxpow = 0;
00068 
00069                 int i = 1;
00070                 for ( IT it = (last-2); it != first-1; --it, ++i) {
00071                     if ( s * sign( *it) < 0) {
00072                         long p = bitsize( abs( *it)) - lan - 1;
00073                         long q = p / i;
00074                         if ( first_time ) {
00075                             first_time = false;
00076                             maxpow = q + 2;
00077                         } else {
00078                             maxpow = std::max( maxpow, q + 2);
00079                         }
00080                     }
00081                 }
00082                 return maxpow;
00083             }

long lower ( const upoldse< NT > &  p  )  [inline]

Definition at line 50 of file contfrac.hpp.

References Kioustelidis_bound_1::foo().

00051             {
00052                 return -foo( p.rbegin(), p.rend());
00053             }

long upper ( const upoldse< NT > &  p  )  [inline]

Definition at line 43 of file contfrac.hpp.

References Kioustelidis_bound_1::foo().

Referenced by mmx::CF_positive().

00044             {
00045                 return foo( p.begin(), p.end());
00046                 // return foo( begin( p), end( p));
00047             }


The documentation for this class was generated from the following file:

Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1