plll  1.0
arithmetic.hpp File Reference

Main arithmetic header. More...

#include <plll/config.hpp>
#include <plll/helper.hpp>
#include <sstream>
#include <iomanip>
#include <cassert>
#include <plll/arithmetic-expressions.hpp>
#include <plll/arithmetic-gmp.hpp>

Go to the source code of this file.

Classes

struct  plll::arithmetic::op::addition
 
struct  plll::arithmetic::binary_operation< A, B, Op >
 Provides information on the result of a binary arithmetic operation. More...
 
struct  plll::arithmetic::implementation::binary_operation_impl< A, B, Op >
 Provides information on the result of a binary arithmetic operation. More...
 
class  plll::arithmetic::implementation::conversion_impl< SourceType, DestContext >
 Provides conversion implementation from type SourceType to DestContext::Type. More...
 
class  plll::arithmetic::implementation::conversion_impl< char *, Context >
 Provides C-style string to type conversions using the usual type conversion facility. More...
 
class  plll::arithmetic::implementation::conversion_impl< char[n], Context >
 Provides C-style string to type conversions using the usual type conversion facility. More...
 
class  plll::arithmetic::implementation::conversion_impl< const char *, Context >
 Provides C-style string to type conversions using the usual type conversion facility. More...
 
class  plll::arithmetic::implementation::conversion_impl< const char[n], Context >
 Provides C-style string to type conversions using the usual type conversion facility. More...
 
class  plll::arithmetic::implementation::conversion_impl< std::string, Context >
 Provides std::string to type conversions using the usual type conversion facility. More...
 
class  plll::arithmetic::implementation::conversion_impl< Type, HexStringContext >
 Provides type to string conversions using the usual type conversion facility (for base 16). More...
 
class  plll::arithmetic::implementation::conversion_impl< Type, OctalStringContext >
 Provides type to string conversions using the usual type conversion facility (for base 8). More...
 
class  plll::arithmetic::implementation::conversion_impl< Type, StringContext >
 Provides type to string conversions using the usual type conversion facility. More...
 
class  plll::arithmetic::implementation::conversion_impl< typename Context::Type, Context >
 Provides an identity conversion from a type to itself. Note that the context is ignored. More...
 
struct  plll::arithmetic::op::division
 
class  plll::arithmetic::implementation::from_string_conversion< Context >
 Provides facilities to convert strings to types. More...
 
class  plll::arithmetic::implementation::from_string_conversion< Context >
 Provides facilities to convert strings to types. More...
 
class  plll::arithmetic::HexStringContext
 An "arithmetic" context for hexadecimal (base 16) conversions to std::strings. More...
 
struct  plll::arithmetic::op::modulo
 
struct  plll::arithmetic::op::multiplication
 
class  plll::arithmetic::implementation::nativeconversion_impl< SourceType >
 Implementation backend for conversions from context types to native types. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< Native, SourceType, NativeInt, SourceInt >
 Implementation backend for native conversion functions. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< double, SourceType, false, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to double. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< float, SourceType, false, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to float. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< Integer, Source, true, SourceInt >
 This class allows a shortcut: converting types to Integer objects by writing convert<Integer>(source). More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< long double, SourceType, false, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to long double. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< long long, SourceType, true, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to long long. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< signed int, SourceType, true, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to signed int. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< signed long, SourceType, true, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to signed long. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< std::string, SourceType, true, SourceInt >
 Provides type to std::string conversion using the native type conversion facility. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< unsigned int, SourceType, true, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to unsigned int. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl2< unsigned long, SourceType, true, SourceInt >
 Provides an implementation of the plll::arithmetic::implementation::nativeconversion_impl2<> template for conversions to unsigned long. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl< char * >
 Provides C-style string to native type conversion using the native type conversion facility. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl< char[n]>
 Provides C-style string to native type conversion using the native type conversion facility. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl< const char * >
 Provides C-style string to native type conversion using the native type conversion facility. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl< const char[n]>
 Provides C-style string to native type conversion using the native type conversion facility. More...
 
class  plll::arithmetic::implementation::nativeconversion_impl< std::string >
 Provides std::string to native type conversion using the native type conversion facility. More...
 
struct  plll::arithmetic::op::negation
 
class  plll::arithmetic::OctalStringContext
 An "arithmetic" context for octal (base 8) conversions to std::strings. More...
 
class  plll::arithmetic::StringContext
 An "arithmetic" context for conversions to std::strings. More...
 
struct  plll::arithmetic::op::subtraction
 
class  plll::arithmetic::implementation::to_string_conversion< Type >
 Provides facilities to convert types to std::strings. More...
 
