realroot_doc 0.1.1
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.

{}

Member Function Documentation

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

Definition at line 56 of file contfrac.hpp.

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

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

            {
                typedef typename std::iterator_traits<IT>::difference_type     size_type;
        
                size_type deg = std::distance( first, last);
                assert( deg > 0 );

                int s = sign( *(last-1));
                long lan = bitsize( *(last-1));

                bool first_time = true;
                long maxpow = 0;

                int i = 1;
                for ( IT it = (last-2); it != first-1; --it, ++i) {
                    if ( s * sign( *it) < 0) {
                        long p = bitsize( abs( *it)) - lan - 1;
                        long q = p / i;
                        if ( first_time ) {
                            first_time = false;
                            maxpow = q + 2;
                        } else {
                            maxpow = std::max( maxpow, q + 2);
                        }
                    }
                }
                return maxpow;
            }
long lower ( const upoldse< NT > &  p) [inline]

Definition at line 50 of file contfrac.hpp.

References Kioustelidis_bound_1::foo().

            {
                return -foo( p.rbegin(), p.rend());
            }
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().

            {
                return foo( p.begin(), p.end());
                // return foo( begin( p), end( p));
            }

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