class  plll::arithmetic::implementation::to_string_conversion< Type >
 Provides facilities to convert types to std::strings. More...
 
struct  plll::arithmetic::traits::type_traits< Type >
 Provides information on arithmetic (and string) types. More...
 
struct  plll::arithmetic::traits::type_traits< char * >
 
struct  plll::arithmetic::traits::type_traits< char[n]>
 
struct  plll::arithmetic::traits::type_traits< const char * >
 
struct  plll::arithmetic::traits::type_traits< const char[n]>
 
struct  plll::arithmetic::traits::type_traits< double >
 
struct  plll::arithmetic::traits::type_traits< float >
 
struct  plll::arithmetic::traits::type_traits< Integer >
 
struct  plll::arithmetic::traits::type_traits< long double >
 
struct  plll::arithmetic::traits::type_traits< long long >
 
struct  plll::arithmetic::traits::type_traits< Real >
 
struct  plll::arithmetic::traits::type_traits< signed int >
 
struct  plll::arithmetic::traits::type_traits< signed long >
 
struct  plll::arithmetic::traits::type_traits< std::string >
 
struct  plll::arithmetic::traits::type_traits< unsigned int >
 
struct  plll::arithmetic::traits::type_traits< unsigned long >
 
struct  plll::arithmetic::unary_operation< A, Op >
 Provides information on the result of an unary arithmetic operation. More...
 
struct  plll::arithmetic::implementation::unary_operation_impl< A, Op >
 Provides information on the result of an unary arithmetic operation. More...
 

Namespaces

 plll
 Contains the plll library.
 
 plll::arithmetic
 Contains the arithmetic backend of plll.
 

Functions

Conversion functions.
template<class SourceType , class DestContext >
void plll::arithmetic::convert (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal 
plll::arithmetic::convert (const SourceType &src, const DestContext &context)
 Converts the value in src to the type described by context and returns the result. More...
 
template<class SourceType , class DestContext >
void plll::arithmetic::convert_fraction (typename DestContext::Type &dst, const SourceType &src1, const SourceType &src2, const DestContext &context)
 Converts the values in src1 and scr2 to the type described by context and stores their quotient in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Frac 
plll::arithmetic::convert_fraction (const SourceType &src1, const SourceType &src2, const DestContext &context)
 Converts the values in src1 and scr2 to the type described by context and returns their quotient. More...
 
template<class SourceType , class DestContext >
void plll::arithmetic::convert_floor (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the floor of the value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Floor 
plll::arithmetic::convert_floor (const SourceType &src, const DestContext &context)
 Converts the floor of the value in src to the type described by context and returns the result. More...
 
template<class SourceType , class DestContext >
void plll::arithmetic::convert_round (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the rounded value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Round 
plll::arithmetic::convert_round (const SourceType &src, const DestContext &context)
 Converts the rounded value in src to the type described by context and returns the result. More...
 
template<class SourceType , class DestContext >
void plll::arithmetic::convert_round (typename DestContext::Type &dst, const SourceType &src, bool &up, const DestContext &context)
 Converts the rounded value in src to the type described by context and stores the result in dst. Stores in up whether the value was rounded up or down. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Round2 
plll::arithmetic::convert_round (const SourceType &src, bool &up, const DestContext &context)
 Converts the rounded value in src to the type described by context and returns the result. Stores in up whether the value was rounded up or down. More...
 
template<class SourceType , class DestContext >
void plll::arithmetic::convert_ceil (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the ceil of the value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Ceil 
plll::arithmetic::convert_ceil (const SourceType &src, const DestContext &context)
 Converts the ceil of the value in src to the type described by context and returns the result in dst. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal 
plll::arithmetic::convert (const SourceType &src)
 Converts the value in src to the native type Native and returns the result. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Floor 
plll::arithmetic::convert_floor (const SourceType &src)
 Converts the floor of the value in src to the native type Native and returns the result. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Round 
plll::arithmetic::convert_round (const SourceType &src)
 Converts the rounded value of src to the native type Native and returns the result. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Round2 
plll::arithmetic::convert_round (const SourceType &src, bool &up)
 Converts the rounded value of src to the native type Native and returns the result. Returns whether the value was rounded up or not in up. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Ceil 
plll::arithmetic::convert_ceil (const SourceType &src)
 Converts the ceil of the value in src to the native type Native and returns the result. More...
 

Detailed Description

Main arithmetic header.

This is the main arithmetic header for the plll lattice reduction library. It provides the basic definitions and functions for arbitrary precision integer arithmetic and arbitrary precision floating point arithmetic. Moreover, it provides a framework for converting between types, for determining the result types of arithmetic operations, and for handling of "global" invariants such as default precision for floating point values.

Definition in file arithmetic.hpp.