[PPL-devel] gmp

Antonio Díaz Quintana qzaida at us.es
Fri Apr 5 10:15:56 CEST 2013


Dear Roberto,
Please, find herein attached a bug found while compiling PPL.
As regards the GMP stuff, it seems it's fixed, though I had to recompile 
once more with
the flag -fexceptions and, following your instructions in ./configure 
output, updating m4.
Any suggestion will be really appreciated.
Antonio

El 04/04/2013 18:48, Roberto Bagnara escribió:
> On 04/04/13 18:07, Antonio Díaz Quintana wrote:
>> Hello again,
>> Thank you for your prompt answer.
>> Still, using the ppl-1.1pre8.tar leads to the same message:
>>      /checking for the GMP library version 4.1.3 or higher.    //
>> //    configure: error: Cannot find GMP version 4.1.3 or higher.//
>> /It also happens when I use the option --with-gmp-build=/opt/gmp-5.1.0
>> Antonio
> Hi Antonio,
>
> we would need to see the `config.log' file that is generated
> by `configure'.  Please send it (compressed) to ppl-devel at cs.unipr.it
> Kind regards,
>
>     Roberto
>
>> El 04/04/2013 16:02, Roberto Bagnara escribió:
>>> On 04/04/13 14:13, Antonio Díaz Quintana wrote:
>>>> Dear Sirs,
>>>> I'm trying to configure ppl 1.0 ( I downloaded the tar.gz source) after installing gmp 5.1. at /usr/local
>>>> Output says I haven't  GMP version 4.1.3 or later.
>>>> I had also installed GMP 4.1.4 version but I configured using --with-gmp=/usr/local to select the last gmp version.
>>>> tried setting CXX to c++ and CC to cc .
>>>> Of sourse, I used the --enable-cxx option to configure gmp.
>>>> GMP check is ok.
>>>> Is there any way I could overcome this trouble?
>>>> Thank you very much in advance for your attention.
>>>> Kind regards,
>>>> Antonio
>>> Dear Antonio,
>>>
>>> quite likely the problem is caused by an incompatibility introduced
>>> by GMP 5.1.  This issue is already dealt with in the Git version
>>> of the PPL.  The snapshot of PPL 1.1 available at
>>>
>>>     http://bugseng.com/products/ppl/download/ftp/snapshots/
>>>
>>> also contains the correction.  Please let us know if this
>>> solves the problem for you.
>>> Kind regards,
>>>
>>>      Roberto
>>>
>> -- 
>> Dr. Antonio J. Díaz Quintana
>> Instituto de Bioquímica Vegetal Y Fotosíntesis
>> Centro de Investigaciones Científicas Isla de la Cartuja
>> Universidad de Sevilla y C.S.I.C.
>>
>> Phone: +34 954 489 507
>> http://www.ibvf.csic.es/node/63
>>
>>
>>
>> _______________________________________________
>> PPL-devel mailing list
>> PPL-devel at cs.unipr.it
>> http://www.cs.unipr.it/mailman/listinfo/ppl-devel
>>
>

-- 
Dr. Antonio J. Díaz Quintana
Instituto de Bioquímica Vegetal Y Fotosíntesis
Centro de Investigaciones Científicas Isla de la Cartuja
Universidad de Sevilla y C.S.I.C.

Phone: +34 954 489 507
http://www.ibvf.csic.es/node/63

-------------- next part --------------
// /usr/libexec/gcc/i386-redhat-linux/3.4.6/cc1plus -quiet -I. -I.. -I.. -I../src -I/usr/local/include -MD .libs/Box.d -MF .deps/Box.Tpo -MP -MT Box.lo -MQ .libs/Box.o -D_GNU_SOURCE -DHAVE_CONFIG_H -DPIC Box.cc -quiet -dumpbase Box.cc -auxbase-strip .libs/Box.o -g -O2 -W -Wall -fexceptions -frounding-math -fPIC -o - -frandom-seed=0
# 1 "Box.cc"
# 1 "/opt/ppl-1.1pre8/src//"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "Box.cc"
# 24 "Box.cc"
# 1 "../ppl-config.h" 1
# 400 "../ppl-config.h"
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 319 "/usr/include/features.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 320 "/usr/include/features.h" 2 3 4
# 342 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4
# 343 "/usr/include/features.h" 2 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/bits/wchar.h" 1 3 4
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 37 "/usr/include/stdint.h" 3 4
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;



__extension__
typedef long long int int64_t;




typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;

typedef unsigned int uint32_t;





__extension__
typedef unsigned long long int uint64_t;






typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;



__extension__
typedef long long int int_least64_t;



typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;



__extension__
typedef unsigned long long int uint_least64_t;






typedef signed char int_fast8_t;





typedef int int_fast16_t;
typedef int int_fast32_t;
__extension__
typedef long long int int_fast64_t;



typedef unsigned char uint_fast8_t;





typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
typedef unsigned long long int uint_fast64_t;
# 126 "/usr/include/stdint.h" 3 4
typedef int intptr_t;


typedef unsigned int uintptr_t;
# 138 "/usr/include/stdint.h" 3 4
__extension__
typedef long long int intmax_t;
__extension__
typedef unsigned long long int uintmax_t;
# 401 "../ppl-config.h" 2



# 1 "/usr/include/inttypes.h" 1 3 4
# 274 "/usr/include/inttypes.h" 3 4
extern "C" {
# 288 "/usr/include/inttypes.h" 3 4
typedef struct
  {
    long long int quot;
    long long int rem;
  } imaxdiv_t;





extern intmax_t imaxabs (intmax_t __n) throw () __attribute__ ((__const__));


extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
      throw () __attribute__ ((__const__));


extern intmax_t strtoimax (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base) throw ();


extern uintmax_t strtoumax (__const char *__restrict __nptr,
       char ** __restrict __endptr, int __base) throw ();


extern intmax_t wcstoimax (__const wchar_t *__restrict __nptr,
      wchar_t **__restrict __endptr, int __base)
     throw ();


extern uintmax_t wcstoumax (__const wchar_t *__restrict __nptr,
       wchar_t ** __restrict __endptr, int __base)
     throw ();
# 390 "/usr/include/inttypes.h" 3 4
__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
      char **__restrict __endptr,
      int __base, int __group) throw ();


extern __inline intmax_t
strtoimax (__const char *__restrict nptr, char **__restrict endptr, int base) throw ()

{
  return __strtoll_internal (nptr, endptr, base, 0);
}



__extension__
extern unsigned long long int __strtoull_internal (__const char *
         __restrict __nptr,
         char **
         __restrict __endptr,
         int __base,
         int __group) throw ();


extern __inline uintmax_t
strtoumax (__const char *__restrict nptr, char **__restrict endptr, int base) throw ()

{
  return __strtoull_internal (nptr, endptr, base, 0);
}



__extension__
extern long long int __wcstoll_internal (__const wchar_t *
      __restrict __nptr,
      wchar_t **__restrict __endptr,
      int __base, int __group) throw ();


extern __inline intmax_t
wcstoimax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw ()

{
  return __wcstoll_internal (nptr, endptr, base, 0);
}




__extension__
extern unsigned long long int __wcstoull_internal (__const wchar_t *
         __restrict __nptr,
         wchar_t **
         __restrict __endptr,
         int __base,
         int __group) throw ();


extern __inline uintmax_t
wcstoumax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw ()

{
  return __wcstoull_internal (nptr, endptr, base, 0);
}




}
# 405 "../ppl-config.h" 2
# 25 "Box.cc" 2
# 1 "Box_defs.hh" 1
# 27 "Box_defs.hh"
# 1 "Box_types.hh" 1
# 16 "Box_types.hh"
namespace Parma_Polyhedra_Library {

template <typename Interval>
class Box;

class Box_Helpers;

}
# 28 "Box_defs.hh" 2
# 1 "globals_types.hh" 1
# 16 "globals_types.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstddef" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstddef" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstddef" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 151 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 213 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 3 4
typedef unsigned int size_t;
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstddef" 2 3

namespace std
{
  using ::ptrdiff_t;
  using ::size_t;
}
# 17 "globals_types.hh" 2

namespace Parma_Polyhedra_Library {



typedef size_t dimension_type;



typedef size_t memory_size_type;



enum Degenerate_Element {

  UNIVERSE,

  EMPTY
};




enum Relation_Symbol {

  EQUAL = 1U,

  LESS_THAN = 2U,

  LESS_OR_EQUAL = LESS_THAN | EQUAL,

  GREATER_THAN = 4U,

  GREATER_OR_EQUAL = GREATER_THAN | EQUAL,

  NOT_EQUAL = LESS_THAN | GREATER_THAN
};



enum Complexity_Class {

  POLYNOMIAL_COMPLEXITY,

  SIMPLEX_COMPLEXITY,

  ANY_COMPLEXITY
};



enum Optimization_Mode {

  MINIMIZATION,

  MAXIMIZATION
};







enum Bounded_Integer_Type_Width {

  BITS_8 = 8,


  BITS_16 = 16,


  BITS_32 = 32,


  BITS_64 = 64,


  BITS_128 = 128
};







enum Bounded_Integer_Type_Representation {

  UNSIGNED,





  SIGNED_2_COMPLEMENT
};







enum Bounded_Integer_Type_Overflow {






  OVERFLOW_WRAPS,
# 143 "globals_types.hh"
  OVERFLOW_UNDEFINED,
# 153 "globals_types.hh"
  OVERFLOW_IMPOSSIBLE
};






enum Representation {






  DENSE,
# 177 "globals_types.hh"
  SPARSE
};
# 187 "globals_types.hh"
enum Floating_Point_Format {

  IEEE754_HALF,


  IEEE754_SINGLE,


  IEEE754_DOUBLE,


  IEEE754_QUAD,


  INTEL_DOUBLE_EXTENDED,


  IBM_SINGLE,


  IBM_DOUBLE
};

struct Weightwatch_Traits;

}
# 29 "Box_defs.hh" 2
# 1 "Coefficient_defs.hh" 1
# 27 "Coefficient_defs.hh"
# 1 "Coefficient_types.hh" 1
# 16 "Coefficient_types.hh"
# 1 "Checked_Number_defs.hh" 1
# 27 "Checked_Number_defs.hh"
# 1 "Checked_Number_types.hh" 1
# 16 "Checked_Number_types.hh"
# 1 "Coefficient_traits_template.hh" 1
# 27 "Coefficient_traits_template.hh"
namespace Parma_Polyhedra_Library {





template <typename Coefficient>
struct Coefficient_traits_template {
};

}
# 17 "Checked_Number_types.hh" 2

namespace Parma_Polyhedra_Library {

struct Extended_Number_Policy;

template <typename T, typename Policy>
class Checked_Number;

}
# 28 "Checked_Number_defs.hh" 2
# 1 "checked_defs.hh" 1
# 27 "checked_defs.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3

# 1 "/usr/include/assert.h" 1 3 4
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 2 3
# 28 "checked_defs.hh" 2
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 1 3
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 3
       
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++config.h" 1 3
# 35 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++config.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/os_defines.h" 1 3
# 36 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++config.h" 2 3
# 57 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++config.h" 3
namespace __gnu_debug_def { }

namespace __gnu_debug
{
  using namespace __gnu_debug_def;
}
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 1 3
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 3
       
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 1 3
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 3
       
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstring" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstring" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstring" 3



# 1 "/usr/include/string.h" 1 3 4
# 28 "/usr/include/string.h" 3 4
extern "C" {




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4




extern void *memcpy (void *__restrict __dest,
       __const void *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, __const void *__src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));






extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
        int __c, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));





extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));


extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memchr (__const void *__s, int __c, size_t __n)
      throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern void *rawmemchr (__const void *__s, int __c)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));


extern void *memrchr (__const void *__s, int __c, size_t __n)
      throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
     throw () __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        __const char *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
     throw () __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
        size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (__const char *__s1, __const char *__s2)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (__const char *__s1, __const char *__s2)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         __const char *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (2)));






# 1 "/usr/include/xlocale.h" 1 3 4
# 28 "/usr/include/xlocale.h" 3 4
typedef struct __locale_struct
{

  struct locale_data *__locales[13];


  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;


  const char *__names[13];
} *__locale_t;
# 119 "/usr/include/string.h" 2 3 4


extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));

extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
    __locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4)));




extern char *strdup (__const char *__s)
     throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));






extern char *strndup (__const char *__string, size_t __n)
     throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/include/string.h" 3 4


extern char *strchr (__const char *__s, int __c)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern char *strrchr (__const char *__s, int __c)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern char *strchrnul (__const char *__s, int __c)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strcspn (__const char *__s, __const char *__reject)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (__const char *__s, __const char *__accept)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strpbrk (__const char *__s, __const char *__accept)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strstr (__const char *__haystack, __const char *__needle)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
     throw () __attribute__ ((__nonnull__ (2)));




extern char *__strtok_r (char *__restrict __s,
    __const char *__restrict __delim,
    char **__restrict __save_ptr)
     throw () __attribute__ ((__nonnull__ (2, 3)));

extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
         char **__restrict __save_ptr)
     throw () __attribute__ ((__nonnull__ (2, 3)));




extern char *strcasestr (__const char *__haystack, __const char *__needle)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));






extern void *memmem (__const void *__haystack, size_t __haystacklen,
       __const void *__needle, size_t __needlelen)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));



extern void *__mempcpy (void *__restrict __dest,
   __const void *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
        __const void *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));





extern size_t strlen (__const char *__s)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern size_t strnlen (__const char *__string, size_t __maxlen)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern char *strerror (int __errnum) throw ();

# 281 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
     throw () __attribute__ ((__nonnull__ (2)));





extern void __bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));



extern void bcopy (__const void *__src, void *__dest, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));


extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *index (__const char *__s, int __c)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));


extern char *rindex (__const char *__s, int __c)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));



extern int ffs (int __i) throw () __attribute__ ((__const__));




extern int ffsl (long int __l) throw () __attribute__ ((__const__));

__extension__ extern int ffsll (long long int __ll)
     throw () __attribute__ ((__const__));




extern int strcasecmp (__const char *__s1, __const char *__s2)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));





extern int strcasecmp_l (__const char *__s1, __const char *__s2,
    __locale_t __loc)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));

extern int strncasecmp_l (__const char *__s1, __const char *__s2,
     size_t __n, __locale_t __loc)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));





extern char *strsep (char **__restrict __stringp,
       __const char *__restrict __delim)
     throw () __attribute__ ((__nonnull__ (1, 2)));




extern int strverscmp (__const char *__s1, __const char *__s2)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strsignal (int __sig) throw ();


extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
     throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
     throw () __attribute__ ((__nonnull__ (1, 2)));



extern char *__stpncpy (char *__restrict __dest,
   __const char *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
        __const char *__restrict __src, size_t __n)
     throw () __attribute__ ((__nonnull__ (1, 2)));


extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1)));


extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));






extern char *basename (__const char *__filename) throw () __attribute__ ((__nonnull__ (1)));
# 426 "/usr/include/string.h" 3 4
}
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstring" 2 3
# 77 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstring" 3
namespace std
{
  using ::memcpy;
  using ::memmove;
  using ::strcpy;
  using ::strncpy;
  using ::strcat;
  using ::strncat;
  using ::memcmp;
  using ::strcmp;
  using ::strcoll;
  using ::strncmp;
  using ::strxfrm;
  using ::strcspn;
  using ::strspn;
  using ::strtok;
  using ::memset;
  using ::strerror;
  using ::strlen;

  using ::memchr;

  inline void*
  memchr(void* __p, int __c, size_t __n)
  { return memchr(const_cast<const void*>(__p), __c, __n); }

  using ::strchr;

  inline char*
  strchr(char* __s1, int __n)
  { return __builtin_strchr(const_cast<const char*>(__s1), __n); }

  using ::strpbrk;

  inline char*
  strpbrk(char* __s1, const char* __s2)
  { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }

  using ::strrchr;

  inline char*
  strrchr(char* __s1, int __n)
  { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }

  using ::strstr;

  inline char*
  strstr(char* __s1, const char* __s2)
  { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
}
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 3




# 1 "/usr/include/stdio.h" 1 3 4
# 30 "/usr/include/stdio.h" 3 4
extern "C" {



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 35 "/usr/include/stdio.h" 2 3 4

# 1 "/usr/include/bits/types.h" 1 3 4
# 28 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/bits/types.h" 2 3 4


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 32 "/usr/include/bits/types.h" 2 3 4


typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;


typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;




__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;







__extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
# 129 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 130 "/usr/include/bits/types.h" 2 3 4






__extension__ typedef __u_quad_t __dev_t;
__extension__ typedef unsigned int __uid_t;
__extension__ typedef unsigned int __gid_t;
__extension__ typedef unsigned long int __ino_t;
__extension__ typedef __u_quad_t __ino64_t;
__extension__ typedef unsigned int __mode_t;
__extension__ typedef unsigned int __nlink_t;
__extension__ typedef long int __off_t;
__extension__ typedef __quad_t __off64_t;
__extension__ typedef int __pid_t;
__extension__ typedef struct { int __val[2]; } __fsid_t;
__extension__ typedef long int __clock_t;
__extension__ typedef unsigned long int __rlim_t;
__extension__ typedef __u_quad_t __rlim64_t;
__extension__ typedef unsigned int __id_t;
__extension__ typedef long int __time_t;
__extension__ typedef unsigned int __useconds_t;
__extension__ typedef long int __suseconds_t;

__extension__ typedef int __daddr_t;
__extension__ typedef long int __swblk_t;
__extension__ typedef int __key_t;


__extension__ typedef int __clockid_t;


__extension__ typedef int __timer_t;


__extension__ typedef long int __blksize_t;




__extension__ typedef long int __blkcnt_t;
__extension__ typedef __quad_t __blkcnt64_t;


__extension__ typedef unsigned long int __fsblkcnt_t;
__extension__ typedef __u_quad_t __fsblkcnt64_t;


__extension__ typedef unsigned long int __fsfilcnt_t;
__extension__ typedef __u_quad_t __fsfilcnt64_t;

__extension__ typedef int __ssize_t;



typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;


__extension__ typedef int __intptr_t;


__extension__ typedef unsigned int __socklen_t;
# 37 "/usr/include/stdio.h" 2 3 4









typedef struct _IO_FILE FILE;





# 62 "/usr/include/stdio.h" 3 4
typedef struct _IO_FILE __FILE;
# 72 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/libio.h" 1 3 4
# 32 "/usr/include/libio.h" 3 4
# 1 "/usr/include/_G_config.h" 1 3 4
# 14 "/usr/include/_G_config.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 354 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 15 "/usr/include/_G_config.h" 2 3 4
# 24 "/usr/include/_G_config.h" 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 48 "/usr/include/wchar.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4
# 76 "/usr/include/wchar.h" 3 4
typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 25 "/usr/include/_G_config.h" 2 3 4

typedef struct
{
  __off_t __pos;
  __mbstate_t __state;
} _G_fpos_t;
typedef struct
{
  __off64_t __pos;
  __mbstate_t __state;
} _G_fpos64_t;
# 44 "/usr/include/_G_config.h" 3 4
# 1 "/usr/include/gconv.h" 1 3 4
# 28 "/usr/include/gconv.h" 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 48 "/usr/include/wchar.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4
# 29 "/usr/include/gconv.h" 2 3 4


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 32 "/usr/include/gconv.h" 2 3 4





enum
{
  __GCONV_OK = 0,
  __GCONV_NOCONV,
  __GCONV_NODB,
  __GCONV_NOMEM,

  __GCONV_EMPTY_INPUT,
  __GCONV_FULL_OUTPUT,
  __GCONV_ILLEGAL_INPUT,
  __GCONV_INCOMPLETE_INPUT,

  __GCONV_ILLEGAL_DESCRIPTOR,
  __GCONV_INTERNAL_ERROR
};



enum
{
  __GCONV_IS_LAST = 0x0001,
  __GCONV_IGNORE_ERRORS = 0x0002
};



struct __gconv_step;
struct __gconv_step_data;
struct __gconv_loaded_object;
struct __gconv_trans_data;



typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
       __const unsigned char **, __const unsigned char *,
       unsigned char **, size_t *, int, int);


typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);


typedef int (*__gconv_init_fct) (struct __gconv_step *);
typedef void (*__gconv_end_fct) (struct __gconv_step *);



typedef int (*__gconv_trans_fct) (struct __gconv_step *,
      struct __gconv_step_data *, void *,
      __const unsigned char *,
      __const unsigned char **,
      __const unsigned char *, unsigned char **,
      size_t *);


typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
       __const unsigned char *,
       unsigned char *, unsigned char *);


typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
     size_t *);


typedef int (*__gconv_trans_init_fct) (void **, const char *);
typedef void (*__gconv_trans_end_fct) (void *);

struct __gconv_trans_data
{

  __gconv_trans_fct __trans_fct;
  __gconv_trans_context_fct __trans_context_fct;
  __gconv_trans_end_fct __trans_end_fct;
  void *__data;
  struct __gconv_trans_data *__next;
};



struct __gconv_step
{
  struct __gconv_loaded_object *__shlib_handle;
  __const char *__modname;

  int __counter;

  char *__from_name;
  char *__to_name;

  __gconv_fct __fct;
  __gconv_btowc_fct __btowc_fct;
  __gconv_init_fct __init_fct;
  __gconv_end_fct __end_fct;



  int __min_needed_from;
  int __max_needed_from;
  int __min_needed_to;
  int __max_needed_to;


  int __stateful;

  void *__data;
};



struct __gconv_step_data
{
  unsigned char *__outbuf;
  unsigned char *__outbufend;



  int __flags;



  int __invocation_counter;



  int __internal_use;

  __mbstate_t *__statep;
  __mbstate_t __state;



  struct __gconv_trans_data *__trans;
};



typedef struct __gconv_info
{
  size_t __nsteps;
  struct __gconv_step *__steps;
  __extension__ struct __gconv_step_data __data [];
} *__gconv_t;
# 45 "/usr/include/_G_config.h" 2 3 4
typedef union
{
  struct __gconv_info __cd;
  struct
  {
    struct __gconv_info __cd;
    struct __gconv_step_data __data;
  } __combined;
} _G_iconv_t;

typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 33 "/usr/include/libio.h" 2 3 4
# 53 "/usr/include/libio.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stdarg.h" 1 3 4
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 54 "/usr/include/libio.h" 2 3 4
# 166 "/usr/include/libio.h" 3 4
struct _IO_jump_t; struct _IO_FILE;
# 176 "/usr/include/libio.h" 3 4
typedef void _IO_lock_t;





struct _IO_marker {
  struct _IO_marker *_next;
  struct _IO_FILE *_sbuf;



  int _pos;
# 199 "/usr/include/libio.h" 3 4
};


enum __codecvt_result
{
  __codecvt_ok,
  __codecvt_partial,
  __codecvt_error,
  __codecvt_noconv
};
# 267 "/usr/include/libio.h" 3 4
struct _IO_FILE {
  int _flags;




  char* _IO_read_ptr;
  char* _IO_read_end;
  char* _IO_read_base;
  char* _IO_write_base;
  char* _IO_write_ptr;
  char* _IO_write_end;
  char* _IO_buf_base;
  char* _IO_buf_end;

  char *_IO_save_base;
  char *_IO_backup_base;
  char *_IO_save_end;

  struct _IO_marker *_markers;

  struct _IO_FILE *_chain;

  int _fileno;



  int _flags2;

  __off_t _old_offset;



  unsigned short _cur_column;
  signed char _vtable_offset;
  char _shortbuf[1];



  _IO_lock_t *_lock;
# 315 "/usr/include/libio.h" 3 4
  __off64_t _offset;
# 324 "/usr/include/libio.h" 3 4
  void *__pad1;
  void *__pad2;
  void *__pad3;
  void *__pad4;
  size_t __pad5;

  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];

};





struct _IO_FILE_plus;

extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
# 360 "/usr/include/libio.h" 3 4
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);







typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
     size_t __n);







typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);


typedef int __io_close_fn (void *__cookie);




typedef __io_read_fn cookie_read_function_t;
typedef __io_write_fn cookie_write_function_t;
typedef __io_seek_fn cookie_seek_function_t;
typedef __io_close_fn cookie_close_function_t;


typedef struct
{
  __io_read_fn *read;
  __io_write_fn *write;
  __io_seek_fn *seek;
  __io_close_fn *close;
} _IO_cookie_io_functions_t;
typedef _IO_cookie_io_functions_t cookie_io_functions_t;

struct _IO_cookie_file;


extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
        void *__cookie, _IO_cookie_io_functions_t __fns);




extern "C" {


extern int __underflow (_IO_FILE *) throw ();
extern int __uflow (_IO_FILE *) throw ();
extern int __overflow (_IO_FILE *, int) throw ();
extern wint_t __wunderflow (_IO_FILE *) throw ();
extern wint_t __wuflow (_IO_FILE *) throw ();
extern wint_t __woverflow (_IO_FILE *, wint_t) throw ();
# 450 "/usr/include/libio.h" 3 4
extern int _IO_getc (_IO_FILE *__fp) throw ();
extern int _IO_putc (int __c, _IO_FILE *__fp) throw ();
extern int _IO_feof (_IO_FILE *__fp) throw ();
extern int _IO_ferror (_IO_FILE *__fp) throw ();

extern int _IO_peekc_locked (_IO_FILE *__fp) throw ();





extern void _IO_flockfile (_IO_FILE *) throw ();
extern void _IO_funlockfile (_IO_FILE *) throw ();
extern int _IO_ftrylockfile (_IO_FILE *) throw ();
# 480 "/usr/include/libio.h" 3 4
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
   __gnuc_va_list, int *__restrict);
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
    __gnuc_va_list);
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) throw ();
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) throw ();

extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) throw ();
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) throw ();

extern void _IO_free_backup_area (_IO_FILE *) throw ();
# 538 "/usr/include/libio.h" 3 4
}
# 73 "/usr/include/stdio.h" 2 3 4




typedef __gnuc_va_list va_list;
# 86 "/usr/include/stdio.h" 3 4


typedef _G_fpos_t fpos_t;





typedef _G_fpos64_t fpos64_t;
# 138 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 139 "/usr/include/stdio.h" 2 3 4



extern struct _IO_FILE *stdin;
extern struct _IO_FILE *stdout;
extern struct _IO_FILE *stderr;









extern int remove (__const char *__filename) throw ();

extern int rename (__const char *__old, __const char *__new) throw ();









extern FILE *tmpfile (void);
# 176 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile64 (void);



extern char *tmpnam (char *__s) throw ();





extern char *tmpnam_r (char *__s) throw ();
# 198 "/usr/include/stdio.h" 3 4
extern char *tempnam (__const char *__dir, __const char *__pfx)
     throw () __attribute__ ((__malloc__));








extern int fclose (FILE *__stream);




extern int fflush (FILE *__stream);

# 223 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 233 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);









extern FILE *fopen (__const char *__restrict __filename,
      __const char *__restrict __modes);




extern FILE *freopen (__const char *__restrict __filename,
        __const char *__restrict __modes,
        FILE *__restrict __stream);
# 264 "/usr/include/stdio.h" 3 4


extern FILE *fopen64 (__const char *__restrict __filename,
        __const char *__restrict __modes);
extern FILE *freopen64 (__const char *__restrict __filename,
   __const char *__restrict __modes,
   FILE *__restrict __stream);




extern FILE *fdopen (int __fd, __const char *__modes) throw ();





extern FILE *fopencookie (void *__restrict __magic_cookie,
     __const char *__restrict __modes,
     _IO_cookie_io_functions_t __io_funcs) throw ();


extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) throw ();




extern FILE *open_memstream (char **__restrict __bufloc,
        size_t *__restrict __sizeloc) throw ();






extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) throw ();





extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) throw ();


extern void setlinebuf (FILE *__stream) throw ();








extern int fprintf (FILE *__restrict __stream,
      __const char *__restrict __format, ...);




extern int printf (__const char *__restrict __format, ...);

extern int sprintf (char *__restrict __s,
      __const char *__restrict __format, ...) throw ();





extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
       __gnuc_va_list __arg);




extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);

extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
       __gnuc_va_list __arg) throw ();





extern int snprintf (char *__restrict __s, size_t __maxlen,
       __const char *__restrict __format, ...)
     throw () __attribute__ ((__format__ (__printf__, 3, 4)));

extern int vsnprintf (char *__restrict __s, size_t __maxlen,
        __const char *__restrict __format, __gnuc_va_list __arg)
     throw () __attribute__ ((__format__ (__printf__, 3, 0)));






extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
        __gnuc_va_list __arg)
     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
extern int __asprintf (char **__restrict __ptr,
         __const char *__restrict __fmt, ...)
     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
extern int asprintf (char **__restrict __ptr,
       __const char *__restrict __fmt, ...)
     throw () __attribute__ ((__format__ (__printf__, 2, 3)));







extern int vdprintf (int __fd, __const char *__restrict __fmt,
       __gnuc_va_list __arg)
     __attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
     __attribute__ ((__format__ (__printf__, 2, 3)));








extern int fscanf (FILE *__restrict __stream,
     __const char *__restrict __format, ...);




extern int scanf (__const char *__restrict __format, ...);

extern int sscanf (__const char *__restrict __s,
     __const char *__restrict __format, ...) throw ();








extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
      __gnuc_va_list __arg)
     __attribute__ ((__format__ (__scanf__, 2, 0)));





extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
     __attribute__ ((__format__ (__scanf__, 1, 0)));


extern int vsscanf (__const char *__restrict __s,
      __const char *__restrict __format, __gnuc_va_list __arg)
     throw () __attribute__ ((__format__ (__scanf__, 2, 0)));









extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);

# 456 "/usr/include/stdio.h" 3 4
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 467 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);











extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);





extern int putchar (int __c);

# 500 "/usr/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);







extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);






extern int getw (FILE *__stream);


extern int putw (int __w, FILE *__stream);








extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream);






extern char *gets (char *__s);

# 545 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
        FILE *__restrict __stream);
# 561 "/usr/include/stdio.h" 3 4
extern __ssize_t __getdelim (char **__restrict __lineptr,
          size_t *__restrict __n, int __delimiter,
          FILE *__restrict __stream);
extern __ssize_t getdelim (char **__restrict __lineptr,
        size_t *__restrict __n, int __delimiter,
        FILE *__restrict __stream);







extern __ssize_t getline (char **__restrict __lineptr,
       size_t *__restrict __n,
       FILE *__restrict __stream);








extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);





extern int puts (__const char *__s);






extern int ungetc (int __c, FILE *__stream);






extern size_t fread (void *__restrict __ptr, size_t __size,
       size_t __n, FILE *__restrict __stream);




extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
        size_t __n, FILE *__restrict __s);

# 622 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (__const char *__restrict __s,
      FILE *__restrict __stream);
# 633 "/usr/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
         size_t __n, FILE *__restrict __stream);
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
          size_t __n, FILE *__restrict __stream);








extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream);




extern void rewind (FILE *__stream);

# 669 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off_t __off, int __whence);




extern __off_t ftello (FILE *__stream);
# 688 "/usr/include/stdio.h" 3 4






extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);




extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
# 711 "/usr/include/stdio.h" 3 4



extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream);
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);




extern void clearerr (FILE *__stream) throw ();

extern int feof (FILE *__stream) throw ();

extern int ferror (FILE *__stream) throw ();




extern void clearerr_unlocked (FILE *__stream) throw ();
extern int feof_unlocked (FILE *__stream) throw ();
extern int ferror_unlocked (FILE *__stream) throw ();








extern void perror (__const char *__s);






# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
# 27 "/usr/include/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern __const char *__const sys_errlist[];


extern int _sys_nerr;
extern __const char *__const _sys_errlist[];
# 750 "/usr/include/stdio.h" 2 3 4




extern int fileno (FILE *__stream) throw ();




extern int fileno_unlocked (FILE *__stream) throw ();
# 769 "/usr/include/stdio.h" 3 4
extern FILE *popen (__const char *__command, __const char *__modes);





extern int pclose (FILE *__stream);





extern char *ctermid (char *__s) throw ();





extern char *cuserid (char *__s);




struct obstack;


extern int obstack_printf (struct obstack *__restrict __obstack,
      __const char *__restrict __format, ...)
     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
       __const char *__restrict __format,
       __gnuc_va_list __args)
     throw () __attribute__ ((__format__ (__printf__, 2, 0)));







extern void flockfile (FILE *__stream) throw ();



extern int ftrylockfile (FILE *__stream) throw ();


extern void funlockfile (FILE *__stream) throw ();
# 830 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio.h" 1 3 4
# 33 "/usr/include/bits/stdio.h" 3 4
inline int
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
{
  return vfprintf (stdout, __fmt, __arg);
}


inline int
getchar (void)
{
  return _IO_getc (stdin);
}




inline int
getc_unlocked (FILE *__fp)
{
  return (__builtin_expect ((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end, 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}


inline int
getchar_unlocked (void)
{
  return (__builtin_expect ((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end, 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
}




inline int
putchar (int __c)
{
  return _IO_putc (__c, stdout);
}




inline int
fputc_unlocked (int __c, FILE *__stream)
{
  return (__builtin_expect ((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end, 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}





inline int
putc_unlocked (int __c, FILE *__stream)
{
  return (__builtin_expect ((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end, 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}


inline int
putchar_unlocked (int __c)
{
  return (__builtin_expect ((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end, 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
}





inline __ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
  return __getdelim (__lineptr, __n, '\n', __stream);
}





inline int
feof_unlocked (FILE *__stream) throw ()
{
  return (((__stream)->_flags & 0x10) != 0);
}


inline int
ferror_unlocked (FILE *__stream) throw ()
{
  return (((__stream)->_flags & 0x20) != 0);
}
# 831 "/usr/include/stdio.h" 2 3 4





}
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 2 3
# 97 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 3
namespace std
{
  using ::FILE;
  using ::fpos_t;

  using ::clearerr;
  using ::fclose;
  using ::feof;
  using ::ferror;
  using ::fflush;
  using ::fgetc;
  using ::fgetpos;
  using ::fgets;
  using ::fopen;
  using ::fprintf;
  using ::fputc;
  using ::fputs;
  using ::fread;
  using ::freopen;
  using ::fscanf;
  using ::fseek;
  using ::fsetpos;
  using ::ftell;
  using ::fwrite;
  using ::getc;
  using ::getchar;
  using ::gets;
  using ::perror;
  using ::printf;
  using ::putc;
  using ::putchar;
  using ::puts;
  using ::remove;
  using ::rename;
  using ::rewind;
  using ::scanf;
  using ::setbuf;
  using ::setvbuf;
  using ::sprintf;
  using ::sscanf;
  using ::tmpfile;
  using ::tmpnam;
  using ::ungetc;
  using ::vfprintf;
  using ::vprintf;
  using ::vsprintf;
}
# 153 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 3
namespace __gnu_cxx
{
# 167 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdio" 3
  using ::snprintf;
  using ::vfscanf;
  using ::vscanf;
  using ::vsnprintf;
  using ::vsscanf;

}

namespace std
{
  using __gnu_cxx::snprintf;
  using __gnu_cxx::vfscanf;
  using __gnu_cxx::vscanf;
  using __gnu_cxx::vsnprintf;
  using __gnu_cxx::vsscanf;
}
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/clocale" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/clocale" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/clocale" 3

# 1 "/usr/include/locale.h" 1 3 4
# 29 "/usr/include/locale.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 30 "/usr/include/locale.h" 2 3 4
# 1 "/usr/include/bits/locale.h" 1 3 4
# 27 "/usr/include/bits/locale.h" 3 4
enum
{
  __LC_CTYPE = 0,
  __LC_NUMERIC = 1,
  __LC_TIME = 2,
  __LC_COLLATE = 3,
  __LC_MONETARY = 4,
  __LC_MESSAGES = 5,
  __LC_ALL = 6,
  __LC_PAPER = 7,
  __LC_NAME = 8,
  __LC_ADDRESS = 9,
  __LC_TELEPHONE = 10,
  __LC_MEASUREMENT = 11,
  __LC_IDENTIFICATION = 12
};
# 31 "/usr/include/locale.h" 2 3 4

extern "C" {
# 52 "/usr/include/locale.h" 3 4
struct lconv
{


  char *decimal_point;
  char *thousands_sep;





  char *grouping;





  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
  char int_frac_digits;
  char frac_digits;

  char p_cs_precedes;

  char p_sep_by_space;

  char n_cs_precedes;

  char n_sep_by_space;






  char p_sign_posn;
  char n_sign_posn;


  char int_p_cs_precedes;

  char int_p_sep_by_space;

  char int_n_cs_precedes;

  char int_n_sep_by_space;






  char int_p_sign_posn;
  char int_n_sign_posn;
# 119 "/usr/include/locale.h" 3 4
};





extern char *setlocale (int __category, __const char *__locale) throw ();


extern struct lconv *localeconv (void) throw ();


# 148 "/usr/include/locale.h" 3 4
typedef __locale_t locale_t;





extern __locale_t newlocale (int __category_mask, __const char *__locale,
        __locale_t __base) throw ();
# 189 "/usr/include/locale.h" 3 4
extern __locale_t duplocale (__locale_t __dataset) throw ();



extern void freelocale (__locale_t __dataset) throw ();






extern __locale_t uselocale (__locale_t __dataset) throw ();







}
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/clocale" 2 3





namespace std
{
  using ::lconv;
  using ::setlocale;
  using ::localeconv;
}
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 2 3
# 1 "/usr/include/langinfo.h" 1 3 4
# 24 "/usr/include/langinfo.h" 3 4
# 1 "/usr/include/nl_types.h" 1 3 4
# 31 "/usr/include/nl_types.h" 3 4
extern "C" {


typedef void *nl_catd;


typedef int nl_item;





extern nl_catd catopen (__const char *__cat_name, int __flag) __attribute__ ((__nonnull__ (1)));



extern char *catgets (nl_catd __catalog, int __set, int __number,
        __const char *__string) throw () __attribute__ ((__nonnull__ (1)));


extern int catclose (nl_catd __catalog) throw () __attribute__ ((__nonnull__ (1)));

}
# 25 "/usr/include/langinfo.h" 2 3 4

# 1 "/usr/include/bits/locale.h" 1 3 4
# 27 "/usr/include/langinfo.h" 2 3 4


extern "C" {
# 43 "/usr/include/langinfo.h" 3 4
enum
{



  ABDAY_1 = (((__LC_TIME) << 16) | (0)),

  ABDAY_2,

  ABDAY_3,

  ABDAY_4,

  ABDAY_5,

  ABDAY_6,

  ABDAY_7,



  DAY_1,

  DAY_2,

  DAY_3,

  DAY_4,

  DAY_5,

  DAY_6,

  DAY_7,



  ABMON_1,

  ABMON_2,

  ABMON_3,

  ABMON_4,

  ABMON_5,

  ABMON_6,

  ABMON_7,

  ABMON_8,

  ABMON_9,

  ABMON_10,

  ABMON_11,

  ABMON_12,



  MON_1,

  MON_2,

  MON_3,

  MON_4,

  MON_5,

  MON_6,

  MON_7,

  MON_8,

  MON_9,

  MON_10,

  MON_11,

  MON_12,


  AM_STR,

  PM_STR,


  D_T_FMT,

  D_FMT,

  T_FMT,

  T_FMT_AMPM,


  ERA,

  __ERA_YEAR,



  ERA_D_FMT,

  ALT_DIGITS,

  ERA_D_T_FMT,

  ERA_T_FMT,


  _NL_TIME_ERA_NUM_ENTRIES,
  _NL_TIME_ERA_ENTRIES,

  _NL_WABDAY_1,
  _NL_WABDAY_2,
  _NL_WABDAY_3,
  _NL_WABDAY_4,
  _NL_WABDAY_5,
  _NL_WABDAY_6,
  _NL_WABDAY_7,


  _NL_WDAY_1,
  _NL_WDAY_2,
  _NL_WDAY_3,
  _NL_WDAY_4,
  _NL_WDAY_5,
  _NL_WDAY_6,
  _NL_WDAY_7,


  _NL_WABMON_1,
  _NL_WABMON_2,
  _NL_WABMON_3,
  _NL_WABMON_4,
  _NL_WABMON_5,
  _NL_WABMON_6,
  _NL_WABMON_7,
  _NL_WABMON_8,
  _NL_WABMON_9,
  _NL_WABMON_10,
  _NL_WABMON_11,
  _NL_WABMON_12,


  _NL_WMON_1,
  _NL_WMON_2,
  _NL_WMON_3,
  _NL_WMON_4,
  _NL_WMON_5,
  _NL_WMON_6,
  _NL_WMON_7,
  _NL_WMON_8,
  _NL_WMON_9,
  _NL_WMON_10,
  _NL_WMON_11,
  _NL_WMON_12,

  _NL_WAM_STR,
  _NL_WPM_STR,

  _NL_WD_T_FMT,
  _NL_WD_FMT,
  _NL_WT_FMT,
  _NL_WT_FMT_AMPM,

  _NL_WERA_YEAR,
  _NL_WERA_D_FMT,
  _NL_WALT_DIGITS,
  _NL_WERA_D_T_FMT,
  _NL_WERA_T_FMT,

  _NL_TIME_WEEK_NDAYS,
  _NL_TIME_WEEK_1STDAY,
  _NL_TIME_WEEK_1STWEEK,
  _NL_TIME_FIRST_WEEKDAY,
  _NL_TIME_FIRST_WORKDAY,
  _NL_TIME_CAL_DIRECTION,
  _NL_TIME_TIMEZONE,

  _DATE_FMT,

  _NL_W_DATE_FMT,

  _NL_TIME_CODESET,

  _NL_NUM_LC_TIME,




  _NL_COLLATE_NRULES = (((__LC_COLLATE) << 16) | (0)),
  _NL_COLLATE_RULESETS,
  _NL_COLLATE_TABLEMB,
  _NL_COLLATE_WEIGHTMB,
  _NL_COLLATE_EXTRAMB,
  _NL_COLLATE_INDIRECTMB,
  _NL_COLLATE_GAP1,
  _NL_COLLATE_GAP2,
  _NL_COLLATE_GAP3,
  _NL_COLLATE_TABLEWC,
  _NL_COLLATE_WEIGHTWC,
  _NL_COLLATE_EXTRAWC,
  _NL_COLLATE_INDIRECTWC,
  _NL_COLLATE_SYMB_HASH_SIZEMB,
  _NL_COLLATE_SYMB_TABLEMB,
  _NL_COLLATE_SYMB_EXTRAMB,
  _NL_COLLATE_COLLSEQMB,
  _NL_COLLATE_COLLSEQWC,
  _NL_COLLATE_CODESET,
  _NL_NUM_LC_COLLATE,




  _NL_CTYPE_CLASS = (((__LC_CTYPE) << 16) | (0)),
  _NL_CTYPE_TOUPPER,
  _NL_CTYPE_GAP1,
  _NL_CTYPE_TOLOWER,
  _NL_CTYPE_GAP2,
  _NL_CTYPE_CLASS32,
  _NL_CTYPE_GAP3,
  _NL_CTYPE_GAP4,
  _NL_CTYPE_GAP5,
  _NL_CTYPE_GAP6,
  _NL_CTYPE_CLASS_NAMES,
  _NL_CTYPE_MAP_NAMES,
  _NL_CTYPE_WIDTH,
  _NL_CTYPE_MB_CUR_MAX,
  _NL_CTYPE_CODESET_NAME,
  CODESET = _NL_CTYPE_CODESET_NAME,

  _NL_CTYPE_TOUPPER32,
  _NL_CTYPE_TOLOWER32,
  _NL_CTYPE_CLASS_OFFSET,
  _NL_CTYPE_MAP_OFFSET,
  _NL_CTYPE_INDIGITS_MB_LEN,
  _NL_CTYPE_INDIGITS0_MB,
  _NL_CTYPE_INDIGITS1_MB,
  _NL_CTYPE_INDIGITS2_MB,
  _NL_CTYPE_INDIGITS3_MB,
  _NL_CTYPE_INDIGITS4_MB,
  _NL_CTYPE_INDIGITS5_MB,
  _NL_CTYPE_INDIGITS6_MB,
  _NL_CTYPE_INDIGITS7_MB,
  _NL_CTYPE_INDIGITS8_MB,
  _NL_CTYPE_INDIGITS9_MB,
  _NL_CTYPE_INDIGITS_WC_LEN,
  _NL_CTYPE_INDIGITS0_WC,
  _NL_CTYPE_INDIGITS1_WC,
  _NL_CTYPE_INDIGITS2_WC,
  _NL_CTYPE_INDIGITS3_WC,
  _NL_CTYPE_INDIGITS4_WC,
  _NL_CTYPE_INDIGITS5_WC,
  _NL_CTYPE_INDIGITS6_WC,
  _NL_CTYPE_INDIGITS7_WC,
  _NL_CTYPE_INDIGITS8_WC,
  _NL_CTYPE_INDIGITS9_WC,
  _NL_CTYPE_OUTDIGIT0_MB,
  _NL_CTYPE_OUTDIGIT1_MB,
  _NL_CTYPE_OUTDIGIT2_MB,
  _NL_CTYPE_OUTDIGIT3_MB,
  _NL_CTYPE_OUTDIGIT4_MB,
  _NL_CTYPE_OUTDIGIT5_MB,
  _NL_CTYPE_OUTDIGIT6_MB,
  _NL_CTYPE_OUTDIGIT7_MB,
  _NL_CTYPE_OUTDIGIT8_MB,
  _NL_CTYPE_OUTDIGIT9_MB,
  _NL_CTYPE_OUTDIGIT0_WC,
  _NL_CTYPE_OUTDIGIT1_WC,
  _NL_CTYPE_OUTDIGIT2_WC,
  _NL_CTYPE_OUTDIGIT3_WC,
  _NL_CTYPE_OUTDIGIT4_WC,
  _NL_CTYPE_OUTDIGIT5_WC,
  _NL_CTYPE_OUTDIGIT6_WC,
  _NL_CTYPE_OUTDIGIT7_WC,
  _NL_CTYPE_OUTDIGIT8_WC,
  _NL_CTYPE_OUTDIGIT9_WC,
  _NL_CTYPE_TRANSLIT_TAB_SIZE,
  _NL_CTYPE_TRANSLIT_FROM_IDX,
  _NL_CTYPE_TRANSLIT_FROM_TBL,
  _NL_CTYPE_TRANSLIT_TO_IDX,
  _NL_CTYPE_TRANSLIT_TO_TBL,
  _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN,
  _NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
  _NL_CTYPE_TRANSLIT_IGNORE_LEN,
  _NL_CTYPE_TRANSLIT_IGNORE,
  _NL_CTYPE_MAP_TO_NONASCII,
  _NL_CTYPE_EXTRA_MAP_1,
  _NL_CTYPE_EXTRA_MAP_2,
  _NL_CTYPE_EXTRA_MAP_3,
  _NL_CTYPE_EXTRA_MAP_4,
  _NL_CTYPE_EXTRA_MAP_5,
  _NL_CTYPE_EXTRA_MAP_6,
  _NL_CTYPE_EXTRA_MAP_7,
  _NL_CTYPE_EXTRA_MAP_8,
  _NL_CTYPE_EXTRA_MAP_9,
  _NL_CTYPE_EXTRA_MAP_10,
  _NL_CTYPE_EXTRA_MAP_11,
  _NL_CTYPE_EXTRA_MAP_12,
  _NL_CTYPE_EXTRA_MAP_13,
  _NL_CTYPE_EXTRA_MAP_14,
  _NL_NUM_LC_CTYPE,




  __INT_CURR_SYMBOL = (((__LC_MONETARY) << 16) | (0)),



  __CURRENCY_SYMBOL,



  __MON_DECIMAL_POINT,



  __MON_THOUSANDS_SEP,



  __MON_GROUPING,



  __POSITIVE_SIGN,



  __NEGATIVE_SIGN,



  __INT_FRAC_DIGITS,



  __FRAC_DIGITS,



  __P_CS_PRECEDES,



  __P_SEP_BY_SPACE,



  __N_CS_PRECEDES,



  __N_SEP_BY_SPACE,



  __P_SIGN_POSN,



  __N_SIGN_POSN,



  _NL_MONETARY_CRNCYSTR,

  __INT_P_CS_PRECEDES,



  __INT_P_SEP_BY_SPACE,



  __INT_N_CS_PRECEDES,



  __INT_N_SEP_BY_SPACE,



  __INT_P_SIGN_POSN,



  __INT_N_SIGN_POSN,



  _NL_MONETARY_DUO_INT_CURR_SYMBOL,
  _NL_MONETARY_DUO_CURRENCY_SYMBOL,
  _NL_MONETARY_DUO_INT_FRAC_DIGITS,
  _NL_MONETARY_DUO_FRAC_DIGITS,
  _NL_MONETARY_DUO_P_CS_PRECEDES,
  _NL_MONETARY_DUO_P_SEP_BY_SPACE,
  _NL_MONETARY_DUO_N_CS_PRECEDES,
  _NL_MONETARY_DUO_N_SEP_BY_SPACE,
  _NL_MONETARY_DUO_INT_P_CS_PRECEDES,
  _NL_MONETARY_DUO_INT_P_SEP_BY_SPACE,
  _NL_MONETARY_DUO_INT_N_CS_PRECEDES,
  _NL_MONETARY_DUO_INT_N_SEP_BY_SPACE,
  _NL_MONETARY_DUO_P_SIGN_POSN,
  _NL_MONETARY_DUO_N_SIGN_POSN,
  _NL_MONETARY_DUO_INT_P_SIGN_POSN,
  _NL_MONETARY_DUO_INT_N_SIGN_POSN,
  _NL_MONETARY_UNO_VALID_FROM,
  _NL_MONETARY_UNO_VALID_TO,
  _NL_MONETARY_DUO_VALID_FROM,
  _NL_MONETARY_DUO_VALID_TO,
  _NL_MONETARY_CONVERSION_RATE,
  _NL_MONETARY_DECIMAL_POINT_WC,
  _NL_MONETARY_THOUSANDS_SEP_WC,
  _NL_MONETARY_CODESET,
  _NL_NUM_LC_MONETARY,



  __DECIMAL_POINT = (((__LC_NUMERIC) << 16) | (0)),



  RADIXCHAR = __DECIMAL_POINT,

  __THOUSANDS_SEP,



  THOUSEP = __THOUSANDS_SEP,

  __GROUPING,



  _NL_NUMERIC_DECIMAL_POINT_WC,
  _NL_NUMERIC_THOUSANDS_SEP_WC,
  _NL_NUMERIC_CODESET,
  _NL_NUM_LC_NUMERIC,

  __YESEXPR = (((__LC_MESSAGES) << 16) | (0)),

  __NOEXPR,

  __YESSTR,



  __NOSTR,



  _NL_MESSAGES_CODESET,
  _NL_NUM_LC_MESSAGES,

  _NL_PAPER_HEIGHT = (((__LC_PAPER) << 16) | (0)),
  _NL_PAPER_WIDTH,
  _NL_PAPER_CODESET,
  _NL_NUM_LC_PAPER,

  _NL_NAME_NAME_FMT = (((__LC_NAME) << 16) | (0)),
  _NL_NAME_NAME_GEN,
  _NL_NAME_NAME_MR,
  _NL_NAME_NAME_MRS,
  _NL_NAME_NAME_MISS,
  _NL_NAME_NAME_MS,
  _NL_NAME_CODESET,
  _NL_NUM_LC_NAME,

  _NL_ADDRESS_POSTAL_FMT = (((__LC_ADDRESS) << 16) | (0)),
  _NL_ADDRESS_COUNTRY_NAME,
  _NL_ADDRESS_COUNTRY_POST,
  _NL_ADDRESS_COUNTRY_AB2,
  _NL_ADDRESS_COUNTRY_AB3,
  _NL_ADDRESS_COUNTRY_CAR,
  _NL_ADDRESS_COUNTRY_NUM,
  _NL_ADDRESS_COUNTRY_ISBN,
  _NL_ADDRESS_LANG_NAME,
  _NL_ADDRESS_LANG_AB,
  _NL_ADDRESS_LANG_TERM,
  _NL_ADDRESS_LANG_LIB,
  _NL_ADDRESS_CODESET,
  _NL_NUM_LC_ADDRESS,

  _NL_TELEPHONE_TEL_INT_FMT = (((__LC_TELEPHONE) << 16) | (0)),
  _NL_TELEPHONE_TEL_DOM_FMT,
  _NL_TELEPHONE_INT_SELECT,
  _NL_TELEPHONE_INT_PREFIX,
  _NL_TELEPHONE_CODESET,
  _NL_NUM_LC_TELEPHONE,

  _NL_MEASUREMENT_MEASUREMENT = (((__LC_MEASUREMENT) << 16) | (0)),
  _NL_MEASUREMENT_CODESET,
  _NL_NUM_LC_MEASUREMENT,

  _NL_IDENTIFICATION_TITLE = (((__LC_IDENTIFICATION) << 16) | (0)),
  _NL_IDENTIFICATION_SOURCE,
  _NL_IDENTIFICATION_ADDRESS,
  _NL_IDENTIFICATION_CONTACT,
  _NL_IDENTIFICATION_EMAIL,
  _NL_IDENTIFICATION_TEL,
  _NL_IDENTIFICATION_FAX,
  _NL_IDENTIFICATION_LANGUAGE,
  _NL_IDENTIFICATION_TERRITORY,
  _NL_IDENTIFICATION_AUDIENCE,
  _NL_IDENTIFICATION_APPLICATION,
  _NL_IDENTIFICATION_ABBREVIATION,
  _NL_IDENTIFICATION_REVISION,
  _NL_IDENTIFICATION_DATE,
  _NL_IDENTIFICATION_CATEGORY,
  _NL_IDENTIFICATION_CODESET,
  _NL_NUM_LC_IDENTIFICATION,


  _NL_NUM
};
# 576 "/usr/include/langinfo.h" 3 4
extern char *nl_langinfo (nl_item __item) throw ();
# 587 "/usr/include/langinfo.h" 3 4
extern char *nl_langinfo_l (nl_item __item, __locale_t l);


}
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 2 3
# 1 "/usr/include/iconv.h" 1 3 4
# 24 "/usr/include/iconv.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 25 "/usr/include/iconv.h" 2 3 4


extern "C" {


typedef void *iconv_t;







extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);




extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
       size_t *__restrict __inbytesleft,
       char **__restrict __outbuf,
       size_t *__restrict __outbytesleft);





extern int iconv_close (iconv_t __cd);

}
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 2 3
# 1 "/usr/include/libintl.h" 1 3 4
# 35 "/usr/include/libintl.h" 3 4
extern "C" {




extern char *gettext (__const char *__msgid) throw ();



extern char *dgettext (__const char *__domainname, __const char *__msgid)
     throw ();
extern char *__dgettext (__const char *__domainname, __const char *__msgid)
     throw () __attribute__ ((__format_arg__ (2)));



extern char *dcgettext (__const char *__domainname,
   __const char *__msgid, int __category) throw ();
extern char *__dcgettext (__const char *__domainname,
     __const char *__msgid, int __category)
     throw () __attribute__ ((__format_arg__ (2)));




extern char *ngettext (__const char *__msgid1, __const char *__msgid2,
         unsigned long int __n)
     throw () __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));



extern char *dngettext (__const char *__domainname, __const char *__msgid1,
   __const char *__msgid2, unsigned long int __n)
     throw () __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));



extern char *dcngettext (__const char *__domainname, __const char *__msgid1,
    __const char *__msgid2, unsigned long int __n,
    int __category)
     throw () __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));





extern char *textdomain (__const char *__domainname) throw ();



extern char *bindtextdomain (__const char *__domainname,
        __const char *__dirname) throw ();



extern char *bind_textdomain_codeset (__const char *__domainname,
          __const char *__codeset) throw ();
# 120 "/usr/include/libintl.h" 3 4
}
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 2 3






namespace __gnu_cxx
{
  extern "C" __typeof(uselocale) __uselocale;
}


namespace std
{
  typedef __locale_t __c_locale;





  template<typename _Tv>
    int
    __convert_from_v(char* __out, const int __size, const char* __fmt,

       _Tv __v, const __c_locale& __cloc, int __prec)
    {
      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
# 84 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++locale.h" 3
      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);





      __gnu_cxx::__uselocale(__old);




      return __ret;
    }
}
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++io.h" 1 3
# 37 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++io.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr.h" 1 3
# 104 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 3
# 1 "/usr/include/pthread.h" 1 3 4
# 20 "/usr/include/pthread.h" 3 4
# 1 "/usr/include/sched.h" 1 3 4
# 29 "/usr/include/sched.h" 3 4
# 1 "/usr/include/time.h" 1 3 4
# 118 "/usr/include/time.h" 3 4
struct timespec
  {
    __time_t tv_sec;
    long int tv_nsec;
  };
# 30 "/usr/include/sched.h" 2 3 4


# 1 "/usr/include/bits/sched.h" 1 3 4
# 62 "/usr/include/bits/sched.h" 3 4
struct sched_param
  {
    int __sched_priority;
  };

extern "C" {



extern int clone (int (*__fn) (void *__arg), void *__child_stack,
    int __flags, void *__arg) throw ();


}







struct __sched_param
  {
    int __sched_priority;
  };
# 98 "/usr/include/bits/sched.h" 3 4
typedef unsigned long int __cpu_mask;






typedef struct
{
  __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
} cpu_set_t;
# 33 "/usr/include/sched.h" 2 3 4




extern "C" {


extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
     throw ();


extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();


extern int sched_setscheduler (__pid_t __pid, int __policy,
          __const struct sched_param *__param) throw ();


extern int sched_getscheduler (__pid_t __pid) throw ();


extern int sched_yield (void) throw ();


extern int sched_get_priority_max (int __algorithm) throw ();


extern int sched_get_priority_min (int __algorithm) throw ();


extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
# 76 "/usr/include/sched.h" 3 4
extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
         __const cpu_set_t *__cpuset) throw ();


extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
         cpu_set_t *__cpuset) throw ();


}
# 21 "/usr/include/pthread.h" 2 3 4
# 1 "/usr/include/time.h" 1 3 4
# 30 "/usr/include/time.h" 3 4
extern "C" {







# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 39 "/usr/include/time.h" 2 3 4



# 1 "/usr/include/bits/time.h" 1 3 4
# 43 "/usr/include/time.h" 2 3 4
# 58 "/usr/include/time.h" 3 4


typedef __clock_t clock_t;



# 74 "/usr/include/time.h" 3 4


typedef __time_t time_t;



# 92 "/usr/include/time.h" 3 4
typedef __clockid_t clockid_t;
# 104 "/usr/include/time.h" 3 4
typedef __timer_t timer_t;
# 129 "/usr/include/time.h" 3 4


struct tm
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;


  long int tm_gmtoff;
  __const char *tm_zone;




};








struct itimerspec
  {
    struct timespec it_interval;
    struct timespec it_value;
  };


struct sigevent;





typedef __pid_t pid_t;








extern clock_t clock (void) throw ();


extern time_t time (time_t *__timer) throw ();


extern double difftime (time_t __time1, time_t __time0)
     throw () __attribute__ ((__const__));


extern time_t mktime (struct tm *__tp) throw ();





extern size_t strftime (char *__restrict __s, size_t __maxsize,
   __const char *__restrict __format,
   __const struct tm *__restrict __tp) throw ();





extern char *strptime (__const char *__restrict __s,
         __const char *__restrict __fmt, struct tm *__tp)
     throw ();







extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
     __const char *__restrict __format,
     __const struct tm *__restrict __tp,
     __locale_t __loc) throw ();

extern char *strptime_l (__const char *__restrict __s,
    __const char *__restrict __fmt, struct tm *__tp,
    __locale_t __loc) throw ();






extern struct tm *gmtime (__const time_t *__timer) throw ();



extern struct tm *localtime (__const time_t *__timer) throw ();





extern struct tm *gmtime_r (__const time_t *__restrict __timer,
       struct tm *__restrict __tp) throw ();



extern struct tm *localtime_r (__const time_t *__restrict __timer,
          struct tm *__restrict __tp) throw ();





extern char *asctime (__const struct tm *__tp) throw ();


extern char *ctime (__const time_t *__timer) throw ();







extern char *asctime_r (__const struct tm *__restrict __tp,
   char *__restrict __buf) throw ();


extern char *ctime_r (__const time_t *__restrict __timer,
        char *__restrict __buf) throw ();




extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;




extern char *tzname[2];



extern void tzset (void) throw ();



extern int daylight;
extern long int timezone;





extern int stime (__const time_t *__when) throw ();
# 309 "/usr/include/time.h" 3 4
extern time_t timegm (struct tm *__tp) throw ();


extern time_t timelocal (struct tm *__tp) throw ();


extern int dysize (int __year) throw () __attribute__ ((__const__));
# 324 "/usr/include/time.h" 3 4
extern int nanosleep (__const struct timespec *__requested_time,
        struct timespec *__remaining);



extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();


extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();


extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
     throw ();






extern int clock_nanosleep (clockid_t __clock_id, int __flags,
       __const struct timespec *__req,
       struct timespec *__rem);


extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();




extern int timer_create (clockid_t __clock_id,
    struct sigevent *__restrict __evp,
    timer_t *__restrict __timerid) throw ();


extern int timer_delete (timer_t __timerid) throw ();


extern int timer_settime (timer_t __timerid, int __flags,
     __const struct itimerspec *__restrict __value,
     struct itimerspec *__restrict __ovalue) throw ();


extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
     throw ();


extern int timer_getoverrun (timer_t __timerid) throw ();
# 386 "/usr/include/time.h" 3 4
extern int getdate_err;
# 395 "/usr/include/time.h" 3 4
extern struct tm *getdate (__const char *__string);
# 409 "/usr/include/time.h" 3 4
extern int getdate_r (__const char *__restrict __string,
        struct tm *__restrict __resbufp);


}
# 22 "/usr/include/pthread.h" 2 3 4


# 1 "/usr/include/signal.h" 1 3 4
# 31 "/usr/include/signal.h" 3 4
extern "C" {

# 1 "/usr/include/bits/sigset.h" 1 3 4
# 23 "/usr/include/bits/sigset.h" 3 4
typedef int __sig_atomic_t;




typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
# 34 "/usr/include/signal.h" 2 3 4
# 50 "/usr/include/signal.h" 3 4
typedef __sigset_t sigset_t;
# 400 "/usr/include/signal.h" 3 4
}
# 25 "/usr/include/pthread.h" 2 3 4
# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/bits/sched.h" 1 3 4
# 24 "/usr/include/bits/pthreadtypes.h" 2 3 4


struct _pthread_fastlock
{
  long int __status;
  int __spinlock;

};



typedef struct _pthread_descr_struct *_pthread_descr;





typedef struct __pthread_attr_s
{
  int __detachstate;
  int __schedpolicy;
  struct __sched_param __schedparam;
  int __inheritsched;
  int __scope;
  size_t __guardsize;
  int __stackaddr_set;
  void *__stackaddr;
  size_t __stacksize;
} pthread_attr_t;





__extension__ typedef long long __pthread_cond_align_t;




typedef struct
{
  struct _pthread_fastlock __c_lock;
  _pthread_descr __c_waiting;
  char __padding[48 - sizeof (struct _pthread_fastlock)
   - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)];
  __pthread_cond_align_t __align;
} pthread_cond_t;



typedef struct
{
  int __dummy;
} pthread_condattr_t;


typedef unsigned int pthread_key_t;





typedef struct
{
  int __m_reserved;
  int __m_count;
  _pthread_descr __m_owner;
  int __m_kind;
  struct _pthread_fastlock __m_lock;
} pthread_mutex_t;



typedef struct
{
  int __mutexkind;
} pthread_mutexattr_t;



typedef int pthread_once_t;




typedef struct _pthread_rwlock_t
{
  struct _pthread_fastlock __rw_lock;
  int __rw_readers;
  _pthread_descr __rw_writer;
  _pthread_descr __rw_read_waiting;
  _pthread_descr __rw_write_waiting;
  int __rw_kind;
  int __rw_pshared;
} pthread_rwlock_t;



typedef struct
{
  int __lockkind;
  int __pshared;
} pthread_rwlockattr_t;




typedef volatile int pthread_spinlock_t;


typedef struct {
  struct _pthread_fastlock __ba_lock;
  int __ba_required;
  int __ba_present;
  _pthread_descr __ba_waiting;
} pthread_barrier_t;


typedef struct {
  int __pshared;
} pthread_barrierattr_t;





typedef unsigned long int pthread_t;
# 26 "/usr/include/pthread.h" 2 3 4
# 1 "/usr/include/bits/initspin.h" 1 3 4
# 27 "/usr/include/pthread.h" 2 3 4


extern "C" {
# 59 "/usr/include/pthread.h" 3 4
enum
{
  PTHREAD_CREATE_JOINABLE,

  PTHREAD_CREATE_DETACHED

};

enum
{
  PTHREAD_INHERIT_SCHED,

  PTHREAD_EXPLICIT_SCHED

};

enum
{
  PTHREAD_SCOPE_SYSTEM,

  PTHREAD_SCOPE_PROCESS

};

enum
{
  PTHREAD_MUTEX_TIMED_NP,
  PTHREAD_MUTEX_RECURSIVE_NP,
  PTHREAD_MUTEX_ERRORCHECK_NP,
  PTHREAD_MUTEX_ADAPTIVE_NP

  ,
  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL



  , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP

};

enum
{
  PTHREAD_PROCESS_PRIVATE,

  PTHREAD_PROCESS_SHARED

};


enum
{
  PTHREAD_RWLOCK_PREFER_READER_NP,
  PTHREAD_RWLOCK_PREFER_WRITER_NP,
  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP
};
# 131 "/usr/include/pthread.h" 3 4
struct _pthread_cleanup_buffer
{
  void (*__routine) (void *);
  void *__arg;
  int __canceltype;
  struct _pthread_cleanup_buffer *__prev;
};



enum
{
  PTHREAD_CANCEL_ENABLE,

  PTHREAD_CANCEL_DISABLE

};
enum
{
  PTHREAD_CANCEL_DEFERRED,

  PTHREAD_CANCEL_ASYNCHRONOUS

};
# 163 "/usr/include/pthread.h" 3 4
extern int pthread_create (pthread_t *__restrict __threadp,
      __const pthread_attr_t *__restrict __attr,
      void *(*__start_routine) (void *),
      void *__restrict __arg) throw ();


extern pthread_t pthread_self (void) throw ();


extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();


extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));




extern int pthread_join (pthread_t __th, void **__thread_return);





extern int pthread_detach (pthread_t __th) throw ();







extern int pthread_attr_init (pthread_attr_t *__attr) throw ();


extern int pthread_attr_destroy (pthread_attr_t *__attr) throw ();


extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
     int __detachstate) throw ();


extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
     int *__detachstate) throw ();


extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
           __const struct sched_param *__restrict
           __param) throw ();


extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
           __attr,
           struct sched_param *__restrict __param)
     throw ();


extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
     throw ();


extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
     __attr, int *__restrict __policy)
     throw ();


extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
      int __inherit) throw ();


extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
      __attr, int *__restrict __inherit)
     throw ();


extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
     throw ();


extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
      int *__restrict __scope) throw ();



extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
          size_t __guardsize) throw ();


extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
          __attr, size_t *__restrict __guardsize)
     throw ();






extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
          void *__stackaddr) throw ();


extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
          __attr, void **__restrict __stackaddr)
     throw ();





extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
      size_t __stacksize) throw ();


extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
      void **__restrict __stackaddr,
      size_t *__restrict __stacksize) throw ();





extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
          size_t __stacksize) throw ();


extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
          __attr, size_t *__restrict __stacksize)
     throw ();





extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) throw ();






extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
      __const struct sched_param *__param)
     throw ();


extern int pthread_getschedparam (pthread_t __target_thread,
      int *__restrict __policy,
      struct sched_param *__restrict __param)
     throw ();



extern int pthread_getconcurrency (void) throw ();


extern int pthread_setconcurrency (int __level) throw ();







extern int pthread_yield (void) throw ();






extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
          __const pthread_mutexattr_t *__restrict
          __mutex_attr) throw ();


extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw ();


extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw ();


extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw ();



extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
        __const struct timespec *__restrict
        __abstime) throw ();



extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw ();






extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw ();


extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw ();


extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
      __restrict __attr,
      int *__restrict __pshared) throw ();


extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
      int __pshared) throw ();





extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
     throw ();


extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
          __attr, int *__restrict __kind) throw ();







extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
         __const pthread_condattr_t *__restrict
         __cond_attr) throw ();


extern int pthread_cond_destroy (pthread_cond_t *__cond) throw ();


extern int pthread_cond_signal (pthread_cond_t *__cond) throw ();


extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw ();



extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
         pthread_mutex_t *__restrict __mutex);





extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
       pthread_mutex_t *__restrict __mutex,
       __const struct timespec *__restrict
       __abstime);




extern int pthread_condattr_init (pthread_condattr_t *__attr) throw ();


extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw ();


extern int pthread_condattr_getpshared (__const pthread_condattr_t *
     __restrict __attr,
     int *__restrict __pshared) throw ();


extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
     int __pshared) throw ();







extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
    __const pthread_rwlockattr_t *__restrict
    __attr) throw ();


extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw ();


extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw ();


extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw ();



extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
           __const struct timespec *__restrict
           __abstime) throw ();



extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw ();


extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw ();



extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
           __const struct timespec *__restrict
           __abstime) throw ();



extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw ();





extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw ();


extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw ();


extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
       __restrict __attr,
       int *__restrict __pshared) throw ();


extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
       int __pshared) throw ();


extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr,
       int *__pref) throw ();


extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
       int __pref) throw ();
# 510 "/usr/include/pthread.h" 3 4
extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
     throw ();


extern int pthread_spin_destroy (pthread_spinlock_t *__lock) throw ();


extern int pthread_spin_lock (pthread_spinlock_t *__lock) throw ();


extern int pthread_spin_trylock (pthread_spinlock_t *__lock) throw ();


extern int pthread_spin_unlock (pthread_spinlock_t *__lock) throw ();




extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
     __const pthread_barrierattr_t *__restrict
     __attr, unsigned int __count) throw ();

extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) throw ();

extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) throw ();

extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) throw ();

extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
        __restrict __attr,
        int *__restrict __pshared) throw ();

extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
        int __pshared) throw ();

extern int pthread_barrier_wait (pthread_barrier_t *__barrier) throw ();
# 557 "/usr/include/pthread.h" 3 4
extern int pthread_key_create (pthread_key_t *__key,
          void (*__destr_function) (void *)) throw ();


extern int pthread_key_delete (pthread_key_t __key) throw ();


extern int pthread_setspecific (pthread_key_t __key,
    __const void *__pointer) throw ();


extern void *pthread_getspecific (pthread_key_t __key) throw ();
# 580 "/usr/include/pthread.h" 3 4
extern int pthread_once (pthread_once_t *__once_control,
    void (*__init_routine) (void));






extern int pthread_setcancelstate (int __state, int *__oldstate);



extern int pthread_setcanceltype (int __type, int *__oldtype);


extern int pthread_cancel (pthread_t __cancelthread);




extern void pthread_testcancel (void);
# 614 "/usr/include/pthread.h" 3 4
extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
       void (*__routine) (void *),
       void *__arg) throw ();







extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
      int __execute) throw ();
# 635 "/usr/include/pthread.h" 3 4
extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
      void (*__routine) (void *),
      void *__arg) throw ();
# 646 "/usr/include/pthread.h" 3 4
extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
       int __execute) throw ();





extern int pthread_getcpuclockid (pthread_t __thread_id,
      __clockid_t *__clock_id) throw ();




# 1 "/usr/include/bits/sigthread.h" 1 3 4
# 31 "/usr/include/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
       __const __sigset_t *__restrict __newmask,
       __sigset_t *__restrict __oldmask)throw ();


extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
# 660 "/usr/include/pthread.h" 2 3 4
# 675 "/usr/include/pthread.h" 3 4
extern int pthread_atfork (void (*__prepare) (void),
      void (*__parent) (void),
      void (*__child) (void)) throw ();




extern void pthread_kill_other_threads_np (void) throw ();

}
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 2 3
# 1 "/usr/include/unistd.h" 1 3 4
# 28 "/usr/include/unistd.h" 3 4
extern "C" {
# 171 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/bits/posix_opt.h" 1 3 4
# 172 "/usr/include/unistd.h" 2 3 4



# 1 "/usr/include/bits/environments.h" 1 3 4
# 176 "/usr/include/unistd.h" 2 3 4
# 189 "/usr/include/unistd.h" 3 4
typedef __ssize_t ssize_t;





# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 196 "/usr/include/unistd.h" 2 3 4





typedef __gid_t gid_t;




typedef __uid_t uid_t;





typedef __off_t off_t;






typedef __off64_t off64_t;




typedef __useconds_t useconds_t;
# 243 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 256 "/usr/include/unistd.h" 3 4
extern int access (__const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1)));




extern int euidaccess (__const char *__name, int __type)
     throw () __attribute__ ((__nonnull__ (1)));
# 287 "/usr/include/unistd.h" 3 4
extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
# 298 "/usr/include/unistd.h" 3 4
extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) throw ();






extern int close (int __fd);






extern ssize_t read (int __fd, void *__buf, size_t __nbytes);





extern ssize_t write (int __fd, __const void *__buf, size_t __n);
# 328 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
        __off_t __offset);






extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
         __off_t __offset);
# 356 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
   __off64_t __offset);


extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
    __off64_t __offset);







extern int pipe (int __pipedes[2]) throw ();
# 378 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) throw ();
# 390 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);






extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
     throw ();






extern int usleep (__useconds_t __useconds);
# 414 "/usr/include/unistd.h" 3 4
extern int pause (void);



extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
     throw () __attribute__ ((__nonnull__ (1)));



extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw ();




extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
     throw () __attribute__ ((__nonnull__ (1)));




extern int chdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1)));



extern int fchdir (int __fd) throw ();
# 448 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) throw ();





extern char *get_current_dir_name (void) throw ();






extern char *getwd (char *__buf) throw () __attribute__ ((__nonnull__ (1)));




extern int dup (int __fd) throw ();


extern int dup2 (int __fd, int __fd2) throw ();


extern char **__environ;

extern char **environ;





extern int execve (__const char *__path, char *__const __argv[],
     char *__const __envp[]) throw () __attribute__ ((__nonnull__ (1)));




extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
     throw ();




extern int execv (__const char *__path, char *__const __argv[])
     throw () __attribute__ ((__nonnull__ (1)));



extern int execle (__const char *__path, __const char *__arg, ...)
     throw () __attribute__ ((__nonnull__ (1)));



extern int execl (__const char *__path, __const char *__arg, ...)
     throw () __attribute__ ((__nonnull__ (1)));



extern int execvp (__const char *__file, char *__const __argv[])
     throw () __attribute__ ((__nonnull__ (1)));




extern int execlp (__const char *__file, __const char *__arg, ...)
     throw () __attribute__ ((__nonnull__ (1)));




extern int nice (int __inc) throw ();




extern void _exit (int __status) __attribute__ ((__noreturn__));





# 1 "/usr/include/bits/confname.h" 1 3 4
# 26 "/usr/include/bits/confname.h" 3 4
enum
  {
    _PC_LINK_MAX,

    _PC_MAX_CANON,

    _PC_MAX_INPUT,

    _PC_NAME_MAX,

    _PC_PATH_MAX,

    _PC_PIPE_BUF,

    _PC_CHOWN_RESTRICTED,

    _PC_NO_TRUNC,

    _PC_VDISABLE,

    _PC_SYNC_IO,

    _PC_ASYNC_IO,

    _PC_PRIO_IO,

    _PC_SOCK_MAXBUF,

    _PC_FILESIZEBITS,

    _PC_REC_INCR_XFER_SIZE,

    _PC_REC_MAX_XFER_SIZE,

    _PC_REC_MIN_XFER_SIZE,

    _PC_REC_XFER_ALIGN,

    _PC_ALLOC_SIZE_MIN,

    _PC_SYMLINK_MAX,

    _PC_2_SYMLINKS

  };


enum
  {
    _SC_ARG_MAX,

    _SC_CHILD_MAX,

    _SC_CLK_TCK,

    _SC_NGROUPS_MAX,

    _SC_OPEN_MAX,

    _SC_STREAM_MAX,

    _SC_TZNAME_MAX,

    _SC_JOB_CONTROL,

    _SC_SAVED_IDS,

    _SC_REALTIME_SIGNALS,

    _SC_PRIORITY_SCHEDULING,

    _SC_TIMERS,

    _SC_ASYNCHRONOUS_IO,

    _SC_PRIORITIZED_IO,

    _SC_SYNCHRONIZED_IO,

    _SC_FSYNC,

    _SC_MAPPED_FILES,

    _SC_MEMLOCK,

    _SC_MEMLOCK_RANGE,

    _SC_MEMORY_PROTECTION,

    _SC_MESSAGE_PASSING,

    _SC_SEMAPHORES,

    _SC_SHARED_MEMORY_OBJECTS,

    _SC_AIO_LISTIO_MAX,

    _SC_AIO_MAX,

    _SC_AIO_PRIO_DELTA_MAX,

    _SC_DELAYTIMER_MAX,

    _SC_MQ_OPEN_MAX,

    _SC_MQ_PRIO_MAX,

    _SC_VERSION,

    _SC_PAGESIZE,


    _SC_RTSIG_MAX,

    _SC_SEM_NSEMS_MAX,

    _SC_SEM_VALUE_MAX,

    _SC_SIGQUEUE_MAX,

    _SC_TIMER_MAX,




    _SC_BC_BASE_MAX,

    _SC_BC_DIM_MAX,

    _SC_BC_SCALE_MAX,

    _SC_BC_STRING_MAX,

    _SC_COLL_WEIGHTS_MAX,

    _SC_EQUIV_CLASS_MAX,

    _SC_EXPR_NEST_MAX,

    _SC_LINE_MAX,

    _SC_RE_DUP_MAX,

    _SC_CHARCLASS_NAME_MAX,


    _SC_2_VERSION,

    _SC_2_C_BIND,

    _SC_2_C_DEV,

    _SC_2_FORT_DEV,

    _SC_2_FORT_RUN,

    _SC_2_SW_DEV,

    _SC_2_LOCALEDEF,


    _SC_PII,

    _SC_PII_XTI,

    _SC_PII_SOCKET,

    _SC_PII_INTERNET,

    _SC_PII_OSI,

    _SC_POLL,

    _SC_SELECT,

    _SC_UIO_MAXIOV,

    _SC_IOV_MAX = _SC_UIO_MAXIOV,

    _SC_PII_INTERNET_STREAM,

    _SC_PII_INTERNET_DGRAM,

    _SC_PII_OSI_COTS,

    _SC_PII_OSI_CLTS,

    _SC_PII_OSI_M,

    _SC_T_IOV_MAX,



    _SC_THREADS,

    _SC_THREAD_SAFE_FUNCTIONS,

    _SC_GETGR_R_SIZE_MAX,

    _SC_GETPW_R_SIZE_MAX,

    _SC_LOGIN_NAME_MAX,

    _SC_TTY_NAME_MAX,

    _SC_THREAD_DESTRUCTOR_ITERATIONS,

    _SC_THREAD_KEYS_MAX,

    _SC_THREAD_STACK_MIN,

    _SC_THREAD_THREADS_MAX,

    _SC_THREAD_ATTR_STACKADDR,

    _SC_THREAD_ATTR_STACKSIZE,

    _SC_THREAD_PRIORITY_SCHEDULING,

    _SC_THREAD_PRIO_INHERIT,

    _SC_THREAD_PRIO_PROTECT,

    _SC_THREAD_PROCESS_SHARED,


    _SC_NPROCESSORS_CONF,

    _SC_NPROCESSORS_ONLN,

    _SC_PHYS_PAGES,

    _SC_AVPHYS_PAGES,

    _SC_ATEXIT_MAX,

    _SC_PASS_MAX,


    _SC_XOPEN_VERSION,

    _SC_XOPEN_XCU_VERSION,

    _SC_XOPEN_UNIX,

    _SC_XOPEN_CRYPT,

    _SC_XOPEN_ENH_I18N,

    _SC_XOPEN_SHM,


    _SC_2_CHAR_TERM,

    _SC_2_C_VERSION,

    _SC_2_UPE,


    _SC_XOPEN_XPG2,

    _SC_XOPEN_XPG3,

    _SC_XOPEN_XPG4,


    _SC_CHAR_BIT,

    _SC_CHAR_MAX,

    _SC_CHAR_MIN,

    _SC_INT_MAX,

    _SC_INT_MIN,

    _SC_LONG_BIT,

    _SC_WORD_BIT,

    _SC_MB_LEN_MAX,

    _SC_NZERO,

    _SC_SSIZE_MAX,

    _SC_SCHAR_MAX,

    _SC_SCHAR_MIN,

    _SC_SHRT_MAX,

    _SC_SHRT_MIN,

    _SC_UCHAR_MAX,

    _SC_UINT_MAX,

    _SC_ULONG_MAX,

    _SC_USHRT_MAX,


    _SC_NL_ARGMAX,

    _SC_NL_LANGMAX,

    _SC_NL_MSGMAX,

    _SC_NL_NMAX,

    _SC_NL_SETMAX,

    _SC_NL_TEXTMAX,


    _SC_XBS5_ILP32_OFF32,

    _SC_XBS5_ILP32_OFFBIG,

    _SC_XBS5_LP64_OFF64,

    _SC_XBS5_LPBIG_OFFBIG,


    _SC_XOPEN_LEGACY,

    _SC_XOPEN_REALTIME,

    _SC_XOPEN_REALTIME_THREADS,


    _SC_ADVISORY_INFO,

    _SC_BARRIERS,

    _SC_BASE,

    _SC_C_LANG_SUPPORT,

    _SC_C_LANG_SUPPORT_R,

    _SC_CLOCK_SELECTION,

    _SC_CPUTIME,

    _SC_THREAD_CPUTIME,

    _SC_DEVICE_IO,

    _SC_DEVICE_SPECIFIC,

    _SC_DEVICE_SPECIFIC_R,

    _SC_FD_MGMT,

    _SC_FIFO,

    _SC_PIPE,

    _SC_FILE_ATTRIBUTES,

    _SC_FILE_LOCKING,

    _SC_FILE_SYSTEM,

    _SC_MONOTONIC_CLOCK,

    _SC_MULTI_PROCESS,

    _SC_SINGLE_PROCESS,

    _SC_NETWORKING,

    _SC_READER_WRITER_LOCKS,

    _SC_SPIN_LOCKS,

    _SC_REGEXP,

    _SC_REGEX_VERSION,

    _SC_SHELL,

    _SC_SIGNALS,

    _SC_SPAWN,

    _SC_SPORADIC_SERVER,

    _SC_THREAD_SPORADIC_SERVER,

    _SC_SYSTEM_DATABASE,

    _SC_SYSTEM_DATABASE_R,

    _SC_TIMEOUTS,

    _SC_TYPED_MEMORY_OBJECTS,

    _SC_USER_GROUPS,

    _SC_USER_GROUPS_R,

    _SC_2_PBS,

    _SC_2_PBS_ACCOUNTING,

    _SC_2_PBS_LOCATE,

    _SC_2_PBS_MESSAGE,

    _SC_2_PBS_TRACK,

    _SC_SYMLOOP_MAX,

    _SC_STREAMS,

    _SC_2_PBS_CHECKPOINT,


    _SC_V6_ILP32_OFF32,

    _SC_V6_ILP32_OFFBIG,

    _SC_V6_LP64_OFF64,

    _SC_V6_LPBIG_OFFBIG,


    _SC_HOST_NAME_MAX,

    _SC_TRACE,

    _SC_TRACE_EVENT_FILTER,

    _SC_TRACE_INHERIT,

    _SC_TRACE_LOG,


    _SC_LEVEL1_ICACHE_SIZE,

    _SC_LEVEL1_ICACHE_ASSOC,

    _SC_LEVEL1_ICACHE_LINESIZE,

    _SC_LEVEL1_DCACHE_SIZE,

    _SC_LEVEL1_DCACHE_ASSOC,

    _SC_LEVEL1_DCACHE_LINESIZE,

    _SC_LEVEL2_CACHE_SIZE,

    _SC_LEVEL2_CACHE_ASSOC,

    _SC_LEVEL2_CACHE_LINESIZE,

    _SC_LEVEL3_CACHE_SIZE,

    _SC_LEVEL3_CACHE_ASSOC,

    _SC_LEVEL3_CACHE_LINESIZE,

    _SC_LEVEL4_CACHE_SIZE,

    _SC_LEVEL4_CACHE_ASSOC,

    _SC_LEVEL4_CACHE_LINESIZE,



    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,

    _SC_RAW_SOCKETS

  };


enum
  {
    _CS_PATH,


    _CS_V6_WIDTH_RESTRICTED_ENVS,


    _CS_GNU_LIBC_VERSION,

    _CS_GNU_LIBPTHREAD_VERSION,


    _CS_LFS_CFLAGS = 1000,

    _CS_LFS_LDFLAGS,

    _CS_LFS_LIBS,

    _CS_LFS_LINTFLAGS,

    _CS_LFS64_CFLAGS,

    _CS_LFS64_LDFLAGS,

    _CS_LFS64_LIBS,

    _CS_LFS64_LINTFLAGS,


    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,

    _CS_XBS5_ILP32_OFF32_LDFLAGS,

    _CS_XBS5_ILP32_OFF32_LIBS,

    _CS_XBS5_ILP32_OFF32_LINTFLAGS,

    _CS_XBS5_ILP32_OFFBIG_CFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,

    _CS_XBS5_ILP32_OFFBIG_LIBS,

    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,

    _CS_XBS5_LP64_OFF64_CFLAGS,

    _CS_XBS5_LP64_OFF64_LDFLAGS,

    _CS_XBS5_LP64_OFF64_LIBS,

    _CS_XBS5_LP64_OFF64_LINTFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,

    _CS_XBS5_LPBIG_OFFBIG_LIBS,

    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,


    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFF32_LIBS,

    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,

    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,

    _CS_POSIX_V6_LP64_OFF64_CFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,

    _CS_POSIX_V6_LP64_OFF64_LIBS,

    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,

    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS

  };
# 531 "/usr/include/unistd.h" 2 3 4


extern long int pathconf (__const char *__path, int __name)
     throw () __attribute__ ((__nonnull__ (1)));


extern long int fpathconf (int __fd, int __name) throw ();


extern long int sysconf (int __name) throw () __attribute__ ((__const__));



extern size_t confstr (int __name, char *__buf, size_t __len) throw ();




extern __pid_t getpid (void) throw ();


extern __pid_t getppid (void) throw ();




extern __pid_t getpgrp (void) throw ();
# 567 "/usr/include/unistd.h" 3 4
extern __pid_t __getpgid (__pid_t __pid) throw ();

extern __pid_t getpgid (__pid_t __pid) throw ();






extern int setpgid (__pid_t __pid, __pid_t __pgid) throw ();
# 593 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) throw ();
# 610 "/usr/include/unistd.h" 3 4
extern __pid_t setsid (void) throw ();



extern __pid_t getsid (__pid_t __pid) throw ();



extern __uid_t getuid (void) throw ();


extern __uid_t geteuid (void) throw ();


extern __gid_t getgid (void) throw ();


extern __gid_t getegid (void) throw ();




extern int getgroups (int __size, __gid_t __list[]) throw ();



extern int group_member (__gid_t __gid) throw ();






extern int setuid (__uid_t __uid) throw ();




extern int setreuid (__uid_t __ruid, __uid_t __euid) throw ();




extern int seteuid (__uid_t __uid) throw ();






extern int setgid (__gid_t __gid) throw ();




extern int setregid (__gid_t __rgid, __gid_t __egid) throw ();




extern int setegid (__gid_t __gid) throw ();





extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid);



extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid);



extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid);



extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid);






extern __pid_t fork (void) throw ();






extern __pid_t vfork (void) throw ();





extern char *ttyname (int __fd) throw ();



extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
     throw () __attribute__ ((__nonnull__ (2)));



extern int isatty (int __fd) throw ();





extern int ttyslot (void) throw ();




extern int link (__const char *__from, __const char *__to)
     throw () __attribute__ ((__nonnull__ (1, 2)));



extern int symlink (__const char *__from, __const char *__to)
     throw () __attribute__ ((__nonnull__ (1, 2)));




extern int readlink (__const char *__restrict __path, char *__restrict __buf,
       size_t __len) throw () __attribute__ ((__nonnull__ (1, 2)));



extern int unlink (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));


extern int rmdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1)));



extern __pid_t tcgetpgrp (int __fd) throw ();


extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw ();






extern char *getlogin (void);







extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));




extern int setlogin (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
# 783 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/getopt.h" 1 3 4
# 50 "/usr/include/getopt.h" 3 4
extern "C" {
# 59 "/usr/include/getopt.h" 3 4
extern char *optarg;
# 73 "/usr/include/getopt.h" 3 4
extern int optind;




extern int opterr;



extern int optopt;
# 152 "/usr/include/getopt.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
       throw ();
# 171 "/usr/include/getopt.h" 3 4
}
# 784 "/usr/include/unistd.h" 2 3 4







extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1)));






extern int sethostname (__const char *__name, size_t __len)
     throw () __attribute__ ((__nonnull__ (1)));



extern int sethostid (long int __id) throw ();





extern int getdomainname (char *__name, size_t __len)
     throw () __attribute__ ((__nonnull__ (1)));
extern int setdomainname (__const char *__name, size_t __len)
     throw () __attribute__ ((__nonnull__ (1)));





extern int vhangup (void) throw ();


extern int revoke (__const char *__file) throw () __attribute__ ((__nonnull__ (1)));







extern int profil (unsigned short int *__sample_buffer, size_t __size,
     size_t __offset, unsigned int __scale)
     throw () __attribute__ ((__nonnull__ (1)));





extern int acct (__const char *__name) throw ();



extern char *getusershell (void) throw ();
extern void endusershell (void) throw ();
extern void setusershell (void) throw ();





extern int daemon (int __nochdir, int __noclose) throw ();






extern int chroot (__const char *__path) throw () __attribute__ ((__nonnull__ (1)));



extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1)));
# 869 "/usr/include/unistd.h" 3 4
extern int fsync (int __fd);






extern long int gethostid (void);


extern void sync (void) throw ();




extern int getpagesize (void) throw () __attribute__ ((__const__));




extern int getdtablesize (void) throw ();




extern int truncate (__const char *__file, __off_t __length)
     throw () __attribute__ ((__nonnull__ (1)));
# 906 "/usr/include/unistd.h" 3 4
extern int truncate64 (__const char *__file, __off64_t __length)
     throw () __attribute__ ((__nonnull__ (1)));
# 916 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off_t __length) throw ();
# 926 "/usr/include/unistd.h" 3 4
extern int ftruncate64 (int __fd, __off64_t __length) throw ();
# 936 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) throw ();





extern void *sbrk (intptr_t __delta) throw ();
# 957 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) throw ();
# 980 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off_t __len);
# 990 "/usr/include/unistd.h" 3 4
extern int lockf64 (int __fd, int __cmd, __off64_t __len);
# 1011 "/usr/include/unistd.h" 3 4
extern int fdatasync (int __fildes) throw ();







extern char *crypt (__const char *__key, __const char *__salt)
     throw () __attribute__ ((__nonnull__ (1, 2)));



extern void encrypt (char *__block, int __edflag) throw () __attribute__ ((__nonnull__ (1)));






extern void swab (__const void *__restrict __from, void *__restrict __to,
    ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));







extern char *ctermid (char *__s) throw ();


}
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 2 3

typedef pthread_key_t __gthread_key_t;
typedef pthread_once_t __gthread_once_t;
typedef pthread_mutex_t __gthread_mutex_t;
typedef pthread_mutex_t __gthread_recursive_mutex_t;
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 3
extern __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
extern __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
extern __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
extern __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
extern __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
extern __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));

extern __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
extern __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
extern __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
extern __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
extern __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
extern __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));

extern __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
# 200 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 3
static inline int
__gthread_active_p (void)
{
  static void *const __gthread_active_ptr = (void *) &__gthrw_pthread_create;
  return __gthread_active_ptr != 0;
}
# 562 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 3
static inline int
__gthread_once (__gthread_once_t *once, void (*func) (void))
{
  if (__gthread_active_p ())
    return __gthrw_pthread_once (once, func);
  else
    return -1;
}

static inline int
__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
  return __gthrw_pthread_key_create (key, dtor);
}

static inline int
__gthread_key_delete (__gthread_key_t key)
{
  return __gthrw_pthread_key_delete (key);
}

static inline void *
__gthread_getspecific (__gthread_key_t key)
{
  return __gthrw_pthread_getspecific (key);
}

static inline int
__gthread_setspecific (__gthread_key_t key, const void *ptr)
{
  return __gthrw_pthread_setspecific (key, ptr);
}

static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
  if (__gthread_active_p ())
    return __gthrw_pthread_mutex_lock (mutex);
  else
    return 0;
}

static inline int
__gthread_mutex_trylock (__gthread_mutex_t *mutex)
{
  if (__gthread_active_p ())
    return __gthrw_pthread_mutex_trylock (mutex);
  else
    return 0;
}

static inline int
__gthread_mutex_unlock (__gthread_mutex_t *mutex)
{
  if (__gthread_active_p ())
    return __gthrw_pthread_mutex_unlock (mutex);
  else
    return 0;
}
# 643 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr-default.h" 3
static inline int
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
{
  return __gthread_mutex_lock (mutex);
}

static inline int
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
{
  return __gthread_mutex_trylock (mutex);
}

static inline int
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
{
  return __gthread_mutex_unlock (mutex);
}
# 105 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/gthr.h" 2 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++io.h" 2 3

namespace std
{
  typedef __gthread_mutex_t __c_lock;


  typedef FILE __c_file;



  struct __ios_flags
  {
    typedef short __int_type;

    static const __int_type _S_boolalpha = 0x0001;
    static const __int_type _S_dec = 0x0002;
    static const __int_type _S_fixed = 0x0004;
    static const __int_type _S_hex = 0x0008;
    static const __int_type _S_internal = 0x0010;
    static const __int_type _S_left = 0x0020;
    static const __int_type _S_oct = 0x0040;
    static const __int_type _S_right = 0x0080;
    static const __int_type _S_scientific = 0x0100;
    static const __int_type _S_showbase = 0x0200;
    static const __int_type _S_showpoint = 0x0400;
    static const __int_type _S_showpos = 0x0800;
    static const __int_type _S_skipws = 0x1000;
    static const __int_type _S_unitbuf = 0x2000;
    static const __int_type _S_uppercase = 0x4000;
    static const __int_type _S_adjustfield = 0x0020 | 0x0080 | 0x0010;
    static const __int_type _S_basefield = 0x0002 | 0x0040 | 0x0008;
    static const __int_type _S_floatfield = 0x0100 | 0x0004;


    static const __int_type _S_badbit = 0x01;
    static const __int_type _S_eofbit = 0x02;
    static const __int_type _S_failbit = 0x04;


    static const __int_type _S_app = 0x01;
    static const __int_type _S_ate = 0x02;
    static const __int_type _S_bin = 0x04;
    static const __int_type _S_in = 0x08;
    static const __int_type _S_out = 0x10;
    static const __int_type _S_trunc = 0x20;
  };
}
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cctype" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cctype" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cctype" 3


# 1 "/usr/include/ctype.h" 1 3 4
# 30 "/usr/include/ctype.h" 3 4
extern "C" {
# 41 "/usr/include/ctype.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 37 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/endian.h" 1 3 4
# 38 "/usr/include/endian.h" 2 3 4
# 42 "/usr/include/ctype.h" 2 3 4






enum
{
  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 81 "/usr/include/ctype.h" 3 4
extern __const unsigned short int **__ctype_b_loc (void)
     __attribute__ ((__const));
extern __const __int32_t **__ctype_tolower_loc (void)
     __attribute__ ((__const));
extern __const __int32_t **__ctype_toupper_loc (void)
     __attribute__ ((__const));
# 96 "/usr/include/ctype.h" 3 4






extern int isalnum (int) throw ();
extern int isalpha (int) throw ();
extern int iscntrl (int) throw ();
extern int isdigit (int) throw ();
extern int islower (int) throw ();
extern int isgraph (int) throw ();
extern int isprint (int) throw ();
extern int ispunct (int) throw ();
extern int isspace (int) throw ();
extern int isupper (int) throw ();
extern int isxdigit (int) throw ();



extern int tolower (int __c) throw ();


extern int toupper (int __c) throw ();








extern int isblank (int) throw ();






extern int isctype (int __c, int __mask) throw ();






extern int isascii (int __c) throw ();



extern int toascii (int __c) throw ();



extern int _toupper (int) throw ();
extern int _tolower (int) throw ();
# 247 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, __locale_t) throw ();
extern int isalpha_l (int, __locale_t) throw ();
extern int iscntrl_l (int, __locale_t) throw ();
extern int isdigit_l (int, __locale_t) throw ();
extern int islower_l (int, __locale_t) throw ();
extern int isgraph_l (int, __locale_t) throw ();
extern int isprint_l (int, __locale_t) throw ();
extern int ispunct_l (int, __locale_t) throw ();
extern int isspace_l (int, __locale_t) throw ();
extern int isupper_l (int, __locale_t) throw ();
extern int isxdigit_l (int, __locale_t) throw ();

extern int isblank_l (int, __locale_t) throw ();



extern int __tolower_l (int __c, __locale_t __l) throw ();
extern int tolower_l (int __c, __locale_t __l) throw ();


extern int __toupper_l (int __c, __locale_t __l) throw ();
extern int toupper_l (int __c, __locale_t __l) throw ();
# 323 "/usr/include/ctype.h" 3 4
}
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cctype" 2 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cctype" 3
namespace std
{
  using ::isalnum;
  using ::isalpha;
  using ::iscntrl;
  using ::isdigit;
  using ::isgraph;
  using ::islower;
  using ::isprint;
  using ::ispunct;
  using ::isspace;
  using ::isupper;
  using ::isxdigit;
  using ::tolower;
  using ::toupper;
}
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stringfwd.h" 1 3
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stringfwd.h" 3
       
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stringfwd.h" 3



namespace std
{
  template<typename _Alloc>
    class allocator;

  template<class _CharT>
    struct char_traits;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
           typename _Alloc = allocator<_CharT> >
    class basic_string;

  template<> struct char_traits<char>;

  typedef basic_string<char> string;


  template<> struct char_traits<wchar_t>;

  typedef basic_string<wchar_t> wstring;

}
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 1 3
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 3
       
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 3



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ctime" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ctime" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ctime" 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ctime" 3
namespace std
{
  using ::clock_t;
  using ::time_t;
  using ::tm;

  using ::clock;
  using ::difftime;
  using ::mktime;
  using ::time;
  using ::asctime;
  using ::ctime;
  using ::gmtime;
  using ::localtime;
  using ::strftime;
}
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 2 3


# 1 "/usr/include/wchar.h" 1 3 4
# 40 "/usr/include/wchar.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stdarg.h" 1 3 4
# 41 "/usr/include/wchar.h" 2 3 4







# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4
# 93 "/usr/include/wchar.h" 3 4


typedef __mbstate_t mbstate_t;



# 118 "/usr/include/wchar.h" 3 4
extern "C" {




struct tm;









extern wchar_t *wcscpy (wchar_t *__restrict __dest,
   __const wchar_t *__restrict __src) throw ();

extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
    __const wchar_t *__restrict __src, size_t __n)
     throw ();


extern wchar_t *wcscat (wchar_t *__restrict __dest,
   __const wchar_t *__restrict __src) throw ();

extern wchar_t *wcsncat (wchar_t *__restrict __dest,
    __const wchar_t *__restrict __src, size_t __n)
     throw ();


extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
     throw () __attribute__ ((__pure__));

extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
     throw () __attribute__ ((__pure__));




extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) throw ();


extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
   size_t __n) throw ();





extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
    __locale_t __loc) throw ();

extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
     size_t __n, __locale_t __loc) throw ();





extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) throw ();



extern size_t wcsxfrm (wchar_t *__restrict __s1,
         __const wchar_t *__restrict __s2, size_t __n) throw ();








extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
        __locale_t __loc) throw ();




extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
    size_t __n, __locale_t __loc) throw ();


extern wchar_t *wcsdup (__const wchar_t *__s) throw () __attribute__ ((__malloc__));




extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
     throw () __attribute__ ((__pure__));

extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
     throw () __attribute__ ((__pure__));





extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
     throw () __attribute__ ((__pure__));





extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
     throw () __attribute__ ((__pure__));


extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
     throw () __attribute__ ((__pure__));

extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept)
     throw () __attribute__ ((__pure__));

extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle)
     throw () __attribute__ ((__pure__));


extern wchar_t *wcstok (wchar_t *__restrict __s,
   __const wchar_t *__restrict __delim,
   wchar_t **__restrict __ptr) throw ();


extern size_t wcslen (__const wchar_t *__s) throw () __attribute__ ((__pure__));




extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle)
     throw () __attribute__ ((__pure__));




extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
     throw () __attribute__ ((__pure__));





extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
     throw () __attribute__ ((__pure__));


extern int wmemcmp (__const wchar_t *__restrict __s1,
      __const wchar_t *__restrict __s2, size_t __n)
     throw () __attribute__ ((__pure__));


extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
    __const wchar_t *__restrict __s2, size_t __n) throw ();



extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
     throw ();


extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw ();





extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
     __const wchar_t *__restrict __s2, size_t __n)
     throw ();






extern wint_t btowc (int __c) throw ();



extern int wctob (wint_t __c) throw ();



extern int mbsinit (__const mbstate_t *__ps) throw () __attribute__ ((__pure__));



extern size_t mbrtowc (wchar_t *__restrict __pwc,
         __const char *__restrict __s, size_t __n,
         mbstate_t *__p) throw ();


extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
         mbstate_t *__restrict __ps) throw ();


extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
   mbstate_t *__restrict __ps) throw ();
extern size_t mbrlen (__const char *__restrict __s, size_t __n,
        mbstate_t *__restrict __ps) throw ();




extern __inline size_t
mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw ()

{ return (__ps != __null
   ? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); }





extern size_t mbsrtowcs (wchar_t *__restrict __dst,
    __const char **__restrict __src, size_t __len,
    mbstate_t *__restrict __ps) throw ();



extern size_t wcsrtombs (char *__restrict __dst,
    __const wchar_t **__restrict __src, size_t __len,
    mbstate_t *__restrict __ps) throw ();






extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
     __const char **__restrict __src, size_t __nmc,
     size_t __len, mbstate_t *__restrict __ps) throw ();



extern size_t wcsnrtombs (char *__restrict __dst,
     __const wchar_t **__restrict __src,
     size_t __nwc, size_t __len,
     mbstate_t *__restrict __ps) throw ();






extern int wcwidth (wchar_t __c) throw ();



extern int wcswidth (__const wchar_t *__s, size_t __n) throw ();






extern double wcstod (__const wchar_t *__restrict __nptr,
        wchar_t **__restrict __endptr) throw ();



extern float wcstof (__const wchar_t *__restrict __nptr,
       wchar_t **__restrict __endptr) throw ();
extern long double wcstold (__const wchar_t *__restrict __nptr,
       wchar_t **__restrict __endptr) throw ();





extern long int wcstol (__const wchar_t *__restrict __nptr,
   wchar_t **__restrict __endptr, int __base) throw ();



extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
      wchar_t **__restrict __endptr, int __base)
     throw ();




__extension__
extern long long int wcstoll (__const wchar_t *__restrict __nptr,
         wchar_t **__restrict __endptr, int __base)
     throw ();



__extension__
extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
     wchar_t **__restrict __endptr,
     int __base) throw ();






__extension__
extern long long int wcstoq (__const wchar_t *__restrict __nptr,
        wchar_t **__restrict __endptr, int __base)
     throw ();



__extension__
extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
           wchar_t **__restrict __endptr,
           int __base) throw ();
# 449 "/usr/include/wchar.h" 3 4
extern long int wcstol_l (__const wchar_t *__restrict __nptr,
     wchar_t **__restrict __endptr, int __base,
     __locale_t __loc) throw ();

extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
        wchar_t **__restrict __endptr,
        int __base, __locale_t __loc) throw ();

__extension__
extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
    wchar_t **__restrict __endptr,
    int __base, __locale_t __loc) throw ();

__extension__
extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
       wchar_t **__restrict __endptr,
       int __base, __locale_t __loc)
     throw ();

extern double wcstod_l (__const wchar_t *__restrict __nptr,
   wchar_t **__restrict __endptr, __locale_t __loc)
     throw ();

extern float wcstof_l (__const wchar_t *__restrict __nptr,
         wchar_t **__restrict __endptr, __locale_t __loc)
     throw ();

extern long double wcstold_l (__const wchar_t *__restrict __nptr,
         wchar_t **__restrict __endptr,
         __locale_t __loc) throw ();





extern double __wcstod_internal (__const wchar_t *__restrict __nptr,
     wchar_t **__restrict __endptr, int __group)
     throw ();
extern float __wcstof_internal (__const wchar_t *__restrict __nptr,
    wchar_t **__restrict __endptr, int __group)
     throw ();
extern long double __wcstold_internal (__const wchar_t *__restrict __nptr,
           wchar_t **__restrict __endptr,
           int __group) throw ();



extern long int __wcstol_internal (__const wchar_t *__restrict __nptr,
       wchar_t **__restrict __endptr,
       int __base, int __group) throw ();




extern unsigned long int __wcstoul_internal (__const wchar_t *__restrict __npt,
          wchar_t **__restrict __endptr,
          int __base, int __group) throw ();
# 531 "/usr/include/wchar.h" 3 4


extern __inline double
wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw ()

{ return __wcstod_internal (__nptr, __endptr, 0); }
extern __inline long int
wcstol (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw ()

{ return __wcstol_internal (__nptr, __endptr, __base, 0); }
extern __inline unsigned long int
wcstoul (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw ()

{ return __wcstoul_internal (__nptr, __endptr, __base, 0); }



extern __inline float
wcstof (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw ()

{ return __wcstof_internal (__nptr, __endptr, 0); }
extern __inline long double
wcstold (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw ()

{ return __wcstold_internal (__nptr, __endptr, 0); }


__extension__
extern __inline long long int
wcstoq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw ()

{ return __wcstoll_internal (__nptr, __endptr, __base, 0); }
__extension__
extern __inline unsigned long long int
wcstouq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw ()

{ return __wcstoull_internal (__nptr, __endptr, __base, 0); }







extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) throw ();



extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
     throw ();








extern int fwide (__FILE *__fp, int __mode) throw ();






extern int fwprintf (__FILE *__restrict __stream,
       __const wchar_t *__restrict __format, ...)
                                                           ;




extern int wprintf (__const wchar_t *__restrict __format, ...)
                                                           ;

extern int swprintf (wchar_t *__restrict __s, size_t __n,
       __const wchar_t *__restrict __format, ...)
     throw () ;





extern int vfwprintf (__FILE *__restrict __s,
        __const wchar_t *__restrict __format,
        __gnuc_va_list __arg)
                                                           ;




extern int vwprintf (__const wchar_t *__restrict __format,
       __gnuc_va_list __arg)
                                                           ;


extern int vswprintf (wchar_t *__restrict __s, size_t __n,
        __const wchar_t *__restrict __format,
        __gnuc_va_list __arg)
     throw () ;






extern int fwscanf (__FILE *__restrict __stream,
      __const wchar_t *__restrict __format, ...)
                                                          ;




extern int wscanf (__const wchar_t *__restrict __format, ...)
                                                          ;

extern int swscanf (__const wchar_t *__restrict __s,
      __const wchar_t *__restrict __format, ...)
     throw () ;











extern int vfwscanf (__FILE *__restrict __s,
       __const wchar_t *__restrict __format,
       __gnuc_va_list __arg)
                                                          ;




extern int vwscanf (__const wchar_t *__restrict __format,
      __gnuc_va_list __arg)
                                                          ;

extern int vswscanf (__const wchar_t *__restrict __s,
       __const wchar_t *__restrict __format,
       __gnuc_va_list __arg)
     throw () ;










extern wint_t fgetwc (__FILE *__stream);
extern wint_t getwc (__FILE *__stream);





extern wint_t getwchar (void);






extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
extern wint_t putwc (wchar_t __wc, __FILE *__stream);





extern wint_t putwchar (wchar_t __wc);







extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
   __FILE *__restrict __stream);





extern int fputws (__const wchar_t *__restrict __ws,
     __FILE *__restrict __stream);






extern wint_t ungetwc (wint_t __wc, __FILE *__stream);

# 743 "/usr/include/wchar.h" 3 4
extern wint_t getwc_unlocked (__FILE *__stream);
extern wint_t getwchar_unlocked (void);







extern wint_t fgetwc_unlocked (__FILE *__stream);







extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
# 769 "/usr/include/wchar.h" 3 4
extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
extern wint_t putwchar_unlocked (wchar_t __wc);
# 779 "/usr/include/wchar.h" 3 4
extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
     __FILE *__restrict __stream);







extern int fputws_unlocked (__const wchar_t *__restrict __ws,
       __FILE *__restrict __stream);







extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
   __const wchar_t *__restrict __format,
   __const struct tm *__restrict __tp) throw ();







extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
     __const wchar_t *__restrict __format,
     __const struct tm *__restrict __tp,
     __locale_t __loc) throw ();
# 824 "/usr/include/wchar.h" 3 4
}
# 55 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 2 3
# 69 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 3
namespace std
{
  using ::mbstate_t;
}
# 141 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 3
namespace std
{
  using ::wint_t;

  using ::btowc;
  using ::fgetwc;
  using ::fgetws;
  using ::fputwc;
  using ::fputws;
  using ::fwide;
  using ::fwprintf;
  using ::fwscanf;
  using ::getwc;
  using ::getwchar;
  using ::mbrlen;
  using ::mbrtowc;
  using ::mbsinit;
  using ::mbsrtowcs;
  using ::putwc;
  using ::putwchar;
  using ::swprintf;
  using ::swscanf;
  using ::ungetwc;
  using ::vfwprintf;

  using ::vfwscanf;

  using ::vswprintf;

  using ::vswscanf;

  using ::vwprintf;

  using ::vwscanf;

  using ::wcrtomb;
  using ::wcscat;
  using ::wcscmp;
  using ::wcscoll;
  using ::wcscpy;
  using ::wcscspn;
  using ::wcsftime;
  using ::wcslen;
  using ::wcsncat;
  using ::wcsncmp;
  using ::wcsncpy;
  using ::wcsrtombs;
  using ::wcsspn;
  using ::wcstod;

  using ::wcstof;

  using ::wcstok;
  using ::wcstol;
  using ::wcstoul;
  using ::wcsxfrm;
  using ::wctob;
  using ::wmemcmp;
  using ::wmemcpy;
  using ::wmemmove;
  using ::wmemset;
  using ::wprintf;
  using ::wscanf;

  using ::wcschr;

  inline wchar_t*
  wcschr(wchar_t* __p, wchar_t __c)
  { return wcschr(const_cast<const wchar_t*>(__p), __c); }

  using ::wcspbrk;

  inline wchar_t*
  wcspbrk(wchar_t* __s1, wchar_t* __s2)
  { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }

  using ::wcsrchr;

  inline wchar_t*
  wcsrchr(wchar_t* __p, wchar_t __c)
  { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }

  using ::wcsstr;

  inline wchar_t*
  wcsstr(wchar_t* __s1, const wchar_t* __s2)
  { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }

  using ::wmemchr;

  inline wchar_t*
  wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
  { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
}







namespace __gnu_cxx
{





  using ::wcstold;
# 258 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwchar" 3
  using ::wcstoll;
  using ::wcstoull;

}

namespace std
{
  using __gnu_cxx::wcstold;
  using __gnu_cxx::wcstoll;
  using __gnu_cxx::wcstoull;
}
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 2 3





namespace std
{
# 72 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 3
  typedef int64_t streamoff;





  typedef ptrdiff_t streamsize;

  template<typename _StateT>
    class fpos;
# 94 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 3
  template<typename _StateT>
    class fpos
    {
    private:
      streamoff _M_off;
      _StateT _M_state;

    public:




      fpos()
      : _M_off(0), _M_state() { }
# 116 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/postypes.h" 3
      fpos(streamoff __off)
      : _M_off(__off), _M_state() { }


      operator streamoff() const { return _M_off; }


      void
      state(_StateT __st)
      { _M_state = __st; }


      _StateT
      state() const
      { return _M_state; }






      bool
      operator==(const fpos& __other) const
      { return _M_off == __other._M_off; }


      bool
      operator!=(const fpos& __other) const
      { return _M_off != __other._M_off; }





      fpos&
      operator+=(streamoff __off)
      {
 _M_off += __off;
 return *this;
      }





      fpos&
      operator-=(streamoff __off)
      {
 _M_off -= __off;
 return *this;
      }







      fpos
      operator+(streamoff __off) const
      {
 fpos __pos(*this);
 __pos += __off;
 return __pos;
      }







      fpos
      operator-(streamoff __off) const
      {
 fpos __pos(*this);
 __pos -= __off;
 return __pos;
      }






      streamoff
      operator-(const fpos& __other) const
      { return _M_off - __other._M_off; }
    };





  typedef fpos<mbstate_t> streampos;

  typedef fpos<mbstate_t> wstreampos;
}
# 51 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 1 3
# 34 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/exception_defines.h" 1 3
# 35 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 2 3

namespace std
{

  void
  __throw_bad_exception(void);


  void
  __throw_bad_alloc(void);


  void
  __throw_bad_cast(void);

  void
  __throw_bad_typeid(void);


  void
  __throw_logic_error(const char* __s);

  void
  __throw_domain_error(const char* __s);

  void
  __throw_invalid_argument(const char* __s);

  void
  __throw_length_error(const char* __s);

  void
  __throw_out_of_range(const char* __s);

  void
  __throw_runtime_error(const char* __s);

  void
  __throw_range_error(const char* __s);

  void
  __throw_overflow_error(const char* __s);

  void
  __throw_underflow_error(const char* __s);


  void
  __throw_ios_failure(const char* __s);
}
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 2 3

namespace std
{
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_ios;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_streambuf;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_istream;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_ostream;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_iostream;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
     typename _Alloc = allocator<_CharT> >
    class basic_stringbuf;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
    typename _Alloc = allocator<_CharT> >
    class basic_istringstream;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
    typename _Alloc = allocator<_CharT> >
    class basic_ostringstream;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
    typename _Alloc = allocator<_CharT> >
    class basic_stringstream;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_filebuf;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_ifstream;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_ofstream;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class basic_fstream;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class istreambuf_iterator;

  template<typename _CharT, typename _Traits = char_traits<_CharT> >
    class ostreambuf_iterator;



  class ios_base;
# 136 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iosfwd" 3
  typedef basic_ios<char> ios;
  typedef basic_streambuf<char> streambuf;
  typedef basic_istream<char> istream;
  typedef basic_ostream<char> ostream;
  typedef basic_iostream<char> iostream;
  typedef basic_stringbuf<char> stringbuf;
  typedef basic_istringstream<char> istringstream;
  typedef basic_ostringstream<char> ostringstream;
  typedef basic_stringstream<char> stringstream;
  typedef basic_filebuf<char> filebuf;
  typedef basic_ifstream<char> ifstream;
  typedef basic_ofstream<char> ofstream;
  typedef basic_fstream<char> fstream;


  typedef basic_ios<wchar_t> wios;
  typedef basic_streambuf<wchar_t> wstreambuf;
  typedef basic_istream<wchar_t> wistream;
  typedef basic_ostream<wchar_t> wostream;
  typedef basic_iostream<wchar_t> wiostream;
  typedef basic_stringbuf<wchar_t> wstringbuf;
  typedef basic_istringstream<wchar_t> wistringstream;
  typedef basic_ostringstream<wchar_t> wostringstream;
  typedef basic_stringstream<wchar_t> wstringstream;
  typedef basic_filebuf<wchar_t> wfilebuf;
  typedef basic_ifstream<wchar_t> wifstream;
  typedef basic_ofstream<wchar_t> wofstream;
  typedef basic_fstream<wchar_t> wfstream;


}
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/exception" 1 3
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/exception" 3
extern "C++" {

namespace std
{
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/exception" 3
  class exception
  {
  public:
    exception() throw() { }
    virtual ~exception() throw();


    virtual const char* what() const throw();
  };



  class bad_exception : public exception
  {
  public:
    bad_exception() throw() { }


    virtual ~bad_exception() throw();
  };


  typedef void (*terminate_handler) ();

  typedef void (*unexpected_handler) ();


  terminate_handler set_terminate(terminate_handler) throw();


  void terminate() __attribute__ ((__noreturn__));


  unexpected_handler set_unexpected(unexpected_handler) throw();


  void unexpected() __attribute__ ((__noreturn__));
# 100 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/exception" 3
  bool uncaught_exception() throw();
}

namespace __gnu_cxx
{
# 115 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/exception" 3
  void __verbose_terminate_handler ();
}

}
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/climits" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/climits" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/climits" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/limits.h" 1 3 4
# 11 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/limits.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/syslimits.h" 1 3 4






# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/limits.h" 1 3 4
# 122 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/limits.h" 3 4
# 1 "/usr/include/limits.h" 1 3 4
# 144 "/usr/include/limits.h" 3 4
# 1 "/usr/include/bits/posix1_lim.h" 1 3 4
# 153 "/usr/include/bits/posix1_lim.h" 3 4
# 1 "/usr/include/bits/local_lim.h" 1 3 4
# 36 "/usr/include/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 37 "/usr/include/bits/local_lim.h" 2 3 4
# 154 "/usr/include/bits/posix1_lim.h" 2 3 4
# 145 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/bits/posix2_lim.h" 1 3 4
# 149 "/usr/include/limits.h" 2 3 4



# 1 "/usr/include/bits/xopen_lim.h" 1 3 4
# 34 "/usr/include/bits/xopen_lim.h" 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 35 "/usr/include/bits/xopen_lim.h" 2 3 4
# 153 "/usr/include/limits.h" 2 3 4
# 123 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/limits.h" 2 3 4
# 8 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/syslimits.h" 2 3 4
# 12 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/limits.h" 2 3 4
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/climits" 2 3
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 3




# 1 "/usr/include/stdlib.h" 1 3 4
# 33 "/usr/include/stdlib.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 34 "/usr/include/stdlib.h" 2 3 4

extern "C" {






# 1 "/usr/include/bits/waitflags.h" 1 3 4
# 43 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/bits/waitstatus.h" 1 3 4
# 67 "/usr/include/bits/waitstatus.h" 3 4
union wait
  {
    int w_status;
    struct
      {

 unsigned int __w_termsig:7;
 unsigned int __w_coredump:1;
 unsigned int __w_retcode:8;
 unsigned int:16;







      } __wait_terminated;
    struct
      {

 unsigned int __w_stopval:8;
 unsigned int __w_stopsig:8;
 unsigned int:16;






      } __wait_stopped;
  };
# 44 "/usr/include/stdlib.h" 2 3 4
# 96 "/usr/include/stdlib.h" 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;







__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;


# 140 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) throw ();




extern double atof (__const char *__nptr)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern int atoi (__const char *__nptr)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern long int atol (__const char *__nptr)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





__extension__ extern long long int atoll (__const char *__nptr)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));





extern double strtod (__const char *__restrict __nptr,
        char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1)));





extern float strtof (__const char *__restrict __nptr,
       char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1)));

extern long double strtold (__const char *__restrict __nptr,
       char **__restrict __endptr)
     throw () __attribute__ ((__nonnull__ (1)));





extern long int strtol (__const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     throw () __attribute__ ((__nonnull__ (1)));

extern unsigned long int strtoul (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     throw () __attribute__ ((__nonnull__ (1)));




__extension__
extern long long int strtoq (__const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     throw () __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     throw () __attribute__ ((__nonnull__ (1)));





__extension__
extern long long int strtoll (__const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     throw () __attribute__ ((__nonnull__ (1)));

__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     throw () __attribute__ ((__nonnull__ (1)));

# 239 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (__const char *__restrict __nptr,
     char **__restrict __endptr, int __base,
     __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4)));

extern unsigned long int strtoul_l (__const char *__restrict __nptr,
        char **__restrict __endptr,
        int __base, __locale_t __loc)
     throw () __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern long long int strtoll_l (__const char *__restrict __nptr,
    char **__restrict __endptr, int __base,
    __locale_t __loc)
     throw () __attribute__ ((__nonnull__ (1, 4)));

__extension__
extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, __locale_t __loc)
     throw () __attribute__ ((__nonnull__ (1, 4)));

extern double strtod_l (__const char *__restrict __nptr,
   char **__restrict __endptr, __locale_t __loc)
     throw () __attribute__ ((__nonnull__ (1, 3)));

extern float strtof_l (__const char *__restrict __nptr,
         char **__restrict __endptr, __locale_t __loc)
     throw () __attribute__ ((__nonnull__ (1, 3)));

extern long double strtold_l (__const char *__restrict __nptr,
         char **__restrict __endptr,
         __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3)));






extern double __strtod_internal (__const char *__restrict __nptr,
     char **__restrict __endptr, int __group)
     throw () __attribute__ ((__nonnull__ (1)));
extern float __strtof_internal (__const char *__restrict __nptr,
    char **__restrict __endptr, int __group)
     throw () __attribute__ ((__nonnull__ (1)));
extern long double __strtold_internal (__const char *__restrict __nptr,
           char **__restrict __endptr,
           int __group) throw () __attribute__ ((__nonnull__ (1)));

extern long int __strtol_internal (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, int __group)
     throw () __attribute__ ((__nonnull__ (1)));



extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
          char **__restrict __endptr,
          int __base, int __group)
     throw () __attribute__ ((__nonnull__ (1)));
# 323 "/usr/include/stdlib.h" 3 4

extern __inline double
strtod (__const char *__restrict __nptr, char **__restrict __endptr) throw ()
{
  return __strtod_internal (__nptr, __endptr, 0);
}
extern __inline long int
strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw ()

{
  return __strtol_internal (__nptr, __endptr, __base, 0);
}
extern __inline unsigned long int
strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw ()

{
  return __strtoul_internal (__nptr, __endptr, __base, 0);
}




extern __inline float
strtof (__const char *__restrict __nptr, char **__restrict __endptr) throw ()
{
  return __strtof_internal (__nptr, __endptr, 0);
}
extern __inline long double
strtold (__const char *__restrict __nptr, char **__restrict __endptr) throw ()
{
  return __strtold_internal (__nptr, __endptr, 0);
}




__extension__ extern __inline long long int
strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw ()

{
  return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw ()

{
  return __strtoull_internal (__nptr, __endptr, __base, 0);
}




__extension__ extern __inline long long int
strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw ()

{
  return __strtoll_internal (__nptr, __endptr, __base, 0);
}
__extension__ extern __inline unsigned long long int
strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) throw ()

{
  return __strtoull_internal (__nptr, __endptr, __base, 0);
}




extern __inline double
atof (__const char *__nptr) throw ()
{
  return strtod (__nptr, (char **) __null);
}
extern __inline int
atoi (__const char *__nptr) throw ()
{
  return (int) strtol (__nptr, (char **) __null, 10);
}
extern __inline long int
atol (__const char *__nptr) throw ()
{
  return strtol (__nptr, (char **) __null, 10);
}




__extension__ extern __inline long long int
atoll (__const char *__nptr) throw ()
{
  return strtoll (__nptr, (char **) __null, 10);
}

# 424 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) throw ();


extern long int a64l (__const char *__s)
     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));




# 1 "/usr/include/sys/types.h" 1 3 4
# 29 "/usr/include/sys/types.h" 3 4
extern "C" {





typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;




typedef __loff_t loff_t;



typedef __ino_t ino_t;






typedef __ino64_t ino64_t;




typedef __dev_t dev_t;
# 72 "/usr/include/sys/types.h" 3 4
typedef __mode_t mode_t;




typedef __nlink_t nlink_t;
# 105 "/usr/include/sys/types.h" 3 4
typedef __id_t id_t;
# 116 "/usr/include/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;
# 141 "/usr/include/sys/types.h" 3 4
typedef __suseconds_t suseconds_t;





# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 148 "/usr/include/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 197 "/usr/include/sys/types.h" 3 4
typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));

typedef int register_t __attribute__ ((__mode__ (__word__)));
# 216 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/select.h" 1 3 4
# 31 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/bits/select.h" 1 3 4
# 32 "/usr/include/sys/select.h" 2 3 4


# 1 "/usr/include/bits/sigset.h" 1 3 4
# 35 "/usr/include/sys/select.h" 2 3 4
# 46 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/bits/time.h" 1 3 4
# 69 "/usr/include/bits/time.h" 3 4
struct timeval
  {
    __time_t tv_sec;
    __suseconds_t tv_usec;
  };
# 47 "/usr/include/sys/select.h" 2 3 4
# 55 "/usr/include/sys/select.h" 3 4
typedef long int __fd_mask;
# 67 "/usr/include/sys/select.h" 3 4
typedef struct
  {



    __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))];





  } fd_set;






typedef __fd_mask fd_mask;
# 99 "/usr/include/sys/select.h" 3 4
extern "C" {
# 109 "/usr/include/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 121 "/usr/include/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
      fd_set *__restrict __writefds,
      fd_set *__restrict __exceptfds,
      const struct timespec *__restrict __timeout,
      const __sigset_t *__restrict __sigmask);


}
# 217 "/usr/include/sys/types.h" 2 3 4


# 1 "/usr/include/sys/sysmacros.h" 1 3 4
# 29 "/usr/include/sys/sysmacros.h" 3 4
__extension__
extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
     throw ();
__extension__
extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
     throw ();
__extension__
extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
       unsigned int __minor)
     throw ();


__extension__ extern __inline unsigned int
gnu_dev_major (unsigned long long int __dev) throw ()
{
  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}

__extension__ extern __inline unsigned int
gnu_dev_minor (unsigned long long int __dev) throw ()
{
  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}

__extension__ extern __inline unsigned long long int
gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
{
  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
   | (((unsigned long long int) (__minor & ~0xff)) << 12)
   | (((unsigned long long int) (__major & ~0xfff)) << 32));
}
# 220 "/usr/include/sys/types.h" 2 3 4




typedef __blksize_t blksize_t;






typedef __blkcnt_t blkcnt_t;



typedef __fsblkcnt_t fsblkcnt_t;



typedef __fsfilcnt_t fsfilcnt_t;
# 258 "/usr/include/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;





# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
# 267 "/usr/include/sys/types.h" 2 3 4


}
# 434 "/usr/include/stdlib.h" 2 3 4






extern long int random (void) throw ();


extern void srandom (unsigned int __seed) throw ();





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     throw () __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     throw () __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     throw () __attribute__ ((__nonnull__ (1, 2)));






extern int rand (void) throw ();

extern void srand (unsigned int __seed) throw ();




extern int rand_r (unsigned int *__seed) throw ();







extern double drand48 (void) throw ();
extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));


extern long int lrand48 (void) throw ();
extern long int nrand48 (unsigned short int __xsubi[3])
     throw () __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) throw ();
extern long int jrand48 (unsigned short int __xsubi[3])
     throw () __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) throw ();
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     throw () __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    unsigned long long int __a;
  };


extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));


extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     throw () __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     throw () __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     throw () __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     throw () __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     throw () __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     throw () __attribute__ ((__nonnull__ (1, 2)));









extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__));

extern void *calloc (size_t __nmemb, size_t __size)
     throw () __attribute__ ((__malloc__));







extern void *realloc (void *__ptr, size_t __size) throw () __attribute__ ((__malloc__));

extern void free (void *__ptr) throw ();




extern void cfree (void *__ptr) throw ();



# 1 "/usr/include/alloca.h" 1 3 4
# 25 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 26 "/usr/include/alloca.h" 2 3 4

extern "C" {





extern void *alloca (size_t __size) throw ();





}
# 607 "/usr/include/stdlib.h" 2 3 4




extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__));




extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     throw () __attribute__ ((__nonnull__ (1)));




extern void abort (void) throw () __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));





extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     throw () __attribute__ ((__nonnull__ (1)));






extern void exit (int __status) throw () __attribute__ ((__noreturn__));






extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));






extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));




extern char *__secure_getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));





extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));





extern int setenv (__const char *__name, __const char *__value, int __replace)
     throw () __attribute__ ((__nonnull__ (2)));


extern int unsetenv (__const char *__name) throw ();






extern int clearenv (void) throw ();
# 691 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1)));
# 702 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1)));
# 711 "/usr/include/stdlib.h" 3 4
extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1)));
# 721 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1)));








extern int system (__const char *__command);







extern char *canonicalize_file_name (__const char *__name)
     throw () __attribute__ ((__nonnull__ (1)));
# 749 "/usr/include/stdlib.h" 3 4
extern char *realpath (__const char *__restrict __name,
         char *__restrict __resolved) throw ();






typedef int (*__compar_fn_t) (__const void *, __const void *);


typedef __compar_fn_t comparison_fn_t;






extern void *bsearch (__const void *__key, __const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5)));



extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));



extern int abs (int __x) throw () __attribute__ ((__const__));
extern long int labs (long int __x) throw () __attribute__ ((__const__));



__extension__ extern long long int llabs (long long int __x)
     throw () __attribute__ ((__const__));







extern div_t div (int __numer, int __denom)
     throw () __attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom)
     throw () __attribute__ ((__const__));




__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     throw () __attribute__ ((__const__));

# 814 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4)));




extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4)));




extern char *gcvt (double __value, int __ndigit, char *__buf)
     throw () __attribute__ ((__nonnull__ (3)));




extern char *qecvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     throw () __attribute__ ((__nonnull__ (3, 4)));
extern char *qfcvt (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign)
     throw () __attribute__ ((__nonnull__ (3, 4)));
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
     throw () __attribute__ ((__nonnull__ (3)));




extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
     int *__restrict __sign, char *__restrict __buf,
     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));

extern int qecvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
      int *__restrict __decpt, int *__restrict __sign,
      char *__restrict __buf, size_t __len)
     throw () __attribute__ ((__nonnull__ (3, 4, 5)));







extern int mblen (__const char *__s, size_t __n) throw ();


extern int mbtowc (wchar_t *__restrict __pwc,
     __const char *__restrict __s, size_t __n) throw ();


extern int wctomb (char *__s, wchar_t __wchar) throw ();



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   __const char *__restrict __s, size_t __n) throw ();

extern size_t wcstombs (char *__restrict __s,
   __const wchar_t *__restrict __pwcs, size_t __n)
     throw ();








extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1)));
# 902 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
        char *__const *__restrict __tokens,
        char **__restrict __valuep)
     throw () __attribute__ ((__nonnull__ (1, 2, 3)));





extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1)));







extern int posix_openpt (int __oflag);







extern int grantpt (int __fd) throw ();



extern int unlockpt (int __fd) throw ();




extern char *ptsname (int __fd) throw ();






extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
     throw () __attribute__ ((__nonnull__ (2)));


extern int getpt (void);






extern int getloadavg (double __loadavg[], int __nelem)
     throw () __attribute__ ((__nonnull__ (1)));





}
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 2 3
# 84 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 3
namespace std
{
  using ::div_t;
  using ::ldiv_t;

  using ::abort;
  using ::abs;
  using ::atexit;
  using ::atof;
  using ::atoi;
  using ::atol;
  using ::bsearch;
  using ::calloc;
  using ::div;
  using ::exit;
  using ::free;
  using ::getenv;
  using ::labs;
  using ::ldiv;
  using ::malloc;

  using ::mblen;
  using ::mbstowcs;
  using ::mbtowc;

  using ::qsort;
  using ::rand;
  using ::realloc;
  using ::srand;
  using ::strtod;
  using ::strtol;
  using ::strtoul;
  using ::system;

  using ::wcstombs;
  using ::wctomb;


  inline long
  abs(long __i) { return labs(__i); }

  inline ldiv_t
  div(long __i, long __j) { return ldiv(__i, __j); }
}
# 140 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 3
namespace __gnu_cxx
{

  using ::lldiv_t;





  using ::_Exit;


  inline long long
  abs(long long __x) { return __x >= 0 ? __x : -__x; }

  inline long long
  llabs(long long __x) { return __x >= 0 ? __x : -__x; }


  inline lldiv_t
  div(long long __n, long long __d)
  { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }

  inline lldiv_t
  lldiv(long long __n, long long __d)
  { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
# 176 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cstdlib" 3
  using ::atoll;
  using ::strtoll;
  using ::strtoull;

  using ::strtof;
  using ::strtold;
}

namespace std
{

  using __gnu_cxx::lldiv_t;

  using __gnu_cxx::_Exit;
  using __gnu_cxx::abs;
  using __gnu_cxx::llabs;

  using __gnu_cxx::div;
  using __gnu_cxx::lldiv;

  using __gnu_cxx::atoll;
  using __gnu_cxx::strtof;
  using __gnu_cxx::strtoll;
  using __gnu_cxx::strtoull;
  using __gnu_cxx::strtold;
}
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/new" 1 3
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/new" 3
extern "C++" {

namespace std
{





  class bad_alloc : public exception
  {
  public:
    bad_alloc() throw() { }


    virtual ~bad_alloc() throw();
  };

  struct nothrow_t { };
  extern const nothrow_t nothrow;


  typedef void (*new_handler)();

  new_handler set_new_handler(new_handler) throw();
}
# 82 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/new" 3
void* operator new(std::size_t) throw (std::bad_alloc);
void* operator new[](std::size_t) throw (std::bad_alloc);
void operator delete(void*) throw();
void operator delete[](void*) throw();
void* operator new(std::size_t, const std::nothrow_t&) throw();
void* operator new[](std::size_t, const std::nothrow_t&) throw();
void operator delete(void*, const std::nothrow_t&) throw();
void operator delete[](void*, const std::nothrow_t&) throw();


inline void* operator new(std::size_t, void* __p) throw() { return __p; }
inline void* operator new[](std::size_t, void* __p) throw() { return __p; }


inline void operator delete (void*, void*) throw() { }
inline void operator delete[](void*, void*) throw() { }

}
# 70 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_pair.h" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_pair.h" 3
namespace std
{

  template<class _T1, class _T2>
    struct pair
    {
      typedef _T1 first_type;
      typedef _T2 second_type;

      _T1 first;
      _T2 second;





      pair()
      : first(), second() { }


      pair(const _T1& __a, const _T2& __b)
      : first(__a), second(__b) { }


      template<class _U1, class _U2>
        pair(const pair<_U1, _U2>& __p)
 : first(__p.first), second(__p.second) { }
    };


  template<class _T1, class _T2>
    inline bool
    operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    { return __x.first == __y.first && __x.second == __y.second; }


  template<class _T1, class _T2>
    inline bool
    operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    { return __x.first < __y.first
      || (!(__y.first < __x.first) && __x.second < __y.second); }


  template<class _T1, class _T2>
    inline bool
    operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    { return !(__x == __y); }


  template<class _T1, class _T2>
    inline bool
    operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    { return __y < __x; }


  template<class _T1, class _T2>
    inline bool
    operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    { return !(__y < __x); }


  template<class _T1, class _T2>
    inline bool
    operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    { return !(__x < __y); }
# 142 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_pair.h" 3
  template<class _T1, class _T2>
    inline pair<_T1, _T2>
    make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); }
}
# 72 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/type_traits.h" 1 3
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/type_traits.h" 3
       
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/type_traits.h" 3
# 90 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/type_traits.h" 3
struct __true_type {};
struct __false_type {};

template <class _Tp>
  struct __type_traits
  {
    typedef __true_type this_dummy_member_must_be_first;
# 114 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/type_traits.h" 3
    typedef __false_type has_trivial_default_constructor;
    typedef __false_type has_trivial_copy_constructor;
    typedef __false_type has_trivial_assignment_operator;
    typedef __false_type has_trivial_destructor;
    typedef __false_type is_POD_type;
  };




template<>
  struct __type_traits<bool>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<char>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<signed char>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<unsigned char>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<wchar_t>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<short>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<unsigned short>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<int>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<unsigned int>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<long>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<unsigned long>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<long long>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<unsigned long long>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<float>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<double>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template<>
  struct __type_traits<long double>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };

template <class _Tp>
  struct __type_traits<_Tp*>
  {
    typedef __true_type has_trivial_default_constructor;
    typedef __true_type has_trivial_copy_constructor;
    typedef __true_type has_trivial_assignment_operator;
    typedef __true_type has_trivial_destructor;
    typedef __true_type is_POD_type;
  };




template <class _Tp>
  struct _Is_integer
  {
    typedef __false_type _Integral;
  };

template<>
  struct _Is_integer<bool>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<char>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<signed char>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<unsigned char>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<wchar_t>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<short>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<unsigned short>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<int>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<unsigned int>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<long>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<unsigned long>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<long long>
  {
    typedef __true_type _Integral;
  };

template<>
  struct _Is_integer<unsigned long long>
  {
    typedef __true_type _Integral;
  };

template<typename _Tp>
  struct _Is_normal_iterator
  {
    typedef __false_type _Normal;
  };


namespace __gnu_cxx
{
  template<typename _Iterator, typename _Container>
    class __normal_iterator;
}

template<typename _Iterator, typename _Container>
  struct _Is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
          _Container> >
  {
    typedef __true_type _Normal;
  };
# 73 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_types.h" 1 3
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_types.h" 3
       
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_types.h" 3

namespace std
{
# 80 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_types.h" 3
  struct input_iterator_tag {};

  struct output_iterator_tag {};

  struct forward_iterator_tag : public input_iterator_tag {};


  struct bidirectional_iterator_tag : public forward_iterator_tag {};


  struct random_access_iterator_tag : public bidirectional_iterator_tag {};
# 104 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_types.h" 3
  template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
           typename _Pointer = _Tp*, typename _Reference = _Tp&>
    struct iterator
    {

      typedef _Category iterator_category;

      typedef _Tp value_type;

      typedef _Distance difference_type;

      typedef _Pointer pointer;

      typedef _Reference reference;
    };







  template<typename _Iterator>
    struct iterator_traits
    {
      typedef typename _Iterator::iterator_category iterator_category;
      typedef typename _Iterator::value_type value_type;
      typedef typename _Iterator::difference_type difference_type;
      typedef typename _Iterator::pointer pointer;
      typedef typename _Iterator::reference reference;
    };

  template<typename _Tp>
    struct iterator_traits<_Tp*>
    {
      typedef random_access_iterator_tag iterator_category;
      typedef _Tp value_type;
      typedef ptrdiff_t difference_type;
      typedef _Tp* pointer;
      typedef _Tp& reference;
    };

  template<typename _Tp>
    struct iterator_traits<const _Tp*>
    {
      typedef random_access_iterator_tag iterator_category;
      typedef _Tp value_type;
      typedef ptrdiff_t difference_type;
      typedef const _Tp* pointer;
      typedef const _Tp& reference;
    };







  template<typename _Iter>
    inline typename iterator_traits<_Iter>::iterator_category
    __iterator_category(const _Iter&)
    { return typename iterator_traits<_Iter>::iterator_category(); }

}
# 74 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_funcs.h" 1 3
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_funcs.h" 3
       
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_funcs.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/concept_check.h" 1 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/concept_check.h" 3
       
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/concept_check.h" 3
# 69 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_funcs.h" 2 3

namespace std
{
  template<typename _InputIterator>
    inline typename iterator_traits<_InputIterator>::difference_type
    __distance(_InputIterator __first, _InputIterator __last,
               input_iterator_tag)
    {

     

      typename iterator_traits<_InputIterator>::difference_type __n = 0;
      while (__first != __last)
 {
   ++__first;
   ++__n;
 }
      return __n;
    }

  template<typename _RandomAccessIterator>
    inline typename iterator_traits<_RandomAccessIterator>::difference_type
    __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
               random_access_iterator_tag)
    {

     

      return __last - __first;
    }
# 112 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_funcs.h" 3
  template<typename _InputIterator>
    inline typename iterator_traits<_InputIterator>::difference_type
    distance(_InputIterator __first, _InputIterator __last)
    {

      return std::__distance(__first, __last,
        std::__iterator_category(__first));
    }

  template<typename _InputIterator, typename _Distance>
    inline void
    __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
    {

     
      while (__n--)
 ++__i;
    }

  template<typename _BidirectionalIterator, typename _Distance>
    inline void
    __advance(_BidirectionalIterator& __i, _Distance __n,
              bidirectional_iterator_tag)
    {

     

      if (__n > 0)
        while (__n--)
   ++__i;
      else
        while (__n++)
   --__i;
    }

  template<typename _RandomAccessIterator, typename _Distance>
    inline void
    __advance(_RandomAccessIterator& __i, _Distance __n,
              random_access_iterator_tag)
    {

     

      __i += __n;
    }
# 170 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator_base_funcs.h" 3
  template<typename _InputIterator, typename _Distance>
    inline void
    advance(_InputIterator& __i, _Distance __n)
    {

      std::__advance(__i, __n, std::__iterator_category(__i));
    }
}
# 75 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 1 3
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
namespace std
{
# 89 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Iterator>
    class reverse_iterator
    : public iterator<typename iterator_traits<_Iterator>::iterator_category,
        typename iterator_traits<_Iterator>::value_type,
        typename iterator_traits<_Iterator>::difference_type,
        typename iterator_traits<_Iterator>::pointer,
                      typename iterator_traits<_Iterator>::reference>
    {
    protected:
      _Iterator current;

    public:
      typedef _Iterator iterator_type;
      typedef typename iterator_traits<_Iterator>::difference_type
              difference_type;
      typedef typename iterator_traits<_Iterator>::reference reference;
      typedef typename iterator_traits<_Iterator>::pointer pointer;

    public:






      reverse_iterator() : current() { }




      explicit
      reverse_iterator(iterator_type __x) : current(__x) { }




      reverse_iterator(const reverse_iterator& __x)
      : current(__x.current) { }





      template<typename _Iter>
        reverse_iterator(const reverse_iterator<_Iter>& __x)
 : current(__x.base()) { }




      iterator_type
      base() const
      { return current; }






      reference
      operator*() const
      {
 _Iterator __tmp = current;
 return *--__tmp;
      }






      pointer
      operator->() const
      { return &(operator*()); }






      reverse_iterator&
      operator++()
      {
 --current;
 return *this;
      }






      reverse_iterator
      operator++(int)
      {
 reverse_iterator __tmp = *this;
 --current;
 return __tmp;
      }






      reverse_iterator&
      operator--()
      {
 ++current;
 return *this;
      }






      reverse_iterator operator--(int)
      {
 reverse_iterator __tmp = *this;
 ++current;
 return __tmp;
      }






      reverse_iterator
      operator+(difference_type __n) const
      { return reverse_iterator(current - __n); }






      reverse_iterator&
      operator+=(difference_type __n)
      {
 current -= __n;
 return *this;
      }






      reverse_iterator
      operator-(difference_type __n) const
      { return reverse_iterator(current + __n); }






      reverse_iterator&
      operator-=(difference_type __n)
      {
 current += __n;
 return *this;
      }






      reference
      operator[](difference_type __n) const
      { return *(*this + __n); }
    };
# 275 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Iterator>
    inline bool
    operator==(const reverse_iterator<_Iterator>& __x,
        const reverse_iterator<_Iterator>& __y)
    { return __x.base() == __y.base(); }

  template<typename _Iterator>
    inline bool
    operator<(const reverse_iterator<_Iterator>& __x,
       const reverse_iterator<_Iterator>& __y)
    { return __y.base() < __x.base(); }

  template<typename _Iterator>
    inline bool
    operator!=(const reverse_iterator<_Iterator>& __x,
        const reverse_iterator<_Iterator>& __y)
    { return !(__x == __y); }

  template<typename _Iterator>
    inline bool
    operator>(const reverse_iterator<_Iterator>& __x,
       const reverse_iterator<_Iterator>& __y)
    { return __y < __x; }

  template<typename _Iterator>
    inline bool
    operator<=(const reverse_iterator<_Iterator>& __x,
  const reverse_iterator<_Iterator>& __y)
    { return !(__y < __x); }

  template<typename _Iterator>
    inline bool
    operator>=(const reverse_iterator<_Iterator>& __x,
        const reverse_iterator<_Iterator>& __y)
    { return !(__x < __y); }

  template<typename _Iterator>
    inline typename reverse_iterator<_Iterator>::difference_type
    operator-(const reverse_iterator<_Iterator>& __x,
       const reverse_iterator<_Iterator>& __y)
    { return __y.base() - __x.base(); }

  template<typename _Iterator>
    inline reverse_iterator<_Iterator>
    operator+(typename reverse_iterator<_Iterator>::difference_type __n,
       const reverse_iterator<_Iterator>& __x)
    { return reverse_iterator<_Iterator>(__x.base() - __n); }
# 335 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Container>
    class back_insert_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
    {
    protected:
      _Container* container;

    public:

      typedef _Container container_type;


      explicit
      back_insert_iterator(_Container& __x) : container(&__x) { }
# 361 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
      back_insert_iterator&
      operator=(typename _Container::const_reference __value)
      {
 container->push_back(__value);
 return *this;
      }


      back_insert_iterator&
      operator*()
      { return *this; }


      back_insert_iterator&
      operator++()
      { return *this; }


      back_insert_iterator
      operator++(int)
      { return *this; }
    };
# 395 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Container>
    inline back_insert_iterator<_Container>
    back_inserter(_Container& __x)
    { return back_insert_iterator<_Container>(__x); }
# 410 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Container>
    class front_insert_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
    {
    protected:
      _Container* container;

    public:

      typedef _Container container_type;


      explicit front_insert_iterator(_Container& __x) : container(&__x) { }
# 435 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
      front_insert_iterator&
      operator=(typename _Container::const_reference __value)
      {
 container->push_front(__value);
 return *this;
      }


      front_insert_iterator&
      operator*()
      { return *this; }


      front_insert_iterator&
      operator++()
      { return *this; }


      front_insert_iterator
      operator++(int)
      { return *this; }
    };
# 469 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Container>
    inline front_insert_iterator<_Container>
    front_inserter(_Container& __x)
    { return front_insert_iterator<_Container>(__x); }
# 488 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Container>
    class insert_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
    {
    protected:
      _Container* container;
      typename _Container::iterator iter;

    public:

      typedef _Container container_type;





      insert_iterator(_Container& __x, typename _Container::iterator __i)
      : container(&__x), iter(__i) {}
# 530 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
      insert_iterator&
      operator=(const typename _Container::const_reference __value)
      {
 iter = container->insert(iter, __value);
 ++iter;
 return *this;
      }


      insert_iterator&
      operator*()
      { return *this; }


      insert_iterator&
      operator++()
      { return *this; }


      insert_iterator&
      operator++(int)
      { return *this; }
    };
# 565 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _Container, typename _Iterator>
    inline insert_iterator<_Container>
    inserter(_Container& __x, _Iterator __i)
    {
      return insert_iterator<_Container>(__x,
      typename _Container::iterator(__i));
    }
}

namespace __gnu_cxx
{







  using std::iterator_traits;
  using std::iterator;
  template<typename _Iterator, typename _Container>
    class __normal_iterator
    {
    protected:
      _Iterator _M_current;

    public:
      typedef typename iterator_traits<_Iterator>::iterator_category
                                                             iterator_category;
      typedef typename iterator_traits<_Iterator>::value_type value_type;
      typedef typename iterator_traits<_Iterator>::difference_type
                                                             difference_type;
      typedef typename iterator_traits<_Iterator>::reference reference;
      typedef typename iterator_traits<_Iterator>::pointer pointer;

      __normal_iterator() : _M_current(_Iterator()) { }

      explicit
      __normal_iterator(const _Iterator& __i) : _M_current(__i) { }


      template<typename _Iter>
        inline __normal_iterator(const __normal_iterator<_Iter,
     _Container>& __i)
 : _M_current(__i.base()) { }


      reference
      operator*() const
      { return *_M_current; }

      pointer
      operator->() const
      { return _M_current; }

      __normal_iterator&
      operator++()
      {
 ++_M_current;
 return *this;
      }

      __normal_iterator
      operator++(int)
      { return __normal_iterator(_M_current++); }


      __normal_iterator&
      operator--()
      {
 --_M_current;
 return *this;
      }

      __normal_iterator
      operator--(int)
      { return __normal_iterator(_M_current--); }


      reference
      operator[](const difference_type& __n) const
      { return _M_current[__n]; }

      __normal_iterator&
      operator+=(const difference_type& __n)
      { _M_current += __n; return *this; }

      __normal_iterator
      operator+(const difference_type& __n) const
      { return __normal_iterator(_M_current + __n); }

      __normal_iterator&
      operator-=(const difference_type& __n)
      { _M_current -= __n; return *this; }

      __normal_iterator
      operator-(const difference_type& __n) const
      { return __normal_iterator(_M_current - __n); }

      const _Iterator&
      base() const
      { return _M_current; }
    };
# 678 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_iterator.h" 3
  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
    operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
        const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() == __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline bool
    operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
        const __normal_iterator<_Iterator, _Container>& __rhs)
    { return __lhs.base() == __rhs.base(); }

  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
    operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
        const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() != __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline bool
    operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
        const __normal_iterator<_Iterator, _Container>& __rhs)
    { return __lhs.base() != __rhs.base(); }


  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
    operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
       const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() < __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline bool
    operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
       const __normal_iterator<_Iterator, _Container>& __rhs)
    { return __lhs.base() < __rhs.base(); }

  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
    operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
       const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() > __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline bool
    operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
       const __normal_iterator<_Iterator, _Container>& __rhs)
    { return __lhs.base() > __rhs.base(); }

  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
    operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
        const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() <= __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline bool
    operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
        const __normal_iterator<_Iterator, _Container>& __rhs)
    { return __lhs.base() <= __rhs.base(); }

  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline bool
    operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
        const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() >= __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline bool
    operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
        const __normal_iterator<_Iterator, _Container>& __rhs)
    { return __lhs.base() >= __rhs.base(); }





  template<typename _IteratorL, typename _IteratorR, typename _Container>
    inline typename __normal_iterator<_IteratorL, _Container>::difference_type
    operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
       const __normal_iterator<_IteratorR, _Container>& __rhs)
    { return __lhs.base() - __rhs.base(); }

  template<typename _Iterator, typename _Container>
    inline __normal_iterator<_Iterator, _Container>
    operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
       __n, const __normal_iterator<_Iterator, _Container>& __i)
    { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
}
# 76 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/debug/debug.h" 1 3
# 272 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/debug/debug.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3

# 1 "/usr/include/assert.h" 1 3 4
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 2 3
# 273 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/debug/debug.h" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 275 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/debug/debug.h" 2 3



namespace __gnu_debug
{
  template<typename _Iterator, typename _Sequence>
    class _Safe_iterator;


  inline bool
  __check_singular_aux(const void*) { return false; }



  template<typename _Iterator>
    inline bool
    __check_singular(_Iterator& __x)
    { return __gnu_debug::__check_singular_aux(&__x); }


  template<typename _Tp>
    inline bool
    __check_singular(const _Tp* __ptr)
    { return __ptr == 0; }


  template<typename _Iterator, typename _Sequence>
    inline bool
    __check_singular(const _Safe_iterator<_Iterator, _Sequence>& __x)
    { return __x._M_singular(); }



  template<typename _Iterator>
    inline bool
    __check_dereferenceable(_Iterator&)
    { return true; }


  template<typename _Tp>
    inline bool
    __check_dereferenceable(const _Tp* __ptr)
    { return __ptr; }


  template<typename _Iterator, typename _Sequence>
    inline bool
    __check_dereferenceable(const _Safe_iterator<_Iterator, _Sequence>& __x)
    { return __x._M_dereferenceable(); }




  template<typename _RandomAccessIterator>
    inline bool
    __valid_range_aux2(const _RandomAccessIterator& __first,
         const _RandomAccessIterator& __last,
         std::random_access_iterator_tag)
    { return __last - __first >= 0; }





  template<typename _InputIterator>
    inline bool
    __valid_range_aux2(const _InputIterator&, const _InputIterator&,
         std::input_iterator_tag)
    { return true; }





  template<typename _Integral>
    inline bool
    __valid_range_aux(const _Integral&, const _Integral&, __true_type)
    { return true; }




  template<typename _InputIterator>
    inline bool
    __valid_range_aux(const _InputIterator& __first,
        const _InputIterator& __last, __false_type)
  {
    typedef typename std::iterator_traits<_InputIterator>::iterator_category
      _Category;
    return __gnu_debug::__valid_range_aux2(__first, __last, _Category());
  }






  template<typename _InputIterator>
    inline bool
    __valid_range(const _InputIterator& __first, const _InputIterator& __last)
    {
      typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
      return __gnu_debug::__valid_range_aux(__first, __last, _Integral());
    }


  template<typename _Iterator, typename _Sequence>
    inline bool
    __valid_range(const _Safe_iterator<_Iterator, _Sequence>& __first,
    const _Safe_iterator<_Iterator, _Sequence>& __last)
    { return __first._M_valid_range(__last); }





  template<typename _InputIterator>
    inline _InputIterator
    __check_valid_range(const _InputIterator& __first,
   const _InputIterator& __last)
    {
      ;
      return __first;
    }


  template<typename _CharT, typename _Integer>
    inline const _CharT*
    __check_string(const _CharT* __s, const _Integer& __n)
    {



      return __s;
    }


  template<typename _CharT>
    inline const _CharT*
    __check_string(const _CharT* __s)
    {



      return __s;
    }



  template<typename _InputIterator>
    inline bool
    __check_sorted_aux(const _InputIterator&, const _InputIterator&,
                       std::input_iterator_tag)
    { return true; }



  template<typename _ForwardIterator>
    inline bool
    __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
                       std::forward_iterator_tag)
    {
      if (__first == __last)
        return true;

      _ForwardIterator __next = __first;
      for (++__next; __next != __last; __first = __next, ++__next) {
        if (*__next < *__first)
          return false;
      }

      return true;
    }



  template<typename _InputIterator, typename _Predicate>
    inline bool
    __check_sorted_aux(const _InputIterator&, const _InputIterator&,
                       _Predicate, std::input_iterator_tag)
    { return true; }



  template<typename _ForwardIterator, typename _Predicate>
    inline bool
    __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
                       _Predicate __pred, std::forward_iterator_tag)
    {
      if (__first == __last)
        return true;

      _ForwardIterator __next = __first;
      for (++__next; __next != __last; __first = __next, ++__next) {
        if (__pred(*__next, *__first))
          return false;
      }

      return true;
    }


  template<typename _InputIterator>
    inline bool
    __check_sorted(const _InputIterator& __first, const _InputIterator& __last)
    {
      typedef typename std::iterator_traits<_InputIterator>::iterator_category
        _Category;
      return __gnu_debug::__check_sorted_aux(__first, __last, _Category());
    }

  template<typename _InputIterator, typename _Predicate>
    inline bool
    __check_sorted(const _InputIterator& __first, const _InputIterator& __last,
                   _Predicate __pred)
    {
      typedef typename std::iterator_traits<_InputIterator>::iterator_category
        _Category;
      return __gnu_debug::__check_sorted_aux(__first, __last, __pred,
          _Category());
    }




  template<typename _ForwardIterator, typename _Tp>
    inline bool
    __check_partitioned(_ForwardIterator __first, _ForwardIterator __last,
   const _Tp& __value)
    {
      while (__first != __last && *__first < __value)
 ++__first;
      while (__first != __last && !(*__first < __value))
 ++__first;
      return __first == __last;
    }


  template<typename _ForwardIterator, typename _Tp, typename _Pred>
    inline bool
    __check_partitioned(_ForwardIterator __first, _ForwardIterator __last,
   const _Tp& __value, _Pred __pred)
    {
      while (__first != __last && __pred(*__first, __value))
 ++__first;
      while (__first != __last && !__pred(*__first, __value))
 ++__first;
      return __first == __last;
    }
}
# 78 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 2 3

namespace std
{
# 90 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2>
    inline void
    iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
    {
      typedef typename iterator_traits<_ForwardIterator1>::value_type
 _ValueType1;
      typedef typename iterator_traits<_ForwardIterator2>::value_type
 _ValueType2;


     

     

     

     


      const _ValueType1 __tmp = *__a;
      *__a = *__b;
      *__b = __tmp;
    }
# 123 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _Tp>
    inline void
    swap(_Tp& __a, _Tp& __b)
    {

     

      const _Tp __tmp = __a;
      __a = __b;
      __b = __tmp;
    }
# 148 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _Tp>
    inline const _Tp&
    min(const _Tp& __a, const _Tp& __b)
    {

     

      if (__b < __a)
 return __b;
      return __a;
    }
# 170 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _Tp>
    inline const _Tp&
    max(const _Tp& __a, const _Tp& __b)
    {

     

      if (__a < __b)
 return __b;
      return __a;
    }
# 192 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _Tp, typename _Compare>
    inline const _Tp&
    min(const _Tp& __a, const _Tp& __b, _Compare __comp)
    {

      if (__comp(__b, __a))
 return __b;
      return __a;
    }
# 212 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _Tp, typename _Compare>
    inline const _Tp&
    max(const _Tp& __a, const _Tp& __b, _Compare __comp)
    {

      if (__comp(__a, __b))
 return __b;
      return __a;
    }







  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy(_InputIterator __first, _InputIterator __last,
    _OutputIterator __result, input_iterator_tag)
    {
      for (; __first != __last; ++__result, ++__first)
 *__result = *__first;
      return __result;
    }

  template<typename _RandomAccessIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy(_RandomAccessIterator __first, _RandomAccessIterator __last,
    _OutputIterator __result, random_access_iterator_tag)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
          _Distance;
      for (_Distance __n = __last - __first; __n > 0; --__n)
 {
   *__result = *__first;
   ++__first;
   ++__result;
 }
      return __result;
    }

  template<typename _Tp>
    inline _Tp*
    __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result)
    {
      std::memmove(__result, __first, sizeof(_Tp) * (__last - __first));
      return __result + (__last - __first);
    }

  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy_aux2(_InputIterator __first, _InputIterator __last,
  _OutputIterator __result, __false_type)
    { return std::__copy(__first, __last, __result,
    std::__iterator_category(__first)); }

  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy_aux2(_InputIterator __first, _InputIterator __last,
  _OutputIterator __result, __true_type)
    { return std::__copy(__first, __last, __result,
    std::__iterator_category(__first)); }

  template<typename _Tp>
    inline _Tp*
    __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result, __true_type)
    { return std::__copy_trivial(__first, __last, __result); }

  template<typename _Tp>
    inline _Tp*
    __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result,
  __true_type)
    { return std::__copy_trivial(__first, __last, __result); }

  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy_ni2(_InputIterator __first, _InputIterator __last,
        _OutputIterator __result, __true_type)
    {
      typedef typename iterator_traits<_InputIterator>::value_type
 _ValueType;
      typedef typename __type_traits<
 _ValueType>::has_trivial_assignment_operator _Trivial;
      return _OutputIterator(std::__copy_aux2(__first, __last, __result.base(),
           _Trivial()));
    }

  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy_ni2(_InputIterator __first, _InputIterator __last,
        _OutputIterator __result, __false_type)
    {
      typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
      typedef typename __type_traits<
 _ValueType>::has_trivial_assignment_operator _Trivial;
      return std::__copy_aux2(__first, __last, __result, _Trivial());
    }

  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy_ni1(_InputIterator __first, _InputIterator __last,
        _OutputIterator __result, __true_type)
    {
      typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal;
      return std::__copy_ni2(__first.base(), __last.base(),
        __result, __Normal());
    }

  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    __copy_ni1(_InputIterator __first, _InputIterator __last,
        _OutputIterator __result, __false_type)
    {
      typedef typename _Is_normal_iterator<_OutputIterator>::_Normal __Normal;
      return std::__copy_ni2(__first, __last, __result, __Normal());
    }
# 346 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    copy(_InputIterator __first, _InputIterator __last,
  _OutputIterator __result)
    {

     
     

      ;

       typedef typename _Is_normal_iterator<_InputIterator>::_Normal __Normal;
       return std::__copy_ni1(__first, __last, __result, __Normal());
    }

  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
    inline _BidirectionalIterator2
    __copy_backward(_BidirectionalIterator1 __first,
      _BidirectionalIterator1 __last,
      _BidirectionalIterator2 __result,
      bidirectional_iterator_tag)
    {
      while (__first != __last)
        *--__result = *--__last;
      return __result;
    }

  template<typename _RandomAccessIterator, typename _BidirectionalIterator>
    inline _BidirectionalIterator
    __copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last,
      _BidirectionalIterator __result, random_access_iterator_tag)
    {
      typename iterator_traits<_RandomAccessIterator>::difference_type __n;
      for (__n = __last - __first; __n > 0; --__n)
        *--__result = *--__last;
      return __result;
    }






  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
           typename _BoolType>
    struct __copy_backward_dispatch
    {
      static _BidirectionalIterator2
      copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
    _BidirectionalIterator2 __result)
      { return std::__copy_backward(__first, __last, __result,
        std::__iterator_category(__first)); }
    };

  template<typename _Tp>
    struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
    {
      static _Tp*
      copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
      {
 const ptrdiff_t _Num = __last - __first;
 std::memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
 return __result - _Num;
      }
    };

  template<typename _Tp>
    struct __copy_backward_dispatch<const _Tp*, _Tp*, __true_type>
    {
      static _Tp*
      copy(const _Tp* __first, const _Tp* __last, _Tp* __result)
      {
 return std::__copy_backward_dispatch<_Tp*, _Tp*, __true_type>
   ::copy(__first, __last, __result);
      }
    };

  template<typename _BI1, typename _BI2>
    inline _BI2
    __copy_backward_aux(_BI1 __first, _BI1 __last, _BI2 __result)
    {
      typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
       ::has_trivial_assignment_operator _Trivial;
      return
 std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first,
          __last,
          __result);
    }

  template <typename _BI1, typename _BI2>
    inline _BI2
    __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
        _BI2 __result, __true_type)
    { return _BI2(std::__copy_backward_aux(__first, __last, __result.base())); }

  template <typename _BI1, typename _BI2>
    inline _BI2
    __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last,
        _BI2 __result, __false_type)
    { return std::__copy_backward_aux(__first, __last, __result); }

  template <typename _BI1, typename _BI2>
    inline _BI2
    __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last,
       _BI2 __result, __true_type)
    {
      typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
      return std::__copy_backward_output_normal_iterator(__first.base(),
        __last.base(),
        __result, __Normal());
    }

  template <typename _BI1, typename _BI2>
    inline _BI2
    __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last,
       _BI2 __result, __false_type)
    {
      typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal;
      return std::__copy_backward_output_normal_iterator(__first, __last,
        __result, __Normal());
    }
# 485 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template <typename _BI1, typename _BI2>
    inline _BI2
    copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
    {

     
     
     


      ;

      typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal;
      return std::__copy_backward_input_normal_iterator(__first, __last,
       __result, __Normal());
    }
# 514 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _ForwardIterator, typename _Tp>
    void
    fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
    {

     

      ;

      for ( ; __first != __last; ++__first)
 *__first = __value;
    }
# 538 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _OutputIterator, typename _Size, typename _Tp>
    _OutputIterator
    fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
    {

     

      for ( ; __n > 0; --__n, ++__first)
 *__first = __value;
      return __first;
    }


  inline void
  fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c)
  {
    ;
    const unsigned char __tmp = __c;
    std::memset(__first, __tmp, __last - __first);
  }

  inline void
  fill(signed char* __first, signed char* __last, const signed char& __c)
  {
    ;
    const signed char __tmp = __c;
    std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
  }

  inline void
  fill(char* __first, char* __last, const char& __c)
  {
    ;
    const char __tmp = __c;
    std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
  }

  template<typename _Size>
    inline unsigned char*
    fill_n(unsigned char* __first, _Size __n, const unsigned char& __c)
    {
      std::fill(__first, __first + __n, __c);
      return __first + __n;
    }

  template<typename _Size>
    inline signed char*
    fill_n(char* __first, _Size __n, const signed char& __c)
    {
      std::fill(__first, __first + __n, __c);
      return __first + __n;
    }

  template<typename _Size>
    inline char*
    fill_n(char* __first, _Size __n, const char& __c)
    {
      std::fill(__first, __first + __n, __c);
      return __first + __n;
    }
# 612 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator1, typename _InputIterator2>
    pair<_InputIterator1, _InputIterator2>
    mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
      _InputIterator2 __first2)
    {

     
     
     


      ;

      while (__first1 != __last1 && *__first1 == *__first2)
        {
   ++__first1;
   ++__first2;
        }
      return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
    }
# 647 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _BinaryPredicate>
    pair<_InputIterator1, _InputIterator2>
    mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
      _InputIterator2 __first2, _BinaryPredicate __binary_pred)
    {

     
     
      ;

      while (__first1 != __last1 && __binary_pred(*__first1, *__first2))
        {
   ++__first1;
   ++__first2;
        }
      return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
    }
# 677 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator1, typename _InputIterator2>
    inline bool
    equal(_InputIterator1 __first1, _InputIterator1 __last1,
   _InputIterator2 __first2)
    {

     
     
     


      ;

      for ( ; __first1 != __last1; ++__first1, ++__first2)
 if (!(*__first1 == *__first2))
   return false;
      return true;
    }
# 709 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _BinaryPredicate>
    inline bool
    equal(_InputIterator1 __first1, _InputIterator1 __last1,
   _InputIterator2 __first2,
   _BinaryPredicate __binary_pred)
    {

     
     
      ;

      for ( ; __first1 != __last1; ++__first1, ++__first2)
 if (!__binary_pred(*__first1, *__first2))
   return false;
      return true;
    }
# 741 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator1, typename _InputIterator2>
    bool
    lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2)
    {

     
     
     


     


      ;
      ;

      for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
 {
   if (*__first1 < *__first2)
     return true;
   if (*__first2 < *__first1)
     return false;
 }
      return __first1 == __last1 && __first2 != __last2;
    }
# 780 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _Compare>
    bool
    lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2,
       _Compare __comp)
    {

     
     
      ;
      ;

      for ( ; __first1 != __last1 && __first2 != __last2
     ; ++__first1, ++__first2)
 {
   if (__comp(*__first1, *__first2))
     return true;
   if (__comp(*__first2, *__first1))
     return false;
 }
      return __first1 == __last1 && __first2 != __last2;
    }

  inline bool
  lexicographical_compare(const unsigned char* __first1,
     const unsigned char* __last1,
     const unsigned char* __first2,
     const unsigned char* __last2)
  {
    ;
    ;

    const size_t __len1 = __last1 - __first1;
    const size_t __len2 = __last2 - __first2;
    const int __result = std::memcmp(__first1, __first2,
         std::min(__len1, __len2));
    return __result != 0 ? __result < 0 : __len1 < __len2;
  }

  inline bool
  lexicographical_compare(const char* __first1, const char* __last1,
     const char* __first2, const char* __last2)
  {
    ;
    ;


    return std::lexicographical_compare((const signed char*) __first1,
     (const signed char*) __last1,
     (const signed char*) __first2,
     (const signed char*) __last2);






  }

}
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 2 3


namespace __gnu_cxx
{
# 62 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 3
  template <class _CharT>
    struct _Char_types
    {
      typedef unsigned long int_type;
      typedef std::streampos pos_type;
      typedef std::streamoff off_type;
      typedef std::mbstate_t state_type;
    };
# 86 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 3
  template<typename _CharT>
    struct char_traits
    {
      typedef _CharT char_type;
      typedef typename _Char_types<_CharT>::int_type int_type;
      typedef typename _Char_types<_CharT>::pos_type pos_type;
      typedef typename _Char_types<_CharT>::off_type off_type;
      typedef typename _Char_types<_CharT>::state_type state_type;

      static void
      assign(char_type& __c1, const char_type& __c2)
      { __c1 = __c2; }

      static bool
      eq(const char_type& __c1, const char_type& __c2)
      { return __c1 == __c2; }

      static bool
      lt(const char_type& __c1, const char_type& __c2)
      { return __c1 < __c2; }

      static int
      compare(const char_type* __s1, const char_type* __s2, std::size_t __n);

      static std::size_t
      length(const char_type* __s);

      static const char_type*
      find(const char_type* __s, std::size_t __n, const char_type& __a);

      static char_type*
      move(char_type* __s1, const char_type* __s2, std::size_t __n);

      static char_type*
      copy(char_type* __s1, const char_type* __s2, std::size_t __n);

      static char_type*
      assign(char_type* __s, std::size_t __n, char_type __a);

      static char_type
      to_char_type(const int_type& __c)
      { return static_cast<char_type>(__c); }

      static int_type
      to_int_type(const char_type& __c)
      { return static_cast<int_type>(__c); }

      static bool
      eq_int_type(const int_type& __c1, const int_type& __c2)
      { return __c1 == __c2; }

      static int_type
      eof()
      { return static_cast<int_type>((-1)); }

      static int_type
      not_eof(const int_type& __c)
      { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
    };

  template<typename _CharT>
    int
    char_traits<_CharT>::
    compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
    {
      for (size_t __i = 0; __i < __n; ++__i)
 if (lt(__s1[__i], __s2[__i]))
   return -1;
 else if (lt(__s2[__i], __s1[__i]))
   return 1;
      return 0;
    }

  template<typename _CharT>
    std::size_t
    char_traits<_CharT>::
    length(const char_type* __p)
    {
      std::size_t __i = 0;
      while (!eq(__p[__i], char_type()))
        ++__i;
      return __i;
    }

  template<typename _CharT>
    const typename char_traits<_CharT>::char_type*
    char_traits<_CharT>::
    find(const char_type* __s, std::size_t __n, const char_type& __a)
    {
      for (std::size_t __i = 0; __i < __n; ++__i)
        if (eq(__s[__i], __a))
          return __s + __i;
      return 0;
    }

  template<typename _CharT>
    typename char_traits<_CharT>::char_type*
    char_traits<_CharT>::
    move(char_type* __s1, const char_type* __s2, std::size_t __n)
    {
      return static_cast<_CharT*>(std::memmove(__s1, __s2,
            __n * sizeof(char_type)));
    }

  template<typename _CharT>
    typename char_traits<_CharT>::char_type*
    char_traits<_CharT>::
    copy(char_type* __s1, const char_type* __s2, std::size_t __n)
    {
      std::copy(__s2, __s2 + __n, __s1);
      return __s1;
    }

  template<typename _CharT>
    typename char_traits<_CharT>::char_type*
    char_traits<_CharT>::
    assign(char_type* __s, std::size_t __n, char_type __a)
    {
      std::fill_n(__s, __n, __a);
      return __s;
    }
}

namespace std
{
# 224 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/char_traits.h" 3
  template<class _CharT>
    struct char_traits
    : public __gnu_cxx::char_traits<_CharT>
    { };



  template<>
    struct char_traits<char>
    {
      typedef char char_type;
      typedef int int_type;
      typedef streampos pos_type;
      typedef streamoff off_type;
      typedef mbstate_t state_type;

      static void
      assign(char_type& __c1, const char_type& __c2)
      { __c1 = __c2; }

      static bool
      eq(const char_type& __c1, const char_type& __c2)
      { return __c1 == __c2; }

      static bool
      lt(const char_type& __c1, const char_type& __c2)
      { return __c1 < __c2; }

      static int
      compare(const char_type* __s1, const char_type* __s2, size_t __n)
      { return memcmp(__s1, __s2, __n); }

      static size_t
      length(const char_type* __s)
      { return strlen(__s); }

      static const char_type*
      find(const char_type* __s, size_t __n, const char_type& __a)
      { return static_cast<const char_type*>(memchr(__s, __a, __n)); }

      static char_type*
      move(char_type* __s1, const char_type* __s2, size_t __n)
      { return static_cast<char_type*>(memmove(__s1, __s2, __n)); }

      static char_type*
      copy(char_type* __s1, const char_type* __s2, size_t __n)
      { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }

      static char_type*
      assign(char_type* __s, size_t __n, char_type __a)
      { return static_cast<char_type*>(memset(__s, __a, __n)); }

      static char_type
      to_char_type(const int_type& __c)
      { return static_cast<char_type>(__c); }



      static int_type
      to_int_type(const char_type& __c)
      { return static_cast<int_type>(static_cast<unsigned char>(__c)); }

      static bool
      eq_int_type(const int_type& __c1, const int_type& __c2)
      { return __c1 == __c2; }

      static int_type
      eof() { return static_cast<int_type>((-1)); }

      static int_type
      not_eof(const int_type& __c)
      { return (__c == eof()) ? 0 : __c; }
  };




  template<>
    struct char_traits<wchar_t>
    {
      typedef wchar_t char_type;
      typedef wint_t int_type;
      typedef streamoff off_type;
      typedef wstreampos pos_type;
      typedef mbstate_t state_type;

      static void
      assign(char_type& __c1, const char_type& __c2)
      { __c1 = __c2; }

      static bool
      eq(const char_type& __c1, const char_type& __c2)
      { return __c1 == __c2; }

      static bool
      lt(const char_type& __c1, const char_type& __c2)
      { return __c1 < __c2; }

      static int
      compare(const char_type* __s1, const char_type* __s2, size_t __n)
      { return wmemcmp(__s1, __s2, __n); }

      static size_t
      length(const char_type* __s)
      { return wcslen(__s); }

      static const char_type*
      find(const char_type* __s, size_t __n, const char_type& __a)
      { return wmemchr(__s, __a, __n); }

      static char_type*
      move(char_type* __s1, const char_type* __s2, size_t __n)
      { return wmemmove(__s1, __s2, __n); }

      static char_type*
      copy(char_type* __s1, const char_type* __s2, size_t __n)
      { return wmemcpy(__s1, __s2, __n); }

      static char_type*
      assign(char_type* __s, size_t __n, char_type __a)
      { return wmemset(__s, __a, __n); }

      static char_type
      to_char_type(const int_type& __c) { return char_type(__c); }

      static int_type
      to_int_type(const char_type& __c) { return int_type(__c); }

      static bool
      eq_int_type(const int_type& __c1, const int_type& __c2)
      { return __c1 == __c2; }

      static int_type
      eof() { return static_cast<int_type>((0xffffffffu)); }

      static int_type
      not_eof(const int_type& __c)
      { return eq_int_type(__c, eof()) ? 0 : __c; }
  };


  template<typename _CharT, typename _Traits>
    struct _Char_traits_match
    {
      _CharT _M_c;
      _Char_traits_match(_CharT const& __c) : _M_c(__c) { }

      bool
      operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); }
    };
}
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/localefwd.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/localefwd.h" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/localefwd.h" 3




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 1 3
# 36 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 3
namespace std
{

  void
  __throw_bad_exception(void);


  void
  __throw_bad_alloc(void);


  void
  __throw_bad_cast(void);

  void
  __throw_bad_typeid(void);


  void
  __throw_logic_error(const char* __s);

  void
  __throw_domain_error(const char* __s);

  void
  __throw_invalid_argument(const char* __s);

  void
  __throw_length_error(const char* __s);

  void
  __throw_out_of_range(const char* __s);

  void
  __throw_runtime_error(const char* __s);

  void
  __throw_range_error(const char* __s);

  void
  __throw_overflow_error(const char* __s);

  void
  __throw_underflow_error(const char* __s);


  void
  __throw_ios_failure(const char* __s);
}
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/localefwd.h" 2 3

namespace std
{

  class locale;


  template<typename _CharT>
    inline bool
    isspace(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isprint(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    iscntrl(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isupper(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    islower(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isalpha(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isdigit(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    ispunct(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isxdigit(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isalnum(_CharT, const locale&);

  template<typename _CharT>
    inline bool
    isgraph(_CharT, const locale&);

  template<typename _CharT>
    inline _CharT
    toupper(_CharT, const locale&);

  template<typename _CharT>
    inline _CharT
    tolower(_CharT, const locale&);


  class ctype_base;
  template<typename _CharT>
    class ctype;
  template<> class ctype<char>;

  template<> class ctype<wchar_t>;

  template<typename _CharT>
    class ctype_byname;


  class codecvt_base;
  class __enc_traits;
  template<typename _InternT, typename _ExternT, typename _StateT>
    class codecvt;
  template<> class codecvt<char, char, mbstate_t>;

  template<> class codecvt<wchar_t, char, mbstate_t>;

  template<typename _InternT, typename _ExternT, typename _StateT>
    class codecvt_byname;


  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
    class num_get;
  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
    class num_put;
  template<typename _CharT> class numpunct;
  template<typename _CharT> class numpunct_byname;


  template<typename _CharT>
    class collate;
  template<typename _CharT> class
    collate_byname;


  class time_base;
  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
    class time_get;
  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
    class time_get_byname;
  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
    class time_put;
  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
    class time_put_byname;


  class money_base;
  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
    class money_get;
  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
    class money_put;
  template<typename _CharT, bool _Intl = false>
    class moneypunct;
  template<typename _CharT, bool _Intl = false>
    class moneypunct_byname;


  class messages_base;
  template<typename _CharT>
    class messages;
  template<typename _CharT>
    class messages_byname;

  template<typename _Facet>
    bool
    has_facet(const locale& __loc) throw();

  template<typename _Facet>
    const _Facet&
    use_facet(const locale& __loc);

  template<typename _Facet>
    inline const _Facet&
    __check_facet(const _Facet* __f)
    {
      if (!__f)
 __throw_bad_cast();
      return *__f;
    }
}
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/atomicity.h" 1 3
# 33 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/atomicity.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/atomic_word.h" 1 3
# 33 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/atomic_word.h" 3
typedef int _Atomic_word;
# 34 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/atomicity.h" 2 3

namespace __gnu_cxx
{
  _Atomic_word
  __attribute__ ((__unused__))
  __exchange_and_add(volatile _Atomic_word* __mem, int __val);

  void
  __attribute__ ((__unused__))
  __atomic_add(volatile _Atomic_word* __mem, int __val);
}
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 3




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 1 3
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
       
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/allocator.h" 1 3
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/allocator.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++allocator.h" 1 3
# 34 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++allocator.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ext/new_allocator.h" 1 3
# 35 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ext/new_allocator.h" 3
namespace __gnu_cxx
{
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ext/new_allocator.h" 3
  template<typename _Tp>
    class new_allocator
    {
    public:
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef _Tp* pointer;
      typedef const _Tp* const_pointer;
      typedef _Tp& reference;
      typedef const _Tp& const_reference;
      typedef _Tp value_type;

      template<typename _Tp1>
        struct rebind
        { typedef new_allocator<_Tp1> other; };

      new_allocator() throw() { }

      new_allocator(const new_allocator&) throw() { }

      template<typename _Tp1>
        new_allocator(const new_allocator<_Tp1>&) throw() { }

      ~new_allocator() throw() { }

      pointer
      address(reference __x) const { return &__x; }

      const_pointer
      address(const_reference __x) const { return &__x; }



      pointer
      allocate(size_type __n, const void* = 0)
      { return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); }


      void
      deallocate(pointer __p, size_type)
      { ::operator delete(__p); }

      size_type
      max_size() const throw()
      { return size_t(-1) / sizeof(_Tp); }



      void
      construct(pointer __p, const _Tp& __val)
      { ::new(__p) _Tp(__val); }

      void
      destroy(pointer __p) { __p->~_Tp(); }
    };

  template<typename _Tp>
    inline bool
    operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
    { return true; }

  template<typename _Tp>
    inline bool
    operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
    { return false; }
}
# 35 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/c++allocator.h" 2 3
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/allocator.h" 2 3

namespace std
{
  template<typename _Tp>
    class allocator;

  template<>
    class allocator<void>
    {
    public:
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef void* pointer;
      typedef const void* const_pointer;
      typedef void value_type;

      template<typename _Tp1>
        struct rebind
        { typedef allocator<_Tp1> other; };
    };






  template<typename _Tp>
    class allocator: public __gnu_cxx::new_allocator<_Tp>
    {
   public:
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef _Tp* pointer;
      typedef const _Tp* const_pointer;
      typedef _Tp& reference;
      typedef const _Tp& const_reference;
      typedef _Tp value_type;

      template<typename _Tp1>
        struct rebind
        { typedef allocator<_Tp1> other; };

      allocator() throw() { }

      allocator(const allocator& a) throw()
      : __gnu_cxx::new_allocator<_Tp>(a) { }

      template<typename _Tp1>
        allocator(const allocator<_Tp1>&) throw() { }

      ~allocator() throw() { }


    };

  template<typename _T1, typename _T2>
    inline bool
    operator==(const allocator<_T1>&, const allocator<_T2>&)
    { return true; }

  template<typename _T1, typename _T2>
    inline bool
    operator!=(const allocator<_T1>&, const allocator<_T2>&)
    { return false; }





  extern template class allocator<char>;
  extern template class allocator<wchar_t>;




}
# 56 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h" 1 3
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h" 3
namespace std
{






  template<typename _T1, typename _T2>
    inline void
    _Construct(_T1* __p, const _T2& __value)
    {


      ::new(static_cast<void*>(__p)) _T1(__value);
    }







  template<typename _T1>
    inline void
    _Construct(_T1* __p)
    {


      ::new(static_cast<void*>(__p)) _T1();
    }






  template<typename _Tp>
    inline void
    _Destroy(_Tp* __pointer)
    { __pointer->~_Tp(); }
# 116 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h" 3
  template<typename _ForwardIterator>
    inline void
    __destroy_aux(_ForwardIterator __first, _ForwardIterator __last,
    __false_type)
    { for ( ; __first != __last; ++__first) std::_Destroy(&*__first); }
# 131 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h" 3
  template<typename _ForwardIterator>
    inline void
    __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type)
    { }
# 143 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h" 3
  template<typename _ForwardIterator>
    inline void
    _Destroy(_ForwardIterator __first, _ForwardIterator __last)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
                       _Value_type;
      typedef typename __type_traits<_Value_type>::has_trivial_destructor
                       _Has_trivial_destructor;

      std::__destroy_aux(__first, __last, _Has_trivial_destructor());
    }
}
# 57 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_uninitialized.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_uninitialized.h" 3
namespace std
{

  template<typename _InputIterator, typename _ForwardIterator>
    inline _ForwardIterator
    __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
        _ForwardIterator __result,
        __true_type)
    { return std::copy(__first, __last, __result); }

  template<typename _InputIterator, typename _ForwardIterator>
    inline _ForwardIterator
    __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
        _ForwardIterator __result,
        __false_type)
    {
      _ForwardIterator __cur = __result;
      try
 {
   for ( ; __first != __last; ++__first, ++__cur)
     std::_Construct(&*__cur, *__first);
   return __cur;
 }
      catch(...)
 {
   std::_Destroy(__result, __cur);
   throw;
 }
    }
# 105 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_uninitialized.h" 3
  template<typename _InputIterator, typename _ForwardIterator>
    inline _ForwardIterator
    uninitialized_copy(_InputIterator __first, _InputIterator __last,
         _ForwardIterator __result)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
      typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD;
      return std::__uninitialized_copy_aux(__first, __last, __result,
        _Is_POD());
    }

  inline char*
  uninitialized_copy(const char* __first, const char* __last, char* __result)
  {
    std::memmove(__result, __first, __last - __first);
    return __result + (__last - __first);
  }

  inline wchar_t*
  uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
       wchar_t* __result)
  {
    std::memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
    return __result + (__last - __first);
  }



  template<typename _ForwardIterator, typename _Tp>
    inline void
    __uninitialized_fill_aux(_ForwardIterator __first,
        _ForwardIterator __last,
        const _Tp& __x, __true_type)
    { std::fill(__first, __last, __x); }

  template<typename _ForwardIterator, typename _Tp>
    void
    __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last,
        const _Tp& __x, __false_type)
    {
      _ForwardIterator __cur = __first;
      try
 {
   for ( ; __cur != __last; ++__cur)
     std::_Construct(&*__cur, __x);
 }
      catch(...)
 {
   std::_Destroy(__first, __cur);
   throw;
 }
    }
# 167 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_uninitialized.h" 3
  template<typename _ForwardIterator, typename _Tp>
    inline void
    uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
         const _Tp& __x)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
      typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD;
      std::__uninitialized_fill_aux(__first, __last, __x, _Is_POD());
    }



  template<typename _ForwardIterator, typename _Size, typename _Tp>
    inline _ForwardIterator
    __uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n,
          const _Tp& __x, __true_type)
    { return std::fill_n(__first, __n, __x); }

  template<typename _ForwardIterator, typename _Size, typename _Tp>
    _ForwardIterator
    __uninitialized_fill_n_aux(_ForwardIterator __first, _Size __n,
          const _Tp& __x, __false_type)
    {
      _ForwardIterator __cur = __first;
      try
 {
   for ( ; __n > 0; --__n, ++__cur)
     std::_Construct(&*__cur, __x);
   return __cur;
 }
      catch(...)
 {
   std::_Destroy(__first, __cur);
   throw;
 }
    }
# 213 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_uninitialized.h" 3
  template<typename _ForwardIterator, typename _Size, typename _Tp>
    inline _ForwardIterator
    uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
      typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD;
      return std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
    }
# 230 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_uninitialized.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _ForwardIterator>
    inline _ForwardIterator
    __uninitialized_copy_copy(_InputIterator1 __first1,
         _InputIterator1 __last1,
         _InputIterator2 __first2,
         _InputIterator2 __last2,
         _ForwardIterator __result)
    {
      _ForwardIterator __mid = std::uninitialized_copy(__first1, __last1,
             __result);
      try
 {
   return std::uninitialized_copy(__first2, __last2, __mid);
 }
      catch(...)
 {
   std::_Destroy(__result, __mid);
   throw;
 }
    }




  template<typename _ForwardIterator, typename _Tp, typename _InputIterator>
    inline _ForwardIterator
    __uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid,
         const _Tp& __x, _InputIterator __first,
         _InputIterator __last)
    {
      std::uninitialized_fill(__result, __mid, __x);
      try
 {
   return std::uninitialized_copy(__first, __last, __mid);
 }
      catch(...)
 {
   std::_Destroy(__result, __mid);
   throw;
 }
    }




  template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
    inline void
    __uninitialized_copy_fill(_InputIterator __first1, _InputIterator __last1,
         _ForwardIterator __first2,
         _ForwardIterator __last2, const _Tp& __x)
    {
      _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1,
       __first2);
      try
 {
   std::uninitialized_fill(__mid2, __last2, __x);
 }
      catch(...)
 {
   std::_Destroy(__first2, __mid2);
   throw;
 }
    }

}
# 59 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_raw_storage_iter.h" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_raw_storage_iter.h" 3
namespace std
{




  template <class _ForwardIterator, class _Tp>
    class raw_storage_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
    {
    protected:
      _ForwardIterator _M_iter;

    public:
      explicit
      raw_storage_iterator(_ForwardIterator __x)
      : _M_iter(__x) {}

      raw_storage_iterator&
      operator*() { return *this; }

      raw_storage_iterator&
      operator=(const _Tp& __element)
      {
 std::_Construct(&*_M_iter, __element);
 return *this;
      }

      raw_storage_iterator<_ForwardIterator, _Tp>&
      operator++()
      {
 ++_M_iter;
 return *this;
      }

      raw_storage_iterator<_ForwardIterator, _Tp>
      operator++(int)
      {
 raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
 ++_M_iter;
 return __tmp;
      }
    };
}
# 60 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits" 3
# 150 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits" 3
namespace std
{





  enum float_round_style
  {
    round_indeterminate = -1,
    round_toward_zero = 0,
    round_to_nearest = 1,
    round_toward_infinity = 2,
    round_toward_neg_infinity = 3
  };







  enum float_denorm_style
  {

    denorm_indeterminate = -1,

    denorm_absent = 0,

    denorm_present = 1
  };
# 192 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits" 3
  struct __numeric_limits_base
  {


    static const bool is_specialized = false;




    static const int digits = 0;

    static const int digits10 = 0;

    static const bool is_signed = false;





    static const bool is_integer = false;




    static const bool is_exact = false;


    static const int radix = 0;



    static const int min_exponent = 0;


    static const int min_exponent10 = 0;



    static const int max_exponent = 0;


    static const int max_exponent10 = 0;


    static const bool has_infinity = false;


    static const bool has_quiet_NaN = false;


    static const bool has_signaling_NaN = false;

    static const float_denorm_style has_denorm = denorm_absent;


    static const bool has_denorm_loss = false;



    static const bool is_iec559 = false;



    static const bool is_bounded = false;




    static const bool is_modulo = false;


    static const bool traps = false;

    static const bool tinyness_before = false;



    static const float_round_style round_style = round_toward_zero;
  };
# 285 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits" 3
  template<typename _Tp>
    struct numeric_limits : public __numeric_limits_base
    {


      static _Tp min() throw() { return static_cast<_Tp>(0); }

      static _Tp max() throw() { return static_cast<_Tp>(0); }


      static _Tp epsilon() throw() { return static_cast<_Tp>(0); }

      static _Tp round_error() throw() { return static_cast<_Tp>(0); }

      static _Tp infinity() throw() { return static_cast<_Tp>(0); }

      static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }


      static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }



      static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
    };



  template<>
    struct numeric_limits<bool>
    {
      static const bool is_specialized = true;

      static bool min() throw()
      { return false; }
      static bool max() throw()
      { return true; }

      static const int digits = 1;
      static const int digits10 = 0;
      static const bool is_signed = false;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static bool epsilon() throw()
      { return false; }
      static bool round_error() throw()
      { return false; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static bool infinity() throw()
      { return false; }
      static bool quiet_NaN() throw()
      { return false; }
      static bool signaling_NaN() throw()
      { return false; }
      static bool denorm_min() throw()
      { return false; }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = false;




      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<char>
    {
      static const bool is_specialized = true;

      static char min() throw()
      { return (((char)(-1) < 0) ? (char)1 << (sizeof(char) * 8 - ((char)(-1) < 0)) : (char)0); }
      static char max() throw()
      { return (((char)(-1) < 0) ? ((char)1 << (sizeof(char) * 8 - ((char)(-1) < 0))) - 1 : ~(char)0); }

      static const int digits = (sizeof(char) * 8 - ((char)(-1) < 0));
      static const int digits10 = ((sizeof(char) * 8 - ((char)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = ((char)(-1) < 0);
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static char epsilon() throw()
      { return 0; }
      static char round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static char infinity() throw()
      { return char(); }
      static char quiet_NaN() throw()
      { return char(); }
      static char signaling_NaN() throw()
      { return char(); }
      static char denorm_min() throw()
      { return static_cast<char>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<signed char>
    {
      static const bool is_specialized = true;

      static signed char min() throw()
      { return -127 - 1; }
      static signed char max() throw()
      { return 127; }

      static const int digits = (sizeof(signed char) * 8 - ((signed char)(-1) < 0));
      static const int digits10 = ((sizeof(signed char) * 8 - ((signed char)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = true;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static signed char epsilon() throw()
      { return 0; }
      static signed char round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static signed char infinity() throw()
      { return static_cast<signed char>(0); }
      static signed char quiet_NaN() throw()
      { return static_cast<signed char>(0); }
      static signed char signaling_NaN() throw()
      { return static_cast<signed char>(0); }
      static signed char denorm_min() throw()
      { return static_cast<signed char>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<unsigned char>
    {
      static const bool is_specialized = true;

      static unsigned char min() throw()
      { return 0; }
      static unsigned char max() throw()
      { return 127 * 2U + 1; }

      static const int digits = (sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0));
      static const int digits10 = ((sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = false;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static unsigned char epsilon() throw()
      { return 0; }
      static unsigned char round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static unsigned char infinity() throw()
      { return static_cast<unsigned char>(0); }
      static unsigned char quiet_NaN() throw()
      { return static_cast<unsigned char>(0); }
      static unsigned char signaling_NaN() throw()
      { return static_cast<unsigned char>(0); }
      static unsigned char denorm_min() throw()
      { return static_cast<unsigned char>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<wchar_t>
    {
      static const bool is_specialized = true;

      static wchar_t min() throw()
      { return (((wchar_t)(-1) < 0) ? (wchar_t)1 << (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) : (wchar_t)0); }
      static wchar_t max() throw()
      { return (((wchar_t)(-1) < 0) ? ((wchar_t)1 << (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0))) - 1 : ~(wchar_t)0); }

      static const int digits = (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0));
      static const int digits10 = ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = ((wchar_t)(-1) < 0);
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static wchar_t epsilon() throw()
      { return 0; }
      static wchar_t round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static wchar_t infinity() throw()
      { return wchar_t(); }
      static wchar_t quiet_NaN() throw()
      { return wchar_t(); }
      static wchar_t signaling_NaN() throw()
      { return wchar_t(); }
      static wchar_t denorm_min() throw()
      { return wchar_t(); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<short>
    {
      static const bool is_specialized = true;

      static short min() throw()
      { return -32767 - 1; }
      static short max() throw()
      { return 32767; }

      static const int digits = (sizeof(short) * 8 - ((short)(-1) < 0));
      static const int digits10 = ((sizeof(short) * 8 - ((short)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = true;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static short epsilon() throw()
      { return 0; }
      static short round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static short infinity() throw()
      { return short(); }
      static short quiet_NaN() throw()
      { return short(); }
      static short signaling_NaN() throw()
      { return short(); }
      static short denorm_min() throw()
      { return short(); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<unsigned short>
    {
      static const bool is_specialized = true;

      static unsigned short min() throw()
      { return 0; }
      static unsigned short max() throw()
      { return 32767 * 2U + 1; }

      static const int digits = (sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0));
      static const int digits10 = ((sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = false;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static unsigned short epsilon() throw()
      { return 0; }
      static unsigned short round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static unsigned short infinity() throw()
      { return static_cast<unsigned short>(0); }
      static unsigned short quiet_NaN() throw()
      { return static_cast<unsigned short>(0); }
      static unsigned short signaling_NaN() throw()
      { return static_cast<unsigned short>(0); }
      static unsigned short denorm_min() throw()
      { return static_cast<unsigned short>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<int>
    {
      static const bool is_specialized = true;

      static int min() throw()
      { return -2147483647 - 1; }
      static int max() throw()
      { return 2147483647; }

      static const int digits = (sizeof(int) * 8 - ((int)(-1) < 0));
      static const int digits10 = ((sizeof(int) * 8 - ((int)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = true;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static int epsilon() throw()
      { return 0; }
      static int round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static int infinity() throw()
      { return static_cast<int>(0); }
      static int quiet_NaN() throw()
      { return static_cast<int>(0); }
      static int signaling_NaN() throw()
      { return static_cast<int>(0); }
      static int denorm_min() throw()
      { return static_cast<int>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<unsigned int>
    {
      static const bool is_specialized = true;

      static unsigned int min() throw()
      { return 0; }
      static unsigned int max() throw()
      { return 2147483647 * 2U + 1; }

      static const int digits = (sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0));
      static const int digits10 = ((sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = false;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static unsigned int epsilon() throw()
      { return 0; }
      static unsigned int round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static unsigned int infinity() throw()
      { return static_cast<unsigned int>(0); }
      static unsigned int quiet_NaN() throw()
      { return static_cast<unsigned int>(0); }
      static unsigned int signaling_NaN() throw()
      { return static_cast<unsigned int>(0); }
      static unsigned int denorm_min() throw()
      { return static_cast<unsigned int>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<long>
    {
      static const bool is_specialized = true;

      static long min() throw()
      { return -2147483647L - 1; }
      static long max() throw()
      { return 2147483647L; }

      static const int digits = (sizeof(long) * 8 - ((long)(-1) < 0));
      static const int digits10 = ((sizeof(long) * 8 - ((long)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = true;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static long epsilon() throw()
      { return 0; }
      static long round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static long infinity() throw()
      { return static_cast<long>(0); }
      static long quiet_NaN() throw()
      { return static_cast<long>(0); }
      static long signaling_NaN() throw()
      { return static_cast<long>(0); }
      static long denorm_min() throw()
      { return static_cast<long>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<unsigned long>
    {
      static const bool is_specialized = true;

      static unsigned long min() throw()
      { return 0; }
      static unsigned long max() throw()
      { return 2147483647L * 2UL + 1; }

      static const int digits = (sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0));
      static const int digits10 = ((sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = false;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static unsigned long epsilon() throw()
      { return 0; }
      static unsigned long round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static unsigned long infinity() throw()
      { return static_cast<unsigned long>(0); }
      static unsigned long quiet_NaN() throw()
      { return static_cast<unsigned long>(0); }
      static unsigned long signaling_NaN() throw()
      { return static_cast<unsigned long>(0); }
      static unsigned long denorm_min() throw()
      { return static_cast<unsigned long>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<long long>
    {
      static const bool is_specialized = true;

      static long long min() throw()
      { return -9223372036854775807LL - 1; }
      static long long max() throw()
      { return 9223372036854775807LL; }

      static const int digits = (sizeof(long long) * 8 - ((long long)(-1) < 0));
      static const int digits10 = ((sizeof(long long) * 8 - ((long long)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = true;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static long long epsilon() throw()
      { return 0; }
      static long long round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static long long infinity() throw()
      { return static_cast<long long>(0); }
      static long long quiet_NaN() throw()
      { return static_cast<long long>(0); }
      static long long signaling_NaN() throw()
      { return static_cast<long long>(0); }
      static long long denorm_min() throw()
      { return static_cast<long long>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<unsigned long long>
    {
      static const bool is_specialized = true;

      static unsigned long long min() throw()
      { return 0; }
      static unsigned long long max() throw()
      { return 9223372036854775807LL * 2ULL + 1; }

      static const int digits = (sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0));
      static const int digits10 = ((sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0)) * 643 / 2136);
      static const bool is_signed = false;
      static const bool is_integer = true;
      static const bool is_exact = true;
      static const int radix = 2;
      static unsigned long long epsilon() throw()
      { return 0; }
      static unsigned long long round_error() throw()
      { return 0; }

      static const int min_exponent = 0;
      static const int min_exponent10 = 0;
      static const int max_exponent = 0;
      static const int max_exponent10 = 0;

      static const bool has_infinity = false;
      static const bool has_quiet_NaN = false;
      static const bool has_signaling_NaN = false;
      static const float_denorm_style has_denorm = denorm_absent;
      static const bool has_denorm_loss = false;

      static unsigned long long infinity() throw()
      { return static_cast<unsigned long long>(0); }
      static unsigned long long quiet_NaN() throw()
      { return static_cast<unsigned long long>(0); }
      static unsigned long long signaling_NaN() throw()
      { return static_cast<unsigned long long>(0); }
      static unsigned long long denorm_min() throw()
      { return static_cast<unsigned long long>(0); }

      static const bool is_iec559 = false;
      static const bool is_bounded = true;
      static const bool is_modulo = true;

      static const bool traps = true;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_toward_zero;
    };

  template<>
    struct numeric_limits<float>
    {
      static const bool is_specialized = true;

      static float min() throw()
      { return 1.17549435e-38F; }
      static float max() throw()
      { return 3.40282347e+38F; }

      static const int digits = 24;
      static const int digits10 = 6;
      static const bool is_signed = true;
      static const bool is_integer = false;
      static const bool is_exact = false;
      static const int radix = 2;
      static float epsilon() throw()
      { return 1.19209290e-7F; }
      static float round_error() throw()
      { return 0.5F; }

      static const int min_exponent = (-125);
      static const int min_exponent10 = (-37);
      static const int max_exponent = 128;
      static const int max_exponent10 = 38;

      static const bool has_infinity = 1;
      static const bool has_quiet_NaN = 1;
      static const bool has_signaling_NaN = has_quiet_NaN;
      static const float_denorm_style has_denorm
 = bool(1.40129846e-45F) ? denorm_present : denorm_absent;
      static const bool has_denorm_loss = false;

      static float infinity() throw()
      { return __builtin_huge_valf (); }
      static float quiet_NaN() throw()
      { return __builtin_nanf (""); }
      static float signaling_NaN() throw()
      { return __builtin_nansf (""); }
      static float denorm_min() throw()
      { return 1.40129846e-45F; }

      static const bool is_iec559
 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
      static const bool is_bounded = true;
      static const bool is_modulo = false;

      static const bool traps = false;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_to_nearest;
    };





  template<>
    struct numeric_limits<double>
    {
      static const bool is_specialized = true;

      static double min() throw()
      { return 2.2250738585072014e-308; }
      static double max() throw()
      { return 1.7976931348623157e+308; }

      static const int digits = 53;
      static const int digits10 = 15;
      static const bool is_signed = true;
      static const bool is_integer = false;
      static const bool is_exact = false;
      static const int radix = 2;
      static double epsilon() throw()
      { return 2.2204460492503131e-16; }
      static double round_error() throw()
      { return 0.5; }

      static const int min_exponent = (-1021);
      static const int min_exponent10 = (-307);
      static const int max_exponent = 1024;
      static const int max_exponent10 = 308;

      static const bool has_infinity = 1;
      static const bool has_quiet_NaN = 1;
      static const bool has_signaling_NaN = has_quiet_NaN;
      static const float_denorm_style has_denorm
 = bool(4.9406564584124654e-324) ? denorm_present : denorm_absent;
      static const bool has_denorm_loss = false;

      static double infinity() throw()
      { return __builtin_huge_val(); }
      static double quiet_NaN() throw()
      { return __builtin_nan (""); }
      static double signaling_NaN() throw()
      { return __builtin_nans (""); }
      static double denorm_min() throw()
      { return 4.9406564584124654e-324; }

      static const bool is_iec559
 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
      static const bool is_bounded = true;
      static const bool is_modulo = false;

      static const bool traps = false;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_to_nearest;
    };





  template<>
    struct numeric_limits<long double>
    {
      static const bool is_specialized = true;

      static long double min() throw()
      { return 3.36210314311209350626e-4932L; }
      static long double max() throw()
      { return 1.18973149535723176502e+4932L; }

      static const int digits = 64;
      static const int digits10 = 18;
      static const bool is_signed = true;
      static const bool is_integer = false;
      static const bool is_exact = false;
      static const int radix = 2;
      static long double epsilon() throw()
      { return 1.08420217248550443401e-19L; }
      static long double round_error() throw()
      { return 0.5L; }

      static const int min_exponent = (-16381);
      static const int min_exponent10 = (-4931);
      static const int max_exponent = 16384;
      static const int max_exponent10 = 4932;

      static const bool has_infinity = 1;
      static const bool has_quiet_NaN = 1;
      static const bool has_signaling_NaN = has_quiet_NaN;
      static const float_denorm_style has_denorm
 = bool(3.64519953188247460253e-4951L) ? denorm_present : denorm_absent;
      static const bool has_denorm_loss
 = false;

      static long double infinity() throw()
      { return __builtin_huge_vall (); }
      static long double quiet_NaN() throw()
      { return __builtin_nanl (""); }
      static long double signaling_NaN() throw()
      { return __builtin_nansl (""); }
      static long double denorm_min() throw()
      { return 3.64519953188247460253e-4951L; }

      static const bool is_iec559
 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
      static const bool is_bounded = true;
      static const bool is_modulo = false;

      static const bool traps = false;
      static const bool tinyness_before = false;
      static const float_round_style round_style = round_to_nearest;
    };





}
# 62 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 2 3

namespace std
{
# 73 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
  template<typename _Tp>
    pair<_Tp*, ptrdiff_t>
    __get_temporary_buffer(ptrdiff_t __len, _Tp*)
    {
      const ptrdiff_t __max = numeric_limits<ptrdiff_t>::max() / sizeof(_Tp);
      if (__len > __max)
 __len = __max;

      while (__len > 0)
 {
   _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
       nothrow));
   if (__tmp != 0)
     return pair<_Tp*, ptrdiff_t>(__tmp, __len);
   __len /= 2;
 }
      return pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
    }
# 109 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
  template<typename _Tp>
    inline pair<_Tp*, ptrdiff_t>
    get_temporary_buffer(ptrdiff_t __len)
    { return std::__get_temporary_buffer(__len, static_cast<_Tp*>(0)); }
# 121 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
  template<typename _Tp>
    void
    return_temporary_buffer(_Tp* __p)
    { ::operator delete(__p, nothrow); }
# 133 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
  template<typename _Tp1>
    struct auto_ptr_ref
    {
      _Tp1* _M_ptr;

      explicit
      auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
    };
# 174 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
  template<typename _Tp>
    class auto_ptr
    {
    private:
      _Tp* _M_ptr;

    public:

      typedef _Tp element_type;







      explicit
      auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
# 200 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
# 212 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      template<typename _Tp1>
        auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
# 223 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      auto_ptr&
      operator=(auto_ptr& __a) throw()
      {
 reset(__a.release());
 return *this;
      }
# 240 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      template<typename _Tp1>
        auto_ptr&
        operator=(auto_ptr<_Tp1>& __a) throw()
        {
   reset(__a.release());
   return *this;
 }
# 260 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      ~auto_ptr() { delete _M_ptr; }
# 270 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      element_type&
      operator*() const throw()
      {
 ;
 return *_M_ptr;
      }







      element_type*
      operator->() const throw()
      {
 ;
 return _M_ptr;
      }
# 300 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      element_type*
      get() const throw() { return _M_ptr; }
# 314 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      element_type*
      release() throw()
      {
 element_type* __tmp = _M_ptr;
 _M_ptr = 0;
 return __tmp;
      }
# 329 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      void
      reset(element_type* __p = 0) throw()
      {
 if (__p != _M_ptr)
   {
     delete _M_ptr;
     _M_ptr = __p;
   }
      }
# 350 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory" 3
      auto_ptr(auto_ptr_ref<element_type> __ref) throw()
      : _M_ptr(__ref._M_ptr) { }

      auto_ptr&
      operator=(auto_ptr_ref<element_type> __ref) throw()
      {
 if (__ref._M_ptr != this->get())
   {
     delete _M_ptr;
     _M_ptr = __ref._M_ptr;
   }
 return *this;
      }

      template<typename _Tp1>
        operator auto_ptr_ref<_Tp1>() throw()
        { return auto_ptr_ref<_Tp1>(this->release()); }

      template<typename _Tp1>
        operator auto_ptr<_Tp1>() throw()
        { return auto_ptr<_Tp1>(this->release()); }

  };
}
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 2 3



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
namespace std
{
# 101 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Arg, class _Result>
    struct unary_function
    {
      typedef _Arg argument_type;


      typedef _Result result_type;
    };




  template <class _Arg1, class _Arg2, class _Result>
    struct binary_function
    {
      typedef _Arg1 first_argument_type;


      typedef _Arg2 second_argument_type;
      typedef _Result result_type;
    };
# 133 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Tp>
    struct plus : public binary_function<_Tp, _Tp, _Tp>
    {
      _Tp
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x + __y; }
    };


  template <class _Tp>
    struct minus : public binary_function<_Tp, _Tp, _Tp>
    {
      _Tp
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x - __y; }
    };


  template <class _Tp>
    struct multiplies : public binary_function<_Tp, _Tp, _Tp>
    {
      _Tp
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x * __y; }
    };


  template <class _Tp>
    struct divides : public binary_function<_Tp, _Tp, _Tp>
    {
      _Tp
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x / __y; }
    };


  template <class _Tp>
    struct modulus : public binary_function<_Tp, _Tp, _Tp>
    {
      _Tp
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x % __y; }
    };


  template <class _Tp>
    struct negate : public unary_function<_Tp, _Tp>
    {
      _Tp
      operator()(const _Tp& __x) const
      { return -__x; }
    };
# 195 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Tp>
    struct equal_to : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x == __y; }
    };


  template <class _Tp>
    struct not_equal_to : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x != __y; }
    };


  template <class _Tp>
    struct greater : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x > __y; }
    };


  template <class _Tp>
    struct less : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x < __y; }
    };


  template <class _Tp>
    struct greater_equal : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x >= __y; }
    };


  template <class _Tp>
    struct less_equal : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x <= __y; }
    };
# 256 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Tp>
    struct logical_and : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x && __y; }
    };


  template <class _Tp>
    struct logical_or : public binary_function<_Tp, _Tp, bool>
    {
      bool
      operator()(const _Tp& __x, const _Tp& __y) const
      { return __x || __y; }
    };


  template <class _Tp>
    struct logical_not : public unary_function<_Tp, bool>
    {
      bool
      operator()(const _Tp& __x) const
      { return !__x; }
    };
# 311 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Predicate>
    class unary_negate
    : public unary_function<typename _Predicate::argument_type, bool>
    {
    protected:
      _Predicate _M_pred;
    public:
      explicit
      unary_negate(const _Predicate& __x) : _M_pred(__x) {}

      bool
      operator()(const typename _Predicate::argument_type& __x) const
      { return !_M_pred(__x); }
    };


  template <class _Predicate>
    inline unary_negate<_Predicate>
    not1(const _Predicate& __pred)
    { return unary_negate<_Predicate>(__pred); }


  template <class _Predicate>
    class binary_negate
    : public binary_function<typename _Predicate::first_argument_type,
        typename _Predicate::second_argument_type,
        bool>
    {
    protected:
      _Predicate _M_pred;
    public:
      explicit
      binary_negate(const _Predicate& __x)
      : _M_pred(__x) { }

      bool
      operator()(const typename _Predicate::first_argument_type& __x,
   const typename _Predicate::second_argument_type& __y) const
      { return !_M_pred(__x, __y); }
    };


  template <class _Predicate>
    inline binary_negate<_Predicate>
    not2(const _Predicate& __pred)
    { return binary_negate<_Predicate>(__pred); }
# 391 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Operation>
    class binder1st
    : public unary_function<typename _Operation::second_argument_type,
       typename _Operation::result_type>
    {
    protected:
      _Operation op;
      typename _Operation::first_argument_type value;
    public:
      binder1st(const _Operation& __x,
  const typename _Operation::first_argument_type& __y)
      : op(__x), value(__y) {}

      typename _Operation::result_type
      operator()(const typename _Operation::second_argument_type& __x) const
      { return op(value, __x); }



      typename _Operation::result_type
      operator()(typename _Operation::second_argument_type& __x) const
      { return op(value, __x); }
    };


  template <class _Operation, class _Tp>
    inline binder1st<_Operation>
    bind1st(const _Operation& __fn, const _Tp& __x)
    {
      typedef typename _Operation::first_argument_type _Arg1_type;
      return binder1st<_Operation>(__fn, _Arg1_type(__x));
    }


  template <class _Operation>
    class binder2nd
    : public unary_function<typename _Operation::first_argument_type,
       typename _Operation::result_type>
    {
    protected:
      _Operation op;
      typename _Operation::second_argument_type value;
    public:
      binder2nd(const _Operation& __x,
  const typename _Operation::second_argument_type& __y)
      : op(__x), value(__y) {}

      typename _Operation::result_type
      operator()(const typename _Operation::first_argument_type& __x) const
      { return op(__x, value); }



      typename _Operation::result_type
      operator()(typename _Operation::first_argument_type& __x) const
      { return op(__x, value); }
    };


  template <class _Operation, class _Tp>
    inline binder2nd<_Operation>
    bind2nd(const _Operation& __fn, const _Tp& __x)
    {
      typedef typename _Operation::second_argument_type _Arg2_type;
      return binder2nd<_Operation>(__fn, _Arg2_type(__x));
    }
# 480 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Arg, class _Result>
    class pointer_to_unary_function : public unary_function<_Arg, _Result>
    {
    protected:
      _Result (*_M_ptr)(_Arg);
    public:
      pointer_to_unary_function() {}

      explicit
      pointer_to_unary_function(_Result (*__x)(_Arg))
      : _M_ptr(__x) {}

      _Result
      operator()(_Arg __x) const
      { return _M_ptr(__x); }
    };


  template <class _Arg, class _Result>
    inline pointer_to_unary_function<_Arg, _Result>
    ptr_fun(_Result (*__x)(_Arg))
    { return pointer_to_unary_function<_Arg, _Result>(__x); }


  template <class _Arg1, class _Arg2, class _Result>
    class pointer_to_binary_function
    : public binary_function<_Arg1, _Arg2, _Result>
    {
    protected:
      _Result (*_M_ptr)(_Arg1, _Arg2);
    public:
      pointer_to_binary_function() {}

      explicit
      pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
      : _M_ptr(__x) {}

      _Result
      operator()(_Arg1 __x, _Arg2 __y) const
      { return _M_ptr(__x, __y); }
    };


  template <class _Arg1, class _Arg2, class _Result>
    inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
    ptr_fun(_Result (*__x)(_Arg1, _Arg2))
    { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }


  template <class _Tp>
    struct _Identity : public unary_function<_Tp,_Tp>
    {
      _Tp&
      operator()(_Tp& __x) const
      { return __x; }

      const _Tp&
      operator()(const _Tp& __x) const
      { return __x; }
    };

  template <class _Pair>
    struct _Select1st : public unary_function<_Pair,
           typename _Pair::first_type>
    {
      typename _Pair::first_type&
      operator()(_Pair& __x) const
      { return __x.first; }

      const typename _Pair::first_type&
      operator()(const _Pair& __x) const
      { return __x.first; }
    };

  template <class _Pair>
    struct _Select2nd : public unary_function<_Pair,
           typename _Pair::second_type>
    {
      typename _Pair::second_type&
      operator()(_Pair& __x) const
      { return __x.second; }

      const typename _Pair::second_type&
      operator()(const _Pair& __x) const
      { return __x.second; }
    };
# 590 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_function.h" 3
  template <class _Ret, class _Tp>
    class mem_fun_t : public unary_function<_Tp*, _Ret>
    {
    public:
      explicit
      mem_fun_t(_Ret (_Tp::*__pf)())
      : _M_f(__pf) {}

      _Ret
      operator()(_Tp* __p) const
      { return (__p->*_M_f)(); }
    private:
      _Ret (_Tp::*_M_f)();
    };


  template <class _Ret, class _Tp>
    class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
    {
    public:
      explicit
      const_mem_fun_t(_Ret (_Tp::*__pf)() const)
      : _M_f(__pf) {}

      _Ret
      operator()(const _Tp* __p) const
      { return (__p->*_M_f)(); }
    private:
      _Ret (_Tp::*_M_f)() const;
    };


  template <class _Ret, class _Tp>
    class mem_fun_ref_t : public unary_function<_Tp, _Ret>
    {
    public:
      explicit
      mem_fun_ref_t(_Ret (_Tp::*__pf)())
      : _M_f(__pf) {}

      _Ret
      operator()(_Tp& __r) const
      { return (__r.*_M_f)(); }
    private:
      _Ret (_Tp::*_M_f)();
  };


  template <class _Ret, class _Tp>
    class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
    {
    public:
      explicit
      const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
      : _M_f(__pf) {}

      _Ret
      operator()(const _Tp& __r) const
      { return (__r.*_M_f)(); }
    private:
      _Ret (_Tp::*_M_f)() const;
    };


  template <class _Ret, class _Tp, class _Arg>
    class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
    {
    public:
      explicit
      mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
      : _M_f(__pf) {}

      _Ret
      operator()(_Tp* __p, _Arg __x) const
      { return (__p->*_M_f)(__x); }
    private:
      _Ret (_Tp::*_M_f)(_Arg);
    };


  template <class _Ret, class _Tp, class _Arg>
    class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
    {
    public:
      explicit
      const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
      : _M_f(__pf) {}

      _Ret
      operator()(const _Tp* __p, _Arg __x) const
      { return (__p->*_M_f)(__x); }
    private:
      _Ret (_Tp::*_M_f)(_Arg) const;
    };


  template <class _Ret, class _Tp, class _Arg>
    class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
    {
    public:
      explicit
      mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
      : _M_f(__pf) {}

      _Ret
      operator()(_Tp& __r, _Arg __x) const
      { return (__r.*_M_f)(__x); }
    private:
      _Ret (_Tp::*_M_f)(_Arg);
    };


  template <class _Ret, class _Tp, class _Arg>
    class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
    {
    public:
      explicit
      const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
      : _M_f(__pf) {}

      _Ret
      operator()(const _Tp& __r, _Arg __x) const
      { return (__r.*_M_f)(__x); }
    private:
      _Ret (_Tp::*_M_f)(_Arg) const;
    };


  template <class _Tp>
    class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void>
    {
    public:
      explicit
      mem_fun_t(void (_Tp::*__pf)())
      : _M_f(__pf) {}

      void
      operator()(_Tp* __p) const
      { (__p->*_M_f)(); }
    private:
      void (_Tp::*_M_f)();
    };


  template <class _Tp>
    class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void>
    {
    public:
      explicit
      const_mem_fun_t(void (_Tp::*__pf)() const)
      : _M_f(__pf) {}

      void
      operator()(const _Tp* __p) const
      { (__p->*_M_f)(); }
    private:
      void (_Tp::*_M_f)() const;
    };


  template <class _Tp>
    class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
    {
    public:
      explicit
      mem_fun_ref_t(void (_Tp::*__pf)())
      : _M_f(__pf) {}

      void
      operator()(_Tp& __r) const
      { (__r.*_M_f)(); }
    private:
      void (_Tp::*_M_f)();
    };


  template <class _Tp>
    class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
    {
    public:
      explicit
      const_mem_fun_ref_t(void (_Tp::*__pf)() const)
      : _M_f(__pf) {}

      void
      operator()(const _Tp& __r) const
      { (__r.*_M_f)(); }
    private:
      void (_Tp::*_M_f)() const;
    };


  template <class _Tp, class _Arg>
    class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void>
    {
    public:
      explicit
      mem_fun1_t(void (_Tp::*__pf)(_Arg))
      : _M_f(__pf) {}

      void
      operator()(_Tp* __p, _Arg __x) const
      { (__p->*_M_f)(__x); }
    private:
      void (_Tp::*_M_f)(_Arg);
    };


  template <class _Tp, class _Arg>
    class const_mem_fun1_t<void, _Tp, _Arg>
    : public binary_function<const _Tp*, _Arg, void>
    {
    public:
      explicit
      const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const)
      : _M_f(__pf) {}

      void
      operator()(const _Tp* __p, _Arg __x) const
      { (__p->*_M_f)(__x); }
    private:
      void (_Tp::*_M_f)(_Arg) const;
    };


  template <class _Tp, class _Arg>
    class mem_fun1_ref_t<void, _Tp, _Arg>
    : public binary_function<_Tp, _Arg, void>
    {
    public:
      explicit
      mem_fun1_ref_t(void (_Tp::*__pf)(_Arg))
      : _M_f(__pf) {}

      void
      operator()(_Tp& __r, _Arg __x) const
      { (__r.*_M_f)(__x); }
    private:
      void (_Tp::*_M_f)(_Arg);
    };


  template <class _Tp, class _Arg>
    class const_mem_fun1_ref_t<void, _Tp, _Arg>
    : public binary_function<_Tp, _Arg, void>
    {
    public:
      explicit
      const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const)
      : _M_f(__pf) {}

      void
      operator()(const _Tp& __r, _Arg __x) const
      { (__r.*_M_f)(__x); }
    private:
      void (_Tp::*_M_f)(_Arg) const;
    };



  template <class _Ret, class _Tp>
    inline mem_fun_t<_Ret, _Tp>
    mem_fun(_Ret (_Tp::*__f)())
    { return mem_fun_t<_Ret, _Tp>(__f); }

  template <class _Ret, class _Tp>
    inline const_mem_fun_t<_Ret, _Tp>
    mem_fun(_Ret (_Tp::*__f)() const)
    { return const_mem_fun_t<_Ret, _Tp>(__f); }

  template <class _Ret, class _Tp>
    inline mem_fun_ref_t<_Ret, _Tp>
    mem_fun_ref(_Ret (_Tp::*__f)())
    { return mem_fun_ref_t<_Ret, _Tp>(__f); }

  template <class _Ret, class _Tp>
    inline const_mem_fun_ref_t<_Ret, _Tp>
    mem_fun_ref(_Ret (_Tp::*__f)() const)
    { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }

  template <class _Ret, class _Tp, class _Arg>
    inline mem_fun1_t<_Ret, _Tp, _Arg>
    mem_fun(_Ret (_Tp::*__f)(_Arg))
    { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }

  template <class _Ret, class _Tp, class _Arg>
    inline const_mem_fun1_t<_Ret, _Tp, _Arg>
    mem_fun(_Ret (_Tp::*__f)(_Arg) const)
    { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }

  template <class _Ret, class _Tp, class _Arg>
    inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
    mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
    { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }

  template <class _Ret, class _Tp, class _Arg>
    inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
    mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
    { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }



}
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3




namespace std
{
# 109 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    class basic_string
    {

    public:
      typedef _Traits traits_type;
      typedef typename _Traits::char_type value_type;
      typedef _Alloc allocator_type;
      typedef typename _Alloc::size_type size_type;
      typedef typename _Alloc::difference_type difference_type;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;
      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
      typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
                                                            const_iterator;
      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
      typedef std::reverse_iterator<iterator> reverse_iterator;

    private:
# 144 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      struct _Rep_base
      {
 size_type _M_length;
 size_type _M_capacity;
 _Atomic_word _M_refcount;
      };

      struct _Rep : _Rep_base
      {

 typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
# 169 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
 static const size_type _S_max_size;
 static const _CharT _S_terminal;



        static size_type _S_empty_rep_storage[];

        static _Rep&
        _S_empty_rep()
        { return *reinterpret_cast<_Rep*>(&_S_empty_rep_storage); }

        bool
 _M_is_leaked() const
        { return this->_M_refcount < 0; }

        bool
 _M_is_shared() const
        { return this->_M_refcount > 0; }

        void
 _M_set_leaked()
        { this->_M_refcount = -1; }

        void
 _M_set_sharable()
        { this->_M_refcount = 0; }

 _CharT*
 _M_refdata() throw()
 { return reinterpret_cast<_CharT*>(this + 1); }

 _CharT*
 _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
 {
   return (!_M_is_leaked() && __alloc1 == __alloc2)
           ? _M_refcopy() : _M_clone(__alloc1);
 }


 static _Rep*
 _S_create(size_type, size_type, const _Alloc&);

 void
 _M_dispose(const _Alloc& __a)
 {

   if (__builtin_expect(this != &_S_empty_rep(), false))

     if (__gnu_cxx::__exchange_and_add(&this->_M_refcount, -1) <= 0)
       _M_destroy(__a);
 }

 void
 _M_destroy(const _Alloc&) throw();

 _CharT*
 _M_refcopy() throw()
 {

   if (__builtin_expect(this != &_S_empty_rep(), false))

            __gnu_cxx::__atomic_add(&this->_M_refcount, 1);
   return _M_refdata();
 }

 _CharT*
 _M_clone(const _Alloc&, size_type __res = 0);
      };


      struct _Alloc_hider : _Alloc
      {
 _Alloc_hider(_CharT* __dat, const _Alloc& __a)
 : _Alloc(__a), _M_p(__dat) { }

 _CharT* _M_p;
      };

    public:





      static const size_type npos = static_cast<size_type>(-1);

    private:

      mutable _Alloc_hider _M_dataplus;

      _CharT*
      _M_data() const
      { return _M_dataplus._M_p; }

      _CharT*
      _M_data(_CharT* __p)
      { return (_M_dataplus._M_p = __p); }

      _Rep*
      _M_rep() const
      { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }



      iterator
      _M_ibegin() const { return iterator(_M_data()); }

      iterator
      _M_iend() const { return iterator(_M_data() + this->size()); }

      void
      _M_leak()
      {
 if (!_M_rep()->_M_is_leaked())
   _M_leak_hard();
      }

      size_type
      _M_check(size_type __pos, const char* __s) const
      {
 if (__pos > this->size())
   __throw_out_of_range((__s));
 return __pos;
      }


      size_type
      _M_limit(size_type __pos, size_type __off) const
      {
 const bool __testoff = __off < this->size() - __pos;
 return __testoff ? __off : this->size() - __pos;
      }



      template<class _Iterator>
        static void
        _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
        {
   for (; __k1 != __k2; ++__k1, ++__p)
     traits_type::assign(*__p, *__k1);
 }

      static void
      _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
      { _S_copy_chars(__p, __k1.base(), __k2.base()); }

      static void
      _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
      { _S_copy_chars(__p, __k1.base(), __k2.base()); }

      static void
      _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
      { traits_type::copy(__p, __k1, __k2 - __k1); }

      static void
      _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
      { traits_type::copy(__p, __k1, __k2 - __k1); }

      void
      _M_mutate(size_type __pos, size_type __len1, size_type __len2);

      void
      _M_leak_hard();

      static _Rep&
      _S_empty_rep()
      { return _Rep::_S_empty_rep(); }

    public:







      inline
      basic_string();




      explicit
      basic_string(const _Alloc& __a);






      basic_string(const basic_string& __str);






      basic_string(const basic_string& __str, size_type __pos,
     size_type __n = npos);







      basic_string(const basic_string& __str, size_type __pos,
     size_type __n, const _Alloc& __a);
# 388 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string(const _CharT* __s, size_type __n,
     const _Alloc& __a = _Alloc());





      basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());






      basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());







      template<class _InputIterator>
        basic_string(_InputIterator __beg, _InputIterator __end,
       const _Alloc& __a = _Alloc());




      ~basic_string()
      { _M_rep()->_M_dispose(this->get_allocator()); }





      basic_string&
      operator=(const basic_string& __str)
      {
 this->assign(__str);
 return *this;
      }





      basic_string&
      operator=(const _CharT* __s)
      {
 this->assign(__s);
 return *this;
      }
# 449 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      operator=(_CharT __c)
      {
 this->assign(1, __c);
 return *this;
      }






      iterator
      begin()
      {
 _M_leak();
 return iterator(_M_data());
      }





      const_iterator
      begin() const
      { return const_iterator(_M_data()); }





      iterator
      end()
      {
 _M_leak();
 return iterator(_M_data() + this->size());
      }





      const_iterator
      end() const
      { return const_iterator(_M_data() + this->size()); }






      reverse_iterator
      rbegin()
      { return reverse_iterator(this->end()); }






      const_reverse_iterator
      rbegin() const
      { return const_reverse_iterator(this->end()); }






      reverse_iterator
      rend()
      { return reverse_iterator(this->begin()); }






      const_reverse_iterator
      rend() const
      { return const_reverse_iterator(this->begin()); }

    public:



      size_type
      size() const { return _M_rep()->_M_length; }



      size_type
      length() const { return _M_rep()->_M_length; }


      size_type
      max_size() const { return _Rep::_S_max_size; }
# 557 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      void
      resize(size_type __n, _CharT __c);
# 570 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      void
      resize(size_type __n) { this->resize(__n, _CharT()); }





      size_type
      capacity() const { return _M_rep()->_M_capacity; }
# 597 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      void
      reserve(size_type __res_arg = 0);




      void
      clear() { _M_mutate(0, this->size(), 0); }




      bool
      empty() const { return this->size() == 0; }
# 623 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      const_reference
      operator[] (size_type __pos) const
      {
 ;
 return _M_data()[__pos];
      }
# 640 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      reference
      operator[](size_type __pos)
      {
 ;
 _M_leak();
 return _M_data()[__pos];
      }
# 658 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      const_reference
      at(size_type __n) const
      {
 if (__n >= this->size())
   __throw_out_of_range(("basic_string::at"));
 return _M_data()[__n];
      }
# 677 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      reference
      at(size_type __n)
      {
 if (__n >= size())
   __throw_out_of_range(("basic_string::at"));
 _M_leak();
 return _M_data()[__n];
      }







      basic_string&
      operator+=(const basic_string& __str) { return this->append(__str); }






      basic_string&
      operator+=(const _CharT* __s) { return this->append(__s); }






      basic_string&
      operator+=(_CharT __c) { return this->append(size_type(1), __c); }






      basic_string&
      append(const basic_string& __str);
# 731 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      append(const basic_string& __str, size_type __pos, size_type __n);







      basic_string&
      append(const _CharT* __s, size_type __n);






      basic_string&
      append(const _CharT* __s)
      {
 ;
 return this->append(__s, traits_type::length(__s));
      }
# 763 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      append(size_type __n, _CharT __c)
      { return _M_replace_aux(this->size(), size_type(0), __n, __c); }
# 775 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      template<class _InputIterator>
        basic_string&
        append(_InputIterator __first, _InputIterator __last)
        { return this->replace(_M_iend(), _M_iend(), __first, __last); }





      void
      push_back(_CharT __c)
      { _M_replace_aux(this->size(), size_type(0), size_type(1), __c); }






      basic_string&
      assign(const basic_string& __str);
# 808 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      assign(const basic_string& __str, size_type __pos, size_type __n)
      { return this->assign(__str._M_data()
       + __str._M_check(__pos, "basic_string::assign"),
       __str._M_limit(__pos, __n)); }
# 824 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      assign(const _CharT* __s, size_type __n);
# 836 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      assign(const _CharT* __s)
      {
 ;
 return this->assign(__s, traits_type::length(__s));
      }
# 852 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      assign(size_type __n, _CharT __c)
      { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
# 864 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      template<class _InputIterator>
        basic_string&
        assign(_InputIterator __first, _InputIterator __last)
        { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
# 881 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      void
      insert(iterator __p, size_type __n, _CharT __c)
      { this->replace(__p, __p, __n, __c); }
# 896 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      template<class _InputIterator>
        void insert(iterator __p, _InputIterator __beg, _InputIterator __end)
        { this->replace(__p, __p, __beg, __end); }
# 911 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      insert(size_type __pos1, const basic_string& __str)
      { return this->insert(__pos1, __str, size_type(0), __str.size()); }
# 933 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      insert(size_type __pos1, const basic_string& __str,
      size_type __pos2, size_type __n)
      { return this->insert(__pos1, __str._M_data()
       + __str._M_check(__pos2, "basic_string::insert"),
       __str._M_limit(__pos2, __n)); }
# 956 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      insert(size_type __pos, const _CharT* __s, size_type __n);
# 974 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      insert(size_type __pos, const _CharT* __s)
      {
 ;
 return this->insert(__pos, __s, traits_type::length(__s));
      }
# 997 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      insert(size_type __pos, size_type __n, _CharT __c)
      { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
         size_type(0), __n, __c); }
# 1014 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      iterator
      insert(iterator __p, _CharT __c)
      {
 ;
 const size_type __pos = __p - _M_ibegin();
 _M_replace_aux(__pos, size_type(0), size_type(1), __c);
 _M_rep()->_M_set_leaked();
 return this->_M_ibegin() + __pos;
      }
# 1038 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      erase(size_type __pos = 0, size_type __n = npos)
      { return _M_replace_safe(_M_check(__pos, "basic_string::erase"),
          _M_limit(__pos, __n), __null, size_type(0)); }
# 1051 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      iterator
      erase(iterator __position)
      {
 ;

 const size_type __pos = __position - _M_ibegin();
 _M_replace_safe(__pos, size_type(1), __null, size_type(0));
 _M_rep()->_M_set_leaked();
 return _M_ibegin() + __pos;
      }
# 1071 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      iterator
      erase(iterator __first, iterator __last)
      {
 ;

        const size_type __pos = __first - _M_ibegin();
 _M_replace_safe(__pos, __last - __first, __null, size_type(0));
 _M_rep()->_M_set_leaked();
 return _M_ibegin() + __pos;
      }
# 1098 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(size_type __pos, size_type __n, const basic_string& __str)
      { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
# 1120 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(size_type __pos1, size_type __n1, const basic_string& __str,
       size_type __pos2, size_type __n2)
      { return this->replace(__pos1, __n1, __str._M_data()
        + __str._M_check(__pos2, "basic_string::replace"),
        __str._M_limit(__pos2, __n2)); }
# 1144 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(size_type __pos, size_type __n1, const _CharT* __s,
       size_type __n2);
# 1163 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(size_type __pos, size_type __n1, const _CharT* __s)
      {
 ;
 return this->replace(__pos, __n1, __s, traits_type::length(__s));
      }
# 1186 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
      { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
         _M_limit(__pos, __n1), __n2, __c); }
# 1204 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(iterator __i1, iterator __i2, const basic_string& __str)
      { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
# 1222 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
      {
 ;

 return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
      }
# 1243 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(iterator __i1, iterator __i2, const _CharT* __s)
      {
 ;
 return this->replace(__i1, __i2, __s, traits_type::length(__s));
      }
# 1264 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string&
      replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
      {
 ;

 return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
      }
# 1286 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      template<class _InputIterator>
        basic_string&
        replace(iterator __i1, iterator __i2,
  _InputIterator __k1, _InputIterator __k2)
        {
   ;

   ;
   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
 }



      basic_string&
        replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
        {
   ;

   ;
   return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
          __k1, __k2 - __k1);
 }

      basic_string&
        replace(iterator __i1, iterator __i2,
  const _CharT* __k1, const _CharT* __k2)
        {
   ;

   ;
   return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
          __k1, __k2 - __k1);
 }

      basic_string&
        replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
        {
   ;

   ;
   return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
          __k1.base(), __k2 - __k1);
 }

      basic_string&
        replace(iterator __i1, iterator __i2,
  const_iterator __k1, const_iterator __k2)
        {
   ;

   ;
   return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
          __k1.base(), __k2 - __k1);
 }

    private:
      template<class _Integer>
 basic_string&
 _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
       _Integer __val, __true_type)
        { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }

      template<class _InputIterator>
 basic_string&
 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
       _InputIterator __k2, __false_type);

      basic_string&
      _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
       _CharT __c)
      {
 if (this->max_size() - (this->size() - __n1) < __n2)
   __throw_length_error(("basic_string::_M_replace_aux"));
 _M_mutate(__pos1, __n1, __n2);
 if (__n2 == 1)
   _M_data()[__pos1] = __c;
 else if (__n2)
   traits_type::assign(_M_data() + __pos1, __n2, __c);
 return *this;
      }

      basic_string&
      _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
        size_type __n2)
      {
 _M_mutate(__pos1, __n1, __n2);
 if (__n2 == 1)
   _M_data()[__pos1] = *__s;
 else if (__n2)
   traits_type::copy(_M_data() + __pos1, __s, __n2);
 return *this;
      }



      template<class _InIterator>
        static _CharT*
        _S_construct_aux(_InIterator __beg, _InIterator __end,
    const _Alloc& __a, __false_type)
 {
          typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
          return _S_construct(__beg, __end, __a, _Tag());
 }

      template<class _InIterator>
        static _CharT*
        _S_construct_aux(_InIterator __beg, _InIterator __end,
    const _Alloc& __a, __true_type)
 { return _S_construct(static_cast<size_type>(__beg),
         static_cast<value_type>(__end), __a); }

      template<class _InIterator>
        static _CharT*
        _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
 {
   typedef typename _Is_integer<_InIterator>::_Integral _Integral;
   return _S_construct_aux(__beg, __end, __a, _Integral());
        }


      template<class _InIterator>
        static _CharT*
         _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
        input_iterator_tag);



      template<class _FwdIterator>
        static _CharT*
        _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
       forward_iterator_tag);

      static _CharT*
      _S_construct(size_type __req, _CharT __c, const _Alloc& __a);

    public:
# 1435 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
# 1445 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      void
      swap(basic_string& __s);
# 1455 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      const _CharT*
      c_str() const { return _M_data(); }







      const _CharT*
      data() const { return _M_data(); }




      allocator_type
      get_allocator() const { return _M_dataplus; }
# 1484 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find(const _CharT* __s, size_type __pos, size_type __n) const;
# 1497 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find(const basic_string& __str, size_type __pos = 0) const
      { return this->find(__str.data(), __pos, __str.size()); }
# 1511 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find(const _CharT* __s, size_type __pos = 0) const
      {
 ;
 return this->find(__s, __pos, traits_type::length(__s));
      }
# 1528 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find(_CharT __c, size_type __pos = 0) const;
# 1541 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      rfind(const basic_string& __str, size_type __pos = npos) const
      { return this->rfind(__str.data(), __pos, __str.size()); }
# 1556 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      rfind(const _CharT* __s, size_type __pos, size_type __n) const;
# 1569 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      rfind(const _CharT* __s, size_type __pos = npos) const
      {
 ;
 return this->rfind(__s, __pos, traits_type::length(__s));
      }
# 1586 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      rfind(_CharT __c, size_type __pos = npos) const;
# 1599 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_of(const basic_string& __str, size_type __pos = 0) const
      { return this->find_first_of(__str.data(), __pos, __str.size()); }
# 1614 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
# 1627 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_of(const _CharT* __s, size_type __pos = 0) const
      {
 ;
 return this->find_first_of(__s, __pos, traits_type::length(__s));
      }
# 1646 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_of(_CharT __c, size_type __pos = 0) const
      { return this->find(__c, __pos); }
# 1660 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_of(const basic_string& __str, size_type __pos = npos) const
      { return this->find_last_of(__str.data(), __pos, __str.size()); }
# 1675 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
# 1688 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_of(const _CharT* __s, size_type __pos = npos) const
      {
 ;
 return this->find_last_of(__s, __pos, traits_type::length(__s));
      }
# 1707 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_of(_CharT __c, size_type __pos = npos) const
      { return this->rfind(__c, __pos); }
# 1721 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_not_of(const basic_string& __str, size_type __pos = 0) const
      { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
# 1736 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_not_of(const _CharT* __s, size_type __pos,
   size_type __n) const;
# 1750 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_not_of(const _CharT* __s, size_type __pos = 0) const
      {
 ;
 return this->find_first_not_of(__s, __pos, traits_type::length(__s));
      }
# 1767 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_first_not_of(_CharT __c, size_type __pos = 0) const;
# 1780 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_not_of(const basic_string& __str, size_type __pos = npos) const
      { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
# 1796 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_not_of(const _CharT* __s, size_type __pos,
         size_type __n) const;
# 1809 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_not_of(const _CharT* __s, size_type __pos = npos) const
      {
 ;
 return this->find_last_not_of(__s, __pos, traits_type::length(__s));
      }
# 1826 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      size_type
      find_last_not_of(_CharT __c, size_type __pos = npos) const;
# 1841 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      basic_string
      substr(size_type __pos = 0, size_type __n = npos) const
      { return basic_string(*this,
       _M_check(__pos, "basic_string::substr"), __n); }
# 1859 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      int
      compare(const basic_string& __str) const
      {
 const size_type __size = this->size();
 const size_type __osize = __str.size();
 const size_type __len = std::min(__size, __osize);

 int __r = traits_type::compare(_M_data(), __str.data(), __len);
 if (!__r)
   __r = __size - __osize;
 return __r;
      }
# 1889 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      int
      compare(size_type __pos, size_type __n, const basic_string& __str) const;
# 1913 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      int
      compare(size_type __pos1, size_type __n1, const basic_string& __str,
       size_type __pos2, size_type __n2) const;
# 1931 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      int
      compare(const _CharT* __s) const;
# 1954 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      int
      compare(size_type __pos, size_type __n1, const _CharT* __s) const;
# 1979 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
      int
      compare(size_type __pos, size_type __n1, const _CharT* __s,
       size_type __n2) const;
  };

  template<typename _CharT, typename _Traits, typename _Alloc>
    inline basic_string<_CharT, _Traits, _Alloc>::
    basic_string()

    : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
# 2000 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>
    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    {
      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
      __str.append(__rhs);
      return __str;
    }







  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT,_Traits,_Alloc>
    operator+(const _CharT* __lhs,
       const basic_string<_CharT,_Traits,_Alloc>& __rhs);







  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT,_Traits,_Alloc>
    operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline basic_string<_CharT, _Traits, _Alloc>
    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      const _CharT* __rhs)
    {
      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
      __str.append(__rhs);
      return __str;
    }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline basic_string<_CharT, _Traits, _Alloc>
    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
    {
      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef typename __string_type::size_type __size_type;
      __string_type __str(__lhs);
      __str.append(__size_type(1), __rhs);
      return __str;
    }
# 2071 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __lhs.compare(__rhs) == 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator==(const _CharT* __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __rhs.compare(__lhs) == 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const _CharT* __rhs)
    { return __lhs.compare(__rhs) == 0; }
# 2108 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __rhs.compare(__lhs) != 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator!=(const _CharT* __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __rhs.compare(__lhs) != 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const _CharT* __rhs)
    { return __lhs.compare(__rhs) != 0; }
# 2145 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __lhs.compare(__rhs) < 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
       const _CharT* __rhs)
    { return __lhs.compare(__rhs) < 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator<(const _CharT* __lhs,
       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __rhs.compare(__lhs) > 0; }
# 2182 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __lhs.compare(__rhs) > 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
       const _CharT* __rhs)
    { return __lhs.compare(__rhs) > 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator>(const _CharT* __lhs,
       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __rhs.compare(__lhs) < 0; }
# 2219 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __lhs.compare(__rhs) <= 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const _CharT* __rhs)
    { return __lhs.compare(__rhs) <= 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator<=(const _CharT* __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
  { return __rhs.compare(__lhs) >= 0; }
# 2256 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __lhs.compare(__rhs) >= 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
        const _CharT* __rhs)
    { return __lhs.compare(__rhs) >= 0; }







  template<typename _CharT, typename _Traits, typename _Alloc>
    inline bool
    operator>=(const _CharT* __lhs,
      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { return __rhs.compare(__lhs) <= 0; }
# 2293 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline void
    swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
  basic_string<_CharT, _Traits, _Alloc>& __rhs)
    { __lhs.swap(__rhs); }
# 2310 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_istream<_CharT, _Traits>&
    operator>>(basic_istream<_CharT, _Traits>& __is,
        basic_string<_CharT, _Traits, _Alloc>& __str);
# 2324 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __os,
        const basic_string<_CharT, _Traits, _Alloc>& __str);
# 2342 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_istream<_CharT,_Traits>&
    getline(basic_istream<_CharT, _Traits>& __is,
     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
# 2359 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.h" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    inline basic_istream<_CharT,_Traits>&
    getline(basic_istream<_CharT, _Traits>& __is,
     basic_string<_CharT, _Traits, _Alloc>& __str);
}
# 54 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 2 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/algorithm" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/algorithm" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/algorithm" 3




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 1 3
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
namespace std
{



  template<typename _RandomAccessIterator, typename _Distance>
    bool
    __is_heap(_RandomAccessIterator __first, _Distance __n)
    {
      _Distance __parent = 0;
      for (_Distance __child = 1; __child < __n; ++__child)
 {
   if (__first[__parent] < __first[__child])
     return false;
   if ((__child & 1) == 0)
     ++__parent;
 }
      return true;
    }

  template<typename _RandomAccessIterator, typename _Distance,
           typename _StrictWeakOrdering>
    bool
    __is_heap(_RandomAccessIterator __first, _StrictWeakOrdering __comp,
       _Distance __n)
    {
      _Distance __parent = 0;
      for (_Distance __child = 1; __child < __n; ++__child)
 {
   if (__comp(__first[__parent], __first[__child]))
     return false;
   if ((__child & 1) == 0)
     ++__parent;
 }
      return true;
    }

  template<typename _RandomAccessIterator>
    bool
    __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
    { return std::__is_heap(__first, std::distance(__first, __last)); }

  template<typename _RandomAccessIterator, typename _StrictWeakOrdering>
    bool
    __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
     _StrictWeakOrdering __comp)
    { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }



  template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
    void
    __push_heap(_RandomAccessIterator __first,
  _Distance __holeIndex, _Distance __topIndex, _Tp __value)
    {
      _Distance __parent = (__holeIndex - 1) / 2;
      while (__holeIndex > __topIndex && *(__first + __parent) < __value)
 {
   *(__first + __holeIndex) = *(__first + __parent);
   __holeIndex = __parent;
   __parent = (__holeIndex - 1) / 2;
 }
      *(__first + __holeIndex) = __value;
    }
# 139 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator>
    inline void
    push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
   _ValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
   _DistanceType;


     

     
      ;


      std::__push_heap(__first, _DistanceType((__last - __first) - 1),
         _DistanceType(0), _ValueType(*(__last - 1)));
    }

  template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
     typename _Compare>
    void
    __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
  _Distance __topIndex, _Tp __value, _Compare __comp)
    {
      _Distance __parent = (__holeIndex - 1) / 2;
      while (__holeIndex > __topIndex
      && __comp(*(__first + __parent), __value))
 {
   *(__first + __holeIndex) = *(__first + __parent);
   __holeIndex = __parent;
   __parent = (__holeIndex - 1) / 2;
 }
      *(__first + __holeIndex) = __value;
    }
# 187 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    inline void
    push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
       _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
   _ValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
   _DistanceType;


     

      ;
      ;

      std::__push_heap(__first, _DistanceType((__last - __first) - 1),
         _DistanceType(0), _ValueType(*(__last - 1)), __comp);
    }

  template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
    void
    __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
    _Distance __len, _Tp __value)
    {
      const _Distance __topIndex = __holeIndex;
      _Distance __secondChild = 2 * __holeIndex + 2;
      while (__secondChild < __len)
 {
   if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
     __secondChild--;
   *(__first + __holeIndex) = *(__first + __secondChild);
   __holeIndex = __secondChild;
   __secondChild = 2 * (__secondChild + 1);
 }
      if (__secondChild == __len)
 {
   *(__first + __holeIndex) = *(__first + (__secondChild - 1));
   __holeIndex = __secondChild - 1;
 }
      std::__push_heap(__first, __holeIndex, __topIndex, __value);
    }

  template<typename _RandomAccessIterator, typename _Tp>
    inline void
    __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
        _RandomAccessIterator __result, _Tp __value)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _Distance;
      *__result = *__first;
      std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first),
    __value);
    }
# 251 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator>
    inline void
    pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     
      ;
      ;

      std::__pop_heap(__first, __last - 1, __last - 1,
        _ValueType(*(__last - 1)));
    }

  template<typename _RandomAccessIterator, typename _Distance,
    typename _Tp, typename _Compare>
    void
    __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
    _Distance __len, _Tp __value, _Compare __comp)
    {
      const _Distance __topIndex = __holeIndex;
      _Distance __secondChild = 2 * __holeIndex + 2;
      while (__secondChild < __len)
 {
   if (__comp(*(__first + __secondChild),
       *(__first + (__secondChild - 1))))
     __secondChild--;
   *(__first + __holeIndex) = *(__first + __secondChild);
   __holeIndex = __secondChild;
   __secondChild = 2 * (__secondChild + 1);
 }
      if (__secondChild == __len)
 {
   *(__first + __holeIndex) = *(__first + (__secondChild - 1));
   __holeIndex = __secondChild - 1;
 }
      std::__push_heap(__first, __holeIndex, __topIndex, __value, __comp);
    }

  template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
    inline void
    __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
        _RandomAccessIterator __result, _Tp __value, _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _Distance;
      *__result = *__first;
      std::__adjust_heap(__first, _Distance(0), _Distance(__last - __first),
    __value, __comp);
    }
# 317 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    inline void
    pop_heap(_RandomAccessIterator __first,
      _RandomAccessIterator __last, _Compare __comp)
    {

     

      ;
      ;

      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;
      std::__pop_heap(__first, __last - 1, __last - 1,
        _ValueType(*(__last - 1)), __comp);
    }
# 342 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator>
    void
    make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
   _ValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
   _DistanceType;


     

     
      ;

      if (__last - __first < 2)
 return;

      const _DistanceType __len = __last - __first;
      _DistanceType __parent = (__len - 2) / 2;
      while (true)
 {
   std::__adjust_heap(__first, __parent, __len,
        _ValueType(*(__first + __parent)));
   if (__parent == 0)
     return;
   __parent--;
 }
    }
# 382 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    inline void
    make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
       _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
   _ValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
   _DistanceType;


     

      ;

      if (__last - __first < 2)
 return;

      const _DistanceType __len = __last - __first;
      _DistanceType __parent = (__len - 2) / 2;
      while (true)
 {
   std::__adjust_heap(__first, __parent, __len,
        _ValueType(*(__first + __parent)), __comp);
   if (__parent == 0)
     return;
   __parent--;
 }
    }
# 420 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator>
    void
    sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {

     

     

      ;


      while (__last - __first > 1)
 std::pop_heap(__first, __last--);
    }
# 446 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_heap.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    void
    sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
       _Compare __comp)
    {

     

      ;
      ;

      while (__last - __first > 1)
 std::pop_heap(__first, __last--, __comp);
    }

}
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tempbuf.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tempbuf.h" 3
namespace std
{







  template<typename _ForwardIterator, typename _Tp>
    class _Temporary_buffer
    {

     

 public:
      typedef _Tp value_type;
      typedef value_type* pointer;
      typedef pointer iterator;
      typedef ptrdiff_t size_type;

    protected:
      size_type _M_original_len;
      size_type _M_len;
      pointer _M_buffer;

      void
      _M_initialize_buffer(const _Tp&, __true_type) { }

      void
      _M_initialize_buffer(const _Tp& val, __false_type)
      { std::uninitialized_fill_n(_M_buffer, _M_len, val); }

    public:

      size_type
      size() const
      { return _M_len; }


      size_type
      requested_size() const
      { return _M_original_len; }


      iterator
      begin()
      { return _M_buffer; }


      iterator
      end()
      { return _M_buffer + _M_len; }





      _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);

      ~_Temporary_buffer()
      {
 std::_Destroy(_M_buffer, _M_buffer + _M_len);
 std::return_temporary_buffer(_M_buffer);
      }

    private:

      _Temporary_buffer(const _Temporary_buffer&);

      void
      operator=(const _Temporary_buffer&);
    };


  template<typename _ForwardIterator, typename _Tp>
    _Temporary_buffer<_ForwardIterator, _Tp>::
    _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
    : _M_original_len(std::distance(__first, __last)),
      _M_len(0), _M_buffer(0)
    {

      typedef typename __type_traits<_Tp>::has_trivial_default_constructor
       _Trivial;

      try
 {
   pair<pointer, size_type> __p(get_temporary_buffer<
           value_type>(_M_original_len));
   _M_buffer = __p.first;
   _M_len = __p.second;
   if (_M_len > 0)
     _M_initialize_buffer(*__first, _Trivial());
 }
      catch(...)
 {
   std::return_temporary_buffer(_M_buffer);
   _M_buffer = 0;
   _M_len = 0;
   throw;
 }
    }
}
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 2 3




namespace std
{
# 84 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _Tp>
    inline const _Tp&
    __median(const _Tp& __a, const _Tp& __b, const _Tp& __c)
    {

     
      if (__a < __b)
 if (__b < __c)
   return __b;
 else if (__a < __c)
   return __c;
 else
   return __a;
      else if (__a < __c)
 return __a;
      else if (__b < __c)
 return __c;
      else
 return __b;
    }
# 118 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _Tp, typename _Compare>
    inline const _Tp&
    __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp)
    {

     
      if (__comp(__a, __b))
 if (__comp(__b, __c))
   return __b;
 else if (__comp(__a, __c))
   return __c;
 else
   return __a;
      else if (__comp(__a, __c))
 return __a;
      else if (__comp(__b, __c))
 return __c;
      else
 return __b;
    }
# 150 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _Function>
    _Function
    for_each(_InputIterator __first, _InputIterator __last, _Function __f)
    {

     
      ;
      for ( ; __first != __last; ++__first)
 __f(*__first);
      return __f;
    }






  template<typename _InputIterator, typename _Tp>
    inline _InputIterator
    find(_InputIterator __first, _InputIterator __last,
  const _Tp& __val, input_iterator_tag)
    {
      while (__first != __last && !(*__first == __val))
 ++__first;
      return __first;
    }






  template<typename _InputIterator, typename _Predicate>
    inline _InputIterator
    find_if(_InputIterator __first, _InputIterator __last,
     _Predicate __pred, input_iterator_tag)
    {
      while (__first != __last && !__pred(*__first))
 ++__first;
      return __first;
    }






  template<typename _RandomAccessIterator, typename _Tp>
    _RandomAccessIterator
    find(_RandomAccessIterator __first, _RandomAccessIterator __last,
  const _Tp& __val, random_access_iterator_tag)
    {
      typename iterator_traits<_RandomAccessIterator>::difference_type
 __trip_count = (__last - __first) >> 2;

      for ( ; __trip_count > 0 ; --__trip_count)
 {
   if (*__first == __val)
     return __first;
   ++__first;

   if (*__first == __val)
     return __first;
   ++__first;

   if (*__first == __val)
     return __first;
   ++__first;

   if (*__first == __val)
     return __first;
   ++__first;
 }

      switch (__last - __first)
 {
 case 3:
   if (*__first == __val)
     return __first;
   ++__first;
 case 2:
   if (*__first == __val)
     return __first;
   ++__first;
 case 1:
   if (*__first == __val)
     return __first;
   ++__first;
 case 0:
 default:
   return __last;
 }
    }






  template<typename _RandomAccessIterator, typename _Predicate>
    _RandomAccessIterator
    find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
     _Predicate __pred, random_access_iterator_tag)
    {
      typename iterator_traits<_RandomAccessIterator>::difference_type
 __trip_count = (__last - __first) >> 2;

      for ( ; __trip_count > 0 ; --__trip_count)
 {
   if (__pred(*__first))
     return __first;
   ++__first;

   if (__pred(*__first))
     return __first;
   ++__first;

   if (__pred(*__first))
     return __first;
   ++__first;

   if (__pred(*__first))
     return __first;
   ++__first;
 }

      switch (__last - __first)
 {
 case 3:
   if (__pred(*__first))
     return __first;
   ++__first;
 case 2:
   if (__pred(*__first))
     return __first;
   ++__first;
 case 1:
   if (__pred(*__first))
     return __first;
   ++__first;
 case 0:
 default:
   return __last;
 }
    }
# 304 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _Tp>
    inline _InputIterator
    find(_InputIterator __first, _InputIterator __last,
  const _Tp& __val)
    {

     
     

      ;
      return std::find(__first, __last, __val,
         std::__iterator_category(__first));
    }
# 326 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _Predicate>
    inline _InputIterator
    find_if(_InputIterator __first, _InputIterator __last,
     _Predicate __pred)
    {

     
     

      ;
      return std::find_if(__first, __last, __pred,
     std::__iterator_category(__first));
    }
# 348 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator>
    _ForwardIterator
    adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
    {

     
     

      ;
      if (__first == __last)
 return __last;
      _ForwardIterator __next = __first;
      while(++__next != __last)
 {
   if (*__first == *__next)
     return __first;
   __first = __next;
 }
      return __last;
    }
# 379 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _BinaryPredicate>
    _ForwardIterator
    adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
    _BinaryPredicate __binary_pred)
    {

     
     


      ;
      if (__first == __last)
 return __last;
      _ForwardIterator __next = __first;
      while(++__next != __last)
 {
   if (__binary_pred(*__first, *__next))
     return __first;
   __first = __next;
 }
      return __last;
    }
# 410 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _Tp>
    typename iterator_traits<_InputIterator>::difference_type
    count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
    {

     
     

     
      ;
      typename iterator_traits<_InputIterator>::difference_type __n = 0;
      for ( ; __first != __last; ++__first)
 if (*__first == __value)
   ++__n;
      return __n;
    }
# 435 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _Predicate>
    typename iterator_traits<_InputIterator>::difference_type
    count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
    {

     
     

      ;
      typename iterator_traits<_InputIterator>::difference_type __n = 0;
      for ( ; __first != __last; ++__first)
 if (__pred(*__first))
   ++__n;
      return __n;
    }
# 474 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2>
    _ForwardIterator1
    search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
    _ForwardIterator2 __first2, _ForwardIterator2 __last2)
    {

     
     
     


      ;
      ;

      if (__first1 == __last1 || __first2 == __last2)
 return __first1;


      _ForwardIterator2 __tmp(__first2);
      ++__tmp;
      if (__tmp == __last2)
 return std::find(__first1, __last1, *__first2);


      _ForwardIterator2 __p1, __p;
      __p1 = __first2; ++__p1;
      _ForwardIterator1 __current = __first1;

      while (__first1 != __last1)
 {
   __first1 = std::find(__first1, __last1, *__first2);
   if (__first1 == __last1)
     return __last1;

   __p = __p1;
   __current = __first1;
   if (++__current == __last1)
     return __last1;

   while (*__current == *__p)
     {
       if (++__p == __last2)
  return __first1;
       if (++__current == __last1)
  return __last1;
     }
   ++__first1;
 }
      return __first1;
    }
# 545 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2,
    typename _BinaryPredicate>
    _ForwardIterator1
    search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
    _ForwardIterator2 __first2, _ForwardIterator2 __last2,
    _BinaryPredicate __predicate)
    {

     
     
     


      ;
      ;


      if (__first1 == __last1 || __first2 == __last2)
 return __first1;


      _ForwardIterator2 __tmp(__first2);
      ++__tmp;
      if (__tmp == __last2)
 {
   while (__first1 != __last1 && !__predicate(*__first1, *__first2))
     ++__first1;
   return __first1;
 }


      _ForwardIterator2 __p1, __p;
      __p1 = __first2; ++__p1;
      _ForwardIterator1 __current = __first1;

      while (__first1 != __last1)
 {
   while (__first1 != __last1)
     {
       if (__predicate(*__first1, *__first2))
  break;
       ++__first1;
     }
   while (__first1 != __last1 && !__predicate(*__first1, *__first2))
     ++__first1;
   if (__first1 == __last1)
     return __last1;

   __p = __p1;
   __current = __first1;
   if (++__current == __last1)
     return __last1;

   while (__predicate(*__current, *__p))
     {
       if (++__p == __last2)
  return __first1;
       if (++__current == __last1)
  return __last1;
     }
   ++__first1;
 }
      return __first1;
    }
# 623 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Integer, typename _Tp>
    _ForwardIterator
    search_n(_ForwardIterator __first, _ForwardIterator __last,
      _Integer __count, const _Tp& __val)
    {

     
     

     
      ;

      if (__count <= 0)
 return __first;
      else
 {
   __first = std::find(__first, __last, __val);
   while (__first != __last)
     {
       typename iterator_traits<_ForwardIterator>::difference_type
  __n = __count;
       _ForwardIterator __i = __first;
       ++__i;
       while (__i != __last && __n != 1 && *__i == __val)
  {
    ++__i;
    --__n;
  }
       if (__n == 1)
  return __first;
       else
  __first = std::find(__i, __last, __val);
     }
   return __last;
 }
    }
# 675 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Integer, typename _Tp,
           typename _BinaryPredicate>
    _ForwardIterator
    search_n(_ForwardIterator __first, _ForwardIterator __last,
      _Integer __count, const _Tp& __val,
      _BinaryPredicate __binary_pred)
    {

     
     

      ;

      if (__count <= 0)
 return __first;
      else
 {
   while (__first != __last)
     {
       if (__binary_pred(*__first, __val))
  break;
       ++__first;
     }
   while (__first != __last)
     {
       typename iterator_traits<_ForwardIterator>::difference_type
  __n = __count;
       _ForwardIterator __i = __first;
       ++__i;
       while (__i != __last && __n != 1 && __binary_pred(*__i, __val))
  {
    ++__i;
    --__n;
  }
       if (__n == 1)
  return __first;
       else
  {
    while (__i != __last)
      {
        if (__binary_pred(*__i, __val))
   break;
        ++__i;
      }
    __first = __i;
  }
     }
   return __last;
 }
    }
# 737 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2>
    _ForwardIterator2
    swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
  _ForwardIterator2 __first2)
    {

     

     

     


     


      ;

      for ( ; __first1 != __last1; ++__first1, ++__first2)
 std::iter_swap(__first1, __first2);
      return __first2;
    }
# 775 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator,
    typename _UnaryOperation>
    _OutputIterator
    transform(_InputIterator __first, _InputIterator __last,
       _OutputIterator __result, _UnaryOperation __unary_op)
    {

     
     


      ;

      for ( ; __first != __last; ++__first, ++__result)
 *__result = __unary_op(*__first);
      return __result;
    }
# 810 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator, typename _BinaryOperation>
    _OutputIterator
    transform(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _OutputIterator __result,
       _BinaryOperation __binary_op)
    {

     
     
     


      ;

      for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
 *__result = __binary_op(*__first1, *__first2);
      return __result;
    }
# 842 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp>
    void
    replace(_ForwardIterator __first, _ForwardIterator __last,
     const _Tp& __old_value, const _Tp& __new_value)
    {

     

     

     

      ;

      for ( ; __first != __last; ++__first)
 if (*__first == __old_value)
   *__first = __new_value;
    }
# 873 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Predicate, typename _Tp>
    void
    replace_if(_ForwardIterator __first, _ForwardIterator __last,
        _Predicate __pred, const _Tp& __new_value)
    {

     

     

     

      ;

      for ( ; __first != __last; ++__first)
 if (__pred(*__first))
   *__first = __new_value;
    }
# 906 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator, typename _Tp>
    _OutputIterator
    replace_copy(_InputIterator __first, _InputIterator __last,
   _OutputIterator __result,
   const _Tp& __old_value, const _Tp& __new_value)
    {

     
     

     

      ;

      for ( ; __first != __last; ++__first, ++__result)
 *__result = *__first == __old_value ? __new_value : *__first;
      return __result;
    }
# 939 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator,
    typename _Predicate, typename _Tp>
    _OutputIterator
    replace_copy_if(_InputIterator __first, _InputIterator __last,
      _OutputIterator __result,
      _Predicate __pred, const _Tp& __new_value)
    {

     
     

     

      ;

      for ( ; __first != __last; ++__first, ++__result)
 *__result = __pred(*__first) ? __new_value : *__first;
      return __result;
    }
# 970 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Generator>
    void
    generate(_ForwardIterator __first, _ForwardIterator __last,
      _Generator __gen)
    {

     
     

      ;

      for ( ; __first != __last; ++__first)
 *__first = __gen();
    }
# 996 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _OutputIterator, typename _Size, typename _Generator>
    _OutputIterator
    generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
    {

     



      for ( ; __n > 0; --__n, ++__first)
 *__first = __gen();
      return __first;
    }
# 1023 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator, typename _Tp>
    _OutputIterator
    remove_copy(_InputIterator __first, _InputIterator __last,
  _OutputIterator __result, const _Tp& __value)
    {

     
     

     

      ;

      for ( ; __first != __last; ++__first)
 if (!(*__first == __value))
   {
     *__result = *__first;
     ++__result;
   }
      return __result;
    }
# 1059 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator,
    typename _Predicate>
    _OutputIterator
    remove_copy_if(_InputIterator __first, _InputIterator __last,
     _OutputIterator __result, _Predicate __pred)
    {

     
     

     

      ;

      for ( ; __first != __last; ++__first)
 if (!__pred(*__first))
   {
     *__result = *__first;
     ++__result;
   }
      return __result;
    }
# 1098 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp>
    _ForwardIterator
    remove(_ForwardIterator __first, _ForwardIterator __last,
    const _Tp& __value)
    {

     

     

      ;

      __first = std::find(__first, __last, __value);
      _ForwardIterator __i = __first;
      return __first == __last ? __first
          : std::remove_copy(++__i, __last,
        __first, __value);
    }
# 1133 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Predicate>
    _ForwardIterator
    remove_if(_ForwardIterator __first, _ForwardIterator __last,
       _Predicate __pred)
    {

     

     

      ;

      __first = std::find_if(__first, __last, __pred);
      _ForwardIterator __i = __first;
      return __first == __last ? __first
          : std::remove_copy_if(++__i, __last,
           __first, __pred);
    }
# 1159 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator>
    _OutputIterator
    __unique_copy(_InputIterator __first, _InputIterator __last,
    _OutputIterator __result,
    output_iterator_tag)
    {

      typename iterator_traits<_InputIterator>::value_type __value = *__first;
      *__result = __value;
      while (++__first != __last)
 if (!(__value == *__first))
   {
     __value = *__first;
     *++__result = __value;
   }
      return ++__result;
    }
# 1184 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _ForwardIterator>
    _ForwardIterator
    __unique_copy(_InputIterator __first, _InputIterator __last,
    _ForwardIterator __result,
    forward_iterator_tag)
    {

      *__result = *__first;
      while (++__first != __last)
 if (!(*__result == *__first))
   *++__result = *__first;
      return ++__result;
    }
# 1206 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator,
    typename _BinaryPredicate>
    _OutputIterator
    __unique_copy(_InputIterator __first, _InputIterator __last,
    _OutputIterator __result,
    _BinaryPredicate __binary_pred,
    output_iterator_tag)
    {

     



      typename iterator_traits<_InputIterator>::value_type __value = *__first;
      *__result = __value;
      while (++__first != __last)
 if (!__binary_pred(__value, *__first))
   {
     __value = *__first;
     *++__result = __value;
   }
      return ++__result;
    }
# 1238 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _ForwardIterator,
    typename _BinaryPredicate>
    _ForwardIterator
    __unique_copy(_InputIterator __first, _InputIterator __last,
    _ForwardIterator __result,
    _BinaryPredicate __binary_pred,
    forward_iterator_tag)
    {

     



      *__result = *__first;
      while (++__first != __last)
 if (!__binary_pred(*__result, *__first)) *++__result = *__first;
      return ++__result;
    }
# 1270 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator>
    inline _OutputIterator
    unique_copy(_InputIterator __first, _InputIterator __last,
  _OutputIterator __result)
    {

     
     

     

      ;

      typedef typename iterator_traits<_OutputIterator>::iterator_category
 _IterType;

      if (__first == __last) return __result;
      return std::__unique_copy(__first, __last, __result, _IterType());
    }
# 1305 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _OutputIterator,
    typename _BinaryPredicate>
    inline _OutputIterator
    unique_copy(_InputIterator __first, _InputIterator __last,
  _OutputIterator __result,
  _BinaryPredicate __binary_pred)
    {

     
     

      ;

      typedef typename iterator_traits<_OutputIterator>::iterator_category
 _IterType;

      if (__first == __last) return __result;
      return std::__unique_copy(__first, __last, __result,
    __binary_pred, _IterType());
    }
# 1339 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator>
    _ForwardIterator
    unique(_ForwardIterator __first, _ForwardIterator __last)
    {

     

     

      ;


      __first = std::adjacent_find(__first, __last);
      if (__first == __last)
 return __last;


      _ForwardIterator __dest = __first;
      ++__first;
      while (++__first != __last)
 if (!(*__dest == *__first))
   *++__dest = *__first;
      return ++__dest;
    }
# 1378 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _BinaryPredicate>
    _ForwardIterator
    unique(_ForwardIterator __first, _ForwardIterator __last,
           _BinaryPredicate __binary_pred)
    {

     

     


      ;


      __first = std::adjacent_find(__first, __last, __binary_pred);
      if (__first == __last)
 return __last;


      _ForwardIterator __dest = __first;
      ++__first;
      while (++__first != __last)
 if (!__binary_pred(*__dest, *__first))
   *++__dest = *__first;
      return ++__dest;
    }
# 1412 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator>
    void
    __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,
     bidirectional_iterator_tag)
    {
      while (true)
 if (__first == __last || __first == --__last)
   return;
 else
   std::iter_swap(__first++, __last);
    }
# 1431 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator>
    void
    __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,
     random_access_iterator_tag)
    {
      while (__first < __last)
 std::iter_swap(__first++, --__last);
    }
# 1451 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator>
    inline void
    reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
    {

     

      ;
      std::__reverse(__first, __last, std::__iterator_category(__first));
    }
# 1477 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator, typename _OutputIterator>
    _OutputIterator
    reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,
        _OutputIterator __result)
    {

     

     

      ;

      while (__first != __last)
 {
   --__last;
   *__result = *__last;
   ++__result;
 }
      return __result;
    }
# 1505 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _EuclideanRingElement>
    _EuclideanRingElement
    __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
    {
      while (__n != 0)
 {
   _EuclideanRingElement __t = __m % __n;
   __m = __n;
   __n = __t;
 }
      return __m;
    }






  template<typename _ForwardIterator>
    void
    __rotate(_ForwardIterator __first,
      _ForwardIterator __middle,
      _ForwardIterator __last,
       forward_iterator_tag)
    {
      if ((__first == __middle) || (__last == __middle))
 return;

      _ForwardIterator __first2 = __middle;
      do
 {
   swap(*__first++, *__first2++);
   if (__first == __middle)
     __middle = __first2;
 }
      while (__first2 != __last);

      __first2 = __middle;

      while (__first2 != __last)
 {
   swap(*__first++, *__first2++);
   if (__first == __middle)
     __middle = __first2;
   else if (__first2 == __last)
     __first2 = __middle;
 }
    }






  template<typename _BidirectionalIterator>
    void
    __rotate(_BidirectionalIterator __first,
      _BidirectionalIterator __middle,
      _BidirectionalIterator __last,
       bidirectional_iterator_tag)
    {

     


      if ((__first == __middle) || (__last == __middle))
 return;

      std::__reverse(__first, __middle, bidirectional_iterator_tag());
      std::__reverse(__middle, __last, bidirectional_iterator_tag());

      while (__first != __middle && __middle != __last)
 swap(*__first++, *--__last);

      if (__first == __middle)
 std::__reverse(__middle, __last, bidirectional_iterator_tag());
      else
 std::__reverse(__first, __middle, bidirectional_iterator_tag());
    }






  template<typename _RandomAccessIterator>
    void
    __rotate(_RandomAccessIterator __first,
      _RandomAccessIterator __middle,
      _RandomAccessIterator __last,
      random_access_iterator_tag)
    {

     


      if ((__first == __middle) || (__last == __middle))
 return;

      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _Distance;
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;

      const _Distance __n = __last - __first;
      const _Distance __k = __middle - __first;
      const _Distance __l = __n - __k;

      if (__k == __l)
 {
   std::swap_ranges(__first, __middle, __middle);
   return;
 }

      const _Distance __d = __gcd(__n, __k);

      for (_Distance __i = 0; __i < __d; __i++)
 {
   const _ValueType __tmp = *__first;
   _RandomAccessIterator __p = __first;

   if (__k < __l)
     {
       for (_Distance __j = 0; __j < __l / __d; __j++)
  {
    if (__p > __first + __l)
      {
        *__p = *(__p - __l);
        __p -= __l;
      }

    *__p = *(__p + __k);
    __p += __k;
  }
     }
   else
     {
       for (_Distance __j = 0; __j < __k / __d - 1; __j ++)
  {
    if (__p < __last - __k)
      {
        *__p = *(__p + __k);
        __p += __k;
      }
    *__p = * (__p - __l);
    __p -= __l;
  }
     }

   *__p = __tmp;
   ++__first;
 }
    }
# 1677 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator>
    inline void
    rotate(_ForwardIterator __first, _ForwardIterator __middle,
    _ForwardIterator __last)
    {

     

      ;
      ;

      typedef typename iterator_traits<_ForwardIterator>::iterator_category
 _IterType;
      std::__rotate(__first, __middle, __last, _IterType());
    }
# 1710 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _OutputIterator>
    _OutputIterator
    rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,
                _ForwardIterator __last, _OutputIterator __result)
    {

     
     

      ;
      ;

      return std::copy(__first, __middle, copy(__middle, __last, __result));
    }
# 1735 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator>
    inline void
    random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {

     

      ;

      if (__first != __last)
 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
   std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
    }
# 1762 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator, typename _RandomNumberGenerator>
    void
    random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
     _RandomNumberGenerator& __rand)
    {

     

      ;

      if (__first == __last)
 return;
      for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
 std::iter_swap(__i, __first + __rand((__i - __first) + 1));
    }







  template<typename _ForwardIterator, typename _Predicate>
    _ForwardIterator
    __partition(_ForwardIterator __first, _ForwardIterator __last,
  _Predicate __pred,
  forward_iterator_tag)
    {
      if (__first == __last)
 return __first;

      while (__pred(*__first))
 if (++__first == __last)
   return __first;

      _ForwardIterator __next = __first;

      while (++__next != __last)
 if (__pred(*__next))
   {
     swap(*__first, *__next);
     ++__first;
   }

      return __first;
    }






  template<typename _BidirectionalIterator, typename _Predicate>
    _BidirectionalIterator
    __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,
  _Predicate __pred,
  bidirectional_iterator_tag)
    {
      while (true)
 {
   while (true)
     if (__first == __last)
       return __first;
     else if (__pred(*__first))
       ++__first;
     else
       break;
   --__last;
   while (true)
     if (__first == __last)
       return __first;
     else if (!__pred(*__last))
       --__last;
     else
       break;
   std::iter_swap(__first, __last);
   ++__first;
 }
    }
# 1856 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Predicate>
    inline _ForwardIterator
    partition(_ForwardIterator __first, _ForwardIterator __last,
       _Predicate __pred)
    {

     

     

      ;

      return std::__partition(__first, __last, __pred,
         std::__iterator_category(__first));
    }







  template<typename _ForwardIterator, typename _Predicate, typename _Distance>
    _ForwardIterator
    __inplace_stable_partition(_ForwardIterator __first,
          _ForwardIterator __last,
          _Predicate __pred, _Distance __len)
    {
      if (__len == 1)
 return __pred(*__first) ? __last : __first;
      _ForwardIterator __middle = __first;
      std::advance(__middle, __len / 2);
      _ForwardIterator __begin = std::__inplace_stable_partition(__first,
         __middle,
         __pred,
         __len / 2);
      _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last,
              __pred,
              __len
              - __len / 2);
      std::rotate(__begin, __middle, __end);
      std::advance(__begin, std::distance(__middle, __end));
      return __begin;
    }






  template<typename _ForwardIterator, typename _Pointer, typename _Predicate,
    typename _Distance>
    _ForwardIterator
    __stable_partition_adaptive(_ForwardIterator __first,
    _ForwardIterator __last,
    _Predicate __pred, _Distance __len,
    _Pointer __buffer,
    _Distance __buffer_size)
    {
      if (__len <= __buffer_size)
 {
   _ForwardIterator __result1 = __first;
   _Pointer __result2 = __buffer;
   for ( ; __first != __last ; ++__first)
     if (__pred(*__first))
       {
  *__result1 = *__first;
  ++__result1;
       }
     else
       {
  *__result2 = *__first;
  ++__result2;
       }
   std::copy(__buffer, __result2, __result1);
   return __result1;
 }
      else
 {
   _ForwardIterator __middle = __first;
   std::advance(__middle, __len / 2);
   _ForwardIterator __begin =
     std::__stable_partition_adaptive(__first, __middle, __pred,
          __len / 2, __buffer,
          __buffer_size);
   _ForwardIterator __end =
     std::__stable_partition_adaptive(__middle, __last, __pred,
          __len - __len / 2,
          __buffer, __buffer_size);
   std::rotate(__begin, __middle, __end);
   std::advance(__begin, std::distance(__middle, __end));
   return __begin;
 }
    }
# 1967 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Predicate>
    _ForwardIterator
    stable_partition(_ForwardIterator __first, _ForwardIterator __last,
       _Predicate __pred)
    {

     

     

      ;

      if (__first == __last)
 return __first;
      else
 {
   typedef typename iterator_traits<_ForwardIterator>::value_type
     _ValueType;
   typedef typename iterator_traits<_ForwardIterator>::difference_type
     _DistanceType;

   _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first,
        __last);
 if (__buf.size() > 0)
   return
     std::__stable_partition_adaptive(__first, __last, __pred,
       _DistanceType(__buf.requested_size()),
       __buf.begin(), __buf.size());
 else
   return
     std::__inplace_stable_partition(__first, __last, __pred,
      _DistanceType(__buf.requested_size()));
 }
    }






  template<typename _RandomAccessIterator, typename _Tp>
    _RandomAccessIterator
    __unguarded_partition(_RandomAccessIterator __first,
     _RandomAccessIterator __last, _Tp __pivot)
    {
      while (true)
 {
   while (*__first < __pivot)
     ++__first;
   --__last;
   while (__pivot < *__last)
     --__last;
   if (!(__first < __last))
     return __first;
   std::iter_swap(__first, __last);
   ++__first;
 }
    }






  template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
    _RandomAccessIterator
    __unguarded_partition(_RandomAccessIterator __first,
     _RandomAccessIterator __last,
     _Tp __pivot, _Compare __comp)
    {
      while (true)
 {
   while (__comp(*__first, __pivot))
     ++__first;
   --__last;
   while (__comp(__pivot, *__last))
     --__last;
   if (!(__first < __last))
     return __first;
   std::iter_swap(__first, __last);
   ++__first;
 }
    }







  enum { _S_threshold = 16 };






  template<typename _RandomAccessIterator, typename _Tp>
    void
    __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val)
    {
      _RandomAccessIterator __next = __last;
      --__next;
      while (__val < *__next)
 {
   *__last = *__next;
   __last = __next;
   --__next;
 }
      *__last = __val;
    }






  template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
    void
    __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val,
         _Compare __comp)
    {
      _RandomAccessIterator __next = __last;
      --__next;
      while (__comp(__val, *__next))
 {
   *__last = *__next;
   __last = __next;
   --__next;
 }
      *__last = __val;
    }






  template<typename _RandomAccessIterator>
    void
    __insertion_sort(_RandomAccessIterator __first,
       _RandomAccessIterator __last)
    {
      if (__first == __last)
 return;

      for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
 {
   typename iterator_traits<_RandomAccessIterator>::value_type
     __val = *__i;
   if (__val < *__first)
     {
       std::copy_backward(__first, __i, __i + 1);
       *__first = __val;
     }
   else
     std::__unguarded_linear_insert(__i, __val);
 }
    }






  template<typename _RandomAccessIterator, typename _Compare>
    void
    __insertion_sort(_RandomAccessIterator __first,
       _RandomAccessIterator __last, _Compare __comp)
    {
      if (__first == __last) return;

      for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
 {
   typename iterator_traits<_RandomAccessIterator>::value_type
     __val = *__i;
   if (__comp(__val, *__first))
     {
       std::copy_backward(__first, __i, __i + 1);
       *__first = __val;
     }
   else
     std::__unguarded_linear_insert(__i, __val, __comp);
 }
    }






  template<typename _RandomAccessIterator>
    inline void
    __unguarded_insertion_sort(_RandomAccessIterator __first,
          _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;

      for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
 std::__unguarded_linear_insert(__i, _ValueType(*__i));
    }






  template<typename _RandomAccessIterator, typename _Compare>
    inline void
    __unguarded_insertion_sort(_RandomAccessIterator __first,
          _RandomAccessIterator __last, _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;

      for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
 std::__unguarded_linear_insert(__i, _ValueType(*__i), __comp);
    }






  template<typename _RandomAccessIterator>
    void
    __final_insertion_sort(_RandomAccessIterator __first,
      _RandomAccessIterator __last)
    {
      if (__last - __first > _S_threshold)
 {
   std::__insertion_sort(__first, __first + _S_threshold);
   std::__unguarded_insertion_sort(__first + _S_threshold, __last);
 }
      else
 std::__insertion_sort(__first, __last);
    }






  template<typename _RandomAccessIterator, typename _Compare>
    void
    __final_insertion_sort(_RandomAccessIterator __first,
      _RandomAccessIterator __last, _Compare __comp)
    {
      if (__last - __first > _S_threshold)
 {
   std::__insertion_sort(__first, __first + _S_threshold, __comp);
   std::__unguarded_insertion_sort(__first + _S_threshold, __last,
       __comp);
 }
      else
 std::__insertion_sort(__first, __last, __comp);
    }






  template<typename _Size>
    inline _Size
    __lg(_Size __n)
    {
      _Size __k;
      for (__k = 0; __n != 1; __n >>= 1)
 ++__k;
      return __k;
    }
# 2256 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator>
    void
    partial_sort(_RandomAccessIterator __first,
   _RandomAccessIterator __middle,
   _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     
      ;
      ;

      std::make_heap(__first, __middle);
      for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
 if (*__i < *__first)
   std::__pop_heap(__first, __middle, __i, _ValueType(*__i));
      std::sort_heap(__first, __middle);
    }
# 2297 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    void
    partial_sort(_RandomAccessIterator __first,
   _RandomAccessIterator __middle,
   _RandomAccessIterator __last,
   _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     

      ;
      ;

      std::make_heap(__first, __middle, __comp);
      for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
 if (__comp(*__i, *__first))
   std::__pop_heap(__first, __middle, __i, _ValueType(*__i), __comp);
      std::sort_heap(__first, __middle, __comp);
    }
# 2339 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _RandomAccessIterator>
    _RandomAccessIterator
    partial_sort_copy(_InputIterator __first, _InputIterator __last,
        _RandomAccessIterator __result_first,
        _RandomAccessIterator __result_last)
    {
      typedef typename iterator_traits<_InputIterator>::value_type
 _InputValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _OutputValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _DistanceType;


     
     

     
     
      ;
      ;

      if (__result_first == __result_last)
 return __result_last;
      _RandomAccessIterator __result_real_last = __result_first;
      while(__first != __last && __result_real_last != __result_last)
 {
   *__result_real_last = *__first;
   ++__result_real_last;
   ++__first;
 }
      std::make_heap(__result_first, __result_real_last);
      while (__first != __last)
 {
   if (*__first < *__result_first)
     std::__adjust_heap(__result_first, _DistanceType(0),
          _DistanceType(__result_real_last
          - __result_first),
          _InputValueType(*__first));
   ++__first;
 }
      std::sort_heap(__result_first, __result_real_last);
      return __result_real_last;
    }
# 2403 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _RandomAccessIterator, typename _Compare>
    _RandomAccessIterator
    partial_sort_copy(_InputIterator __first, _InputIterator __last,
        _RandomAccessIterator __result_first,
        _RandomAccessIterator __result_last,
        _Compare __comp)
    {
      typedef typename iterator_traits<_InputIterator>::value_type
 _InputValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _OutputValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _DistanceType;


     
     

     

     

      ;
      ;

      if (__result_first == __result_last)
 return __result_last;
      _RandomAccessIterator __result_real_last = __result_first;
      while(__first != __last && __result_real_last != __result_last)
 {
   *__result_real_last = *__first;
   ++__result_real_last;
   ++__first;
 }
      std::make_heap(__result_first, __result_real_last, __comp);
      while (__first != __last)
 {
   if (__comp(*__first, *__result_first))
     std::__adjust_heap(__result_first, _DistanceType(0),
          _DistanceType(__result_real_last
          - __result_first),
          _InputValueType(*__first),
          __comp);
   ++__first;
 }
      std::sort_heap(__result_first, __result_real_last, __comp);
      return __result_real_last;
    }






  template<typename _RandomAccessIterator, typename _Size>
    void
    __introsort_loop(_RandomAccessIterator __first,
       _RandomAccessIterator __last,
       _Size __depth_limit)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;

      while (__last - __first > _S_threshold)
 {
   if (__depth_limit == 0)
     {
       std::partial_sort(__first, __last, __last);
       return;
     }
   --__depth_limit;
   _RandomAccessIterator __cut =
     std::__unguarded_partition(__first, __last,
           _ValueType(std::__median(*__first,
        *(__first
          + (__last
             - __first)
          / 2),
        *(__last
          - 1))));
   std::__introsort_loop(__cut, __last, __depth_limit);
   __last = __cut;
 }
    }






  template<typename _RandomAccessIterator, typename _Size, typename _Compare>
    void
    __introsort_loop(_RandomAccessIterator __first,
       _RandomAccessIterator __last,
       _Size __depth_limit, _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;

      while (__last - __first > _S_threshold)
 {
   if (__depth_limit == 0)
     {
       std::partial_sort(__first, __last, __last, __comp);
       return;
     }
   --__depth_limit;
   _RandomAccessIterator __cut =
     std::__unguarded_partition(__first, __last,
           _ValueType(std::__median(*__first,
        *(__first
          + (__last
             - __first)
          / 2),
        *(__last - 1),
        __comp)),
           __comp);
   std::__introsort_loop(__cut, __last, __depth_limit, __comp);
   __last = __cut;
 }
    }
# 2538 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator>
    inline void
    sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     
      ;

      if (__first != __last)
 {
   std::__introsort_loop(__first, __last, __lg(__last - __first) * 2);
   std::__final_insertion_sort(__first, __last);
 }
    }
# 2572 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    inline void
    sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
  _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     

      ;

      if (__first != __last)
 {
   std::__introsort_loop(__first, __last, __lg(__last - __first) * 2,
    __comp);
   std::__final_insertion_sort(__first, __last, __comp);
 }
    }
# 2605 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp>
    _ForwardIterator
    lower_bound(_ForwardIterator __first, _ForwardIterator __last,
  const _Tp& __val)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_ForwardIterator>::difference_type
 _DistanceType;






     
     
     
      ;

      _DistanceType __len = std::distance(__first, __last);
      _DistanceType __half;
      _ForwardIterator __middle;

      while (__len > 0)
 {
   __half = __len >> 1;
   __middle = __first;
   std::advance(__middle, __half);
   if (*__middle < __val)
     {
       __first = __middle;
       ++__first;
       __len = __len - __half - 1;
     }
   else
     __len = __half;
 }
      return __first;
    }
# 2660 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp, typename _Compare>
    _ForwardIterator
    lower_bound(_ForwardIterator __first, _ForwardIterator __last,
  const _Tp& __val, _Compare __comp)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_ForwardIterator>::difference_type
 _DistanceType;


     
     

      ;

      _DistanceType __len = std::distance(__first, __last);
      _DistanceType __half;
      _ForwardIterator __middle;

      while (__len > 0)
 {
   __half = __len >> 1;
   __middle = __first;
   std::advance(__middle, __half);
   if (__comp(*__middle, __val))
     {
       __first = __middle;
       ++__first;
       __len = __len - __half - 1;
     }
   else
     __len = __half;
 }
      return __first;
    }
# 2707 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp>
    _ForwardIterator
    upper_bound(_ForwardIterator __first, _ForwardIterator __last,
  const _Tp& __val)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_ForwardIterator>::difference_type
 _DistanceType;



     
     
     
      ;

      _DistanceType __len = std::distance(__first, __last);
      _DistanceType __half;
      _ForwardIterator __middle;

      while (__len > 0)
 {
   __half = __len >> 1;
   __middle = __first;
   std::advance(__middle, __half);
   if (__val < *__middle)
     __len = __half;
   else
     {
       __first = __middle;
       ++__first;
       __len = __len - __half - 1;
     }
 }
      return __first;
    }
# 2759 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp, typename _Compare>
    _ForwardIterator
    upper_bound(_ForwardIterator __first, _ForwardIterator __last,
  const _Tp& __val, _Compare __comp)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_ForwardIterator>::difference_type
 _DistanceType;


     
     

      ;

      _DistanceType __len = std::distance(__first, __last);
      _DistanceType __half;
      _ForwardIterator __middle;

      while (__len > 0)
 {
   __half = __len >> 1;
   __middle = __first;
   std::advance(__middle, __half);
   if (__comp(__val, *__middle))
     __len = __half;
   else
     {
       __first = __middle;
       ++__first;
       __len = __len - __half - 1;
     }
 }
      return __first;
    }






  template<typename _BidirectionalIterator, typename _Distance>
    void
    __merge_without_buffer(_BidirectionalIterator __first,
      _BidirectionalIterator __middle,
      _BidirectionalIterator __last,
      _Distance __len1, _Distance __len2)
    {
      if (__len1 == 0 || __len2 == 0)
 return;
      if (__len1 + __len2 == 2)
 {
   if (*__middle < *__first)
     std::iter_swap(__first, __middle);
   return;
 }
      _BidirectionalIterator __first_cut = __first;
      _BidirectionalIterator __second_cut = __middle;
      _Distance __len11 = 0;
      _Distance __len22 = 0;
      if (__len1 > __len2)
 {
   __len11 = __len1 / 2;
   std::advance(__first_cut, __len11);
   __second_cut = std::lower_bound(__middle, __last, *__first_cut);
   __len22 = std::distance(__middle, __second_cut);
 }
      else
 {
   __len22 = __len2 / 2;
   std::advance(__second_cut, __len22);
   __first_cut = std::upper_bound(__first, __middle, *__second_cut);
   __len11 = std::distance(__first, __first_cut);
 }
      std::rotate(__first_cut, __middle, __second_cut);
      _BidirectionalIterator __new_middle = __first_cut;
      std::advance(__new_middle, std::distance(__middle, __second_cut));
      std::__merge_without_buffer(__first, __first_cut, __new_middle,
      __len11, __len22);
      std::__merge_without_buffer(__new_middle, __second_cut, __last,
      __len1 - __len11, __len2 - __len22);
    }






  template<typename _BidirectionalIterator, typename _Distance,
    typename _Compare>
    void
    __merge_without_buffer(_BidirectionalIterator __first,
                           _BidirectionalIterator __middle,
      _BidirectionalIterator __last,
      _Distance __len1, _Distance __len2,
      _Compare __comp)
    {
      if (__len1 == 0 || __len2 == 0)
 return;
      if (__len1 + __len2 == 2)
 {
   if (__comp(*__middle, *__first))
     std::iter_swap(__first, __middle);
   return;
 }
      _BidirectionalIterator __first_cut = __first;
      _BidirectionalIterator __second_cut = __middle;
      _Distance __len11 = 0;
      _Distance __len22 = 0;
      if (__len1 > __len2)
 {
   __len11 = __len1 / 2;
   std::advance(__first_cut, __len11);
   __second_cut = std::lower_bound(__middle, __last, *__first_cut,
       __comp);
   __len22 = std::distance(__middle, __second_cut);
 }
      else
 {
   __len22 = __len2 / 2;
   std::advance(__second_cut, __len22);
   __first_cut = std::upper_bound(__first, __middle, *__second_cut,
      __comp);
   __len11 = std::distance(__first, __first_cut);
 }
      std::rotate(__first_cut, __middle, __second_cut);
      _BidirectionalIterator __new_middle = __first_cut;
      std::advance(__new_middle, std::distance(__middle, __second_cut));
      std::__merge_without_buffer(__first, __first_cut, __new_middle,
      __len11, __len22, __comp);
      std::__merge_without_buffer(__new_middle, __second_cut, __last,
      __len1 - __len11, __len2 - __len22, __comp);
    }






  template<typename _RandomAccessIterator>
    void
    __inplace_stable_sort(_RandomAccessIterator __first,
     _RandomAccessIterator __last)
    {
      if (__last - __first < 15)
 {
   std::__insertion_sort(__first, __last);
   return;
 }
      _RandomAccessIterator __middle = __first + (__last - __first) / 2;
      std::__inplace_stable_sort(__first, __middle);
      std::__inplace_stable_sort(__middle, __last);
      std::__merge_without_buffer(__first, __middle, __last,
      __middle - __first,
      __last - __middle);
    }






  template<typename _RandomAccessIterator, typename _Compare>
    void
    __inplace_stable_sort(_RandomAccessIterator __first,
     _RandomAccessIterator __last, _Compare __comp)
    {
      if (__last - __first < 15)
 {
   std::__insertion_sort(__first, __last, __comp);
   return;
 }
      _RandomAccessIterator __middle = __first + (__last - __first) / 2;
      std::__inplace_stable_sort(__first, __middle, __comp);
      std::__inplace_stable_sort(__middle, __last, __comp);
      std::__merge_without_buffer(__first, __middle, __last,
      __middle - __first,
      __last - __middle,
      __comp);
    }
# 2957 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator>
    _OutputIterator
    merge(_InputIterator1 __first1, _InputIterator1 __last1,
   _InputIterator2 __first2, _InputIterator2 __last2,
   _OutputIterator __result)
    {

     
     
     

     


     

      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 {
   if (*__first2 < *__first1)
     {
       *__result = *__first2;
       ++__first2;
     }
   else
     {
       *__result = *__first1;
       ++__first1;
     }
   ++__result;
 }
      return std::copy(__first2, __last2, std::copy(__first1, __last1,
          __result));
    }
# 3015 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator, typename _Compare>
    _OutputIterator
    merge(_InputIterator1 __first1, _InputIterator1 __last1,
   _InputIterator2 __first2, _InputIterator2 __last2,
   _OutputIterator __result, _Compare __comp)
    {

     
     
     


     

     


      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 {
   if (__comp(*__first2, *__first1))
     {
       *__result = *__first2;
       ++__first2;
     }
   else
     {
       *__result = *__first1;
       ++__first1;
     }
   ++__result;
 }
      return std::copy(__first2, __last2, std::copy(__first1, __last1,
          __result));
    }

  template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
    typename _Distance>
    void
    __merge_sort_loop(_RandomAccessIterator1 __first,
        _RandomAccessIterator1 __last,
        _RandomAccessIterator2 __result,
        _Distance __step_size)
    {
      const _Distance __two_step = 2 * __step_size;

      while (__last - __first >= __two_step)
 {
   __result = std::merge(__first, __first + __step_size,
    __first + __step_size, __first + __two_step,
    __result);
   __first += __two_step;
 }

      __step_size = std::min(_Distance(__last - __first), __step_size);
      std::merge(__first, __first + __step_size, __first + __step_size, __last,
   __result);
    }

  template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
    typename _Distance, typename _Compare>
    void
    __merge_sort_loop(_RandomAccessIterator1 __first,
        _RandomAccessIterator1 __last,
        _RandomAccessIterator2 __result, _Distance __step_size,
        _Compare __comp)
    {
      const _Distance __two_step = 2 * __step_size;

      while (__last - __first >= __two_step)
 {
   __result = std::merge(__first, __first + __step_size,
    __first + __step_size, __first + __two_step,
    __result,
    __comp);
   __first += __two_step;
 }
      __step_size = std::min(_Distance(__last - __first), __step_size);

      std::merge(__first, __first + __step_size,
   __first + __step_size, __last,
   __result,
   __comp);
    }

  enum { _S_chunk_size = 7 };

  template<typename _RandomAccessIterator, typename _Distance>
    void
    __chunk_insertion_sort(_RandomAccessIterator __first,
      _RandomAccessIterator __last,
      _Distance __chunk_size)
    {
      while (__last - __first >= __chunk_size)
 {
   std::__insertion_sort(__first, __first + __chunk_size);
   __first += __chunk_size;
 }
      std::__insertion_sort(__first, __last);
    }

  template<typename _RandomAccessIterator, typename _Distance, typename _Compare>
    void
    __chunk_insertion_sort(_RandomAccessIterator __first,
      _RandomAccessIterator __last,
      _Distance __chunk_size, _Compare __comp)
    {
      while (__last - __first >= __chunk_size)
 {
   std::__insertion_sort(__first, __first + __chunk_size, __comp);
   __first += __chunk_size;
 }
      std::__insertion_sort(__first, __last, __comp);
    }

  template<typename _RandomAccessIterator, typename _Pointer>
    void
    __merge_sort_with_buffer(_RandomAccessIterator __first,
        _RandomAccessIterator __last,
                             _Pointer __buffer)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _Distance;

      const _Distance __len = __last - __first;
      const _Pointer __buffer_last = __buffer + __len;

      _Distance __step_size = _S_chunk_size;
      std::__chunk_insertion_sort(__first, __last, __step_size);

      while (__step_size < __len)
 {
   std::__merge_sort_loop(__first, __last, __buffer, __step_size);
   __step_size *= 2;
   std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size);
   __step_size *= 2;
 }
    }

  template<typename _RandomAccessIterator, typename _Pointer, typename _Compare>
    void
    __merge_sort_with_buffer(_RandomAccessIterator __first,
        _RandomAccessIterator __last,
                             _Pointer __buffer, _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _Distance;

      const _Distance __len = __last - __first;
      const _Pointer __buffer_last = __buffer + __len;

      _Distance __step_size = _S_chunk_size;
      std::__chunk_insertion_sort(__first, __last, __step_size, __comp);

      while (__step_size < __len)
 {
   std::__merge_sort_loop(__first, __last, __buffer,
     __step_size, __comp);
   __step_size *= 2;
   std::__merge_sort_loop(__buffer, __buffer_last, __first,
     __step_size, __comp);
   __step_size *= 2;
 }
    }






  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
    typename _BidirectionalIterator3>
    _BidirectionalIterator3
    __merge_backward(_BidirectionalIterator1 __first1,
       _BidirectionalIterator1 __last1,
       _BidirectionalIterator2 __first2,
       _BidirectionalIterator2 __last2,
       _BidirectionalIterator3 __result)
    {
      if (__first1 == __last1)
 return std::copy_backward(__first2, __last2, __result);
      if (__first2 == __last2)
 return std::copy_backward(__first1, __last1, __result);
      --__last1;
      --__last2;
      while (true)
 {
   if (*__last2 < *__last1)
     {
       *--__result = *__last1;
       if (__first1 == __last1)
  return std::copy_backward(__first2, ++__last2, __result);
       --__last1;
     }
   else
     {
       *--__result = *__last2;
       if (__first2 == __last2)
  return std::copy_backward(__first1, ++__last1, __result);
       --__last2;
     }
 }
    }






  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
    typename _BidirectionalIterator3, typename _Compare>
    _BidirectionalIterator3
    __merge_backward(_BidirectionalIterator1 __first1,
       _BidirectionalIterator1 __last1,
       _BidirectionalIterator2 __first2,
       _BidirectionalIterator2 __last2,
       _BidirectionalIterator3 __result,
       _Compare __comp)
    {
      if (__first1 == __last1)
 return std::copy_backward(__first2, __last2, __result);
      if (__first2 == __last2)
 return std::copy_backward(__first1, __last1, __result);
      --__last1;
      --__last2;
      while (true)
 {
   if (__comp(*__last2, *__last1))
     {
       *--__result = *__last1;
       if (__first1 == __last1)
  return std::copy_backward(__first2, ++__last2, __result);
       --__last1;
     }
   else
     {
       *--__result = *__last2;
       if (__first2 == __last2)
  return std::copy_backward(__first1, ++__last1, __result);
       --__last2;
     }
 }
    }






  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
    typename _Distance>
    _BidirectionalIterator1
    __rotate_adaptive(_BidirectionalIterator1 __first,
        _BidirectionalIterator1 __middle,
        _BidirectionalIterator1 __last,
        _Distance __len1, _Distance __len2,
        _BidirectionalIterator2 __buffer,
        _Distance __buffer_size)
    {
      _BidirectionalIterator2 __buffer_end;
      if (__len1 > __len2 && __len2 <= __buffer_size)
 {
   __buffer_end = std::copy(__middle, __last, __buffer);
   std::copy_backward(__first, __middle, __last);
   return std::copy(__buffer, __buffer_end, __first);
 }
      else if (__len1 <= __buffer_size)
 {
   __buffer_end = std::copy(__first, __middle, __buffer);
   std::copy(__middle, __last, __first);
   return std::copy_backward(__buffer, __buffer_end, __last);
 }
      else
 {
   std::rotate(__first, __middle, __last);
   std::advance(__first, std::distance(__middle, __last));
   return __first;
 }
    }






  template<typename _BidirectionalIterator, typename _Distance,
    typename _Pointer>
    void
    __merge_adaptive(_BidirectionalIterator __first,
                     _BidirectionalIterator __middle,
       _BidirectionalIterator __last,
       _Distance __len1, _Distance __len2,
       _Pointer __buffer, _Distance __buffer_size)
    {
      if (__len1 <= __len2 && __len1 <= __buffer_size)
 {
   _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
   std::merge(__buffer, __buffer_end, __middle, __last, __first);
 }
      else if (__len2 <= __buffer_size)
 {
   _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
   std::__merge_backward(__first, __middle, __buffer,
    __buffer_end, __last);
 }
      else
 {
   _BidirectionalIterator __first_cut = __first;
   _BidirectionalIterator __second_cut = __middle;
   _Distance __len11 = 0;
   _Distance __len22 = 0;
   if (__len1 > __len2)
     {
       __len11 = __len1 / 2;
       std::advance(__first_cut, __len11);
       __second_cut = std::lower_bound(__middle, __last,
           *__first_cut);
       __len22 = std::distance(__middle, __second_cut);
     }
   else
     {
       __len22 = __len2 / 2;
       std::advance(__second_cut, __len22);
       __first_cut = std::upper_bound(__first, __middle,
          *__second_cut);
       __len11 = std::distance(__first, __first_cut);
     }
   _BidirectionalIterator __new_middle =
     std::__rotate_adaptive(__first_cut, __middle, __second_cut,
       __len1 - __len11, __len22, __buffer,
       __buffer_size);
   std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
    __len22, __buffer, __buffer_size);
   std::__merge_adaptive(__new_middle, __second_cut, __last,
    __len1 - __len11,
    __len2 - __len22, __buffer, __buffer_size);
 }
    }






  template<typename _BidirectionalIterator, typename _Distance, typename _Pointer,
    typename _Compare>
    void
    __merge_adaptive(_BidirectionalIterator __first,
                     _BidirectionalIterator __middle,
       _BidirectionalIterator __last,
       _Distance __len1, _Distance __len2,
       _Pointer __buffer, _Distance __buffer_size,
       _Compare __comp)
    {
      if (__len1 <= __len2 && __len1 <= __buffer_size)
 {
   _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
   std::merge(__buffer, __buffer_end, __middle, __last, __first, __comp);
 }
      else if (__len2 <= __buffer_size)
 {
   _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
   std::__merge_backward(__first, __middle, __buffer, __buffer_end,
    __last, __comp);
 }
      else
 {
   _BidirectionalIterator __first_cut = __first;
   _BidirectionalIterator __second_cut = __middle;
   _Distance __len11 = 0;
   _Distance __len22 = 0;
   if (__len1 > __len2)
     {
       __len11 = __len1 / 2;
       std::advance(__first_cut, __len11);
       __second_cut = std::lower_bound(__middle, __last, *__first_cut,
           __comp);
       __len22 = std::distance(__middle, __second_cut);
     }
   else
     {
       __len22 = __len2 / 2;
       std::advance(__second_cut, __len22);
       __first_cut = std::upper_bound(__first, __middle, *__second_cut,
          __comp);
       __len11 = std::distance(__first, __first_cut);
     }
   _BidirectionalIterator __new_middle =
     std::__rotate_adaptive(__first_cut, __middle, __second_cut,
       __len1 - __len11, __len22, __buffer,
       __buffer_size);
   std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
    __len22, __buffer, __buffer_size, __comp);
   std::__merge_adaptive(__new_middle, __second_cut, __last,
    __len1 - __len11,
    __len2 - __len22, __buffer,
    __buffer_size, __comp);
 }
    }
# 3435 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator>
    void
    inplace_merge(_BidirectionalIterator __first,
    _BidirectionalIterator __middle,
    _BidirectionalIterator __last)
    {
      typedef typename iterator_traits<_BidirectionalIterator>::value_type
          _ValueType;
      typedef typename iterator_traits<_BidirectionalIterator>::difference_type
          _DistanceType;


     

     
      ;
      ;

      if (__first == __middle || __middle == __last)
 return;

      _DistanceType __len1 = std::distance(__first, __middle);
      _DistanceType __len2 = std::distance(__middle, __last);

      _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
          __last);
      if (__buf.begin() == 0)
 std::__merge_without_buffer(__first, __middle, __last, __len1, __len2);
      else
 std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
         __buf.begin(), _DistanceType(__buf.size()));
    }
# 3489 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator, typename _Compare>
    void
    inplace_merge(_BidirectionalIterator __first,
    _BidirectionalIterator __middle,
    _BidirectionalIterator __last,
    _Compare __comp)
    {
      typedef typename iterator_traits<_BidirectionalIterator>::value_type
          _ValueType;
      typedef typename iterator_traits<_BidirectionalIterator>::difference_type
          _DistanceType;


     

     

      ;
      ;

      if (__first == __middle || __middle == __last)
 return;

      const _DistanceType __len1 = std::distance(__first, __middle);
      const _DistanceType __len2 = std::distance(__middle, __last);

      _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
          __last);
      if (__buf.begin() == 0)
 std::__merge_without_buffer(__first, __middle, __last, __len1,
        __len2, __comp);
      else
 std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
         __buf.begin(), _DistanceType(__buf.size()),
         __comp);
    }

  template<typename _RandomAccessIterator, typename _Pointer,
    typename _Distance>
    void
    __stable_sort_adaptive(_RandomAccessIterator __first,
      _RandomAccessIterator __last,
                           _Pointer __buffer, _Distance __buffer_size)
    {
      const _Distance __len = (__last - __first + 1) / 2;
      const _RandomAccessIterator __middle = __first + __len;
      if (__len > __buffer_size)
 {
   std::__stable_sort_adaptive(__first, __middle,
          __buffer, __buffer_size);
   std::__stable_sort_adaptive(__middle, __last,
          __buffer, __buffer_size);
 }
      else
 {
   std::__merge_sort_with_buffer(__first, __middle, __buffer);
   std::__merge_sort_with_buffer(__middle, __last, __buffer);
 }
      std::__merge_adaptive(__first, __middle, __last,
       _Distance(__middle - __first),
       _Distance(__last - __middle),
       __buffer, __buffer_size);
    }

  template<typename _RandomAccessIterator, typename _Pointer,
    typename _Distance, typename _Compare>
    void
    __stable_sort_adaptive(_RandomAccessIterator __first,
      _RandomAccessIterator __last,
                           _Pointer __buffer, _Distance __buffer_size,
                           _Compare __comp)
    {
      const _Distance __len = (__last - __first + 1) / 2;
      const _RandomAccessIterator __middle = __first + __len;
      if (__len > __buffer_size)
 {
   std::__stable_sort_adaptive(__first, __middle, __buffer,
          __buffer_size, __comp);
   std::__stable_sort_adaptive(__middle, __last, __buffer,
          __buffer_size, __comp);
 }
      else
 {
   std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp);
   std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp);
 }
      std::__merge_adaptive(__first, __middle, __last,
       _Distance(__middle - __first),
       _Distance(__last - __middle),
       __buffer, __buffer_size,
       __comp);
    }
# 3598 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator>
    inline void
    stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _DistanceType;


     

     
      ;

      _Temporary_buffer<_RandomAccessIterator, _ValueType>
 buf(__first, __last);
      if (buf.begin() == 0)
 std::__inplace_stable_sort(__first, __last);
      else
 std::__stable_sort_adaptive(__first, __last, buf.begin(),
        _DistanceType(buf.size()));
    }
# 3639 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    inline void
    stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
  _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
 _DistanceType;


     

     


      ;

      _Temporary_buffer<_RandomAccessIterator, _ValueType> buf(__first, __last);
      if (buf.begin() == 0)
 std::__inplace_stable_sort(__first, __last, __comp);
      else
 std::__stable_sort_adaptive(__first, __last, buf.begin(),
        _DistanceType(buf.size()), __comp);
    }
# 3680 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator>
    void
    nth_element(_RandomAccessIterator __first,
  _RandomAccessIterator __nth,
  _RandomAccessIterator __last)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     
      ;
      ;

      while (__last - __first > 3)
 {
   _RandomAccessIterator __cut =
     std::__unguarded_partition(__first, __last,
           _ValueType(std::__median(*__first,
        *(__first
          + (__last
             - __first)
          / 2),
        *(__last
          - 1))));
   if (__cut <= __nth)
     __first = __cut;
   else
     __last = __cut;
 }
      std::__insertion_sort(__first, __last);
    }
# 3731 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _RandomAccessIterator, typename _Compare>
    void
    nth_element(_RandomAccessIterator __first,
  _RandomAccessIterator __nth,
  _RandomAccessIterator __last,
       _Compare __comp)
    {
      typedef typename iterator_traits<_RandomAccessIterator>::value_type
 _ValueType;


     

     

      ;
      ;

      while (__last - __first > 3)
 {
   _RandomAccessIterator __cut =
     std::__unguarded_partition(__first, __last,
           _ValueType(std::__median(*__first,
        *(__first
          + (__last
             - __first)
          / 2),
        *(__last - 1),
             __comp)), __comp);
   if (__cut <= __nth)
     __first = __cut;
   else
     __last = __cut;
 }
      std::__insertion_sort(__first, __last, __comp);
    }
# 3784 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp>
    pair<_ForwardIterator, _ForwardIterator>
    equal_range(_ForwardIterator __first, _ForwardIterator __last,
  const _Tp& __val)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_ForwardIterator>::difference_type
 _DistanceType;



     
     
     
      ;

      _DistanceType __len = std::distance(__first, __last);
      _DistanceType __half;
      _ForwardIterator __middle, __left, __right;

      while (__len > 0)
 {
   __half = __len >> 1;
   __middle = __first;
   std::advance(__middle, __half);
   if (*__middle < __val)
     {
       __first = __middle;
       ++__first;
       __len = __len - __half - 1;
     }
   else if (__val < *__middle)
     __len = __half;
   else
     {
       __left = std::lower_bound(__first, __middle, __val);
       std::advance(__first, __len);
       __right = std::upper_bound(++__middle, __first, __val);
       return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
     }
 }
      return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
    }
# 3846 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp, typename _Compare>
    pair<_ForwardIterator, _ForwardIterator>
    equal_range(_ForwardIterator __first, _ForwardIterator __last,
  const _Tp& __val,
  _Compare __comp)
    {
      typedef typename iterator_traits<_ForwardIterator>::value_type
 _ValueType;
      typedef typename iterator_traits<_ForwardIterator>::difference_type
 _DistanceType;


     
     

     

      ;

      _DistanceType __len = std::distance(__first, __last);
      _DistanceType __half;
      _ForwardIterator __middle, __left, __right;

      while (__len > 0)
 {
   __half = __len >> 1;
   __middle = __first;
   std::advance(__middle, __half);
   if (__comp(*__middle, __val))
     {
       __first = __middle;
       ++__first;
       __len = __len - __half - 1;
     }
   else if (__comp(__val, *__middle))
     __len = __half;
   else
     {
       __left = std::lower_bound(__first, __middle, __val, __comp);
       std::advance(__first, __len);
       __right = std::upper_bound(++__middle, __first, __val, __comp);
       return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
     }
 }
      return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
    }
# 3904 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp>
    bool
    binary_search(_ForwardIterator __first, _ForwardIterator __last,
                  const _Tp& __val)
    {


     
     

     
      ;

      _ForwardIterator __i = std::lower_bound(__first, __last, __val);
      return __i != __last && !(__val < *__i);
    }
# 3936 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Tp, typename _Compare>
    bool
    binary_search(_ForwardIterator __first, _ForwardIterator __last,
                  const _Tp& __val, _Compare __comp)
    {

     
     

     

      ;

      _ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp);
      return __i != __last && !__comp(__val, *__i);
    }
# 3974 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2>
    bool
    includes(_InputIterator1 __first1, _InputIterator1 __last1,
      _InputIterator2 __first2, _InputIterator2 __last2)
    {

     
     
     


     

      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (*__first2 < *__first1)
   return false;
 else if(*__first1 < *__first2)
   ++__first1;
 else
   ++__first1, ++__first2;

      return __first2 == __last2;
    }
# 4020 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _Compare>
    bool
    includes(_InputIterator1 __first1, _InputIterator1 __last1,
      _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
    {

     
     
     


     


      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (__comp(*__first2, *__first1))
   return false;
 else if(__comp(*__first1, *__first2))
   ++__first1;
 else
   ++__first1, ++__first2;

      return __first2 == __last2;
    }
# 4066 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator>
    _OutputIterator
    set_union(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2,
       _OutputIterator __result)
    {

     
     
     

     


     

      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 {
   if (*__first1 < *__first2)
     {
       *__result = *__first1;
       ++__first1;
     }
   else if (*__first2 < *__first1)
     {
       *__result = *__first2;
       ++__first2;
     }
   else
     {
       *__result = *__first1;
       ++__first1;
       ++__first2;
     }
   ++__result;
 }
      return std::copy(__first2, __last2, std::copy(__first1, __last1,
          __result));
    }
# 4128 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator, typename _Compare>
    _OutputIterator
    set_union(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2,
       _OutputIterator __result, _Compare __comp)
    {

     
     
     


     

     


      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 {
   if (__comp(*__first1, *__first2))
     {
       *__result = *__first1;
       ++__first1;
     }
   else if (__comp(*__first2, *__first1))
     {
       *__result = *__first2;
       ++__first2;
     }
   else
     {
       *__result = *__first1;
       ++__first1;
       ++__first2;
     }
   ++__result;
 }
      return std::copy(__first2, __last2, std::copy(__first1, __last1,
          __result));
    }
# 4189 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator>
    _OutputIterator
    set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2,
       _OutputIterator __result)
    {

     
     
     

     


     

      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (*__first1 < *__first2)
   ++__first1;
 else if (*__first2 < *__first1)
   ++__first2;
 else
   {
     *__result = *__first1;
     ++__first1;
     ++__first2;
     ++__result;
   }
      return __result;
    }
# 4243 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator, typename _Compare>
    _OutputIterator
    set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2,
       _OutputIterator __result, _Compare __comp)
    {

     
     
     


     

     


      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (__comp(*__first1, *__first2))
   ++__first1;
 else if (__comp(*__first2, *__first1))
   ++__first2;
 else
   {
     *__result = *__first1;
     ++__first1;
     ++__first2;
     ++__result;
   }
      return __result;
    }
# 4297 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator>
    _OutputIterator
    set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
     _InputIterator2 __first2, _InputIterator2 __last2,
     _OutputIterator __result)
    {

     
     
     

     


     

      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (*__first1 < *__first2)
   {
     *__result = *__first1;
     ++__first1;
     ++__result;
   }
 else if (*__first2 < *__first1)
   ++__first2;
 else
   {
     ++__first1;
     ++__first2;
   }
      return std::copy(__first1, __last1, __result);
    }
# 4355 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator, typename _Compare>
    _OutputIterator
    set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
     _InputIterator2 __first2, _InputIterator2 __last2,
     _OutputIterator __result, _Compare __comp)
    {

     
     
     


     

     


      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (__comp(*__first1, *__first2))
   {
     *__result = *__first1;
     ++__first1;
     ++__result;
   }
 else if (__comp(*__first2, *__first1))
   ++__first2;
 else
   {
     ++__first1;
     ++__first2;
   }
      return std::copy(__first1, __last1, __result);
    }
# 4409 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator>
    _OutputIterator
    set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
        _InputIterator2 __first2, _InputIterator2 __last2,
        _OutputIterator __result)
    {

     
     
     

     


     

      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (*__first1 < *__first2)
   {
     *__result = *__first1;
     ++__first1;
     ++__result;
   }
 else if (*__first2 < *__first1)
   {
     *__result = *__first2;
     ++__first2;
     ++__result;
   }
 else
   {
     ++__first1;
     ++__first2;
   }
      return std::copy(__first2, __last2, std::copy(__first1,
          __last1, __result));
    }
# 4470 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator1, typename _InputIterator2,
    typename _OutputIterator, typename _Compare>
    _OutputIterator
    set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
        _InputIterator2 __first2, _InputIterator2 __last2,
        _OutputIterator __result,
        _Compare __comp)
    {

     
     
     


     

     


      ;
      ;

      while (__first1 != __last1 && __first2 != __last2)
 if (__comp(*__first1, *__first2))
   {
     *__result = *__first1;
     ++__first1;
     ++__result;
   }
 else if (__comp(*__first2, *__first1))
   {
     *__result = *__first2;
     ++__first2;
     ++__result;
   }
 else
   {
     ++__first1;
     ++__first2;
   }
      return std::copy(__first2, __last2, std::copy(__first1,
          __last1, __result));
    }
# 4523 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator>
    _ForwardIterator
    max_element(_ForwardIterator __first, _ForwardIterator __last)
    {

     
     

      ;

      if (__first == __last)
 return __first;
      _ForwardIterator __result = __first;
      while (++__first != __last)
 if (*__result < *__first)
   __result = __first;
      return __result;
    }
# 4550 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Compare>
    _ForwardIterator
    max_element(_ForwardIterator __first, _ForwardIterator __last,
  _Compare __comp)
    {

     
     


      ;

      if (__first == __last) return __first;
      _ForwardIterator __result = __first;
      while (++__first != __last)
 if (__comp(*__result, *__first)) __result = __first;
      return __result;
    }







  template<typename _ForwardIterator>
    _ForwardIterator
    min_element(_ForwardIterator __first, _ForwardIterator __last)
    {

     
     

      ;

      if (__first == __last)
 return __first;
      _ForwardIterator __result = __first;
      while (++__first != __last)
 if (*__first < *__result)
   __result = __first;
      return __result;
    }
# 4602 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator, typename _Compare>
    _ForwardIterator
    min_element(_ForwardIterator __first, _ForwardIterator __last,
  _Compare __comp)
    {

     
     


      ;

      if (__first == __last)
 return __first;
      _ForwardIterator __result = __first;
      while (++__first != __last)
 if (__comp(*__first, *__result))
   __result = __first;
      return __result;
    }
# 4637 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator>
    bool
    next_permutation(_BidirectionalIterator __first,
       _BidirectionalIterator __last)
    {

     

     

      ;

      if (__first == __last)
 return false;
      _BidirectionalIterator __i = __first;
      ++__i;
      if (__i == __last)
 return false;
      __i = __last;
      --__i;

      for(;;)
 {
   _BidirectionalIterator __ii = __i;
   --__i;
   if (*__i < *__ii)
     {
       _BidirectionalIterator __j = __last;
       while (!(*__i < *--__j))
  {}
       std::iter_swap(__i, __j);
       std::reverse(__ii, __last);
       return true;
     }
   if (__i == __first)
     {
       std::reverse(__first, __last);
       return false;
     }
 }
    }
# 4693 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator, typename _Compare>
    bool
    next_permutation(_BidirectionalIterator __first,
       _BidirectionalIterator __last, _Compare __comp)
    {

     

     


      ;

      if (__first == __last)
 return false;
      _BidirectionalIterator __i = __first;
      ++__i;
      if (__i == __last)
 return false;
      __i = __last;
      --__i;

      for(;;)
 {
   _BidirectionalIterator __ii = __i;
   --__i;
   if (__comp(*__i, *__ii))
     {
       _BidirectionalIterator __j = __last;
       while (!__comp(*__i, *--__j))
  {}
       std::iter_swap(__i, __j);
       std::reverse(__ii, __last);
       return true;
     }
   if (__i == __first)
     {
       std::reverse(__first, __last);
       return false;
     }
 }
    }
# 4748 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator>
    bool
    prev_permutation(_BidirectionalIterator __first,
       _BidirectionalIterator __last)
    {

     

     

      ;

      if (__first == __last)
 return false;
      _BidirectionalIterator __i = __first;
      ++__i;
      if (__i == __last)
 return false;
      __i = __last;
      --__i;

      for(;;)
 {
   _BidirectionalIterator __ii = __i;
   --__i;
   if (*__ii < *__i)
     {
       _BidirectionalIterator __j = __last;
       while (!(*--__j < *__i))
  {}
       std::iter_swap(__i, __j);
       std::reverse(__ii, __last);
       return true;
     }
   if (__i == __first)
     {
       std::reverse(__first, __last);
       return false;
     }
 }
    }
# 4804 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _BidirectionalIterator, typename _Compare>
    bool
    prev_permutation(_BidirectionalIterator __first,
       _BidirectionalIterator __last, _Compare __comp)
    {

     

     


      ;

      if (__first == __last)
 return false;
      _BidirectionalIterator __i = __first;
      ++__i;
      if (__i == __last)
 return false;
      __i = __last;
      --__i;

      for(;;)
 {
   _BidirectionalIterator __ii = __i;
   --__i;
   if (__comp(*__ii, *__i))
     {
       _BidirectionalIterator __j = __last;
       while (!__comp(*--__j, *__i))
  {}
       std::iter_swap(__i, __j);
       std::reverse(__ii, __last);
       return true;
     }
   if (__i == __first)
     {
       std::reverse(__first, __last);
       return false;
     }
 }
    }
# 4863 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _ForwardIterator>
    _InputIterator
    find_first_of(_InputIterator __first1, _InputIterator __last1,
    _ForwardIterator __first2, _ForwardIterator __last2)
    {

     
     
     


      ;
      ;

      for ( ; __first1 != __last1; ++__first1)
 for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
   if (*__first1 == *__iter)
     return __first1;
      return __last1;
    }
# 4899 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _InputIterator, typename _ForwardIterator,
    typename _BinaryPredicate>
    _InputIterator
    find_first_of(_InputIterator __first1, _InputIterator __last1,
    _ForwardIterator __first2, _ForwardIterator __last2,
    _BinaryPredicate __comp)
    {

     
     
     


      ;
      ;

      for ( ; __first1 != __last1; ++__first1)
 for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
   if (__comp(*__first1, *__iter))
     return __first1;
      return __last1;
    }
# 4929 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2>
    _ForwardIterator1
    __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
        _ForwardIterator2 __first2, _ForwardIterator2 __last2,
        forward_iterator_tag, forward_iterator_tag)
    {
      if (__first2 == __last2)
 return __last1;
      else
 {
   _ForwardIterator1 __result = __last1;
   while (1)
     {
       _ForwardIterator1 __new_result
  = std::search(__first1, __last1, __first2, __last2);
       if (__new_result == __last1)
  return __result;
       else
  {
    __result = __new_result;
    __first1 = __new_result;
    ++__first1;
  }
     }
 }
    }

  template<typename _ForwardIterator1, typename _ForwardIterator2,
    typename _BinaryPredicate>
    _ForwardIterator1
    __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
        _ForwardIterator2 __first2, _ForwardIterator2 __last2,
        forward_iterator_tag, forward_iterator_tag,
        _BinaryPredicate __comp)
    {
      if (__first2 == __last2)
 return __last1;
      else
 {
   _ForwardIterator1 __result = __last1;
   while (1)
     {
       _ForwardIterator1 __new_result
  = std::search(__first1, __last1, __first2, __last2, __comp);
       if (__new_result == __last1)
  return __result;
       else
  {
    __result = __new_result;
    __first1 = __new_result;
    ++__first1;
  }
     }
 }
    }


  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
    _BidirectionalIterator1
    __find_end(_BidirectionalIterator1 __first1,
        _BidirectionalIterator1 __last1,
        _BidirectionalIterator2 __first2,
        _BidirectionalIterator2 __last2,
        bidirectional_iterator_tag, bidirectional_iterator_tag)
    {

     

     


      typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
      typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;

      _RevIterator1 __rlast1(__first1);
      _RevIterator2 __rlast2(__first2);
      _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1,
         _RevIterator2(__last2), __rlast2);

      if (__rresult == __rlast1)
 return __last1;
      else
 {
   _BidirectionalIterator1 __result = __rresult.base();
   std::advance(__result, -std::distance(__first2, __last2));
   return __result;
 }
    }

  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
    typename _BinaryPredicate>
    _BidirectionalIterator1
    __find_end(_BidirectionalIterator1 __first1,
        _BidirectionalIterator1 __last1,
        _BidirectionalIterator2 __first2,
        _BidirectionalIterator2 __last2,
        bidirectional_iterator_tag, bidirectional_iterator_tag,
        _BinaryPredicate __comp)
    {

     

     


      typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
      typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;

      _RevIterator1 __rlast1(__first1);
      _RevIterator2 __rlast2(__first2);
      _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1,
         _RevIterator2(__last2), __rlast2,
         __comp);

      if (__rresult == __rlast1)
 return __last1;
      else
 {
   _BidirectionalIterator1 __result = __rresult.base();
   std::advance(__result, -std::distance(__first2, __last2));
   return __result;
 }
    }
# 5079 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2>
    inline _ForwardIterator1
    find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
      _ForwardIterator2 __first2, _ForwardIterator2 __last2)
    {

     
     
     


      ;
      ;

      return std::__find_end(__first1, __last1, __first2, __last2,
        std::__iterator_category(__first1),
        std::__iterator_category(__first2));
    }
# 5124 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h" 3
  template<typename _ForwardIterator1, typename _ForwardIterator2,
    typename _BinaryPredicate>
    inline _ForwardIterator1
    find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
      _ForwardIterator2 __first2, _ForwardIterator2 __last2,
      _BinaryPredicate __comp)
    {

     
     
     


      ;
      ;

      return std::__find_end(__first1, __last1, __first2, __last2,
        std::__iterator_category(__first1),
        std::__iterator_category(__first2),
        __comp);
    }

}
# 70 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/algorithm" 2 3
# 57 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.tcc" 1 3
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.tcc" 3
       
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.tcc" 3

namespace std
{
  template<typename _Type>
    inline bool
    __is_null_pointer(_Type* __ptr)
    { return __ptr == 0; }

  template<typename _Type>
    inline bool
    __is_null_pointer(_Type)
    { return false; }

  template<typename _CharT, typename _Traits, typename _Alloc>
    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;

  template<typename _CharT, typename _Traits, typename _Alloc>
    const _CharT
    basic_string<_CharT, _Traits, _Alloc>::
    _Rep::_S_terminal = _CharT();

  template<typename _CharT, typename _Traits, typename _Alloc>
    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::npos;



  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
    (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
      sizeof(size_type)];





  template<typename _CharT, typename _Traits, typename _Alloc>
    template<typename _InIterator>
      _CharT*
      basic_string<_CharT, _Traits, _Alloc>::
      _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
     input_iterator_tag)
      {

 if (__beg == __end && __a == _Alloc())
   return _S_empty_rep()._M_refdata();


 _CharT __buf[128];
 size_type __len = 0;
 while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
   {
     __buf[__len++] = *__beg;
     ++__beg;
   }
 _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
 traits_type::copy(__r->_M_refdata(), __buf, __len);
 try
   {
     while (__beg != __end)
       {
  if (__len == __r->_M_capacity)
    {

      _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
      traits_type::copy(__another->_M_refdata(),
          __r->_M_refdata(), __len);
      __r->_M_destroy(__a);
      __r = __another;
    }
  __r->_M_refdata()[__len++] = *__beg;
  ++__beg;
       }
   }
 catch(...)
   {
     __r->_M_destroy(__a);
     throw;
   }
 __r->_M_length = __len;
 __r->_M_refdata()[__len] = _Rep::_S_terminal;
 return __r->_M_refdata();
      }

  template<typename _CharT, typename _Traits, typename _Alloc>
    template <typename _InIterator>
      _CharT*
      basic_string<_CharT, _Traits, _Alloc>::
      _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
     forward_iterator_tag)
      {

 if (__beg == __end && __a == _Alloc())
   return _S_empty_rep()._M_refdata();


 if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
   __throw_logic_error(("basic_string::_S_construct NULL not valid"));

 const size_type __dnew = static_cast<size_type>(std::distance(__beg,
              __end));

 _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
 try
   { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
 catch(...)
   {
     __r->_M_destroy(__a);
     throw;
   }
 __r->_M_length = __dnew;
 __r->_M_refdata()[__dnew] = _Rep::_S_terminal;
 return __r->_M_refdata();
      }

  template<typename _CharT, typename _Traits, typename _Alloc>
    _CharT*
    basic_string<_CharT, _Traits, _Alloc>::
    _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
    {

      if (__n == 0 && __a == _Alloc())
 return _S_empty_rep()._M_refdata();


      _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
      if (__n)
 traits_type::assign(__r->_M_refdata(), __n, __c);

      __r->_M_length = __n;
      __r->_M_refdata()[__n] = _Rep::_S_terminal;
      return __r->_M_refdata();
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(const basic_string& __str)
    : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
       __str.get_allocator()),
    __str.get_allocator())
    { }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(const _Alloc& __a)
    : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
    { }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(const basic_string& __str, size_type __pos, size_type __n)
    : _M_dataplus(_S_construct(__str._M_data()
          + __str._M_check(__pos,
      "basic_string::basic_string"),
          __str._M_data() + __str._M_limit(__pos, __n)
          + __pos, _Alloc()), _Alloc())
    { }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(const basic_string& __str, size_type __pos,
   size_type __n, const _Alloc& __a)
    : _M_dataplus(_S_construct(__str._M_data()
          + __str._M_check(__pos,
      "basic_string::basic_string"),
          __str._M_data() + __str._M_limit(__pos, __n)
          + __pos, __a), __a)
    { }


  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
    : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
    { }


  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(const _CharT* __s, const _Alloc& __a)
    : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
          __s + npos, __a), __a)
    { }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(size_type __n, _CharT __c, const _Alloc& __a)
    : _M_dataplus(_S_construct(__n, __c, __a), __a)
    { }


  template<typename _CharT, typename _Traits, typename _Alloc>
    template<typename _InputIterator>
    basic_string<_CharT, _Traits, _Alloc>::
    basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
    : _M_dataplus(_S_construct(__beg, __end, __a), __a)
    { }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>&
    basic_string<_CharT, _Traits, _Alloc>::
    assign(const basic_string& __str)
    {
      if (_M_rep() != __str._M_rep())
 {

   const allocator_type __a = this->get_allocator();
   _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
   _M_rep()->_M_dispose(__a);
   _M_data(__tmp);
 }
      return *this;
    }

   template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>&
     basic_string<_CharT, _Traits, _Alloc>::
     assign(const _CharT* __s, size_type __n)
     {
       ;
       if (__n > this->max_size())
  __throw_length_error(("basic_string::assign"));
       if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data())
    || less<const _CharT*>()(_M_data() + this->size(), __s))
  return _M_replace_safe(size_type(0), this->size(), __s, __n);
       else
  {

    const size_type __pos = __s - _M_data();
    if (__pos >= __n)
      traits_type::copy(_M_data(), __s, __n);
    else if (__pos)
      traits_type::move(_M_data(), __s, __n);
    _M_rep()->_M_set_sharable();
    _M_rep()->_M_length = __n;
    _M_data()[__n] = _Rep::_S_terminal;
    return *this;
  }
     }

   template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>&
     basic_string<_CharT, _Traits, _Alloc>::
     insert(size_type __pos, const _CharT* __s, size_type __n)
     {
       ;
       _M_check(__pos, "basic_string::insert");
       if (this->max_size() - this->size() < __n)
  __throw_length_error(("basic_string::insert"));
       if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data())
           || less<const _CharT*>()(_M_data() + this->size(), __s))
         return _M_replace_safe(__pos, size_type(0), __s, __n);
       else
         {



           const size_type __off = __s - _M_data();
           _M_mutate(__pos, 0, __n);
           __s = _M_data() + __off;
           _CharT* __p = _M_data() + __pos;
           if (__s + __n <= __p)
             traits_type::copy(__p, __s, __n);
           else if (__s >= __p)
             traits_type::copy(__p, __s + __n, __n);
           else
             {
        const size_type __nleft = __p - __s;
               traits_type::copy(__p, __s, __nleft);
               traits_type::copy(__p + __nleft, __p + __n, __n - __nleft);
             }
           return *this;
         }
     }

   template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>&
     basic_string<_CharT, _Traits, _Alloc>::
     replace(size_type __pos, size_type __n1, const _CharT* __s,
      size_type __n2)
     {
       ;
       _M_check(__pos, "basic_string::replace");
       __n1 = _M_limit(__pos, __n1);
       if (this->max_size() - (this->size() - __n1) < __n2)
         __throw_length_error(("basic_string::replace"));
       bool __left;
       if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data())
    || less<const _CharT*>()(_M_data() + this->size(), __s))
         return _M_replace_safe(__pos, __n1, __s, __n2);
       else if ((__left = __s + __n2 <= _M_data() + __pos)
  || _M_data() + __pos + __n1 <= __s)
  {

    const size_type __off = __s - _M_data();
    _M_mutate(__pos, __n1, __n2);
    if (__left)
      traits_type::copy(_M_data() + __pos,
          _M_data() + __off, __n2);
    else
      traits_type::copy(_M_data() + __pos,
          _M_data() + __off + __n2 - __n1, __n2);
    return *this;
  }
       else
  {

    const basic_string __tmp(__s, __n2);
    return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
  }
     }

  template<typename _CharT, typename _Traits, typename _Alloc>
    void
    basic_string<_CharT, _Traits, _Alloc>::_Rep::
    _M_destroy(const _Alloc& __a) throw ()
    {

      if (this == &_S_empty_rep())
 return;

      const size_type __size = sizeof(_Rep_base) +
                        (this->_M_capacity + 1) * sizeof(_CharT);
      _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    void
    basic_string<_CharT, _Traits, _Alloc>::_M_leak_hard()
    {

      if (_M_rep() == &_S_empty_rep())
 return;

      if (_M_rep()->_M_is_shared())
 _M_mutate(0, 0, 0);
      _M_rep()->_M_set_leaked();
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    void
    basic_string<_CharT, _Traits, _Alloc>::
    _M_mutate(size_type __pos, size_type __len1, size_type __len2)
    {
      const size_type __old_size = this->size();
      const size_type __new_size = __old_size + __len2 - __len1;
      const size_type __how_much = __old_size - __pos - __len1;

      if (__new_size > capacity() || _M_rep()->_M_is_shared())
 {

   const allocator_type __a = get_allocator();
   _Rep* __r = _Rep::_S_create(__new_size, capacity(), __a);

   if (__pos)
     traits_type::copy(__r->_M_refdata(), _M_data(), __pos);
   if (__how_much)
     traits_type::copy(__r->_M_refdata() + __pos + __len2,
         _M_data() + __pos + __len1, __how_much);

   _M_rep()->_M_dispose(__a);
   _M_data(__r->_M_refdata());
 }
      else if (__how_much && __len1 != __len2)
 {

   traits_type::move(_M_data() + __pos + __len2,
       _M_data() + __pos + __len1, __how_much);
 }
      _M_rep()->_M_set_sharable();
      _M_rep()->_M_length = __new_size;
      _M_data()[__new_size] = _Rep::_S_terminal;

    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    void
    basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res)
    {
      if (__res != this->capacity() || _M_rep()->_M_is_shared())
        {
   if (__res > this->max_size())
     __throw_length_error(("basic_string::reserve"));

   if (__res < this->size())
     __res = this->size();
   const allocator_type __a = get_allocator();
   _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
   _M_rep()->_M_dispose(__a);
   _M_data(__tmp);
        }
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    void basic_string<_CharT, _Traits, _Alloc>::swap(basic_string& __s)
    {
      if (_M_rep()->_M_is_leaked())
 _M_rep()->_M_set_sharable();
      if (__s._M_rep()->_M_is_leaked())
 __s._M_rep()->_M_set_sharable();
      if (this->get_allocator() == __s.get_allocator())
 {
   _CharT* __tmp = _M_data();
   _M_data(__s._M_data());
   __s._M_data(__tmp);
 }

      else
 {
   const basic_string __tmp1(_M_ibegin(), _M_iend(),
        __s.get_allocator());
   const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
        this->get_allocator());
   *this = __tmp2;
   __s = __tmp1;
 }
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
    basic_string<_CharT, _Traits, _Alloc>::_Rep::
    _S_create(size_type __capacity, size_type __old_capacity,
       const _Alloc& __alloc)
    {
      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;


      if (__capacity > _S_max_size)
 __throw_length_error(("basic_string::_S_create"));
# 501 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.tcc" 3
      const size_type __pagesize = 4096;
      const size_type __subpagesize = 128;
      const size_type __malloc_header_size = 4 * sizeof (void*);
# 513 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_string.tcc" 3
      const size_type __page_capacity = ((__pagesize - __malloc_header_size
       - sizeof(_Rep) - sizeof(_CharT))
      / sizeof(_CharT));

      if (__capacity > __old_capacity && __capacity < 2 * __old_capacity
   && __capacity > __page_capacity)
 __capacity = 2 * __old_capacity;




      size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);

      const size_type __adj_size = __size + __malloc_header_size;
      if (__adj_size > __pagesize)
 {
   const size_type __extra = __pagesize - __adj_size % __pagesize;
   __capacity += __extra / sizeof(_CharT);

   if (__capacity > _S_max_size)
     __capacity = _S_max_size;
   __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
 }
      else if (__size > __subpagesize)
 {
   const size_type __extra = __subpagesize - __adj_size % __subpagesize;
   __capacity += __extra / sizeof(_CharT);
   __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
 }



      void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
      _Rep *__p = new (__place) _Rep;
      __p->_M_capacity = __capacity;
      __p->_M_set_sharable();
      __p->_M_length = 0;
      return __p;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    _CharT*
    basic_string<_CharT, _Traits, _Alloc>::_Rep::
    _M_clone(const _Alloc& __alloc, size_type __res)
    {

      const size_type __requested_cap = this->_M_length + __res;
      _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
      __alloc);
      if (this->_M_length)
 traits_type::copy(__r->_M_refdata(), _M_refdata(),
     this->_M_length);

      __r->_M_length = this->_M_length;
      __r->_M_refdata()[this->_M_length] = _Rep::_S_terminal;
      return __r->_M_refdata();
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    void
    basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
    {
      if (__n > max_size())
 __throw_length_error(("basic_string::resize"));
      const size_type __size = this->size();
      if (__size < __n)
 this->append(__n - __size, __c);
      else if (__n < __size)
 this->erase(__n);

    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    template<typename _InputIterator>
      basic_string<_CharT, _Traits, _Alloc>&
      basic_string<_CharT, _Traits, _Alloc>::
      _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
     _InputIterator __k2, __false_type)
      {
 const basic_string __s(__k1, __k2);
 const size_type __n1 = __i2 - __i1;
 if (this->max_size() - (this->size() - __n1) < __s.size())
   __throw_length_error(("basic_string::_M_replace_dispatch"));
 return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
          __s.size());
      }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>&
    basic_string<_CharT, _Traits, _Alloc>::
    append(const basic_string& __str)
    {



      const size_type __size = __str.size();
      const size_type __len = __size + this->size();
      if (__len > this->capacity())
 this->reserve(__len);
      return _M_replace_safe(this->size(), size_type(0), __str._M_data(),
        __str.size());
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>&
    basic_string<_CharT, _Traits, _Alloc>::
    append(const basic_string& __str, size_type __pos, size_type __n)
    {



      __str._M_check(__pos, "basic_string::append");
      __n = __str._M_limit(__pos, __n);
      const size_type __len = __n + this->size();
      if (__len > this->capacity())
 this->reserve(__len);
      return _M_replace_safe(this->size(), size_type(0), __str._M_data()
        + __pos, __n);
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>&
    basic_string<_CharT, _Traits, _Alloc>::
    append(const _CharT* __s, size_type __n)
    {
      ;
      const size_type __len = __n + this->size();
      if (__len > this->capacity())
 this->reserve(__len);
      return _M_replace_safe(this->size(), size_type(0), __s, __n);
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>
    operator+(const _CharT* __lhs,
       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    {
      ;
      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef typename __string_type::size_type __size_type;
      const __size_type __len = _Traits::length(__lhs);
      __string_type __str;
      __str.reserve(__len + __rhs.size());
      __str.append(__lhs, __len);
      __str.append(__rhs);
      return __str;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_string<_CharT, _Traits, _Alloc>
    operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    {
      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef typename __string_type::size_type __size_type;
      __string_type __str;
      const __size_type __len = __rhs.size();
      __str.reserve(__len + 1);
      __str.append(__size_type(1), __lhs);
      __str.append(__rhs);
      return __str;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    copy(_CharT* __s, size_type __n, size_type __pos) const
    {
      _M_check(__pos, "basic_string::copy");
      __n = _M_limit(__pos, __n);
      ;
      if (__n)
 traits_type::copy(__s, _M_data() + __pos, __n);

      return __n;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find(const _CharT* __s, size_type __pos, size_type __n) const
    {
      ;
      const size_type __size = this->size();
      const _CharT* __data = _M_data();
      for (; __pos + __n <= __size; ++__pos)
 if (traits_type::compare(__data + __pos, __s, __n) == 0)
   return __pos;
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find(_CharT __c, size_type __pos) const
    {
      const size_type __size = this->size();
      size_type __ret = npos;
      if (__pos < __size)
 {
   const _CharT* __data = _M_data();
   const size_type __n = __size - __pos;
   const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
   if (__p)
     __ret = __p - __data;
 }
      return __ret;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    rfind(const _CharT* __s, size_type __pos, size_type __n) const
    {
      ;
      const size_type __size = this->size();
      if (__n <= __size)
 {
   __pos = std::min(size_type(__size - __n), __pos);
   const _CharT* __data = _M_data();
   do
     {
       if (traits_type::compare(__data + __pos, __s, __n) == 0)
  return __pos;
     }
   while (__pos-- > 0);
 }
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    rfind(_CharT __c, size_type __pos) const
    {
      size_type __size = this->size();
      if (__size)
 {
   if (--__size > __pos)
     __size = __pos;
   for (++__size; __size-- > 0; )
     if (traits_type::eq(_M_data()[__size], __c))
       return __size;
 }
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
    {
      ;
      for (; __n && __pos < this->size(); ++__pos)
 {
   const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
   if (__p)
     return __pos;
 }
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
    {
      ;
      size_type __size = this->size();
      if (__size && __n)
 {
   if (--__size > __pos)
     __size = __pos;
   do
     {
       if (traits_type::find(__s, __n, _M_data()[__size]))
  return __size;
     }
   while (__size-- != 0);
 }
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
    {
      ;
      for (; __pos < this->size(); ++__pos)
 if (!traits_type::find(__s, __n, _M_data()[__pos]))
   return __pos;
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find_first_not_of(_CharT __c, size_type __pos) const
    {
      for (; __pos < this->size(); ++__pos)
 if (!traits_type::eq(_M_data()[__pos], __c))
   return __pos;
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
    {
      ;
      size_type __size = this->size();
      if (__size)
 {
   if (--__size > __pos)
     __size = __pos;
   do
     {
       if (!traits_type::find(__s, __n, _M_data()[__size]))
  return __size;
     }
   while (__size--);
 }
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    typename basic_string<_CharT, _Traits, _Alloc>::size_type
    basic_string<_CharT, _Traits, _Alloc>::
    find_last_not_of(_CharT __c, size_type __pos) const
    {
      size_type __size = this->size();
      if (__size)
 {
   if (--__size > __pos)
     __size = __pos;
   do
     {
       if (!traits_type::eq(_M_data()[__size], __c))
  return __size;
     }
   while (__size--);
 }
      return npos;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    int
    basic_string<_CharT, _Traits, _Alloc>::
    compare(size_type __pos, size_type __n, const basic_string& __str) const
    {
      _M_check(__pos, "basic_string::compare");
      __n = _M_limit(__pos, __n);
      const size_type __osize = __str.size();
      const size_type __len = std::min(__n, __osize);
      int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
      if (!__r)
 __r = __n - __osize;
      return __r;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    int
    basic_string<_CharT, _Traits, _Alloc>::
    compare(size_type __pos1, size_type __n1, const basic_string& __str,
     size_type __pos2, size_type __n2) const
    {
      _M_check(__pos1, "basic_string::compare");
      __str._M_check(__pos2, "basic_string::compare");
      __n1 = _M_limit(__pos1, __n1);
      __n2 = __str._M_limit(__pos2, __n2);
      const size_type __len = std::min(__n1, __n2);
      int __r = traits_type::compare(_M_data() + __pos1,
         __str.data() + __pos2, __len);
      if (!__r)
 __r = __n1 - __n2;
      return __r;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    int
    basic_string<_CharT, _Traits, _Alloc>::
    compare(const _CharT* __s) const
    {
      ;
      const size_type __size = this->size();
      const size_type __osize = traits_type::length(__s);
      const size_type __len = std::min(__size, __osize);
      int __r = traits_type::compare(_M_data(), __s, __len);
      if (!__r)
 __r = __size - __osize;
      return __r;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    int
    basic_string <_CharT, _Traits, _Alloc>::
    compare(size_type __pos, size_type __n1, const _CharT* __s) const
    {
      ;
      _M_check(__pos, "basic_string::compare");
      __n1 = _M_limit(__pos, __n1);
      const size_type __osize = traits_type::length(__s);
      const size_type __len = std::min(__n1, __osize);
      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
      if (!__r)
 __r = __n1 - __osize;
      return __r;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    int
    basic_string <_CharT, _Traits, _Alloc>::
    compare(size_type __pos, size_type __n1, const _CharT* __s,
     size_type __n2) const
    {
      ;
      _M_check(__pos, "basic_string::compare");
      __n1 = _M_limit(__pos, __n1);
      const size_type __len = std::min(__n1, __n2);
      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
      if (!__r)
 __r = __n1 - __n2;
      return __r;
    }





  extern template class basic_string<char>;
  extern template
    basic_istream<char>&
    operator>>(basic_istream<char>&, string&);
  extern template
    basic_ostream<char>&
    operator<<(basic_ostream<char>&, const string&);
  extern template
    basic_istream<char>&
    getline(basic_istream<char>&, string&, char);
  extern template
    basic_istream<char>&
    getline(basic_istream<char>&, string&);


  extern template class basic_string<wchar_t>;
  extern template
    basic_istream<wchar_t>&
    operator>>(basic_istream<wchar_t>&, wstring&);
  extern template
    basic_ostream<wchar_t>&
    operator<<(basic_ostream<wchar_t>&, const wstring&);
  extern template
    basic_istream<wchar_t>&
    getline(basic_istream<wchar_t>&, wstring&, wchar_t);
  extern template
    basic_istream<wchar_t>&
    getline(basic_istream<wchar_t>&, wstring&);


}
# 58 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string" 2 3
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 2 3



namespace std
{
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
  class locale
  {
  public:


    typedef int category;


    class facet;
    class id;
    class _Impl;

    friend class facet;
    friend class _Impl;

    template<typename _Facet>
      friend bool
      has_facet(const locale&) throw();

    template<typename _Facet>
      friend const _Facet&
      use_facet(const locale&);

    template<typename _Cache>
      friend struct __use_cache;
# 105 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    static const category none = 0;
    static const category ctype = 1L << 0;
    static const category numeric = 1L << 1;
    static const category collate = 1L << 2;
    static const category time = 1L << 3;
    static const category monetary = 1L << 4;
    static const category messages = 1L << 5;
    static const category all = (ctype | numeric | collate |
        time | monetary | messages);
# 124 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    locale() throw();
# 133 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    locale(const locale& __other) throw();
# 143 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    explicit
    locale(const char* __s);
# 158 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    locale(const locale& __base, const char* __s, category __cat);
# 171 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    locale(const locale& __base, const locale& __add, category __cat);
# 183 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    template<typename _Facet>
      locale(const locale& __other, _Facet* __f);


    ~locale() throw();
# 197 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    const locale&
    operator=(const locale& __other) throw();
# 212 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    template<typename _Facet>
      locale
      combine(const locale& __other) const;






    string
    name() const;
# 231 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    bool
    operator==(const locale& __other) const throw ();







    inline bool
    operator!=(const locale& __other) const throw ()
    { return !(this->operator==(__other)); }
# 259 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    template<typename _Char, typename _Traits, typename _Alloc>
      bool
      operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
   const basic_string<_Char, _Traits, _Alloc>& __s2) const;
# 275 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    static locale
    global(const locale&);




    static const locale&
    classic();

  private:

    _Impl* _M_impl;


    static _Impl* _S_classic;


    static _Impl* _S_global;





    static const char* const* const _S_categories;
# 310 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    static const size_t _S_categories_size = 6 + 6;


    static __gthread_once_t _S_once;


    explicit
    locale(_Impl*) throw();

    static void
    _S_initialize();

    static void
    _S_initialize_once();

    static category
    _S_normalize_category(category);

    void
    _M_coalesce(const locale& __base, const locale& __add, category __cat);
  };
# 343 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
  class locale::facet
  {
  private:
    friend class locale;
    friend class locale::_Impl;

    mutable _Atomic_word _M_refcount;


    static __c_locale _S_c_locale;


    static const char _S_c_name[2];


    static __gthread_once_t _S_once;


    static void
    _S_initialize_once();

  protected:
# 374 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
    explicit
    facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
    { }


    virtual
    ~facet();

    static void
    _S_create_c_locale(__c_locale& __cloc, const char* __s,
         __c_locale __old = 0);

    static __c_locale
    _S_clone_c_locale(__c_locale& __cloc);

    static void
    _S_destroy_c_locale(__c_locale& __cloc);



    static __c_locale
    _S_get_c_locale();

    static const char*
    _S_get_c_name();

  private:
    inline void
    _M_add_reference() const throw()
    { __gnu_cxx::__atomic_add(&_M_refcount, 1); }

    inline void
    _M_remove_reference() const throw()
    {
      if (__gnu_cxx::__exchange_and_add(&_M_refcount, -1) == 1)
 {
   try
     { delete this; }
   catch (...)
     { }
 }
    }

    facet(const facet&);

    facet&
    operator=(const facet&);
  };
# 434 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_classes.h" 3
  class locale::id
  {
  private:
    friend class locale;
    friend class locale::_Impl;

    template<typename _Facet>
      friend const _Facet&
      use_facet(const locale&);

    template<typename _Facet>
      friend bool
      has_facet(const locale&) throw ();




    mutable size_t _M_index;


    static _Atomic_word _S_refcount;

    void
    operator=(const id&);

    id(const id&);

  public:



    id() { }

    size_t
    _M_id() const;
  };



  class locale::_Impl
  {
  public:

    friend class locale;
    friend class locale::facet;

    template<typename _Facet>
      friend bool
      has_facet(const locale&) throw();

    template<typename _Facet>
      friend const _Facet&
      use_facet(const locale&);

    template<typename _Cache>
      friend struct __use_cache;

  private:

    _Atomic_word _M_refcount;
    const facet** _M_facets;
    size_t _M_facets_size;
    const facet** _M_caches;
    char** _M_names;
    static const locale::id* const _S_id_ctype[];
    static const locale::id* const _S_id_numeric[];
    static const locale::id* const _S_id_collate[];
    static const locale::id* const _S_id_time[];
    static const locale::id* const _S_id_monetary[];
    static const locale::id* const _S_id_messages[];
    static const locale::id* const* const _S_facet_categories[];

    inline void
    _M_add_reference() throw()
    { __gnu_cxx::__atomic_add(&_M_refcount, 1); }

    inline void
    _M_remove_reference() throw()
    {
      if (__gnu_cxx::__exchange_and_add(&_M_refcount, -1) == 1)
 {
   try
     { delete this; }
   catch(...)
     { }
 }
    }

    _Impl(const _Impl&, size_t);
    _Impl(const char*, size_t);
    _Impl(size_t) throw();

   ~_Impl() throw();

    _Impl(const _Impl&);

    void
    operator=(const _Impl&);

    inline bool
    _M_check_same_name()
    {
      bool __ret = true;
      for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
 __ret = std::strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
      return __ret;
    }

    void
    _M_replace_categories(const _Impl*, category);

    void
    _M_replace_category(const _Impl*, const locale::id* const*);

    void
    _M_replace_facet(const _Impl*, const locale::id*);

    void
    _M_install_facet(const locale::id*, const facet*);

    template<typename _Facet>
      inline void
      _M_init_facet(_Facet* __facet)
      { _M_install_facet(&_Facet::id, __facet); }

    void
    _M_install_cache(const facet* __cache, size_t __index) throw()
    {
      __cache->_M_add_reference();
      _M_caches[__index] = __cache;
    }
  };

  template<typename _Facet>
    locale::locale(const locale& __other, _Facet* __f)
    {
      _M_impl = new _Impl(*__other._M_impl, 1);

      char* _M_tmp_names[_S_categories_size];
      size_t __i = 0;
      try
 {
   for (; __i < _S_categories_size; ++__i)
     {
       _M_tmp_names[__i] = new char[2];
       std::strcpy(_M_tmp_names[__i], "*");
     }
   _M_impl->_M_install_facet(&_Facet::id, __f);
 }
      catch(...)
 {
   _M_impl->_M_remove_reference();
   for (size_t __j = 0; __j < __i; ++__j)
     delete [] _M_tmp_names[__j];
   throw;
 }

      for (size_t __k = 0; __k < _S_categories_size; ++__k)
 {
   delete [] _M_impl->_M_names[__k];
   _M_impl->_M_names[__k] = _M_tmp_names[__k];
 }
    }
}
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 2 3

namespace std
{




  enum _Ios_Fmtflags
    {
      _S_boolalpha = 1L << 0,
      _S_dec = 1L << 1,
      _S_fixed = 1L << 2,
      _S_hex = 1L << 3,
      _S_internal = 1L << 4,
      _S_left = 1L << 5,
      _S_oct = 1L << 6,
      _S_right = 1L << 7,
      _S_scientific = 1L << 8,
      _S_showbase = 1L << 9,
      _S_showpoint = 1L << 10,
      _S_showpos = 1L << 11,
      _S_skipws = 1L << 12,
      _S_unitbuf = 1L << 13,
      _S_uppercase = 1L << 14,
      _S_adjustfield = _S_left | _S_right | _S_internal,
      _S_basefield = _S_dec | _S_oct | _S_hex,
      _S_floatfield = _S_scientific | _S_fixed,
      _S_ios_fmtflags_end = 1L << 16
    };

  inline _Ios_Fmtflags
  operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
  { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }

  inline _Ios_Fmtflags
  operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
  { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }

  inline _Ios_Fmtflags
  operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
  { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }

  inline _Ios_Fmtflags&
  operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
  { return __a = __a | __b; }

  inline _Ios_Fmtflags&
  operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
  { return __a = __a & __b; }

  inline _Ios_Fmtflags&
  operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
  { return __a = __a ^ __b; }

  inline _Ios_Fmtflags
  operator~(_Ios_Fmtflags __a)
  { return _Ios_Fmtflags(~static_cast<int>(__a)); }


  enum _Ios_Openmode
    {
      _S_app = 1L << 0,
      _S_ate = 1L << 1,
      _S_bin = 1L << 2,
      _S_in = 1L << 3,
      _S_out = 1L << 4,
      _S_trunc = 1L << 5,
      _S_ios_openmode_end = 1L << 16
    };

  inline _Ios_Openmode
  operator&(_Ios_Openmode __a, _Ios_Openmode __b)
  { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }

  inline _Ios_Openmode
  operator|(_Ios_Openmode __a, _Ios_Openmode __b)
  { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }

  inline _Ios_Openmode
  operator^(_Ios_Openmode __a, _Ios_Openmode __b)
  { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }

  inline _Ios_Openmode&
  operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
  { return __a = __a | __b; }

  inline _Ios_Openmode&
  operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
  { return __a = __a & __b; }

  inline _Ios_Openmode&
  operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
  { return __a = __a ^ __b; }

  inline _Ios_Openmode
  operator~(_Ios_Openmode __a)
  { return _Ios_Openmode(~static_cast<int>(__a)); }


  enum _Ios_Iostate
    {
      _S_goodbit = 0,
      _S_badbit = 1L << 0,
      _S_eofbit = 1L << 1,
      _S_failbit = 1L << 2,
      _S_ios_iostate_end = 1L << 16
    };

  inline _Ios_Iostate
  operator&(_Ios_Iostate __a, _Ios_Iostate __b)
  { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }

  inline _Ios_Iostate
  operator|(_Ios_Iostate __a, _Ios_Iostate __b)
  { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }

  inline _Ios_Iostate
  operator^(_Ios_Iostate __a, _Ios_Iostate __b)
  { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }

  inline _Ios_Iostate&
  operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
  { return __a = __a | __b; }

  inline _Ios_Iostate&
  operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
  { return __a = __a & __b; }

  inline _Ios_Iostate&
  operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
  { return __a = __a ^ __b; }

  inline _Ios_Iostate
  operator~(_Ios_Iostate __a)
  { return _Ios_Iostate(~static_cast<int>(__a)); }

  enum _Ios_Seekdir
    {
      _S_beg = 0,
      _S_cur = 1,
      _S_end = 2,
      _S_ios_seekdir_end = 1L << 16
    };
# 201 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
  class ios_base
  {
  public:



    class failure : public exception
    {
    public:


      explicit
      failure(const string& __str) throw();



      virtual
      ~failure() throw();

      virtual const char*
      what() const throw();

    private:
      string _M_msg;
    };
# 253 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    typedef _Ios_Fmtflags fmtflags;


    static const fmtflags boolalpha = fmtflags(__ios_flags::_S_boolalpha);


    static const fmtflags dec = fmtflags(__ios_flags::_S_dec);


    static const fmtflags fixed = fmtflags(__ios_flags::_S_fixed);


    static const fmtflags hex = fmtflags(__ios_flags::_S_hex);




    static const fmtflags internal = fmtflags(__ios_flags::_S_internal);



    static const fmtflags left = fmtflags(__ios_flags::_S_left);


    static const fmtflags oct = fmtflags(__ios_flags::_S_oct);



    static const fmtflags right = fmtflags(__ios_flags::_S_right);


    static const fmtflags scientific = fmtflags(__ios_flags::_S_scientific);



    static const fmtflags showbase = fmtflags(__ios_flags::_S_showbase);



    static const fmtflags showpoint = fmtflags(__ios_flags::_S_showpoint);


    static const fmtflags showpos = fmtflags(__ios_flags::_S_showpos);


    static const fmtflags skipws = fmtflags(__ios_flags::_S_skipws);


    static const fmtflags unitbuf = fmtflags(__ios_flags::_S_unitbuf);



    static const fmtflags uppercase = fmtflags(__ios_flags::_S_uppercase);


    static const fmtflags adjustfield = fmtflags(__ios_flags::_S_adjustfield);


    static const fmtflags basefield = fmtflags(__ios_flags::_S_basefield);


    static const fmtflags floatfield = fmtflags(__ios_flags::_S_floatfield);
# 328 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    typedef _Ios_Iostate iostate;



    static const iostate badbit = iostate(__ios_flags::_S_badbit);


    static const iostate eofbit = iostate(__ios_flags::_S_eofbit);




    static const iostate failbit = iostate(__ios_flags::_S_failbit);


    static const iostate goodbit = iostate(0);
# 359 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    typedef _Ios_Openmode openmode;


    static const openmode app = openmode(__ios_flags::_S_app);


    static const openmode ate = openmode(__ios_flags::_S_ate);





    static const openmode binary = openmode(__ios_flags::_S_bin);


    static const openmode in = openmode(__ios_flags::_S_in);


    static const openmode out = openmode(__ios_flags::_S_out);


    static const openmode trunc = openmode(__ios_flags::_S_trunc);
# 392 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    typedef _Ios_Seekdir seekdir;


    static const seekdir beg = seekdir(0);


    static const seekdir cur = seekdir(1);


    static const seekdir end = seekdir(2);
# 420 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    enum event
    {
      erase_event,
      imbue_event,
      copyfmt_event
    };
# 437 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    typedef void (*event_callback) (event, ios_base&, int);
# 449 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    void
    register_callback(event_callback __fn, int __index);

  protected:






    streamsize _M_precision;
    streamsize _M_width;
    fmtflags _M_flags;
    iostate _M_exception;
    iostate _M_streambuf_state;




    struct _Callback_list
    {

      _Callback_list* _M_next;
      ios_base::event_callback _M_fn;
      int _M_index;
      _Atomic_word _M_refcount;

      _Callback_list(ios_base::event_callback __fn, int __index,
       _Callback_list* __cb)
      : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }

      void
      _M_add_reference() { __gnu_cxx::__atomic_add(&_M_refcount, 1); }


      int
      _M_remove_reference()
      { return __gnu_cxx::__exchange_and_add(&_M_refcount, -1); }
    };

     _Callback_list* _M_callbacks;

    void
    _M_call_callbacks(event __ev) throw();

    void
    _M_dispose_callbacks(void);


    struct _Words
    {
      void* _M_pword;
      long _M_iword;
      _Words() : _M_pword(0), _M_iword(0) { }
    };


    _Words _M_word_zero;



    static const int _S_local_word_size = 8;
    _Words _M_local_word[_S_local_word_size];


    int _M_word_size;
    _Words* _M_word;

    _Words&
    _M_grow_words(int __index, bool __iword);


    locale _M_ios_locale;

    void
    _M_init();

  public:





    class Init
    {
      friend class ios_base;
    public:
      Init();
      ~Init();

    private:
      static _Atomic_word _S_refcount;
      static bool _S_synced_with_stdio;
    };






    inline fmtflags
    flags() const { return _M_flags; }
# 559 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline fmtflags
    flags(fmtflags __fmtfl)
    {
      fmtflags __old = _M_flags;
      _M_flags = __fmtfl;
      return __old;
    }
# 575 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline fmtflags
    setf(fmtflags __fmtfl)
    {
      fmtflags __old = _M_flags;
      _M_flags |= __fmtfl;
      return __old;
    }
# 592 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline fmtflags
    setf(fmtflags __fmtfl, fmtflags __mask)
    {
      fmtflags __old = _M_flags;
      _M_flags &= ~__mask;
      _M_flags |= (__fmtfl & __mask);
      return __old;
    }







    inline void
    unsetf(fmtflags __mask) { _M_flags &= ~__mask; }
# 619 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline streamsize
    precision() const { return _M_precision; }






    inline streamsize
    precision(streamsize __prec)
    {
      streamsize __old = _M_precision;
      _M_precision = __prec;
      return __old;
    }







    inline streamsize
    width() const { return _M_width; }






    inline streamsize
    width(streamsize __wide)
    {
      streamsize __old = _M_width;
      _M_width = __wide;
      return __old;
    }
# 668 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    static bool
    sync_with_stdio(bool __sync = true);
# 680 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    locale
    imbue(const locale& __loc);
# 691 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline locale
    getloc() const { return _M_ios_locale; }
# 701 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline const locale&
    _M_getloc() const { return _M_ios_locale; }
# 719 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    static int
    xalloc() throw();
# 735 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline long&
    iword(int __ix)
    {
      _Words& __word = (__ix < _M_word_size)
   ? _M_word[__ix] : _M_grow_words(__ix, true);
      return __word._M_iword;
    }
# 756 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    inline void*&
    pword(int __ix)
    {
      _Words& __word = (__ix < _M_word_size)
   ? _M_word[__ix] : _M_grow_words(__ix, false);
      return __word._M_pword;
    }
# 773 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h" 3
    virtual ~ios_base();

  protected:
    ios_base();



  private:
    ios_base(const ios_base&);

    ios_base&
    operator=(const ios_base&);
  };



  inline ios_base&
  boolalpha(ios_base& __base)
  {
    __base.setf(ios_base::boolalpha);
    return __base;
  }


  inline ios_base&
  noboolalpha(ios_base& __base)
  {
    __base.unsetf(ios_base::boolalpha);
    return __base;
  }


  inline ios_base&
  showbase(ios_base& __base)
  {
    __base.setf(ios_base::showbase);
    return __base;
  }


  inline ios_base&
  noshowbase(ios_base& __base)
  {
    __base.unsetf(ios_base::showbase);
    return __base;
  }


  inline ios_base&
  showpoint(ios_base& __base)
  {
    __base.setf(ios_base::showpoint);
    return __base;
  }


  inline ios_base&
  noshowpoint(ios_base& __base)
  {
    __base.unsetf(ios_base::showpoint);
    return __base;
  }


  inline ios_base&
  showpos(ios_base& __base)
  {
    __base.setf(ios_base::showpos);
    return __base;
  }


  inline ios_base&
  noshowpos(ios_base& __base)
  {
    __base.unsetf(ios_base::showpos);
    return __base;
  }


  inline ios_base&
  skipws(ios_base& __base)
  {
    __base.setf(ios_base::skipws);
    return __base;
  }


  inline ios_base&
  noskipws(ios_base& __base)
  {
    __base.unsetf(ios_base::skipws);
    return __base;
  }


  inline ios_base&
  uppercase(ios_base& __base)
  {
    __base.setf(ios_base::uppercase);
    return __base;
  }


  inline ios_base&
  nouppercase(ios_base& __base)
  {
    __base.unsetf(ios_base::uppercase);
    return __base;
  }


  inline ios_base&
  unitbuf(ios_base& __base)
  {
     __base.setf(ios_base::unitbuf);
     return __base;
  }


  inline ios_base&
  nounitbuf(ios_base& __base)
  {
     __base.unsetf(ios_base::unitbuf);
     return __base;
  }



  inline ios_base&
  internal(ios_base& __base)
  {
     __base.setf(ios_base::internal, ios_base::adjustfield);
     return __base;
  }


  inline ios_base&
  left(ios_base& __base)
  {
    __base.setf(ios_base::left, ios_base::adjustfield);
    return __base;
  }


  inline ios_base&
  right(ios_base& __base)
  {
    __base.setf(ios_base::right, ios_base::adjustfield);
    return __base;
  }



  inline ios_base&
  dec(ios_base& __base)
  {
    __base.setf(ios_base::dec, ios_base::basefield);
    return __base;
  }


  inline ios_base&
  hex(ios_base& __base)
  {
    __base.setf(ios_base::hex, ios_base::basefield);
    return __base;
  }


  inline ios_base&
  oct(ios_base& __base)
  {
    __base.setf(ios_base::oct, ios_base::basefield);
    return __base;
  }



  inline ios_base&
  fixed(ios_base& __base)
  {
    __base.setf(ios_base::fixed, ios_base::floatfield);
    return __base;
  }


  inline ios_base&
  scientific(ios_base& __base)
  {
    __base.setf(ios_base::scientific, ios_base::floatfield);
    return __base;
  }
}
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3






namespace std
{





  template<typename _CharT, typename _Traits>
    streamsize
    __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
        basic_streambuf<_CharT, _Traits>* __sbout);
# 122 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
  template<typename _CharT, typename _Traits>
    class basic_streambuf
    {
    public:






      typedef _CharT char_type;
      typedef _Traits traits_type;
      typedef typename traits_type::int_type int_type;
      typedef typename traits_type::pos_type pos_type;
      typedef typename traits_type::off_type off_type;
# 145 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      typedef basic_streambuf<char_type, traits_type> __streambuf_type;


      friend class basic_ios<char_type, traits_type>;
      friend class basic_istream<char_type, traits_type>;
      friend class basic_ostream<char_type, traits_type>;
      friend class istreambuf_iterator<char_type, traits_type>;
      friend class ostreambuf_iterator<char_type, traits_type>;

      friend streamsize
      __copy_streambufs<>(__streambuf_type* __sbin,
     __streambuf_type* __sbout);

    protected:
# 169 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      char_type* _M_in_beg;
      char_type* _M_in_cur;
      char_type* _M_in_end;
      char_type* _M_out_beg;
      char_type* _M_out_cur;
      char_type* _M_out_end;






      locale _M_buf_locale;

  public:

      virtual
      ~basic_streambuf()
      { }
# 197 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      locale
      pubimbue(const locale &__loc)
      {
 locale __tmp(this->getloc());
 this->imbue(__loc);
 _M_buf_locale = __loc;
 return __tmp;
      }
# 214 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      locale
      getloc() const
      { return _M_buf_locale; }
# 227 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      __streambuf_type*
      pubsetbuf(char_type* __s, streamsize __n)
      { return this->setbuf(__s, __n); }

      pos_type
      pubseekoff(off_type __off, ios_base::seekdir __way,
   ios_base::openmode __mode = ios_base::in | ios_base::out)
      { return this->seekoff(__off, __way, __mode); }

      pos_type
      pubseekpos(pos_type __sp,
   ios_base::openmode __mode = ios_base::in | ios_base::out)
      { return this->seekpos(__sp, __mode); }

      int
      pubsync() { return this->sync(); }
# 254 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      streamsize
      in_avail()
      {
 const streamsize __ret = this->egptr() - this->gptr();
 return __ret ? __ret : this->showmanyc();
      }
# 268 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      int_type
      snextc()
      {
 int_type __ret = traits_type::eof();
 if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
             __ret), true))
   __ret = this->sgetc();
 return __ret;
      }
# 286 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      int_type
      sbumpc()
      {
 int_type __ret;
 if (__builtin_expect(this->gptr() < this->egptr(), true))
   {
     __ret = traits_type::to_int_type(*this->gptr());
     this->gbump(1);
   }
 else
   __ret = this->uflow();
 return __ret;
      }
# 308 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      int_type
      sgetc()
      {
 int_type __ret;
 if (__builtin_expect(this->gptr() < this->egptr(), true))
   __ret = traits_type::to_int_type(*this->gptr());
 else
   __ret = this->underflow();
 return __ret;
      }
# 327 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      streamsize
      sgetn(char_type* __s, streamsize __n)
      { return this->xsgetn(__s, __n); }
# 341 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      int_type
      sputbackc(char_type __c)
      {
 int_type __ret;
 const bool __testpos = this->eback() < this->gptr();
 if (__builtin_expect(!__testpos ||
        !traits_type::eq(__c, this->gptr()[-1]), false))
   __ret = this->pbackfail(traits_type::to_int_type(__c));
 else
   {
     this->gbump(-1);
     __ret = traits_type::to_int_type(*this->gptr());
   }
 return __ret;
      }
# 366 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      int_type
      sungetc()
      {
 int_type __ret;
 if (__builtin_expect(this->eback() < this->gptr(), true))
   {
     this->gbump(-1);
     __ret = traits_type::to_int_type(*this->gptr());
   }
 else
   __ret = this->pbackfail();
 return __ret;
      }
# 393 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      int_type
      sputc(char_type __c)
      {
 int_type __ret;
 if (__builtin_expect(this->pptr() < this->epptr(), true))
   {
     *this->pptr() = __c;
     this->pbump(1);
     __ret = traits_type::to_int_type(__c);
   }
 else
   __ret = this->overflow(traits_type::to_int_type(__c));
 return __ret;
      }
# 419 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      streamsize
      sputn(const char_type* __s, streamsize __n)
      { return this->xsputn(__s, __n); }

    protected:
# 433 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      basic_streambuf()
      : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
      _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
      _M_buf_locale(locale())
      { }
# 451 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      char_type*
      eback() const { return _M_in_beg; }

      char_type*
      gptr() const { return _M_in_cur; }

      char_type*
      egptr() const { return _M_in_end; }
# 467 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      void
      gbump(int __n) { _M_in_cur += __n; }
# 478 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      void
      setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
      {
 _M_in_beg = __gbeg;
 _M_in_cur = __gnext;
 _M_in_end = __gend;
      }
# 498 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      char_type*
      pbase() const { return _M_out_beg; }

      char_type*
      pptr() const { return _M_out_cur; }

      char_type*
      epptr() const { return _M_out_end; }
# 514 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      void
      pbump(int __n) { _M_out_cur += __n; }
# 524 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      void
      setp(char_type* __pbeg, char_type* __pend)
      {
 _M_out_beg = _M_out_cur = __pbeg;
 _M_out_end = __pend;
      }
# 545 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual void
      imbue(const locale&)
      { }
# 560 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual basic_streambuf<char_type,_Traits>*
      setbuf(char_type*, streamsize)
      { return this; }
# 571 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual pos_type
      seekoff(off_type, ios_base::seekdir,
       ios_base::openmode = ios_base::in | ios_base::out)
      { return pos_type(off_type(-1)); }
# 583 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual pos_type
      seekpos(pos_type,
       ios_base::openmode = ios_base::in | ios_base::out)
      { return pos_type(off_type(-1)); }
# 596 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual int
      sync() { return 0; }
# 618 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual streamsize
      showmanyc() { return 0; }
# 634 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual streamsize
      xsgetn(char_type* __s, streamsize __n);
# 656 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual int_type
      underflow()
      { return traits_type::eof(); }
# 669 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual int_type
      uflow()
      {
 int_type __ret = traits_type::eof();
 const bool __testeof = traits_type::eq_int_type(this->underflow(),
       __ret);
 if (!__testeof)
   {
     __ret = traits_type::to_int_type(*this->gptr());
     this->gbump(1);
   }
 return __ret;
      }
# 693 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual int_type
      pbackfail(int_type = traits_type::eof())
      { return traits_type::eof(); }
# 711 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual streamsize
      xsputn(const char_type* __s, streamsize __n);
# 736 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
      virtual int_type
      overflow(int_type = traits_type::eof())
      { return traits_type::eof(); }
# 765 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 3
    private:


      basic_streambuf(const __streambuf_type& __sb)
      : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
      _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
      _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
      _M_buf_locale(__sb._M_buf_locale)
      { }

      __streambuf_type&
      operator=(const __streambuf_type&) { return *this; };
    };
}


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/streambuf.tcc" 1 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/streambuf.tcc" 3
       
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/streambuf.tcc" 3

namespace std
{
  template<typename _CharT, typename _Traits>
    streamsize
    basic_streambuf<_CharT, _Traits>::
    xsgetn(char_type* __s, streamsize __n)
    {
      streamsize __ret = 0;
      while (__ret < __n)
 {
   const size_t __buf_len = this->egptr() - this->gptr();
   if (__buf_len)
     {
       const size_t __remaining = __n - __ret;
       const size_t __len = std::min(__buf_len, __remaining);
       traits_type::copy(__s, this->gptr(), __len);
       __ret += __len;
       __s += __len;
       this->gbump(__len);
     }

   if (__ret < __n)
     {
       const int_type __c = this->uflow();
       if (!traits_type::eq_int_type(__c, traits_type::eof()))
  {
    traits_type::assign(*__s++, traits_type::to_char_type(__c));
    ++__ret;
  }
       else
  break;
     }
 }
      return __ret;
    }

  template<typename _CharT, typename _Traits>
    streamsize
    basic_streambuf<_CharT, _Traits>::
    xsputn(const char_type* __s, streamsize __n)
    {
      streamsize __ret = 0;
      while (__ret < __n)
 {
   const size_t __buf_len = this->epptr() - this->pptr();
   if (__buf_len)
     {
       const size_t __remaining = __n - __ret;
       const size_t __len = std::min(__buf_len, __remaining);
       traits_type::copy(this->pptr(), __s, __len);
       __ret += __len;
       __s += __len;
       this->pbump(__len);
     }

   if (__ret < __n)
     {
       int_type __c = this->overflow(traits_type::to_int_type(*__s));
       if (!traits_type::eq_int_type(__c, traits_type::eof()))
  {
    ++__ret;
    ++__s;
  }
       else
  break;
     }
 }
      return __ret;
    }





  template<typename _CharT, typename _Traits>
    streamsize
    __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
        basic_streambuf<_CharT, _Traits>* __sbout)
    {
      streamsize __ret = 0;
      typename _Traits::int_type __c = __sbin->sgetc();
      while (!_Traits::eq_int_type(__c, _Traits::eof()))
 {
   const size_t __n = __sbin->egptr() - __sbin->gptr();
   if (__n > 1)
     {
       const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n);
       __sbin->gbump(__wrote);
       __ret += __wrote;
       if (__wrote < __n)
  break;
       __c = __sbin->underflow();
     }
   else
     {
       __c = __sbout->sputc(_Traits::to_char_type(__c));
       if (_Traits::eq_int_type(__c, _Traits::eof()))
  break;
       ++__ret;
       __c = __sbin->snextc();
     }
 }
      return __ret;
    }





  extern template class basic_streambuf<char>;
  extern template
    streamsize
    __copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*);


  extern template class basic_streambuf<wchar_t>;
  extern template
    streamsize
    __copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*);


}
# 782 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf" 2 3
# 51 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 1 3
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
       
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/streambuf_iterator.h" 1 3
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/streambuf_iterator.h" 3
       
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/streambuf_iterator.h" 3






namespace std
{


  template<typename _CharT, typename _Traits>
    class istreambuf_iterator
    : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
        _CharT*, _CharT&>
    {
    public:



      typedef _CharT char_type;
      typedef _Traits traits_type;
      typedef typename _Traits::int_type int_type;
      typedef basic_streambuf<_CharT, _Traits> streambuf_type;
      typedef basic_istream<_CharT, _Traits> istream_type;


    private:







      mutable streambuf_type* _M_sbuf;
      int_type _M_c;

    public:

      istreambuf_iterator() throw()
      : _M_sbuf(0), _M_c(traits_type::eof()) { }


      istreambuf_iterator(istream_type& __s) throw()
      : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }


      istreambuf_iterator(streambuf_type* __s) throw()
      : _M_sbuf(__s), _M_c(traits_type::eof()) { }




      char_type
      operator*() const
      {







 return traits_type::to_char_type(_M_get());
      }


      istreambuf_iterator&
      operator++()
      {
 ;


 const int_type __eof = traits_type::eof();
 if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof))
   _M_sbuf = 0;
 else
   _M_c = __eof;
 return *this;
      }


      istreambuf_iterator
      operator++(int)
      {
 ;



 const int_type __eof = traits_type::eof();
 istreambuf_iterator __old = *this;
 if (_M_sbuf
     && traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()),
     __eof))
   _M_sbuf = 0;
 else
   _M_c = __eof;
 return __old;
      }





      bool
      equal(const istreambuf_iterator& __b) const
      {
 const bool __thiseof = _M_at_eof();
 const bool __beof = __b._M_at_eof();
 return (__thiseof && __beof || (!__thiseof && !__beof));
      }

    private:
      int_type
      _M_get() const
      {
 const int_type __eof = traits_type::eof();
 int_type __ret = __eof;
 if (_M_sbuf)
   {
     if (!traits_type::eq_int_type(_M_c, __eof))
       __ret = _M_c;
     else if (traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
           __eof))
       _M_sbuf = 0;
   }
 return __ret;
      }

      bool
      _M_at_eof() const
      {
 const int_type __eof = traits_type::eof();
 return traits_type::eq_int_type(_M_get(), __eof);
      }
    };

  template<typename _CharT, typename _Traits>
    inline bool
    operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
        const istreambuf_iterator<_CharT, _Traits>& __b)
    { return __a.equal(__b); }

  template<typename _CharT, typename _Traits>
    inline bool
    operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
        const istreambuf_iterator<_CharT, _Traits>& __b)
    { return !__a.equal(__b); }


  template<typename _CharT, typename _Traits>
    class ostreambuf_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
    {
    public:



      typedef _CharT char_type;
      typedef _Traits traits_type;
      typedef basic_streambuf<_CharT, _Traits> streambuf_type;
      typedef basic_ostream<_CharT, _Traits> ostream_type;


    private:
      streambuf_type* _M_sbuf;
      bool _M_failed;

    public:

      ostreambuf_iterator(ostream_type& __s) throw ()
      : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }


      ostreambuf_iterator(streambuf_type* __s) throw ()
      : _M_sbuf(__s), _M_failed(!_M_sbuf) { }


      ostreambuf_iterator&
      operator=(_CharT __c)
      {
 if (!_M_failed &&
     _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
   _M_failed = true;
 return *this;
      }


      ostreambuf_iterator&
      operator*()
      { return *this; }


      ostreambuf_iterator&
      operator++(int)
      { return *this; }


      ostreambuf_iterator&
      operator++()
      { return *this; }


      bool
      failed() const throw()
      { return _M_failed; }

      ostreambuf_iterator&
      _M_put(const _CharT* __ws, streamsize __len)
      {
 if (__builtin_expect(!_M_failed, true)
     && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
    false))
   _M_failed = true;
 return *this;
      }
    };
}
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 2 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwctype" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwctype" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwctype" 3




# 1 "/usr/include/wctype.h" 1 3 4
# 35 "/usr/include/wctype.h" 3 4
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/stddef.h" 1 3 4
# 36 "/usr/include/wctype.h" 2 3 4
# 45 "/usr/include/wctype.h" 3 4

# 63 "/usr/include/wctype.h" 3 4



typedef unsigned long int wctype_t;

# 85 "/usr/include/wctype.h" 3 4
enum
{
  __ISwupper = 0,
  __ISwlower = 1,
  __ISwalpha = 2,
  __ISwdigit = 3,
  __ISwxdigit = 4,
  __ISwspace = 5,
  __ISwprint = 6,
  __ISwgraph = 7,
  __ISwblank = 8,
  __ISwcntrl = 9,
  __ISwpunct = 10,
  __ISwalnum = 11,

  _ISwupper = ((__ISwupper) < 8 ? (int) ((1UL << (__ISwupper)) << 24) : ((__ISwupper) < 16 ? (int) ((1UL << (__ISwupper)) << 8) : ((__ISwupper) < 24 ? (int) ((1UL << (__ISwupper)) >> 8) : (int) ((1UL << (__ISwupper)) >> 24)))),
  _ISwlower = ((__ISwlower) < 8 ? (int) ((1UL << (__ISwlower)) << 24) : ((__ISwlower) < 16 ? (int) ((1UL << (__ISwlower)) << 8) : ((__ISwlower) < 24 ? (int) ((1UL << (__ISwlower)) >> 8) : (int) ((1UL << (__ISwlower)) >> 24)))),
  _ISwalpha = ((__ISwalpha) < 8 ? (int) ((1UL << (__ISwalpha)) << 24) : ((__ISwalpha) < 16 ? (int) ((1UL << (__ISwalpha)) << 8) : ((__ISwalpha) < 24 ? (int) ((1UL << (__ISwalpha)) >> 8) : (int) ((1UL << (__ISwalpha)) >> 24)))),
  _ISwdigit = ((__ISwdigit) < 8 ? (int) ((1UL << (__ISwdigit)) << 24) : ((__ISwdigit) < 16 ? (int) ((1UL << (__ISwdigit)) << 8) : ((__ISwdigit) < 24 ? (int) ((1UL << (__ISwdigit)) >> 8) : (int) ((1UL << (__ISwdigit)) >> 24)))),
  _ISwxdigit = ((__ISwxdigit) < 8 ? (int) ((1UL << (__ISwxdigit)) << 24) : ((__ISwxdigit) < 16 ? (int) ((1UL << (__ISwxdigit)) << 8) : ((__ISwxdigit) < 24 ? (int) ((1UL << (__ISwxdigit)) >> 8) : (int) ((1UL << (__ISwxdigit)) >> 24)))),
  _ISwspace = ((__ISwspace) < 8 ? (int) ((1UL << (__ISwspace)) << 24) : ((__ISwspace) < 16 ? (int) ((1UL << (__ISwspace)) << 8) : ((__ISwspace) < 24 ? (int) ((1UL << (__ISwspace)) >> 8) : (int) ((1UL << (__ISwspace)) >> 24)))),
  _ISwprint = ((__ISwprint) < 8 ? (int) ((1UL << (__ISwprint)) << 24) : ((__ISwprint) < 16 ? (int) ((1UL << (__ISwprint)) << 8) : ((__ISwprint) < 24 ? (int) ((1UL << (__ISwprint)) >> 8) : (int) ((1UL << (__ISwprint)) >> 24)))),
  _ISwgraph = ((__ISwgraph) < 8 ? (int) ((1UL << (__ISwgraph)) << 24) : ((__ISwgraph) < 16 ? (int) ((1UL << (__ISwgraph)) << 8) : ((__ISwgraph) < 24 ? (int) ((1UL << (__ISwgraph)) >> 8) : (int) ((1UL << (__ISwgraph)) >> 24)))),
  _ISwblank = ((__ISwblank) < 8 ? (int) ((1UL << (__ISwblank)) << 24) : ((__ISwblank) < 16 ? (int) ((1UL << (__ISwblank)) << 8) : ((__ISwblank) < 24 ? (int) ((1UL << (__ISwblank)) >> 8) : (int) ((1UL << (__ISwblank)) >> 24)))),
  _ISwcntrl = ((__ISwcntrl) < 8 ? (int) ((1UL << (__ISwcntrl)) << 24) : ((__ISwcntrl) < 16 ? (int) ((1UL << (__ISwcntrl)) << 8) : ((__ISwcntrl) < 24 ? (int) ((1UL << (__ISwcntrl)) >> 8) : (int) ((1UL << (__ISwcntrl)) >> 24)))),
  _ISwpunct = ((__ISwpunct) < 8 ? (int) ((1UL << (__ISwpunct)) << 24) : ((__ISwpunct) < 16 ? (int) ((1UL << (__ISwpunct)) << 8) : ((__ISwpunct) < 24 ? (int) ((1UL << (__ISwpunct)) >> 8) : (int) ((1UL << (__ISwpunct)) >> 24)))),
  _ISwalnum = ((__ISwalnum) < 8 ? (int) ((1UL << (__ISwalnum)) << 24) : ((__ISwalnum) < 16 ? (int) ((1UL << (__ISwalnum)) << 8) : ((__ISwalnum) < 24 ? (int) ((1UL << (__ISwalnum)) >> 8) : (int) ((1UL << (__ISwalnum)) >> 24))))
};



extern "C" {








extern int iswalnum (wint_t __wc) throw ();





extern int iswalpha (wint_t __wc) throw ();


extern int iswcntrl (wint_t __wc) throw ();



extern int iswdigit (wint_t __wc) throw ();



extern int iswgraph (wint_t __wc) throw ();




extern int iswlower (wint_t __wc) throw ();


extern int iswprint (wint_t __wc) throw ();




extern int iswpunct (wint_t __wc) throw ();




extern int iswspace (wint_t __wc) throw ();




extern int iswupper (wint_t __wc) throw ();




extern int iswxdigit (wint_t __wc) throw ();





extern int iswblank (wint_t __wc) throw ();
# 185 "/usr/include/wctype.h" 3 4
extern wctype_t wctype (__const char *__property) throw ();



extern int iswctype (wint_t __wc, wctype_t __desc) throw ();










typedef __const __int32_t *wctrans_t;







extern wint_t towlower (wint_t __wc) throw ();


extern wint_t towupper (wint_t __wc) throw ();


}
# 227 "/usr/include/wctype.h" 3 4
extern "C" {




extern wctrans_t wctrans (__const char *__property) throw ();


extern wint_t towctrans (wint_t __wc, wctrans_t __desc) throw ();








extern int iswalnum_l (wint_t __wc, __locale_t __locale) throw ();





extern int iswalpha_l (wint_t __wc, __locale_t __locale) throw ();


extern int iswcntrl_l (wint_t __wc, __locale_t __locale) throw ();



extern int iswdigit_l (wint_t __wc, __locale_t __locale) throw ();



extern int iswgraph_l (wint_t __wc, __locale_t __locale) throw ();




extern int iswlower_l (wint_t __wc, __locale_t __locale) throw ();


extern int iswprint_l (wint_t __wc, __locale_t __locale) throw ();




extern int iswpunct_l (wint_t __wc, __locale_t __locale) throw ();




extern int iswspace_l (wint_t __wc, __locale_t __locale) throw ();




extern int iswupper_l (wint_t __wc, __locale_t __locale) throw ();




extern int iswxdigit_l (wint_t __wc, __locale_t __locale) throw ();




extern int iswblank_l (wint_t __wc, __locale_t __locale) throw ();



extern wctype_t wctype_l (__const char *__property, __locale_t __locale)
     throw ();



extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
     throw ();







extern wint_t towlower_l (wint_t __wc, __locale_t __locale) throw ();


extern wint_t towupper_l (wint_t __wc, __locale_t __locale) throw ();



extern wctrans_t wctrans_l (__const char *__property, __locale_t __locale)
     throw ();


extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc,
      __locale_t __locale) throw ();



}
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwctype" 2 3
# 79 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cwctype" 3
namespace std
{
  using ::wint_t;

  using ::wctype_t;
  using ::wctrans_t;

  using ::iswalnum;
  using ::iswalpha;

  using ::iswblank;

  using ::iswcntrl;
  using ::iswdigit;
  using ::iswgraph;
  using ::iswlower;
  using ::iswprint;
  using ::iswprint;
  using ::iswpunct;
  using ::iswspace;
  using ::iswupper;
  using ::iswxdigit;
  using ::iswctype;
  using ::towlower;
  using ::towupper;
  using ::towctrans;
  using ::wctrans;
  using ::wctype;
}
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 2 3




namespace std
{
# 63 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _Tv>
    void
    __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
     const __c_locale& __cloc);


  template<>
    void
    __convert_to_v(const char*, float&, ios_base::iostate&,
     const __c_locale&);

  template<>
    void
    __convert_to_v(const char*, double&, ios_base::iostate&,
     const __c_locale&);

  template<>
    void
    __convert_to_v(const char*, long double&, ios_base::iostate&,
     const __c_locale&);



  template<typename _CharT, typename _Traits>
    struct __pad
    {
      static void
      _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
      const _CharT* __olds, const streamsize __newlen,
      const streamsize __oldlen, const bool __num);
    };






  template<typename _CharT>
    _CharT*
    __add_grouping(_CharT* __s, _CharT __sep,
     const char* __gbeg, size_t __gsize,
     const _CharT* __first, const _CharT* __last);




  template<typename _CharT>
    inline
    ostreambuf_iterator<_CharT>
    __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
    {
      __s._M_put(__ws, __len);
      return __s;
    }


  template<typename _CharT, typename _OutIter>
    inline
    _OutIter
    __write(_OutIter __s, const _CharT* __ws, int __len)
    {
      for (int __j = 0; __j < __len; __j++, ++__s)
 *__s = __ws[__j];
      return __s;
    }




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/ctype_base.h" 1 3
# 37 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/ctype_base.h" 3
  struct ctype_base
  {

    typedef const int* __to_type;



    typedef unsigned short mask;
    static const mask upper = _ISupper;
    static const mask lower = _ISlower;
    static const mask alpha = _ISalpha;
    static const mask digit = _ISdigit;
    static const mask xdigit = _ISxdigit;
    static const mask space = _ISspace;
    static const mask print = _ISprint;
    static const mask graph = _ISalpha | _ISdigit | _ISpunct;
    static const mask cntrl = _IScntrl;
    static const mask punct = _ISpunct;
    static const mask alnum = _ISalpha | _ISdigit;
  };
# 133 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 2 3
# 144 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT>
    class __ctype_abstract_base : public locale::facet, public ctype_base
    {
    public:


      typedef _CharT char_type;
# 162 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      bool
      is(mask __m, char_type __c) const
      { return this->do_is(__m, __c); }
# 179 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      is(const char_type *__lo, const char_type *__hi, mask *__vec) const
      { return this->do_is(__lo, __hi, __vec); }
# 195 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
      { return this->do_scan_is(__m, __lo, __hi); }
# 211 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
      { return this->do_scan_not(__m, __lo, __hi); }
# 225 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      toupper(char_type __c) const
      { return this->do_toupper(__c); }
# 240 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      toupper(char_type *__lo, const char_type* __hi) const
      { return this->do_toupper(__lo, __hi); }
# 254 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      tolower(char_type __c) const
      { return this->do_tolower(__c); }
# 269 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      tolower(char_type* __lo, const char_type* __hi) const
      { return this->do_tolower(__lo, __hi); }
# 286 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      widen(char __c) const
      { return this->do_widen(__c); }
# 305 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char*
      widen(const char* __lo, const char* __hi, char_type* __to) const
      { return this->do_widen(__lo, __hi, __to); }
# 324 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char
      narrow(char_type __c, char __dfault) const
      { return this->do_narrow(__c, __dfault); }
# 346 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      narrow(const char_type* __lo, const char_type* __hi,
       char __dfault, char *__to) const
      { return this->do_narrow(__lo, __hi, __dfault, __to); }

    protected:
      explicit
      __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }

      virtual
      ~__ctype_abstract_base() { }
# 371 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual bool
      do_is(mask __m, char_type __c) const = 0;
# 390 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_is(const char_type* __lo, const char_type* __hi,
     mask* __vec) const = 0;
# 409 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_scan_is(mask __m, const char_type* __lo,
   const char_type* __hi) const = 0;
# 428 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_scan_not(mask __m, const char_type* __lo,
    const char_type* __hi) const = 0;
# 446 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_toupper(char_type) const = 0;
# 463 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_toupper(char_type* __lo, const char_type* __hi) const = 0;
# 479 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_tolower(char_type) const = 0;
# 496 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_tolower(char_type* __lo, const char_type* __hi) const = 0;
# 515 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_widen(char) const = 0;
# 536 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char*
      do_widen(const char* __lo, const char* __hi,
        char_type* __dest) const = 0;
# 558 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char
      do_narrow(char_type, char __dfault) const = 0;
# 582 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_narrow(const char_type* __lo, const char_type* __hi,
  char __dfault, char* __dest) const = 0;
    };
# 605 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT>
    class ctype : public __ctype_abstract_base<_CharT>
    {
    public:

      typedef _CharT char_type;
      typedef typename __ctype_abstract_base<_CharT>::mask mask;


      static locale::id id;

      explicit
      ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }

   protected:
      virtual
      ~ctype();

      virtual bool
      do_is(mask __m, char_type __c) const;

      virtual const char_type*
      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;

      virtual const char_type*
      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;

      virtual const char_type*
      do_scan_not(mask __m, const char_type* __lo,
    const char_type* __hi) const;

      virtual char_type
      do_toupper(char_type __c) const;

      virtual const char_type*
      do_toupper(char_type* __lo, const char_type* __hi) const;

      virtual char_type
      do_tolower(char_type __c) const;

      virtual const char_type*
      do_tolower(char_type* __lo, const char_type* __hi) const;

      virtual char_type
      do_widen(char __c) const;

      virtual const char*
      do_widen(const char* __lo, const char* __hi, char_type* __dest) const;

      virtual char
      do_narrow(char_type, char __dfault) const;

      virtual const char_type*
      do_narrow(const char_type* __lo, const char_type* __hi,
  char __dfault, char* __dest) const;
    };

  template<typename _CharT>
    locale::id ctype<_CharT>::id;
# 674 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<>
    class ctype<char> : public locale::facet, public ctype_base
    {
    public:


      typedef char char_type;

    protected:

      __c_locale _M_c_locale_ctype;
      bool _M_del;
      __to_type _M_toupper;
      __to_type _M_tolower;
      const mask* _M_table;
      mutable char _M_widen_ok;
      mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
      mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
      mutable char _M_narrow_ok;


    public:

      static locale::id id;

      static const size_t table_size = 1 + static_cast<unsigned char>(-1);
# 711 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
# 724 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
     size_t __refs = 0);
# 737 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      inline bool
      is(mask __m, char __c) const;
# 752 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      inline const char*
      is(const char* __lo, const char* __hi, mask* __vec) const;
# 766 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      inline const char*
      scan_is(mask __m, const char* __lo, const char* __hi) const;
# 780 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      inline const char*
      scan_not(mask __m, const char* __lo, const char* __hi) const;
# 795 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      toupper(char_type __c) const
      { return this->do_toupper(__c); }
# 812 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      toupper(char_type *__lo, const char_type* __hi) const
      { return this->do_toupper(__lo, __hi); }
# 828 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      tolower(char_type __c) const
      { return this->do_tolower(__c); }
# 845 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      tolower(char_type* __lo, const char_type* __hi) const
      { return this->do_tolower(__lo, __hi); }
# 865 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      widen(char __c) const
      {
 if (_M_widen_ok)
   return _M_widen[static_cast<unsigned char>(__c)];
 this->_M_widen_init();
 return this->do_widen(__c);
      }
# 892 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char*
      widen(const char* __lo, const char* __hi, char_type* __to) const
      {
 if (_M_widen_ok == 1)
   {
     memcpy(__to, __lo, __hi - __lo);
     return __hi;
   }
 if (!_M_widen_ok)
   _M_widen_init();
 return this->do_widen(__lo, __hi, __to);
      }
# 923 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char
      narrow(char_type __c, char __dfault) const
      {
 if (_M_narrow[static_cast<unsigned char>(__c)])
   return _M_narrow[static_cast<unsigned char>(__c)];
 const char __t = do_narrow(__c, __dfault);
 if (__t != __dfault)
   _M_narrow[static_cast<unsigned char>(__c)] = __t;
 return __t;
      }
# 956 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      const char_type*
      narrow(const char_type* __lo, const char_type* __hi,
      char __dfault, char *__to) const
      {
 if (__builtin_expect(_M_narrow_ok == 1, true))
   {
     memcpy(__to, __lo, __hi - __lo);
     return __hi;
   }
 if (!_M_narrow_ok)
   _M_narrow_init();
 return this->do_narrow(__lo, __hi, __dfault, __to);
      }

    protected:


      const mask*
      table() const throw()
      { return _M_table; }


      static const mask*
      classic_table() throw();







      virtual
      ~ctype();
# 1003 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_toupper(char_type) const;
# 1020 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_toupper(char_type* __lo, const char_type* __hi) const;
# 1036 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_tolower(char_type) const;
# 1053 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_tolower(char_type* __lo, const char_type* __hi) const;
# 1073 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_widen(char __c) const
      { return __c; }
# 1096 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char*
      do_widen(const char* __lo, const char* __hi, char_type* __dest) const
      {
 memcpy(__dest, __lo, __hi - __lo);
 return __hi;
      }
# 1122 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char
      do_narrow(char_type __c, char) const
      { return __c; }
# 1148 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_narrow(const char_type* __lo, const char_type* __hi,
  char, char* __dest) const
      {
 memcpy(__dest, __lo, __hi - __lo);
 return __hi;
      }

    private:

      void _M_widen_init() const
      {
 char __tmp[sizeof(_M_widen)];
 for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
   __tmp[__i] = __i;
 do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);

 _M_widen_ok = 1;

 if (memcmp(__tmp, _M_widen, sizeof(_M_widen)))
   _M_widen_ok = 2;
      }




      void _M_narrow_init() const
      {
 char __tmp[sizeof(_M_narrow)];
 for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
   __tmp[__i] = __i;
 do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);

 _M_narrow_ok = 1;
 if (memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
   _M_narrow_ok = 2;
 else
   {


     char __c;
     do_narrow(__tmp, __tmp + 1, 1, &__c);
     if (__c == 1)
       _M_narrow_ok = 2;
   }
      }
    };

  template<>
    const ctype<char>&
    use_facet<ctype<char> >(const locale& __loc);
# 1212 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<>
    class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
    {
    public:


      typedef wchar_t char_type;
      typedef wctype_t __wmask_type;

    protected:
      __c_locale _M_c_locale_ctype;


      bool _M_narrow_ok;
      char _M_narrow[128];
      wint_t _M_widen[1 + static_cast<unsigned char>(-1)];


      mask _M_bit[16];
      __wmask_type _M_wmask[16];

    public:


      static locale::id id;
# 1245 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      ctype(size_t __refs = 0);
# 1256 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      ctype(__c_locale __cloc, size_t __refs = 0);

    protected:
      __wmask_type
      _M_convert_to_wmask(const mask __m) const;


      virtual
      ~ctype();
# 1280 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual bool
      do_is(mask __m, char_type __c) const;
# 1299 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
# 1317 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
# 1335 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_scan_not(mask __m, const char_type* __lo,
    const char_type* __hi) const;
# 1352 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_toupper(char_type) const;
# 1369 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_toupper(char_type* __lo, const char_type* __hi) const;
# 1385 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_tolower(char_type) const;
# 1402 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_tolower(char_type* __lo, const char_type* __hi) const;
# 1422 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_widen(char) const;
# 1444 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char*
      do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
# 1467 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char
      do_narrow(char_type, char __dfault) const;
# 1493 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual const char_type*
      do_narrow(const char_type* __lo, const char_type* __hi,
  char __dfault, char* __dest) const;


      void
      _M_initialize_ctype();
    };

  template<>
    const ctype<wchar_t>&
    use_facet<ctype<wchar_t> >(const locale& __loc);



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/ctype_inline.h" 1 3
# 37 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/ctype_inline.h" 3
  bool
  ctype<char>::
  is(mask __m, char __c) const
  { return _M_table[static_cast<unsigned char>(__c)] & __m; }

  const char*
  ctype<char>::
  is(const char* __low, const char* __high, mask* __vec) const
  {
    while (__low < __high)
      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
    return __high;
  }

  const char*
  ctype<char>::
  scan_is(mask __m, const char* __low, const char* __high) const
  {
    while (__low < __high
    && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
      ++__low;
    return __low;
  }

  const char*
  ctype<char>::
  scan_not(mask __m, const char* __low, const char* __high) const
  {
    while (__low < __high
    && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
      ++__low;
    return __low;
  }
# 1509 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 2 3


  template<typename _CharT>
    class ctype_byname : public ctype<_CharT>
    {
    public:
      typedef _CharT char_type;

      explicit
      ctype_byname(const char* __s, size_t __refs = 0);

    protected:
      virtual
      ~ctype_byname() { };
    };


  template<>
    ctype_byname<char>::ctype_byname(const char*, size_t refs);

  template<>
    ctype_byname<wchar_t>::ctype_byname(const char*, size_t refs);


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 1 3
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3
       
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3



  class codecvt_base
  {
  public:
    enum result
    {
      ok,
      partial,
      error,
      noconv
    };
  };
# 73 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3
  template<typename _InternT, typename _ExternT, typename _StateT>
    class __codecvt_abstract_base
    : public locale::facet, public codecvt_base
    {
    public:

      typedef codecvt_base::result result;
      typedef _InternT intern_type;
      typedef _ExternT extern_type;
      typedef _StateT state_type;
# 120 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3
      result
      out(state_type& __state, const intern_type* __from,
   const intern_type* __from_end, const intern_type*& __from_next,
   extern_type* __to, extern_type* __to_end,
   extern_type*& __to_next) const
      {
 return this->do_out(__state, __from, __from_end, __from_next,
       __to, __to_end, __to_next);
      }
# 159 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3
      result
      unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
       extern_type*& __to_next) const
      { return this->do_unshift(__state, __to,__to_end,__to_next); }
# 199 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3
      result
      in(state_type& __state, const extern_type* __from,
  const extern_type* __from_end, const extern_type*& __from_next,
  intern_type* __to, intern_type* __to_end,
  intern_type*& __to_next) const
      {
 return this->do_in(__state, __from, __from_end, __from_next,
      __to, __to_end, __to_next);
      }

      int
      encoding() const throw()
      { return this->do_encoding(); }

      bool
      always_noconv() const throw()
      { return this->do_always_noconv(); }

      int
      length(state_type& __state, const extern_type* __from,
      const extern_type* __end, size_t __max) const
      { return this->do_length(__state, __from, __end, __max); }

      int
      max_length() const throw()
      { return this->do_max_length(); }

    protected:
      explicit
      __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }

      virtual
      ~__codecvt_abstract_base() { }
# 240 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 3
      virtual result
      do_out(state_type& __state, const intern_type* __from,
      const intern_type* __from_end, const intern_type*& __from_next,
      extern_type* __to, extern_type* __to_end,
      extern_type*& __to_next) const = 0;

      virtual result
      do_unshift(state_type& __state, extern_type* __to,
   extern_type* __to_end, extern_type*& __to_next) const = 0;

      virtual result
      do_in(state_type& __state, const extern_type* __from,
     const extern_type* __from_end, const extern_type*& __from_next,
     intern_type* __to, intern_type* __to_end,
     intern_type*& __to_next) const = 0;

      virtual int
      do_encoding() const throw() = 0;

      virtual bool
      do_always_noconv() const throw() = 0;

      virtual int
      do_length(state_type&, const extern_type* __from,
  const extern_type* __end, size_t __max) const = 0;

      virtual int
      do_max_length() const throw() = 0;
    };



  template<typename _InternT, typename _ExternT, typename _StateT>
    class codecvt
    : public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
    {
    public:

      typedef codecvt_base::result result;
      typedef _InternT intern_type;
      typedef _ExternT extern_type;
      typedef _StateT state_type;

    protected:
      __c_locale _M_c_locale_codecvt;

    public:
      static locale::id id;

      explicit
      codecvt(size_t __refs = 0)
      : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { }

      explicit
      codecvt(__c_locale __cloc, size_t __refs = 0);

    protected:
      virtual
      ~codecvt() { }

      virtual result
      do_out(state_type& __state, const intern_type* __from,
      const intern_type* __from_end, const intern_type*& __from_next,
      extern_type* __to, extern_type* __to_end,
      extern_type*& __to_next) const;

      virtual result
      do_unshift(state_type& __state, extern_type* __to,
   extern_type* __to_end, extern_type*& __to_next) const;

      virtual result
      do_in(state_type& __state, const extern_type* __from,
     const extern_type* __from_end, const extern_type*& __from_next,
     intern_type* __to, intern_type* __to_end,
     intern_type*& __to_next) const;

      virtual int
      do_encoding() const throw();

      virtual bool
      do_always_noconv() const throw();

      virtual int
      do_length(state_type&, const extern_type* __from,
  const extern_type* __end, size_t __max) const;

      virtual int
      do_max_length() const throw();
    };

  template<typename _InternT, typename _ExternT, typename _StateT>
    locale::id codecvt<_InternT, _ExternT, _StateT>::id;


  template<>
    class codecvt<char, char, mbstate_t>
    : public __codecvt_abstract_base<char, char, mbstate_t>
    {
    public:

      typedef char intern_type;
      typedef char extern_type;
      typedef mbstate_t state_type;

    protected:
      __c_locale _M_c_locale_codecvt;

    public:
      static locale::id id;

      explicit
      codecvt(size_t __refs = 0);

      explicit
      codecvt(__c_locale __cloc, size_t __refs = 0);

    protected:
      virtual
      ~codecvt();

      virtual result
      do_out(state_type& __state, const intern_type* __from,
      const intern_type* __from_end, const intern_type*& __from_next,
      extern_type* __to, extern_type* __to_end,
      extern_type*& __to_next) const;

      virtual result
      do_unshift(state_type& __state, extern_type* __to,
   extern_type* __to_end, extern_type*& __to_next) const;

      virtual result
      do_in(state_type& __state, const extern_type* __from,
     const extern_type* __from_end, const extern_type*& __from_next,
     intern_type* __to, intern_type* __to_end,
     intern_type*& __to_next) const;

      virtual int
      do_encoding() const throw();

      virtual bool
      do_always_noconv() const throw();

      virtual int
      do_length(state_type&, const extern_type* __from,
  const extern_type* __end, size_t __max) const;

      virtual int
      do_max_length() const throw();
  };



  template<>
    class codecvt<wchar_t, char, mbstate_t>
    : public __codecvt_abstract_base<wchar_t, char, mbstate_t>
    {
    public:

      typedef wchar_t intern_type;
      typedef char extern_type;
      typedef mbstate_t state_type;

    protected:
      __c_locale _M_c_locale_codecvt;

    public:
      static locale::id id;

      explicit
      codecvt(size_t __refs = 0);

      explicit
      codecvt(__c_locale __cloc, size_t __refs = 0);

    protected:
      virtual
      ~codecvt();

      virtual result
      do_out(state_type& __state, const intern_type* __from,
      const intern_type* __from_end, const intern_type*& __from_next,
      extern_type* __to, extern_type* __to_end,
      extern_type*& __to_next) const;

      virtual result
      do_unshift(state_type& __state,
   extern_type* __to, extern_type* __to_end,
   extern_type*& __to_next) const;

      virtual result
      do_in(state_type& __state,
      const extern_type* __from, const extern_type* __from_end,
      const extern_type*& __from_next,
      intern_type* __to, intern_type* __to_end,
      intern_type*& __to_next) const;

      virtual
      int do_encoding() const throw();

      virtual
      bool do_always_noconv() const throw();

      virtual
      int do_length(state_type&, const extern_type* __from,
      const extern_type* __end, size_t __max) const;

      virtual int
      do_max_length() const throw();
    };



  template<typename _InternT, typename _ExternT, typename _StateT>
    class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
    {
    public:
      explicit
      codecvt_byname(const char* __s, size_t __refs = 0)
      : codecvt<_InternT, _ExternT, _StateT>(__refs)
      {
 if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
   {
     this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
     this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
   }
      }

    protected:
      virtual
      ~codecvt_byname() { }
    };




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/codecvt_specializations.h" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/codecvt_specializations.h" 3
  class __enc_traits
  {
  public:



    typedef iconv_t __desc_type;

  protected:


    static const int _S_max_size = 32;

    char _M_int_enc[_S_max_size];

    char _M_ext_enc[_S_max_size];


    __desc_type _M_in_desc;

    __desc_type _M_out_desc;


    int _M_ext_bom;


    int _M_int_bom;

  public:
    explicit __enc_traits()
    : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
    {
      memset(_M_int_enc, 0, _S_max_size);
      memset(_M_ext_enc, 0, _S_max_size);
    }

    explicit __enc_traits(const char* __int, const char* __ext,
     int __ibom = 0, int __ebom = 0)
    : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(__ebom), _M_int_bom(__ibom)
    {
      strncpy(_M_int_enc, __int, _S_max_size);
      strncpy(_M_ext_enc, __ext, _S_max_size);
      _M_init();
    }
# 99 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/codecvt_specializations.h" 3
    __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
    {
      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
      _M_ext_bom = __obj._M_ext_bom;
      _M_int_bom = __obj._M_int_bom;
      _M_destroy();
      _M_init();
    }


    __enc_traits&
    operator=(const __enc_traits& __obj)
    {
      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
      _M_ext_bom = __obj._M_ext_bom;
      _M_int_bom = __obj._M_int_bom;
      _M_destroy();
      _M_init();
      return *this;
    }

    ~__enc_traits()
    { _M_destroy(); }

    void
    _M_init()
    {
      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
      if (!_M_in_desc)
 {
   _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
   if (_M_in_desc == __err)
     __throw_runtime_error(("__enc_traits::_M_init " "creating iconv input descriptor failed"));

 }
      if (!_M_out_desc)
 {
   _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
   if (_M_out_desc == __err)
     __throw_runtime_error(("__enc_traits::_M_init " "creating iconv output descriptor failed"));

 }
    }

    void
    _M_destroy()
    {
      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
      if (_M_in_desc && _M_in_desc != __err)
 {
   iconv_close(_M_in_desc);
   _M_in_desc = 0;
 }
      if (_M_out_desc && _M_out_desc != __err)
 {
   iconv_close(_M_out_desc);
   _M_out_desc = 0;
 }
    }

    bool
    _M_good()
    {
      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
      bool __test = _M_in_desc && _M_in_desc != __err;
      __test &= _M_out_desc && _M_out_desc != __err;
      return __test;
    }

    const __desc_type*
    _M_get_in_descriptor()
    { return &_M_in_desc; }

    const __desc_type*
    _M_get_out_descriptor()
    { return &_M_out_desc; }

    int
    _M_get_external_bom()
    { return _M_ext_bom; }

    int
    _M_get_internal_bom()
    { return _M_int_bom; }

    const char*
    _M_get_internal_enc()
    { return _M_int_enc; }

    const char*
    _M_get_external_enc()
    { return _M_ext_enc; }
  };




  template<typename _InternT, typename _ExternT>
    class codecvt<_InternT, _ExternT, __enc_traits>
    : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
    {
    public:

      typedef codecvt_base::result result;
      typedef _InternT intern_type;
      typedef _ExternT extern_type;
      typedef __enc_traits state_type;
      typedef __enc_traits::__desc_type __desc_type;
      typedef __enc_traits __enc_type;


      static locale::id id;

      explicit
      codecvt(size_t __refs = 0)
      : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
      { }

      explicit
      codecvt(__enc_type* __enc, size_t __refs = 0)
      : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
      { }

    protected:
      virtual
      ~codecvt() { }

      virtual result
      do_out(state_type& __state, const intern_type* __from,
      const intern_type* __from_end, const intern_type*& __from_next,
      extern_type* __to, extern_type* __to_end,
      extern_type*& __to_next) const;

      virtual result
      do_unshift(state_type& __state, extern_type* __to,
   extern_type* __to_end, extern_type*& __to_next) const;

      virtual result
      do_in(state_type& __state, const extern_type* __from,
     const extern_type* __from_end, const extern_type*& __from_next,
     intern_type* __to, intern_type* __to_end,
     intern_type*& __to_next) const;

      virtual int
      do_encoding() const throw();

      virtual bool
      do_always_noconv() const throw();

      virtual int
      do_length(state_type&, const extern_type* __from,
  const extern_type* __end, size_t __max) const;

      virtual int
      do_max_length() const throw();
    };

  template<typename _InternT, typename _ExternT>
    locale::id
    codecvt<_InternT, _ExternT, __enc_traits>::id;





  template<typename _T>
    inline size_t
    __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
                    iconv_t __cd, char** __inbuf, size_t* __inbytes,
                    char** __outbuf, size_t* __outbytes)
    { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }

  template<typename _InternT, typename _ExternT>
    codecvt_base::result
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_out(state_type& __state, const intern_type* __from,
    const intern_type* __from_end, const intern_type*& __from_next,
    extern_type* __to, extern_type* __to_end,
    extern_type*& __to_next) const
    {
      result __ret = codecvt_base::error;
      if (__state._M_good())
 {
   const __desc_type* __desc = __state._M_get_out_descriptor();
   const size_t __fmultiple = sizeof(intern_type);
   size_t __fbytes = __fmultiple * (__from_end - __from);
   const size_t __tmultiple = sizeof(extern_type);
   size_t __tbytes = __tmultiple * (__to_end - __to);



   char* __cto = reinterpret_cast<char*>(__to);
   char* __cfrom;
   size_t __conv;






   int __int_bom = __state._M_get_internal_bom();
   if (__int_bom)
     {
       size_t __size = __from_end - __from;
       intern_type* __cfixed = static_cast<intern_type*>
  (__builtin_alloca(sizeof(intern_type) * (__size + 1)));
       __cfixed[0] = static_cast<intern_type>(__int_bom);
       char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
       __cfrom = reinterpret_cast<char*>(__cfixed);
       __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
                                        &__fbytes, &__cto, &__tbytes);
     }
   else
     {
       intern_type* __cfixed = const_cast<intern_type*>(__from);
       __cfrom = reinterpret_cast<char*>(__cfixed);
       __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes,
           &__cto, &__tbytes);
     }

   if (__conv != size_t(-1))
     {
       __from_next = reinterpret_cast<const intern_type*>(__cfrom);
       __to_next = reinterpret_cast<extern_type*>(__cto);
       __ret = codecvt_base::ok;
     }
   else
     {
       if (__fbytes < __fmultiple * (__from_end - __from))
  {
    __from_next = reinterpret_cast<const intern_type*>(__cfrom);
    __to_next = reinterpret_cast<extern_type*>(__cto);
    __ret = codecvt_base::partial;
  }
       else
  __ret = codecvt_base::error;
     }
 }
      return __ret;
    }

  template<typename _InternT, typename _ExternT>
    codecvt_base::result
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_unshift(state_type& __state, extern_type* __to,
        extern_type* __to_end, extern_type*& __to_next) const
    {
      result __ret = codecvt_base::error;
      if (__state._M_good())
 {
   const __desc_type* __desc = __state._M_get_in_descriptor();
   const size_t __tmultiple = sizeof(intern_type);
   size_t __tlen = __tmultiple * (__to_end - __to);



   char* __cto = reinterpret_cast<char*>(__to);
   size_t __conv = __iconv_adaptor(iconv,*__desc, __null, __null,
                                          &__cto, &__tlen);

   if (__conv != size_t(-1))
     {
       __to_next = reinterpret_cast<extern_type*>(__cto);
       if (__tlen == __tmultiple * (__to_end - __to))
  __ret = codecvt_base::noconv;
       else if (__tlen == 0)
  __ret = codecvt_base::ok;
       else
  __ret = codecvt_base::partial;
     }
   else
     __ret = codecvt_base::error;
 }
      return __ret;
    }

  template<typename _InternT, typename _ExternT>
    codecvt_base::result
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_in(state_type& __state, const extern_type* __from,
   const extern_type* __from_end, const extern_type*& __from_next,
   intern_type* __to, intern_type* __to_end,
   intern_type*& __to_next) const
    {
      result __ret = codecvt_base::error;
      if (__state._M_good())
 {
   const __desc_type* __desc = __state._M_get_in_descriptor();
   const size_t __fmultiple = sizeof(extern_type);
   size_t __flen = __fmultiple * (__from_end - __from);
   const size_t __tmultiple = sizeof(intern_type);
   size_t __tlen = __tmultiple * (__to_end - __to);



   char* __cto = reinterpret_cast<char*>(__to);
   char* __cfrom;
   size_t __conv;






   int __ext_bom = __state._M_get_external_bom();
   if (__ext_bom)
     {
       size_t __size = __from_end - __from;
       extern_type* __cfixed = static_cast<extern_type*>
  (__builtin_alloca(sizeof(extern_type) * (__size + 1)));
       __cfixed[0] = static_cast<extern_type>(__ext_bom);
       char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
       __cfrom = reinterpret_cast<char*>(__cfixed);
       __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
                                       &__flen, &__cto, &__tlen);
     }
   else
     {
       extern_type* __cfixed = const_cast<extern_type*>(__from);
       __cfrom = reinterpret_cast<char*>(__cfixed);
       __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
                                       &__flen, &__cto, &__tlen);
     }


   if (__conv != size_t(-1))
     {
       __from_next = reinterpret_cast<const extern_type*>(__cfrom);
       __to_next = reinterpret_cast<intern_type*>(__cto);
       __ret = codecvt_base::ok;
     }
   else
     {
       if (__flen < static_cast<size_t>(__from_end - __from))
  {
    __from_next = reinterpret_cast<const extern_type*>(__cfrom);
    __to_next = reinterpret_cast<intern_type*>(__cto);
    __ret = codecvt_base::partial;
  }
       else
  __ret = codecvt_base::error;
     }
 }
      return __ret;
    }

  template<typename _InternT, typename _ExternT>
    int
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_encoding() const throw()
    {
      int __ret = 0;
      if (sizeof(_ExternT) <= sizeof(_InternT))
 __ret = sizeof(_InternT)/sizeof(_ExternT);
      return __ret;
    }

  template<typename _InternT, typename _ExternT>
    bool
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_always_noconv() const throw()
    { return false; }

  template<typename _InternT, typename _ExternT>
    int
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_length(state_type&, const extern_type* __from,
       const extern_type* __end, size_t __max) const
    { return std::min(__max, static_cast<size_t>(__end - __from)); }



  template<typename _InternT, typename _ExternT>
    int
    codecvt<_InternT, _ExternT, __enc_traits>::
    do_max_length() const throw()
    { return 1; }
# 476 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/codecvt.h" 2 3
# 1534 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 2 3


  class __num_base
  {
  public:


    enum
      {
        _S_ominus,
        _S_oplus,
        _S_ox,
        _S_oX,
        _S_odigits,
        _S_odigits_end = _S_odigits + 16,
        _S_oudigits = _S_odigits_end,
        _S_oudigits_end = _S_oudigits + 16,
        _S_oe = _S_odigits + 14,
        _S_oE = _S_oudigits + 14,
 _S_oend = _S_oudigits_end
      };






    static const char* _S_atoms_out;



    static const char* _S_atoms_in;

    enum
    {
      _S_iminus,
      _S_iplus,
      _S_ix,
      _S_iX,
      _S_izero,
      _S_ie = _S_izero + 14,
      _S_iE = _S_izero + 20,
      _S_iend = 26
    };



    static void
    _S_format_float(const ios_base& __io, char* __fptr, char __mod);
  };

  template<typename _CharT>
    struct __numpunct_cache : public locale::facet
    {
      const char* _M_grouping;
      size_t _M_grouping_size;
      bool _M_use_grouping;
      const _CharT* _M_truename;
      size_t _M_truename_size;
      const _CharT* _M_falsename;
      size_t _M_falsename_size;
      _CharT _M_decimal_point;
      _CharT _M_thousands_sep;





      _CharT _M_atoms_out[__num_base::_S_oend];





      _CharT _M_atoms_in[__num_base::_S_iend];

      bool _M_allocated;

      __numpunct_cache(size_t __refs = 0) : facet(__refs),
      _M_grouping(__null), _M_grouping_size(0), _M_use_grouping(false),
      _M_truename(__null), _M_truename_size(0), _M_falsename(__null),
      _M_falsename_size(0), _M_decimal_point(_CharT()),
      _M_thousands_sep(_CharT()), _M_allocated(false)
      { }

      ~__numpunct_cache();

      void
      _M_cache(const locale& __loc);

    private:
      __numpunct_cache&
      operator=(const __numpunct_cache&);

      explicit
      __numpunct_cache(const __numpunct_cache&);
    };

  template<typename _CharT>
    __numpunct_cache<_CharT>::~__numpunct_cache()
    {
      if (_M_allocated)
 {
   delete [] _M_grouping;
   delete [] _M_truename;
   delete [] _M_falsename;
 }
    }
# 1656 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT>
    class numpunct : public locale::facet
    {
    public:



      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;

      typedef __numpunct_cache<_CharT> __cache_type;

    protected:
      __cache_type* _M_data;

    public:

      static locale::id id;






      explicit
      numpunct(size_t __refs = 0) : facet(__refs), _M_data(__null)
      { _M_initialize_numpunct(); }
# 1693 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      numpunct(__cache_type* __cache, size_t __refs = 0)
      : facet(__refs), _M_data(__cache)
      { _M_initialize_numpunct(); }
# 1707 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      numpunct(__c_locale __cloc, size_t __refs = 0)
      : facet(__refs), _M_data(__null)
      { _M_initialize_numpunct(__cloc); }
# 1721 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      decimal_point() const
      { return this->do_decimal_point(); }
# 1734 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      thousands_sep() const
      { return this->do_thousands_sep(); }
# 1765 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string
      grouping() const
      { return this->do_grouping(); }
# 1778 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      truename() const
      { return this->do_truename(); }
# 1791 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      falsename() const
      { return this->do_falsename(); }

    protected:

      virtual
      ~numpunct();
# 1808 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_decimal_point() const
      { return _M_data->_M_decimal_point; }
# 1820 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_thousands_sep() const
      { return _M_data->_M_thousands_sep; }
# 1833 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string
      do_grouping() const
      { return _M_data->_M_grouping; }
# 1846 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_truename() const
      { return _M_data->_M_truename; }
# 1859 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_falsename() const
      { return _M_data->_M_falsename; }


      void
      _M_initialize_numpunct(__c_locale __cloc = __null);
    };

  template<typename _CharT>
    locale::id numpunct<_CharT>::id;

  template<>
    numpunct<char>::~numpunct();

  template<>
    void
    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);


  template<>
    numpunct<wchar_t>::~numpunct();

  template<>
    void
    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);


  template<typename _CharT>
    class numpunct_byname : public numpunct<_CharT>
    {
    public:
      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;

      explicit
      numpunct_byname(const char* __s, size_t __refs = 0)
      : numpunct<_CharT>(__refs)
      {
 if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
   {
     __c_locale __tmp;
     this->_S_create_c_locale(__tmp, __s);
     this->_M_initialize_numpunct(__tmp);
     this->_S_destroy_c_locale(__tmp);
   }
      }

    protected:
      virtual
      ~numpunct_byname() { }
    };
# 1924 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT, typename _InIter>
    class num_get : public locale::facet
    {
    public:



      typedef _CharT char_type;
      typedef _InIter iter_type;



      static locale::id id;
# 1945 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      num_get(size_t __refs = 0) : facet(__refs) { }
# 1971 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, bool& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }
# 2007 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, long& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, unsigned short& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, unsigned int& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, unsigned long& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }


      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, long long& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, unsigned long long& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }
# 2066 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, float& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, double& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, long double& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }
# 2108 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get(iter_type __in, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, void*& __v) const
      { return this->do_get(__in, __end, __io, __err, __v); }

    protected:

      virtual ~num_get() { }

      iter_type
      _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
         string& __xtrc) const;

      template<typename _ValueT>
        iter_type
        _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
         _ValueT& __v) const;
# 2141 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;


      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
       unsigned short&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      unsigned int&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      unsigned long&) const;


      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      long long&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      unsigned long long&) const;


      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      float&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      double&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      long double&) const;

      virtual iter_type
      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
      void*&) const;

    };

  template<typename _CharT, typename _InIter>
    locale::id num_get<_CharT, _InIter>::id;
# 2203 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT, typename _OutIter>
    class num_put : public locale::facet
    {
    public:



      typedef _CharT char_type;
      typedef _OutIter iter_type;



      static locale::id id;
# 2224 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      num_put(size_t __refs = 0) : facet(__refs) { }
# 2242 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
      { return this->do_put(__s, __f, __fill, __v); }
# 2284 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
      { return this->do_put(__s, __f, __fill, __v); }

      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill,
   unsigned long __v) const
      { return this->do_put(__s, __f, __fill, __v); }


      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
      { return this->do_put(__s, __f, __fill, __v); }

      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill,
   unsigned long long __v) const
      { return this->do_put(__s, __f, __fill, __v); }
# 2347 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
      { return this->do_put(__s, __f, __fill, __v); }

      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill,
   long double __v) const
      { return this->do_put(__s, __f, __fill, __v); }
# 2372 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, ios_base& __f, char_type __fill,
   const void* __v) const
      { return this->do_put(__s, __f, __fill, __v); }

    protected:
      template<typename _ValueT>
        iter_type
        _M_insert_float(iter_type, ios_base& __io, char_type __fill,
   char __mod, _ValueT __v) const;

      void
      _M_group_float(const char* __grouping, size_t __grouping_size,
       char_type __sep, const char_type* __p, char_type* __new,
       char_type* __cs, int& __len) const;

      template<typename _ValueT>
        iter_type
        _M_insert_int(iter_type, ios_base& __io, char_type __fill,
        _ValueT __v) const;

      void
      _M_group_int(const char* __grouping, size_t __grouping_size,
     char_type __sep, ios_base& __io, char_type* __new,
     char_type* __cs, int& __len) const;

      void
      _M_pad(char_type __fill, streamsize __w, ios_base& __io,
      char_type* __new, const char_type* __cs, int& __len) const;


      virtual
      ~num_put() { };
# 2420 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, bool __v) const;

      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, long __v) const;

      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, unsigned long) const;


      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, long long __v) const;

      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const;


      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, double __v) const;

      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, long double __v) const;

      virtual iter_type
      do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;

    };

  template <typename _CharT, typename _OutIter>
    locale::id num_put<_CharT, _OutIter>::id;
# 2464 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT>
    class collate : public locale::facet
    {
    public:



      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;


    protected:


      __c_locale _M_c_locale_collate;

    public:

      static locale::id id;
# 2491 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      collate(size_t __refs = 0)
      : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
      { }
# 2505 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      collate(__c_locale __cloc, size_t __refs = 0)
      : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
      { }
# 2522 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      int
      compare(const _CharT* __lo1, const _CharT* __hi1,
       const _CharT* __lo2, const _CharT* __hi2) const
      { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
# 2541 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      transform(const _CharT* __lo, const _CharT* __hi) const
      { return this->do_transform(__lo, __hi); }
# 2555 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      long
      hash(const _CharT* __lo, const _CharT* __hi) const
      { return this->do_hash(__lo, __hi); }


      int
      _M_compare(const _CharT*, const _CharT*) const;

      size_t
      _M_transform(_CharT*, const _CharT*, size_t) const;

  protected:

      virtual
      ~collate()
      { _S_destroy_c_locale(_M_c_locale_collate); }
# 2584 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual int
      do_compare(const _CharT* __lo1, const _CharT* __hi1,
   const _CharT* __lo2, const _CharT* __hi2) const;
# 2600 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_transform(const _CharT* __lo, const _CharT* __hi) const;
# 2613 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual long
      do_hash(const _CharT* __lo, const _CharT* __hi) const;
    };

  template<typename _CharT>
    locale::id collate<_CharT>::id;


  template<>
    int
    collate<char>::_M_compare(const char*, const char*) const;

  template<>
    size_t
    collate<char>::_M_transform(char*, const char*, size_t) const;


  template<>
    int
    collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const;

  template<>
    size_t
    collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const;


  template<typename _CharT>
    class collate_byname : public collate<_CharT>
    {
    public:


      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;


      explicit
      collate_byname(const char* __s, size_t __refs = 0)
      : collate<_CharT>(__refs)
      {
 if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
   {
     this->_S_destroy_c_locale(this->_M_c_locale_collate);
     this->_S_create_c_locale(this->_M_c_locale_collate, __s);
   }
      }

    protected:
      virtual
      ~collate_byname() { }
    };
# 2672 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  class time_base
  {
  public:
    enum dateorder { no_order, dmy, mdy, ymd, ydm };
  };

  template<typename _CharT>
    struct __timepunct_cache : public locale::facet
    {

      static const _CharT* _S_timezones[14];

      const _CharT* _M_date_format;
      const _CharT* _M_date_era_format;
      const _CharT* _M_time_format;
      const _CharT* _M_time_era_format;
      const _CharT* _M_date_time_format;
      const _CharT* _M_date_time_era_format;
      const _CharT* _M_am;
      const _CharT* _M_pm;
      const _CharT* _M_am_pm_format;


      const _CharT* _M_day1;
      const _CharT* _M_day2;
      const _CharT* _M_day3;
      const _CharT* _M_day4;
      const _CharT* _M_day5;
      const _CharT* _M_day6;
      const _CharT* _M_day7;


      const _CharT* _M_aday1;
      const _CharT* _M_aday2;
      const _CharT* _M_aday3;
      const _CharT* _M_aday4;
      const _CharT* _M_aday5;
      const _CharT* _M_aday6;
      const _CharT* _M_aday7;


      const _CharT* _M_month01;
      const _CharT* _M_month02;
      const _CharT* _M_month03;
      const _CharT* _M_month04;
      const _CharT* _M_month05;
      const _CharT* _M_month06;
      const _CharT* _M_month07;
      const _CharT* _M_month08;
      const _CharT* _M_month09;
      const _CharT* _M_month10;
      const _CharT* _M_month11;
      const _CharT* _M_month12;


      const _CharT* _M_amonth01;
      const _CharT* _M_amonth02;
      const _CharT* _M_amonth03;
      const _CharT* _M_amonth04;
      const _CharT* _M_amonth05;
      const _CharT* _M_amonth06;
      const _CharT* _M_amonth07;
      const _CharT* _M_amonth08;
      const _CharT* _M_amonth09;
      const _CharT* _M_amonth10;
      const _CharT* _M_amonth11;
      const _CharT* _M_amonth12;

      bool _M_allocated;

      __timepunct_cache(size_t __refs = 0) : facet(__refs),
      _M_date_format(__null), _M_date_era_format(__null), _M_time_format(__null),
      _M_time_era_format(__null), _M_date_time_format(__null),
      _M_date_time_era_format(__null), _M_am(__null), _M_pm(__null),
      _M_am_pm_format(__null), _M_day1(__null), _M_day2(__null), _M_day3(__null),
      _M_day4(__null), _M_day5(__null), _M_day6(__null), _M_day7(__null),
      _M_aday1(__null), _M_aday2(__null), _M_aday3(__null), _M_aday4(__null),
      _M_aday5(__null), _M_aday6(__null), _M_aday7(__null), _M_month01(__null),
      _M_month02(__null), _M_month03(__null), _M_month04(__null), _M_month05(__null),
      _M_month06(__null), _M_month07(__null), _M_month08(__null), _M_month09(__null),
      _M_month10(__null), _M_month11(__null), _M_month12(__null), _M_amonth01(__null),
      _M_amonth02(__null), _M_amonth03(__null), _M_amonth04(__null),
      _M_amonth05(__null), _M_amonth06(__null), _M_amonth07(__null),
      _M_amonth08(__null), _M_amonth09(__null), _M_amonth10(__null),
      _M_amonth11(__null), _M_amonth12(__null), _M_allocated(false)
      { }

      ~__timepunct_cache();

      void
      _M_cache(const locale& __loc);

    private:
      __timepunct_cache&
      operator=(const __timepunct_cache&);

      explicit
      __timepunct_cache(const __timepunct_cache&);
    };

  template<typename _CharT>
    __timepunct_cache<_CharT>::~__timepunct_cache()
    {
      if (_M_allocated)
 {

 }
    }


  template<>
    const char*
    __timepunct_cache<char>::_S_timezones[14];


  template<>
    const wchar_t*
    __timepunct_cache<wchar_t>::_S_timezones[14];



  template<typename _CharT>
    const _CharT* __timepunct_cache<_CharT>::_S_timezones[14];

  template<typename _CharT>
    class __timepunct : public locale::facet
    {
    public:

      typedef _CharT __char_type;
      typedef basic_string<_CharT> __string_type;
      typedef __timepunct_cache<_CharT> __cache_type;

    protected:
      __cache_type* _M_data;
      __c_locale _M_c_locale_timepunct;
      const char* _M_name_timepunct;

    public:

      static locale::id id;

      explicit
      __timepunct(size_t __refs = 0);

      explicit
      __timepunct(__cache_type* __cache, size_t __refs = 0);
# 2830 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);

      void
      _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
      const tm* __tm) const;

      void
      _M_date_formats(const _CharT** __date) const
      {

 __date[0] = _M_data->_M_date_format;
 __date[1] = _M_data->_M_date_era_format;
      }

      void
      _M_time_formats(const _CharT** __time) const
      {

 __time[0] = _M_data->_M_time_format;
 __time[1] = _M_data->_M_time_era_format;
      }

      void
      _M_date_time_formats(const _CharT** __dt) const
      {

 __dt[0] = _M_data->_M_date_time_format;
 __dt[1] = _M_data->_M_date_time_era_format;
      }

      void
      _M_am_pm_format(const _CharT* __ampm) const
      { __ampm = _M_data->_M_am_pm_format; }

      void
      _M_am_pm(const _CharT** __ampm) const
      {
 __ampm[0] = _M_data->_M_am;
 __ampm[1] = _M_data->_M_pm;
      }

      void
      _M_days(const _CharT** __days) const
      {
 __days[0] = _M_data->_M_day1;
 __days[1] = _M_data->_M_day2;
 __days[2] = _M_data->_M_day3;
 __days[3] = _M_data->_M_day4;
 __days[4] = _M_data->_M_day5;
 __days[5] = _M_data->_M_day6;
 __days[6] = _M_data->_M_day7;
      }

      void
      _M_days_abbreviated(const _CharT** __days) const
      {
 __days[0] = _M_data->_M_aday1;
 __days[1] = _M_data->_M_aday2;
 __days[2] = _M_data->_M_aday3;
 __days[3] = _M_data->_M_aday4;
 __days[4] = _M_data->_M_aday5;
 __days[5] = _M_data->_M_aday6;
 __days[6] = _M_data->_M_aday7;
      }

      void
      _M_months(const _CharT** __months) const
      {
 __months[0] = _M_data->_M_month01;
 __months[1] = _M_data->_M_month02;
 __months[2] = _M_data->_M_month03;
 __months[3] = _M_data->_M_month04;
 __months[4] = _M_data->_M_month05;
 __months[5] = _M_data->_M_month06;
 __months[6] = _M_data->_M_month07;
 __months[7] = _M_data->_M_month08;
 __months[8] = _M_data->_M_month09;
 __months[9] = _M_data->_M_month10;
 __months[10] = _M_data->_M_month11;
 __months[11] = _M_data->_M_month12;
      }

      void
      _M_months_abbreviated(const _CharT** __months) const
      {
 __months[0] = _M_data->_M_amonth01;
 __months[1] = _M_data->_M_amonth02;
 __months[2] = _M_data->_M_amonth03;
 __months[3] = _M_data->_M_amonth04;
 __months[4] = _M_data->_M_amonth05;
 __months[5] = _M_data->_M_amonth06;
 __months[6] = _M_data->_M_amonth07;
 __months[7] = _M_data->_M_amonth08;
 __months[8] = _M_data->_M_amonth09;
 __months[9] = _M_data->_M_amonth10;
 __months[10] = _M_data->_M_amonth11;
 __months[11] = _M_data->_M_amonth12;
      }

    protected:
      virtual
      ~__timepunct();


      void
      _M_initialize_timepunct(__c_locale __cloc = __null);
    };

  template<typename _CharT>
    locale::id __timepunct<_CharT>::id;


  template<>
    void
    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);

  template<>
    void
    __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;


  template<>
    void
    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);

  template<>
    void
    __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*,
     const tm*) const;



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/time_members.h" 1 3
# 37 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/time_members.h" 3
  template<typename _CharT>
    __timepunct<_CharT>::__timepunct(size_t __refs)
    : facet(__refs), _M_data(__null), _M_c_locale_timepunct(__null),
    _M_name_timepunct(_S_get_c_name())
    { _M_initialize_timepunct(); }

  template<typename _CharT>
    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(__null),
    _M_name_timepunct(_S_get_c_name())
    { _M_initialize_timepunct(); }

  template<typename _CharT>
    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
         size_t __refs)
    : facet(__refs), _M_data(__null), _M_c_locale_timepunct(__null),
    _M_name_timepunct(__s)
    {
      char* __tmp = new char[std::strlen(__s) + 1];
      std::strcpy(__tmp, __s);
      _M_name_timepunct = __tmp;
      _M_initialize_timepunct(__cloc);
    }

  template<typename _CharT>
    __timepunct<_CharT>::~__timepunct()
    {
      if (_M_name_timepunct != _S_get_c_name())
 delete [] _M_name_timepunct;
      delete _M_data;
      _S_destroy_c_locale(_M_c_locale_timepunct);
    }
# 2964 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 2 3
# 2977 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT, typename _InIter>
    class time_get : public locale::facet, public time_base
    {
    public:



      typedef _CharT char_type;
      typedef _InIter iter_type;

      typedef basic_string<_CharT> __string_type;


      static locale::id id;
# 2999 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      time_get(size_t __refs = 0)
      : facet (__refs) { }
# 3016 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      dateorder
      date_order() const
      { return this->do_date_order(); }
# 3040 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get_time(iter_type __beg, iter_type __end, ios_base& __io,
        ios_base::iostate& __err, tm* __tm) const
      { return this->do_get_time(__beg, __end, __io, __err, __tm); }
# 3065 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get_date(iter_type __beg, iter_type __end, ios_base& __io,
        ios_base::iostate& __err, tm* __tm) const
      { return this->do_get_date(__beg, __end, __io, __err, __tm); }
# 3093 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
    ios_base::iostate& __err, tm* __tm) const
      { return this->do_get_weekday(__beg, __end, __io, __err, __tm); }
# 3122 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get_monthname(iter_type __beg, iter_type __end, ios_base& __io,
      ios_base::iostate& __err, tm* __tm) const
      { return this->do_get_monthname(__beg, __end, __io, __err, __tm); }
# 3148 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get_year(iter_type __beg, iter_type __end, ios_base& __io,
        ios_base::iostate& __err, tm* __tm) const
      { return this->do_get_year(__beg, __end, __io, __err, __tm); }

    protected:

      virtual
      ~time_get() { }
# 3168 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual dateorder
      do_date_order() const;
# 3186 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
    ios_base::iostate& __err, tm* __tm) const;
# 3205 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
    ios_base::iostate& __err, tm* __tm) const;
# 3224 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get_weekday(iter_type __beg, iter_type __end, ios_base&,
       ios_base::iostate& __err, tm* __tm) const;
# 3243 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get_monthname(iter_type __beg, iter_type __end, ios_base&,
         ios_base::iostate& __err, tm* __tm) const;
# 3262 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
    ios_base::iostate& __err, tm* __tm) const;


      iter_type
      _M_extract_num(iter_type __beg, iter_type __end, int& __member,
       int __min, int __max, size_t __len,
       ios_base& __io, ios_base::iostate& __err) const;



      iter_type
      _M_extract_name(iter_type __beg, iter_type __end, int& __member,
        const _CharT** __names, size_t __indexlen,
        ios_base& __io, ios_base::iostate& __err) const;


      iter_type
      _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
       ios_base::iostate& __err, tm* __tm,
       const _CharT* __format) const;
    };

  template<typename _CharT, typename _InIter>
    locale::id time_get<_CharT, _InIter>::id;

  template<typename _CharT, typename _InIter>
    class time_get_byname : public time_get<_CharT, _InIter>
    {
    public:

      typedef _CharT char_type;
      typedef _InIter iter_type;

      explicit
      time_get_byname(const char*, size_t __refs = 0)
      : time_get<_CharT, _InIter>(__refs) { }

    protected:
      virtual
      ~time_get_byname() { }
    };
# 3317 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT, typename _OutIter>
    class time_put : public locale::facet
    {
    public:



      typedef _CharT char_type;
      typedef _OutIter iter_type;



      static locale::id id;
# 3338 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      time_put(size_t __refs = 0)
      : facet(__refs) { }
# 3357 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
   const _CharT* __beg, const _CharT* __end) const;
# 3377 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, ios_base& __io, char_type __fill,
   const tm* __tm, char __format, char __mod = 0) const
      { return this->do_put(__s, __io, __fill, __tm, __format, __mod); }

    protected:

      virtual
      ~time_put()
      { }
# 3404 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
      char __format, char __mod) const;
    };

  template<typename _CharT, typename _OutIter>
    locale::id time_put<_CharT, _OutIter>::id;

  template<typename _CharT, typename _OutIter>
    class time_put_byname : public time_put<_CharT, _OutIter>
    {
    public:

      typedef _CharT char_type;
      typedef _OutIter iter_type;

      explicit
      time_put_byname(const char*, size_t __refs = 0)
      : time_put<_CharT, _OutIter>(__refs)
      { };

    protected:
      virtual
      ~time_put_byname() { }
    };
# 3441 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  class money_base
  {
  public:
    enum part { none, space, symbol, sign, value };
    struct pattern { char field[4]; };

    static const pattern _S_default_pattern;

    enum
    {
      _S_minus,
      _S_zero,
      _S_end = 11
    };



    static const char* _S_atoms;



    static pattern
    _S_construct_pattern(char __precedes, char __space, char __posn);
  };

  template<typename _CharT, bool _Intl>
    struct __moneypunct_cache : public locale::facet
    {
      const char* _M_grouping;
      size_t _M_grouping_size;
      bool _M_use_grouping;
      _CharT _M_decimal_point;
      _CharT _M_thousands_sep;
      const _CharT* _M_curr_symbol;
      size_t _M_curr_symbol_size;
      const _CharT* _M_positive_sign;
      size_t _M_positive_sign_size;
      const _CharT* _M_negative_sign;
      size_t _M_negative_sign_size;
      int _M_frac_digits;
      money_base::pattern _M_pos_format;
      money_base::pattern _M_neg_format;




      _CharT _M_atoms[money_base::_S_end];

      bool _M_allocated;

      __moneypunct_cache(size_t __refs = 0) : facet(__refs),
      _M_grouping(__null), _M_grouping_size(0), _M_use_grouping(false),
      _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()),
      _M_curr_symbol(__null), _M_curr_symbol_size(0),
      _M_positive_sign(__null), _M_positive_sign_size(0),
      _M_negative_sign(__null), _M_negative_sign_size(0),
      _M_frac_digits(0),
      _M_pos_format(money_base::pattern()),
      _M_neg_format(money_base::pattern()), _M_allocated(false)
      { }

      ~__moneypunct_cache();

      void
      _M_cache(const locale& __loc);

    private:
      __moneypunct_cache&
      operator=(const __moneypunct_cache&);

      explicit
      __moneypunct_cache(const __moneypunct_cache&);
    };

  template<typename _CharT, bool _Intl>
    __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache()
    {
      if (_M_allocated)
 {
   delete [] _M_grouping;
   delete [] _M_curr_symbol;
   delete [] _M_positive_sign;
   delete [] _M_negative_sign;
 }
    }







  template<typename _CharT, bool _Intl>
    class moneypunct : public locale::facet, public money_base
    {
    public:



      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;

      typedef __moneypunct_cache<_CharT, _Intl> __cache_type;

    private:
      __cache_type* _M_data;

    public:


      static const bool intl = _Intl;

      static locale::id id;
# 3562 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      moneypunct(size_t __refs = 0) : facet(__refs), _M_data(__null)
      { _M_initialize_moneypunct(); }
# 3574 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      moneypunct(__cache_type* __cache, size_t __refs = 0)
      : facet(__refs), _M_data(__cache)
      { _M_initialize_moneypunct(); }
# 3589 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
      : facet(__refs), _M_data(__null)
      { _M_initialize_moneypunct(__cloc, __s); }
# 3603 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      decimal_point() const
      { return this->do_decimal_point(); }
# 3616 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      char_type
      thousands_sep() const
      { return this->do_thousands_sep(); }
# 3645 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string
      grouping() const
      { return this->do_grouping(); }
# 3658 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      curr_symbol() const
      { return this->do_curr_symbol(); }
# 3675 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      positive_sign() const
      { return this->do_positive_sign(); }
# 3692 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      negative_sign() const
      { return this->do_negative_sign(); }
# 3708 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      int
      frac_digits() const
      { return this->do_frac_digits(); }
# 3743 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      pattern
      pos_format() const
      { return this->do_pos_format(); }

      pattern
      neg_format() const
      { return this->do_neg_format(); }


    protected:

      virtual
      ~moneypunct();
# 3765 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_decimal_point() const
      { return _M_data->_M_decimal_point; }
# 3777 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual char_type
      do_thousands_sep() const
      { return _M_data->_M_thousands_sep; }
# 3790 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string
      do_grouping() const
      { return _M_data->_M_grouping; }
# 3803 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_curr_symbol() const
      { return _M_data->_M_curr_symbol; }
# 3816 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_positive_sign() const
      { return _M_data->_M_positive_sign; }
# 3829 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_negative_sign() const
      { return _M_data->_M_negative_sign; }
# 3843 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual int
      do_frac_digits() const
      { return _M_data->_M_frac_digits; }
# 3857 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual pattern
      do_pos_format() const
      { return _M_data->_M_pos_format; }
# 3871 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual pattern
      do_neg_format() const
      { return _M_data->_M_neg_format; }


       void
       _M_initialize_moneypunct(__c_locale __cloc = __null,
    const char* __name = __null);
    };

  template<typename _CharT, bool _Intl>
    locale::id moneypunct<_CharT, _Intl>::id;

  template<typename _CharT, bool _Intl>
    const bool moneypunct<_CharT, _Intl>::intl;

  template<>
    moneypunct<char, true>::~moneypunct();

  template<>
    moneypunct<char, false>::~moneypunct();

  template<>
    void
    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);

  template<>
    void
    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);


  template<>
    moneypunct<wchar_t, true>::~moneypunct();

  template<>
    moneypunct<wchar_t, false>::~moneypunct();

  template<>
    void
    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
       const char*);

  template<>
    void
    moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
        const char*);


  template<typename _CharT, bool _Intl>
    class moneypunct_byname : public moneypunct<_CharT, _Intl>
    {
    public:
      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;

      static const bool intl = _Intl;

      explicit
      moneypunct_byname(const char* __s, size_t __refs = 0)
      : moneypunct<_CharT, _Intl>(__refs)
      {
 if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
   {
     __c_locale __tmp;
     this->_S_create_c_locale(__tmp, __s);
     this->_M_initialize_moneypunct(__tmp);
     this->_S_destroy_c_locale(__tmp);
   }
      }

    protected:
      virtual
      ~moneypunct_byname() { }
    };

  template<typename _CharT, bool _Intl>
    const bool moneypunct_byname<_CharT, _Intl>::intl;
# 3961 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT, typename _InIter>
    class money_get : public locale::facet
    {
    public:



      typedef _CharT char_type;
      typedef _InIter iter_type;
      typedef basic_string<_CharT> string_type;



      static locale::id id;
# 3983 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      money_get(size_t __refs = 0) : facet(__refs) { }
# 4013 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
   ios_base::iostate& __err, long double& __units) const
      { return this->do_get(__s, __end, __intl, __io, __err, __units); }
# 4043 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
   ios_base::iostate& __err, string_type& __digits) const
      { return this->do_get(__s, __end, __intl, __io, __err, __digits); }

    protected:

      virtual
      ~money_get() { }
# 4060 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
      ios_base::iostate& __err, long double& __units) const;
# 4071 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
      ios_base::iostate& __err, string_type& __digits) const;

      template<bool _Intl>
        iter_type
        _M_extract(iter_type __s, iter_type __end, ios_base& __io,
     ios_base::iostate& __err, string& __digits) const;
    };

  template<typename _CharT, typename _InIter>
    locale::id money_get<_CharT, _InIter>::id;
# 4096 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT, typename _OutIter>
    class money_put : public locale::facet
    {
    public:


      typedef _CharT char_type;
      typedef _OutIter iter_type;
      typedef basic_string<_CharT> string_type;



      static locale::id id;
# 4117 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      money_put(size_t __refs = 0) : facet(__refs) { }
# 4137 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, bool __intl, ios_base& __io,
   char_type __fill, long double __units) const
      { return this->do_put(__s, __intl, __io, __fill, __units); }
# 4159 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      iter_type
      put(iter_type __s, bool __intl, ios_base& __io,
   char_type __fill, const string_type& __digits) const
      { return this->do_put(__s, __intl, __io, __fill, __digits); }

    protected:

      virtual
      ~money_put() { }
# 4187 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
      long double __units) const;
# 4209 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual iter_type
      do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
      const string_type& __digits) const;

      template<bool _Intl>
        iter_type
        _M_insert(iter_type __s, ios_base& __io, char_type __fill,
    const string_type& __digits) const;
    };

  template<typename _CharT, typename _OutIter>
    locale::id money_put<_CharT, _OutIter>::id;




  struct messages_base
  {
    typedef int catalog;
  };
# 4250 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT>
    class messages : public locale::facet, public messages_base
    {
    public:



      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;


    protected:


      __c_locale _M_c_locale_messages;
      const char* _M_name_messages;

    public:

      static locale::id id;
# 4278 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      messages(size_t __refs = 0);
# 4292 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      explicit
      messages(__c_locale __cloc, const char* __s, size_t __refs = 0);
# 4305 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      catalog
      open(const basic_string<char>& __s, const locale& __loc) const
      { return this->do_open(__s, __loc); }
# 4323 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      catalog
      open(const basic_string<char>&, const locale&, const char*) const;
# 4341 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      string_type
      get(catalog __c, int __set, int __msgid, const string_type& __s) const
      { return this->do_get(__c, __set, __msgid, __s); }
# 4352 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      void
      close(catalog __c) const
      { return this->do_close(__c); }

    protected:

      virtual
      ~messages();
# 4372 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual catalog
      do_open(const basic_string<char>&, const locale&) const;
# 4391 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
      virtual string_type
      do_get(catalog, int, int, const string_type& __dfault) const;






      virtual void
      do_close(catalog) const;


      char*
      _M_convert_to_char(const string_type& __msg) const
      {

 return reinterpret_cast<char*>(const_cast<_CharT*>(__msg.c_str()));
      }


      string_type
      _M_convert_from_char(char*) const
      {
# 4448 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
 return string_type();
      }
     };

  template<typename _CharT>
    locale::id messages<_CharT>::id;


  template<>
    string
    messages<char>::do_get(catalog, int, int, const string&) const;


  template<>
    wstring
    messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;


  template<typename _CharT>
    class messages_byname : public messages<_CharT>
    {
    public:
      typedef _CharT char_type;
      typedef basic_string<_CharT> string_type;

      explicit
      messages_byname(const char* __s, size_t __refs = 0);

    protected:
      virtual
      ~messages_byname()
      { }
    };


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/messages_members.h" 1 3
# 37 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/i386-redhat-linux/bits/messages_members.h" 3
  template<typename _CharT>
     messages<_CharT>::messages(size_t __refs)
     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
     _M_name_messages(_S_get_c_name())
     { }

  template<typename _CharT>
     messages<_CharT>::messages(__c_locale __cloc, const char* __s,
    size_t __refs)
     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
     _M_name_messages(__s)
     {
       char* __tmp = new char[std::strlen(__s) + 1];
       std::strcpy(__tmp, __s);
       _M_name_messages = __tmp;
     }

  template<typename _CharT>
    typename messages<_CharT>::catalog
    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
      const char* __dir) const
    {
      bindtextdomain(__s.c_str(), __dir);
      return this->do_open(__s, __loc);
    }


  template<typename _CharT>
    messages<_CharT>::~messages()
    {
      if (_M_name_messages != _S_get_c_name())
 delete [] _M_name_messages;
      _S_destroy_c_locale(_M_c_locale_messages);
    }

  template<typename _CharT>
    typename messages<_CharT>::catalog
    messages<_CharT>::do_open(const basic_string<char>& __s,
         const locale&) const
    {


      textdomain(__s.c_str());
      return 0;
    }

  template<typename _CharT>
    void
    messages<_CharT>::do_close(catalog) const
    { }


   template<typename _CharT>
     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
     : messages<_CharT>(__refs)
     {
       if (this->_M_name_messages != locale::facet::_S_get_c_name())
  delete [] this->_M_name_messages;
       char* __tmp = new char[std::strlen(__s) + 1];
       std::strcpy(__tmp, __s);
       this->_M_name_messages = __tmp;

       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  {
    this->_S_destroy_c_locale(this->_M_c_locale_messages);
    this->_S_create_c_locale(this->_M_c_locale_messages, __s);
  }
     }
# 4484 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 2 3
# 4492 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.h" 3
  template<typename _CharT>
    inline bool
    isspace(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }

  template<typename _CharT>
    inline bool
    isprint(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }

  template<typename _CharT>
    inline bool
    iscntrl(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }

  template<typename _CharT>
    inline bool
    isupper(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }

  template<typename _CharT>
    inline bool islower(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }

  template<typename _CharT>
    inline bool
    isalpha(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }

  template<typename _CharT>
    inline bool
    isdigit(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }

  template<typename _CharT>
    inline bool
    ispunct(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }

  template<typename _CharT>
    inline bool
    isxdigit(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }

  template<typename _CharT>
    inline bool
    isalnum(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }

  template<typename _CharT>
    inline bool
    isgraph(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }

  template<typename _CharT>
    inline _CharT
    toupper(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }

  template<typename _CharT>
    inline _CharT
    tolower(_CharT __c, const locale& __loc)
    { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }

}
# 45 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 2 3

namespace std
{







  template<typename _CharT, typename _Traits>
    class basic_ios : public ios_base
    {
    public:






      typedef _CharT char_type;
      typedef typename _Traits::int_type int_type;
      typedef typename _Traits::pos_type pos_type;
      typedef typename _Traits::off_type off_type;
      typedef _Traits traits_type;
# 78 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      typedef ctype<_CharT> __ctype_type;
      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
           __num_put_type;
      typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
           __num_get_type;



    protected:
      basic_ostream<_CharT, _Traits>* _M_tie;
      mutable char_type _M_fill;
      mutable bool _M_fill_init;
      basic_streambuf<_CharT, _Traits>* _M_streambuf;


      const __ctype_type* _M_ctype;

      const __num_put_type* _M_num_put;

      const __num_get_type* _M_num_get;

    public:







      operator void*() const
      { return this->fail() ? 0 : const_cast<basic_ios*>(this); }

      bool
      operator!() const
      { return this->fail(); }
# 122 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      iostate
      rdstate() const
      { return _M_streambuf_state; }
# 133 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      void
      clear(iostate __state = goodbit);







      void
      setstate(iostate __state)
      { this->clear(this->rdstate() | __state); }




      void
      _M_setstate(iostate __state)
      {


 _M_streambuf_state |= __state;
 if (this->exceptions() & __state)
   throw;
      }







      bool
      good() const
      { return this->rdstate() == 0; }







      bool
      eof() const
      { return (this->rdstate() & eofbit) != 0; }
# 186 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      bool
      fail() const
      { return (this->rdstate() & (badbit | failbit)) != 0; }







      bool
      bad() const
      { return (this->rdstate() & badbit) != 0; }
# 207 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      iostate
      exceptions() const
      { return _M_exception; }
# 242 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      void
      exceptions(iostate __except)
      {
        _M_exception = __except;
        this->clear(_M_streambuf_state);
      }







      explicit
      basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
      : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
      _M_ctype(0), _M_num_put(0), _M_num_get(0)
      { this->init(__sb); }







      virtual
      ~basic_ios() { }
# 280 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      basic_ostream<_CharT, _Traits>*
      tie() const
      { return _M_tie; }
# 292 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      basic_ostream<_CharT, _Traits>*
      tie(basic_ostream<_CharT, _Traits>* __tiestr)
      {
        basic_ostream<_CharT, _Traits>* __old = _M_tie;
        _M_tie = __tiestr;
        return __old;
      }







      basic_streambuf<_CharT, _Traits>*
      rdbuf() const
      { return _M_streambuf; }
# 332 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      basic_streambuf<_CharT, _Traits>*
      rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
# 346 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      basic_ios&
      copyfmt(const basic_ios& __rhs);







      char_type
      fill() const
      {
 if (!_M_fill_init)
   {
     _M_fill = this->widen(' ');
     _M_fill_init = true;
   }
 return _M_fill;
      }
# 375 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      char_type
      fill(char_type __ch)
      {
 char_type __old = this->fill();
 _M_fill = __ch;
 return __old;
      }
# 395 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      locale
      imbue(const locale& __loc);
# 415 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      char
      narrow(char_type __c, char __dfault) const;
# 433 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 3
      char_type
      widen(char __c) const;

    protected:







      basic_ios()
      : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
      _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
      { }







      void
      init(basic_streambuf<_CharT, _Traits>* __sb);

      void
      _M_cache_locale(const locale& __loc);
    };
}


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.tcc" 1 3
# 33 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.tcc" 3
       
# 34 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.tcc" 3

namespace std
{
  template<typename _CharT, typename _Traits>
    void
    basic_ios<_CharT, _Traits>::clear(iostate __state)
    {
      if (this->rdbuf())
 _M_streambuf_state = __state;
      else
   _M_streambuf_state = __state | badbit;
      if (this->exceptions() & this->rdstate())
 __throw_ios_failure(("basic_ios::clear"));
    }

  template<typename _CharT, typename _Traits>
    basic_streambuf<_CharT, _Traits>*
    basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
    {
      basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
      _M_streambuf = __sb;
      this->clear();
      return __old;
    }

  template<typename _CharT, typename _Traits>
    basic_ios<_CharT, _Traits>&
    basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
    {


      if (this != &__rhs)
 {




   _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
                      _M_local_word : new _Words[__rhs._M_word_size];


   _Callback_list* __cb = __rhs._M_callbacks;
   if (__cb)
     __cb->_M_add_reference();
   _M_call_callbacks(erase_event);
   if (_M_word != _M_local_word)
     {
       delete [] _M_word;
       _M_word = 0;
     }
   _M_dispose_callbacks();


   _M_callbacks = __cb;
   for (int __i = 0; __i < __rhs._M_word_size; ++__i)
     __words[__i] = __rhs._M_word[__i];
   if (_M_word != _M_local_word)
     {
       delete [] _M_word;
       _M_word = 0;
     }
   _M_word = __words;
   _M_word_size = __rhs._M_word_size;

   this->flags(__rhs.flags());
   this->width(__rhs.width());
   this->precision(__rhs.precision());
   this->tie(__rhs.tie());
   this->fill(__rhs.fill());
   _M_ios_locale = __rhs.getloc();
   _M_cache_locale(_M_ios_locale);

   _M_call_callbacks(copyfmt_event);


   this->exceptions(__rhs.exceptions());
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    char
    basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
    { return __check_facet(_M_ctype).narrow(__c, __dfault); }

  template<typename _CharT, typename _Traits>
    _CharT
    basic_ios<_CharT, _Traits>::widen(char __c) const
    { return __check_facet(_M_ctype).widen(__c); }


  template<typename _CharT, typename _Traits>
    locale
    basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
    {
      locale __old(this->getloc());
      ios_base::imbue(__loc);
      _M_cache_locale(__loc);
      if (this->rdbuf() != 0)
 this->rdbuf()->pubimbue(__loc);
      return __old;
    }

  template<typename _CharT, typename _Traits>
    void
    basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
    {

      ios_base::_M_init();


      _M_cache_locale(_M_ios_locale);
# 159 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.tcc" 3
      _M_fill = _CharT();
      _M_fill_init = false;

      _M_tie = 0;
      _M_exception = goodbit;
      _M_streambuf = __sb;
      _M_streambuf_state = __sb ? goodbit : badbit;
    }

  template<typename _CharT, typename _Traits>
    void
    basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
    {
      if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
 _M_ctype = &use_facet<__ctype_type>(__loc);
      else
 _M_ctype = 0;

      if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
 _M_num_put = &use_facet<__num_put_type>(__loc);
      else
 _M_num_put = 0;

      if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
 _M_num_get = &use_facet<__num_get_type>(__loc);
      else
 _M_num_get = 0;
    }





  extern template class basic_ios<char>;


  extern template class basic_ios<wchar_t>;


}
# 465 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/basic_ios.h" 2 3
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ios" 2 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 2 3

namespace std
{
# 57 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
  template<typename _CharT, typename _Traits>
    class basic_ostream : virtual public basic_ios<_CharT, _Traits>
    {
    public:

      typedef _CharT char_type;
      typedef typename _Traits::int_type int_type;
      typedef typename _Traits::pos_type pos_type;
      typedef typename _Traits::off_type off_type;
      typedef _Traits traits_type;


      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
      typedef basic_ios<_CharT, _Traits> __ios_type;
      typedef basic_ostream<_CharT, _Traits> __ostream_type;
      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
             __num_put_type;
      typedef ctype<_CharT> __ctype_type;

      template<typename _CharT2, typename _Traits2>
        friend basic_ostream<_CharT2, _Traits2>&
        operator<<(basic_ostream<_CharT2, _Traits2>&, _CharT2);

      template<typename _Traits2>
        friend basic_ostream<char, _Traits2>&
        operator<<(basic_ostream<char, _Traits2>&, char);

      template<typename _CharT2, typename _Traits2>
        friend basic_ostream<_CharT2, _Traits2>&
        operator<<(basic_ostream<_CharT2, _Traits2>&, const _CharT2*);

      template<typename _Traits2>
        friend basic_ostream<char, _Traits2>&
        operator<<(basic_ostream<char, _Traits2>&, const char*);

      template<typename _CharT2, typename _Traits2>
        friend basic_ostream<_CharT2, _Traits2>&
        operator<<(basic_ostream<_CharT2, _Traits2>&, const char*);
# 104 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      explicit
      basic_ostream(__streambuf_type* __sb)
      { this->init(__sb); }






      virtual
      ~basic_ostream() { }


      class sentry;
      friend class sentry;
# 130 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      inline __ostream_type&
      operator<<(__ostream_type& (*__pf)(__ostream_type&));

      inline __ostream_type&
      operator<<(__ios_type& (*__pf)(__ios_type&));

      inline __ostream_type&
      operator<<(ios_base& (*__pf) (ios_base&));
# 167 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      __ostream_type&
      operator<<(long __n);

      __ostream_type&
      operator<<(unsigned long __n);

      __ostream_type&
      operator<<(bool __n);

      __ostream_type&
      operator<<(short __n)
      {
 ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
 if (__fmt & ios_base::oct || __fmt & ios_base::hex)
   return this->operator<<(static_cast<unsigned long>
      (static_cast<unsigned short>(__n)));
 else
   return this->operator<<(static_cast<long>(__n));
      }

      __ostream_type&
      operator<<(unsigned short __n)
      { return this->operator<<(static_cast<unsigned long>(__n)); }

      __ostream_type&
      operator<<(int __n)
      {
 ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
 if (__fmt & ios_base::oct || __fmt & ios_base::hex)
   return this->operator<<(static_cast<unsigned long>
      (static_cast<unsigned int>(__n)));
 else
   return this->operator<<(static_cast<long>(__n));
      }

      __ostream_type&
      operator<<(unsigned int __n)
      { return this->operator<<(static_cast<unsigned long>(__n)); }


      __ostream_type&
      operator<<(long long __n);

      __ostream_type&
      operator<<(unsigned long long __n);


      __ostream_type&
      operator<<(double __f);

      __ostream_type&
      operator<<(float __f)
      { return this->operator<<(static_cast<double>(__f)); }

      __ostream_type&
      operator<<(long double __f);

      __ostream_type&
      operator<<(const void* __p);
# 248 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      __ostream_type&
      operator<<(__streambuf_type* __sb);
# 281 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      __ostream_type&
      put(char_type __c);


      void
      _M_write(const char_type* __s, streamsize __n)
      {
 streamsize __put = this->rdbuf()->sputn(__s, __n);
 if (__put != __n)
   this->setstate(ios_base::badbit);
      }
# 309 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      __ostream_type&
      write(const char_type* __s, streamsize __n);
# 322 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      __ostream_type&
      flush();
# 333 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      pos_type
      tellp();
# 344 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      __ostream_type&
      seekp(pos_type);
# 356 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
       __ostream_type&
      seekp(off_type, ios_base::seekdir);

    protected:
      explicit
      basic_ostream() { }
    };
# 374 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
  template <typename _CharT, typename _Traits>
    class basic_ostream<_CharT, _Traits>::sentry
    {

      bool _M_ok;
      basic_ostream<_CharT,_Traits>& _M_os;

    public:
# 393 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      explicit
      sentry(basic_ostream<_CharT,_Traits>& __os);
# 403 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      ~sentry()
      {

 if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception())
   {

     if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
       _M_os.setstate(ios_base::badbit);
   }
      }
# 421 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
      operator bool() const
      { return _M_ok; }
    };
# 442 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c);

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    { return (__out << __out.widen(__c)); }


  template <class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, char __c);


  template<class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    { return (__out << static_cast<char>(__c)); }

  template<class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    { return (__out << static_cast<char>(__c)); }
# 482 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s);

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits> &
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);


  template<class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s);


  template<class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    { return (__out << reinterpret_cast<const char*>(__s)); }

  template<class _Traits>
    basic_ostream<char, _Traits> &
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    { return (__out << reinterpret_cast<const char*>(__s)); }
# 516 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 3
  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    endl(basic_ostream<_CharT, _Traits>& __os)
    { return flush(__os.put(__os.widen('\n'))); }







  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    ends(basic_ostream<_CharT, _Traits>& __os)
    { return __os.put(_CharT()); }






  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    flush(basic_ostream<_CharT, _Traits>& __os)
    { return __os.flush(); }

}


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ostream.tcc" 1 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ostream.tcc" 3
       
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ostream.tcc" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/locale" 1 3
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/locale" 3
       
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/locale" 3




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 1 3
# 36 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
       
# 37 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/typeinfo" 1 3
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/typeinfo" 3
extern "C++" {

namespace __cxxabiv1
{
  class __class_type_info;
}
# 55 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/typeinfo" 3
namespace std
{






  class type_info
  {
  public:




    virtual ~type_info();

  private:

    type_info& operator=(const type_info&);
    type_info(const type_info&);

  protected:
    const char *__name;

  protected:
    explicit type_info(const char *__n): __name(__n) { }

  public:



    const char* name() const
    { return __name; }
# 101 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/typeinfo" 3
    bool before(const type_info& __arg) const
    { return __name < __arg.__name; }
    bool operator==(const type_info& __arg) const
    { return __name == __arg.__name; }

    bool operator!=(const type_info& __arg) const
    { return !operator==(__arg); }


  public:

    virtual bool __is_pointer_p() const;

    virtual bool __is_function_p() const;







    virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
       unsigned __outer) const;


    virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
        void **__obj_ptr) const;
  };






  class bad_cast : public exception
  {
  public:
    bad_cast() throw() { }


    virtual ~bad_cast() throw();
  };


  class bad_typeid : public exception
  {
  public:
    bad_typeid () throw() { }


    virtual ~bad_typeid() throw();
  };
}

}
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 2 3


namespace std
{
  template<typename _Facet>
    locale
    locale::combine(const locale& __other) const
    {
      _Impl* __tmp = new _Impl(*_M_impl, 1);
      try
 {
   __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
 }
      catch(...)
 {
   __tmp->_M_remove_reference();
   throw;
 }
      return locale(__tmp);
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    bool
    locale::operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
                       const basic_string<_CharT, _Traits, _Alloc>& __s2) const
    {
      typedef std::collate<_CharT> __collate_type;
      const __collate_type& __collate = use_facet<__collate_type>(*this);
      return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
    __s2.data(), __s2.data() + __s2.length()) < 0);
    }
# 83 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
  template<typename _Facet>
    inline bool
    has_facet(const locale& __loc) throw()
    {
      const size_t __i = _Facet::id._M_id();
      const locale::facet** __facets = __loc._M_impl->_M_facets;
      return (__i < __loc._M_impl->_M_facets_size && __facets[__i]);
    }
# 105 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
  template<typename _Facet>
    inline const _Facet&
    use_facet(const locale& __loc)
    {
      const size_t __i = _Facet::id._M_id();
      const locale::facet** __facets = __loc._M_impl->_M_facets;
      if (!(__i < __loc._M_impl->_M_facets_size && __facets[__i]))
        __throw_bad_cast();
      return static_cast<const _Facet&>(*__facets[__i]);
    }



  template<typename _Facet>
    struct __use_cache
    {
      const _Facet*
      operator() (const locale& __loc) const;
    };


  template<typename _CharT>
    struct __use_cache<__numpunct_cache<_CharT> >
    {
      const __numpunct_cache<_CharT>*
      operator() (const locale& __loc) const
      {
 const size_t __i = numpunct<_CharT>::id._M_id();
 const locale::facet** __caches = __loc._M_impl->_M_caches;
 if (!__caches[__i])
   {
     __numpunct_cache<_CharT>* __tmp = __null;
     try
       {
  __tmp = new __numpunct_cache<_CharT>;
  __tmp->_M_cache(__loc);
       }
     catch(...)
       {
  delete __tmp;
  throw;
       }
     __loc._M_impl->_M_install_cache(__tmp, __i);
   }
 return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
      }
    };

  template<typename _CharT, bool _Intl>
    struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
    {
      const __moneypunct_cache<_CharT, _Intl>*
      operator() (const locale& __loc) const
      {
 const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
 const locale::facet** __caches = __loc._M_impl->_M_caches;
 if (!__caches[__i])
   {
     __moneypunct_cache<_CharT, _Intl>* __tmp = __null;
     try
       {
  __tmp = new __moneypunct_cache<_CharT, _Intl>;
  __tmp->_M_cache(__loc);
       }
     catch(...)
       {
  delete __tmp;
  throw;
       }
     __loc._M_impl->_M_install_cache(__tmp, __i);
   }
 return static_cast<
   const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]);
      }
    };

  template<typename _CharT>
    void
    __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
    {
      _M_allocated = true;

      const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);

      _M_grouping_size = __np.grouping().size();
      char* __grouping = new char[_M_grouping_size];
      __np.grouping().copy(__grouping, _M_grouping_size);
      _M_grouping = __grouping;
      _M_use_grouping = _M_grouping_size && __np.grouping()[0] != 0;

      _M_truename_size = __np.truename().size();
      _CharT* __truename = new _CharT[_M_truename_size];
      __np.truename().copy(__truename, _M_truename_size);
      _M_truename = __truename;

      _M_falsename_size = __np.falsename().size();
      _CharT* __falsename = new _CharT[_M_falsename_size];
      __np.falsename().copy(__falsename, _M_falsename_size);
      _M_falsename = __falsename;

      _M_decimal_point = __np.decimal_point();
      _M_thousands_sep = __np.thousands_sep();

      const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
      __ct.widen(__num_base::_S_atoms_out,
   __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
      __ct.widen(__num_base::_S_atoms_in,
   __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
    }

  template<typename _CharT, bool _Intl>
    void
    __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc)
    {
      _M_allocated = true;

      const moneypunct<_CharT, _Intl>& __mp =
 use_facet<moneypunct<_CharT, _Intl> >(__loc);

      _M_grouping_size = __mp.grouping().size();
      char* __grouping = new char[_M_grouping_size];
      __mp.grouping().copy(__grouping, _M_grouping_size);
      _M_grouping = __grouping;
      _M_use_grouping = _M_grouping_size && __mp.grouping()[0] != 0;

      _M_decimal_point = __mp.decimal_point();
      _M_thousands_sep = __mp.thousands_sep();
      _M_frac_digits = __mp.frac_digits();

      _M_curr_symbol_size = __mp.curr_symbol().size();
      _CharT* __curr_symbol = new _CharT[_M_curr_symbol_size];
      __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size);
      _M_curr_symbol = __curr_symbol;

      _M_positive_sign_size = __mp.positive_sign().size();
      _CharT* __positive_sign = new _CharT[_M_positive_sign_size];
      __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size);
      _M_positive_sign = __positive_sign;

      _M_negative_sign_size = __mp.negative_sign().size();
      _CharT* __negative_sign = new _CharT[_M_negative_sign_size];
      __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size);
      _M_negative_sign = __negative_sign;

      _M_pos_format = __mp.pos_format();
      _M_neg_format = __mp.neg_format();

      const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
      __ct.widen(money_base::_S_atoms,
   money_base::_S_atoms + money_base::_S_end, _M_atoms);
    }
# 266 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
  static bool
  __verify_grouping(const char* __grouping, size_t __grouping_size,
      const string& __grouping_tmp);

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
       ios_base::iostate& __err, string& __xtrc) const
    {
      typedef char_traits<_CharT> __traits_type;
      typedef typename numpunct<_CharT>::__cache_type __cache_type;
      __use_cache<__cache_type> __uc;
      const locale& __loc = __io._M_getloc();
      const __cache_type* __lc = __uc(__loc);
      const _CharT* __lit = __lc->_M_atoms_in;


      bool __found_mantissa = false;


      if (__beg != __end)
 {
   const char_type __c = *__beg;
   const bool __plus = __c == __lit[__num_base::_S_iplus];
   if ((__plus || __c == __lit[__num_base::_S_iminus])
       && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
       && !(__c == __lc->_M_decimal_point))
     {
       __xtrc += __plus ? '+' : '-';
       ++__beg;
     }
 }


      while (__beg != __end)
 {
   const char_type __c = *__beg;
   if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep
       || __c == __lc->_M_decimal_point)
     break;
   else if (__c == __lit[__num_base::_S_izero])
     {
       if (!__found_mantissa)
  {
    __xtrc += '0';
    __found_mantissa = true;
  }
       ++__beg;
     }
   else
     break;
 }


      bool __found_dec = false;
      bool __found_sci = false;
      string __found_grouping;
      if (__lc->_M_use_grouping)
 __found_grouping.reserve(32);
      int __sep_pos = 0;
      const char_type* __lit_zero = __lit + __num_base::_S_izero;
      const char_type* __q;
      while (__beg != __end)
        {


   const char_type __c = *__beg;
          if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
     {
       if (!__found_dec && !__found_sci)
  {


    if (__sep_pos)
      {
        __found_grouping += static_cast<char>(__sep_pos);
        __sep_pos = 0;
        ++__beg;
      }
    else
      {
        __err |= ios_base::failbit;
        break;
      }
  }
       else
  break;
            }
   else if (__c == __lc->_M_decimal_point)
     {
       if (!__found_dec && !__found_sci)
  {



    if (__found_grouping.size())
      __found_grouping += static_cast<char>(__sep_pos);
    __xtrc += '.';
    __found_dec = true;
    ++__beg;
  }
       else
  break;
     }
          else if ((__q = __traits_type::find(__lit_zero, 10, __c)))
     {
       __xtrc += __num_base::_S_atoms_in[__q - __lit];
       __found_mantissa = true;
       ++__sep_pos;
       ++__beg;
     }
   else if ((__c == __lit[__num_base::_S_ie]
      || __c == __lit[__num_base::_S_iE])
     && __found_mantissa && !__found_sci)
     {

       if (__found_grouping.size() && !__found_dec)
  __found_grouping += static_cast<char>(__sep_pos);
       __xtrc += 'e';
       __found_sci = true;


       if (++__beg != __end)
  {
    const bool __plus = *__beg == __lit[__num_base::_S_iplus];
    if ((__plus || *__beg == __lit[__num_base::_S_iminus])
        && !(__lc->_M_use_grouping
      && *__beg == __lc->_M_thousands_sep)
        && !(*__beg == __lc->_M_decimal_point))
      {
        __xtrc += __plus ? '+' : '-';
        ++__beg;
      }
  }
     }
   else

     break;
        }



      if (__lc->_M_use_grouping && __found_grouping.size())
        {

   if (!__found_dec && !__found_sci)
     __found_grouping += static_cast<char>(__sep_pos);

          if (!std::__verify_grouping(__lc->_M_grouping,
          __lc->_M_grouping_size,
          __found_grouping))
     __err |= ios_base::failbit;
        }


      if (__beg == __end)
        __err |= ios_base::eofbit;
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    template<typename _ValueT>
      _InIter
      num_get<_CharT, _InIter>::
      _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
       ios_base::iostate& __err, _ValueT& __v) const
      {
        typedef char_traits<_CharT> __traits_type;
 typedef typename numpunct<_CharT>::__cache_type __cache_type;
 __use_cache<__cache_type> __uc;
 const locale& __loc = __io._M_getloc();
 const __cache_type* __lc = __uc(__loc);
 const _CharT* __lit = __lc->_M_atoms_in;


 const ios_base::fmtflags __basefield = __io.flags()
                                        & ios_base::basefield;
 const bool __oct = __basefield == ios_base::oct;
 int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);


 bool __found_num = false;


 bool __negative = false;
 if (__beg != __end)
   {
     const char_type __c = *__beg;
     if (numeric_limits<_ValueT>::is_signed)
       __negative = __c == __lit[__num_base::_S_iminus];
     if ((__negative || __c == __lit[__num_base::_S_iplus])
  && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
  && !(__c == __lc->_M_decimal_point))
       ++__beg;
   }



 while (__beg != __end)
   {
     const char_type __c = *__beg;
     if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep
  || __c == __lc->_M_decimal_point)
       break;
     else if (__c == __lit[__num_base::_S_izero]
       && (!__found_num || __base == 10))
       {
  __found_num = true;
  ++__beg;
       }
     else if (__found_num)
       {
  if (__c == __lit[__num_base::_S_ix]
      || __c == __lit[__num_base::_S_iX])
    {
      if (__basefield == 0)
        __base = 16;
      if (__base == 16)
        {
   __found_num = false;
   ++__beg;
        }
    }
  else if (__basefield == 0)
    __base = 8;
  break;
       }
     else
       break;
   }



 const size_t __len = __base == 16 ? (__num_base::_S_iend
          - __num_base::_S_izero)
                                   : __base;


 string __found_grouping;
 if (__lc->_M_use_grouping)
   __found_grouping.reserve(32);
 int __sep_pos = 0;
 bool __overflow = false;
 _ValueT __result = 0;
 const char_type* __lit_zero = __lit + __num_base::_S_izero;
 const char_type* __q;
 if (__negative)
   {
     const _ValueT __min = numeric_limits<_ValueT>::min() / __base;
     for (; __beg != __end; ++__beg)
       {


  const char_type __c = *__beg;
  if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
    {


      if (__sep_pos)
        {
   __found_grouping += static_cast<char>(__sep_pos);
   __sep_pos = 0;
        }
      else
        {
   __err |= ios_base::failbit;
   break;
        }
    }
  else if (__c == __lc->_M_decimal_point)
    break;
  else if ((__q = __traits_type::find(__lit_zero, __len, __c)))
    {
      int __digit = __q - __lit_zero;
      if (__digit > 15)
        __digit -= 6;
      if (__result < __min)
        __overflow = true;
      else
        {
   const _ValueT __new_result = __result * __base
                                - __digit;
   __overflow |= __new_result > __result;
   __result = __new_result;
   ++__sep_pos;
   __found_num = true;
        }
    }
  else

    break;
       }
   }
 else
   {
     const _ValueT __max = numeric_limits<_ValueT>::max() / __base;
     for (; __beg != __end; ++__beg)
       {
  const char_type __c = *__beg;
  if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
    {
      if (__sep_pos)
        {
   __found_grouping += static_cast<char>(__sep_pos);
   __sep_pos = 0;
        }
      else
        {
   __err |= ios_base::failbit;
   break;
        }
    }
  else if (__c == __lc->_M_decimal_point)
    break;
  else if ((__q = __traits_type::find(__lit_zero, __len, __c)))
    {
      int __digit = __q - __lit_zero;
      if (__digit > 15)
        __digit -= 6;
      if (__result > __max)
        __overflow = true;
      else
        {
   const _ValueT __new_result = __result * __base
                                + __digit;
   __overflow |= __new_result < __result;
   __result = __new_result;
   ++__sep_pos;
   __found_num = true;
        }
    }
  else
    break;
       }
   }



 if (__lc->_M_use_grouping && __found_grouping.size())
   {

     __found_grouping += static_cast<char>(__sep_pos);

     if (!std::__verify_grouping(__lc->_M_grouping,
     __lc->_M_grouping_size,
     __found_grouping))
       __err |= ios_base::failbit;
   }

 if (!(__err & ios_base::failbit) && !__overflow
     && __found_num)
   __v = __result;
 else
   __err |= ios_base::failbit;

 if (__beg == __end)
   __err |= ios_base::eofbit;
 return __beg;
      }



  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, bool& __v) const
    {
      if (!(__io.flags() & ios_base::boolalpha))
        {



   long __l = -1;
          __beg = _M_extract_int(__beg, __end, __io, __err, __l);
   if (__l == 0 || __l == 1)
     __v = __l;
   else
            __err |= ios_base::failbit;
        }
      else
        {

   typedef char_traits<_CharT> __traits_type;
   typedef typename numpunct<_CharT>::__cache_type __cache_type;
   __use_cache<__cache_type> __uc;
   const locale& __loc = __io._M_getloc();
   const __cache_type* __lc = __uc(__loc);

   bool __testf = true;
   bool __testt = true;
   size_t __n;
          for (__n = 0; __beg != __end; ++__n, ++__beg)
            {
       if (__testf)
  if (__n < __lc->_M_falsename_size)
    __testf = *__beg == __lc->_M_falsename[__n];
  else
    break;

       if (__testt)
  if (__n < __lc->_M_truename_size)
    __testt = *__beg == __lc->_M_truename[__n];
  else
    break;

       if (!__testf && !__testt)
  break;
            }
   if (__testf && __n == __lc->_M_falsename_size)
     __v = 0;
   else if (__testt && __n == __lc->_M_truename_size)
     __v = 1;
   else
     __err |= ios_base::failbit;

          if (__beg == __end)
            __err |= ios_base::eofbit;
        }
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, long& __v) const
    { return _M_extract_int(__beg, __end, __io, __err, __v); }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, unsigned short& __v) const
    { return _M_extract_int(__beg, __end, __io, __err, __v); }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, unsigned int& __v) const
    { return _M_extract_int(__beg, __end, __io, __err, __v); }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, unsigned long& __v) const
    { return _M_extract_int(__beg, __end, __io, __err, __v); }


  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, long long& __v) const
    { return _M_extract_int(__beg, __end, __io, __err, __v); }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, unsigned long long& __v) const
    { return _M_extract_int(__beg, __end, __io, __err, __v); }


  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
    ios_base::iostate& __err, float& __v) const
    {
      string __xtrc;
      __xtrc.reserve(32);
      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, double& __v) const
    {
      string __xtrc;
      __xtrc.reserve(32);
      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, long double& __v) const
    {
      string __xtrc;
      __xtrc.reserve(32);
      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    num_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, ios_base& __io,
           ios_base::iostate& __err, void*& __v) const
    {

      typedef ios_base::fmtflags fmtflags;
      const fmtflags __fmt = __io.flags();
      __io.flags(__fmt & ~ios_base::basefield | ios_base::hex);

      unsigned long __ul;
      __beg = _M_extract_int(__beg, __end, __io, __err, __ul);


      __io.flags(__fmt);

      if (!(__err & ios_base::failbit))
 __v = reinterpret_cast<void*>(__ul);
      else
 __err |= ios_base::failbit;
      return __beg;
    }



  template<typename _CharT, typename _OutIter>
    void
    num_put<_CharT, _OutIter>::
    _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
    _CharT* __new, const _CharT* __cs, int& __len) const
    {


      __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new, __cs,
        __w, __len, true);
      __len = static_cast<int>(__w);
    }


  template<typename _CharT>
    inline int
    __int_to_char(_CharT* __bufend, long __v, const _CharT* __lit,
    ios_base::fmtflags __flags)
    {
      unsigned long __ul = static_cast<unsigned long>(__v);
      bool __neg = false;
      if (__v < 0)
 {
   __ul = -__ul;
   __neg = true;
 }
      return __int_to_char(__bufend, __ul, __lit, __flags, __neg);
    }

  template<typename _CharT>
    inline int
    __int_to_char(_CharT* __bufend, unsigned long __v, const _CharT* __lit,
    ios_base::fmtflags __flags)
    {

      return __int_to_char(__bufend, __v, __lit,
      __flags & ~ios_base::showpos, false);
    }


  template<typename _CharT>
    inline int
    __int_to_char(_CharT* __bufend, long long __v, const _CharT* __lit,
    ios_base::fmtflags __flags)
    {
      unsigned long long __ull = static_cast<unsigned long long>(__v);
      bool __neg = false;
      if (__v < 0)
 {
   __ull = -__ull;
   __neg = true;
 }
      return __int_to_char(__bufend, __ull, __lit, __flags, __neg);
    }

  template<typename _CharT>
    inline int
    __int_to_char(_CharT* __bufend, unsigned long long __v,
    const _CharT* __lit, ios_base::fmtflags __flags)
    { return __int_to_char(__bufend, __v, __lit,
      __flags & ~ios_base::showpos, false); }


  template<typename _CharT, typename _ValueT>
    int
    __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
    ios_base::fmtflags __flags, bool __neg)
    {

      const bool __showbase = (__flags & ios_base::showbase) && __v;
      const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
      _CharT* __buf = __bufend - 1;

      if (__builtin_expect(__basefield != ios_base::oct &&
      __basefield != ios_base::hex, true))
 {

   do
     {
       *__buf-- = __lit[(__v % 10) + __num_base::_S_odigits];
       __v /= 10;
     }
   while (__v != 0);
   if (__neg)
     *__buf-- = __lit[__num_base::_S_ominus];
   else if (__flags & ios_base::showpos)
     *__buf-- = __lit[__num_base::_S_oplus];
 }
      else if (__basefield == ios_base::oct)
 {

   do
     {
       *__buf-- = __lit[(__v & 0x7) + __num_base::_S_odigits];
       __v >>= 3;
     }
   while (__v != 0);
   if (__showbase)
     *__buf-- = __lit[__num_base::_S_odigits];
 }
      else
 {

   const bool __uppercase = __flags & ios_base::uppercase;
   const int __case_offset = __uppercase ? __num_base::_S_oudigits
                                         : __num_base::_S_odigits;
   do
     {
       *__buf-- = __lit[(__v & 0xf) + __case_offset];
       __v >>= 4;
     }
   while (__v != 0);
   if (__showbase)
     {

       *__buf-- = __lit[__num_base::_S_ox + __uppercase];

       *__buf-- = __lit[__num_base::_S_odigits];
     }
 }
      return __bufend - __buf - 1;
    }

  template<typename _CharT, typename _OutIter>
    void
    num_put<_CharT, _OutIter>::
    _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
   ios_base& __io, _CharT* __new, _CharT* __cs, int& __len) const
    {





      streamsize __off = 0;
      const ios_base::fmtflags __basefield = __io.flags()
                                      & ios_base::basefield;
      if ((__io.flags() & ios_base::showbase) && __len > 1)
 if (__basefield == ios_base::oct)
   {
     __off = 1;
     __new[0] = __cs[0];
   }
 else if (__basefield == ios_base::hex)
   {
     __off = 2;
     __new[0] = __cs[0];
     __new[1] = __cs[1];
   }
      _CharT* __p;
      __p = std::__add_grouping(__new + __off, __sep, __grouping,
    __grouping_size, __cs + __off,
    __cs + __len);
      __len = __p - __new;
    }

  template<typename _CharT, typename _OutIter>
    template<typename _ValueT>
      _OutIter
      num_put<_CharT, _OutIter>::
      _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
      _ValueT __v) const
      {
 typedef typename numpunct<_CharT>::__cache_type __cache_type;
 __use_cache<__cache_type> __uc;
 const locale& __loc = __io._M_getloc();
 const __cache_type* __lc = __uc(__loc);
 const _CharT* __lit = __lc->_M_atoms_out;


 const int __ilen = 4 * sizeof(_ValueT);
 _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
            * __ilen));



 int __len;
 __len = __int_to_char(__cs + __ilen, __v, __lit, __io.flags());
 __cs += __ilen - __len;


 if (__lc->_M_use_grouping)
   {


     _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
          * __len * 2));
     _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
    __lc->_M_thousands_sep, __io, __cs2, __cs, __len);
     __cs = __cs2;
   }


 const streamsize __w = __io.width();
 if (__w > static_cast<streamsize>(__len))
   {
     _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
          * __w));
     _M_pad(__fill, __w, __io, __cs3, __cs, __len);
     __cs = __cs3;
   }
 __io.width(0);



 return std::__write(__s, __cs, __len);
      }

  template<typename _CharT, typename _OutIter>
    void
    num_put<_CharT, _OutIter>::
    _M_group_float(const char* __grouping, size_t __grouping_size,
     _CharT __sep, const _CharT* __p, _CharT* __new,
     _CharT* __cs, int& __len) const
    {



      _CharT* __p2;
      const int __declen = __p ? __p - __cs : __len;
      __p2 = std::__add_grouping(__new, __sep, __grouping, __grouping_size,
     __cs, __cs + __declen);


      int __newlen = __p2 - __new;
      if (__p)
 {
   char_traits<_CharT>::copy(__p2, __p, __len - __declen);
   __newlen += __len - __declen;
 }
      __len = __newlen;
    }
# 1041 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
  template<typename _CharT, typename _OutIter>
    template<typename _ValueT>
      _OutIter
      num_put<_CharT, _OutIter>::
      _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
         _ValueT __v) const
      {
 typedef typename numpunct<_CharT>::__cache_type __cache_type;
 __use_cache<__cache_type> __uc;
 const locale& __loc = __io._M_getloc();
 const __cache_type* __lc = __uc(__loc);


 streamsize __prec = __io.precision();
 if (__prec < static_cast<streamsize>(0))
   __prec = static_cast<streamsize>(6);

 const int __max_digits = numeric_limits<_ValueT>::digits10;


 int __len;

 char __fbuf[16];




 int __cs_size = __max_digits * 3;
 char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));

 __num_base::_S_format_float(__io, __fbuf, __mod);
 __len = std::__convert_from_v(__cs, __cs_size, __fbuf, __v,
          _S_get_c_locale(), __prec);


 if (__len >= __cs_size)
   {
     __cs_size = __len + 1;
     __cs = static_cast<char*>(__builtin_alloca(__cs_size));
     __len = std::__convert_from_v(__cs, __cs_size, __fbuf, __v,
       _S_get_c_locale(), __prec);
   }
# 1105 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

      _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
          * __len));
      __ctype.widen(__cs, __cs + __len, __ws);


      const _CharT __cdec = __ctype.widen('.');
      const _CharT __dec = __lc->_M_decimal_point;
      const _CharT* __p;
      if ((__p = char_traits<_CharT>::find(__ws, __len, __cdec)))
 __ws[__p - __ws] = __dec;


      if (__lc->_M_use_grouping)
 {


   _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
        * __len * 2));
   _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
    __lc->_M_thousands_sep, __p, __ws2, __ws, __len);
   __ws = __ws2;
 }


      const streamsize __w = __io.width();
      if (__w > static_cast<streamsize>(__len))
 {
   _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
        * __w));
   _M_pad(__fill, __w, __io, __ws3, __ws, __len);
   __ws = __ws3;
 }
      __io.width(0);



      return std::__write(__s, __ws, __len);
      }

  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
    {
      const ios_base::fmtflags __flags = __io.flags();
      if ((__flags & ios_base::boolalpha) == 0)
        {
          const long __l = __v;
          __s = _M_insert_int(__s, __io, __fill, __l);
        }
      else
        {
   typedef typename numpunct<_CharT>::__cache_type __cache_type;
   __use_cache<__cache_type> __uc;
   const locale& __loc = __io._M_getloc();
   const __cache_type* __lc = __uc(__loc);

   const _CharT* __name = __v ? __lc->_M_truename
                              : __lc->_M_falsename;
   int __len = __v ? __lc->_M_truename_size
                   : __lc->_M_falsename_size;

   const streamsize __w = __io.width();
   if (__w > static_cast<streamsize>(__len))
     {
       _CharT* __cs
  = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
       * __w));
       _M_pad(__fill, __w, __io, __cs, __name, __len);
       __name = __cs;
     }
   __io.width(0);
   __s = std::__write(__s, __name, __len);
 }
      return __s;
    }

  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
    { return _M_insert_int(__s, __io, __fill, __v); }

  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill,
           unsigned long __v) const
    { return _M_insert_int(__s, __io, __fill, __v); }


  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __b, char_type __fill, long long __v) const
    { return _M_insert_int(__s, __b, __fill, __v); }

  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill,
           unsigned long long __v) const
    { return _M_insert_int(__s, __io, __fill, __v); }


  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
    { return _M_insert_float(__s, __io, __fill, char(), __v); }

  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill,
    long double __v) const
    { return _M_insert_float(__s, __io, __fill, 'L', __v); }

  template<typename _CharT, typename _OutIter>
    _OutIter
    num_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type __fill,
           const void* __v) const
    {
      const ios_base::fmtflags __flags = __io.flags();
      const ios_base::fmtflags __fmt = ~(ios_base::basefield
      | ios_base::uppercase
      | ios_base::internal);
      __io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));

      __s = _M_insert_int(__s, __io, __fill,
     reinterpret_cast<unsigned long>(__v));
      __io.flags(__flags);
      return __s;
    }

  template<typename _CharT, typename _InIter>
    template<bool _Intl>
      _InIter
      money_get<_CharT, _InIter>::
      _M_extract(iter_type __beg, iter_type __end, ios_base& __io,
   ios_base::iostate& __err, string& __units) const
      {
 typedef char_traits<_CharT> __traits_type;
 typedef typename string_type::size_type size_type;
 typedef money_base::part part;
 typedef moneypunct<_CharT, _Intl> __moneypunct_type;
 typedef typename __moneypunct_type::__cache_type __cache_type;

 const locale& __loc = __io._M_getloc();
 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

 __use_cache<__cache_type> __uc;
 const __cache_type* __lc = __uc(__loc);
 const char_type* __lit = __lc->_M_atoms;


 bool __negative = false;

 size_type __sign_size = 0;

 const bool __mandatory_sign = (__lc->_M_positive_sign_size
           && __lc->_M_negative_sign_size);

 string __grouping_tmp;
 if (__lc->_M_use_grouping)
   __grouping_tmp.reserve(32);

 int __last_pos = 0;

 int __n = 0;

 bool __testvalid = true;

 bool __testdecfound = false;


 string __res;
 __res.reserve(32);

 const char_type* __lit_zero = __lit + money_base::_S_zero;
 const char_type* __q;
 const money_base::pattern __p = __lc->_M_neg_format;
 for (int __i = 0; __i < 4 && __testvalid; ++__i)
   {
     const part __which = static_cast<part>(__p.field[__i]);
     switch (__which)
       {
       case money_base::symbol:




  if (__io.flags() & ios_base::showbase || __sign_size > 1
      || __i == 0
      || (__i == 1 && (__mandatory_sign
         || (static_cast<part>(__p.field[0])
      == money_base::sign)
         || (static_cast<part>(__p.field[2])
      == money_base::space)))
      || (__i == 2 && ((static_cast<part>(__p.field[3])
          == money_base::value)
         || __mandatory_sign
         && (static_cast<part>(__p.field[3])
      == money_base::sign))))
    {
      const size_type __len = __lc->_M_curr_symbol_size;
      size_type __j = 0;
      for (; __beg != __end && __j < __len
      && *__beg == __lc->_M_curr_symbol[__j];
    ++__beg, ++__j);
      if (__j != __len
   && (__j || __io.flags() & ios_base::showbase))
        __testvalid = false;
    }
  break;
       case money_base::sign:

  if (__lc->_M_positive_sign_size && __beg != __end
      && *__beg == __lc->_M_positive_sign[0])
    {
      __sign_size = __lc->_M_positive_sign_size;
      ++__beg;
    }
  else if (__lc->_M_negative_sign_size && __beg != __end
    && *__beg == __lc->_M_negative_sign[0])
    {
      __negative = true;
      __sign_size = __lc->_M_negative_sign_size;
      ++__beg;
    }
  else if (__lc->_M_positive_sign_size
    && !__lc->_M_negative_sign_size)


    __negative = true;
  else if (__mandatory_sign)
    __testvalid = false;
  break;
       case money_base::value:


  for (; __beg != __end; ++__beg)
    if ((__q = __traits_type::find(__lit_zero, 10, *__beg)))
      {
        __res += money_base::_S_atoms[__q - __lit];
        ++__n;
      }
    else if (*__beg == __lc->_M_decimal_point && !__testdecfound)
      {
        __last_pos = __n;
        __n = 0;
        __testdecfound = true;
      }
    else if (__lc->_M_use_grouping
      && *__beg == __lc->_M_thousands_sep
      && !__testdecfound)
      {
        if (__n)
   {

     __grouping_tmp += static_cast<char>(__n);
     __n = 0;
   }
        else
   {
     __testvalid = false;
     break;
   }
      }
    else
      break;
  if (__res.empty())
    __testvalid = false;
  break;
       case money_base::space:

  if (__beg != __end && __ctype.is(ctype_base::space, *__beg))
    ++__beg;
  else
    __testvalid = false;
       case money_base::none:

  if (__i != 3)
    for (; __beg != __end
    && __ctype.is(ctype_base::space, *__beg); ++__beg);
  break;
       }
   }


 if (__sign_size > 1 && __testvalid)
   {
     const char_type* __sign = __negative ? __lc->_M_negative_sign
                                          : __lc->_M_positive_sign;
     size_type __i = 1;
     for (; __beg != __end && __i < __sign_size
     && *__beg == __sign[__i]; ++__beg, ++__i);

     if (__i != __sign_size)
       __testvalid = false;
   }

 if (__testvalid)
   {

     if (__res.size() > 1)
       {
  const size_type __first = __res.find_first_not_of('0');
  const bool __only_zeros = __first == string::npos;
  if (__first)
    __res.erase(0, __only_zeros ? __res.size() - 1 : __first);
       }


     if (__negative && __res[0] != '0')
       __res.insert(__res.begin(), '-');


     if (__grouping_tmp.size())
       {

  __grouping_tmp += static_cast<char>(__testdecfound ? __last_pos
                         : __n);
  if (!std::__verify_grouping(__lc->_M_grouping,
         __lc->_M_grouping_size,
         __grouping_tmp))
    __testvalid = false;
       }


     if (__testdecfound && __lc->_M_frac_digits > 0
  && __n != __lc->_M_frac_digits)
       __testvalid = false;
   }


 if (__beg == __end)
   __err |= ios_base::eofbit;


 if (!__testvalid)
   __err |= ios_base::failbit;
 else
   __units.swap(__res);

 return __beg;
      }

  template<typename _CharT, typename _InIter>
    _InIter
    money_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
    ios_base::iostate& __err, long double& __units) const
    {
      string __str;
      if (__intl)
 __beg = _M_extract<true>(__beg, __end, __io, __err, __str);
      else
 __beg = _M_extract<false>(__beg, __end, __io, __err, __str);
      std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    money_get<_CharT, _InIter>::
    do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
    ios_base::iostate& __err, string_type& __units) const
    {
      typedef typename string::size_type size_type;

      const locale& __loc = __io._M_getloc();
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

      string __str;
      const iter_type __ret = __intl ? _M_extract<true>(__beg, __end, __io,
       __err, __str)
                              : _M_extract<false>(__beg, __end, __io,
        __err, __str);
      const size_type __len = __str.size();
      if (__len)
 {
   _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
              * __len));
   __ctype.widen(__str.data(), __str.data() + __len, __ws);
   __units.assign(__ws, __len);
 }

      return __ret;
    }

  template<typename _CharT, typename _OutIter>
    template<bool _Intl>
      _OutIter
      money_put<_CharT, _OutIter>::
      _M_insert(iter_type __s, ios_base& __io, char_type __fill,
  const string_type& __digits) const
      {
 typedef typename string_type::size_type size_type;
 typedef money_base::part part;
 typedef moneypunct<_CharT, _Intl> __moneypunct_type;
 typedef typename __moneypunct_type::__cache_type __cache_type;

 const locale& __loc = __io._M_getloc();
 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

 __use_cache<__cache_type> __uc;
 const __cache_type* __lc = __uc(__loc);
 const char_type* __lit = __lc->_M_atoms;



 const char_type* __beg = __digits.data();

 money_base::pattern __p;
 const char_type* __sign;
 size_type __sign_size;
 if (*__beg != __lit[money_base::_S_minus])
   {
     __p = __lc->_M_pos_format;
     __sign = __lc->_M_positive_sign;
     __sign_size = __lc->_M_positive_sign_size;
   }
 else
   {
     __p = __lc->_M_neg_format;
     __sign = __lc->_M_negative_sign;
     __sign_size = __lc->_M_negative_sign_size;
     if (__digits.size())
       ++__beg;
   }


 size_type __len = __ctype.scan_not(ctype_base::digit, __beg,
        __beg + __digits.size()) - __beg;
 if (__len)
   {



     string_type __value;
     __value.reserve(2 * __len);



     int __paddec = __len - __lc->_M_frac_digits;
     if (__paddec > 0)
         {
  if (__lc->_M_frac_digits < 0)
    __paddec = __len;
    if (__lc->_M_grouping_size)
      {
      _CharT* __ws =
          static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
             * 2 * __len));
        _CharT* __ws_end =
        std::__add_grouping(__ws, __lc->_M_thousands_sep,
       __lc->_M_grouping,
       __lc->_M_grouping_size,
       __beg, __beg + __paddec);
      __value.assign(__ws, __ws_end - __ws);
      }
    else
    __value.assign(__beg, __paddec);
       }


     if (__lc->_M_frac_digits > 0)
       {
  __value += __lc->_M_decimal_point;
  if (__paddec >= 0)
    __value.append(__beg + __paddec, __lc->_M_frac_digits);
  else
    {

      __value.append(-__paddec, __lit[money_base::_S_zero]);
      __value.append(__beg, __len);
    }
         }


     const ios_base::fmtflags __f = __io.flags()
                                    & ios_base::adjustfield;
     __len = __value.size() + __sign_size;
     __len += ((__io.flags() & ios_base::showbase)
        ? __lc->_M_curr_symbol_size : 0);

     string_type __res;
     __res.reserve(2 * __len);

     const size_type __width = static_cast<size_type>(__io.width());
     const bool __testipad = (__f == ios_base::internal
         && __len < __width);

     for (int __i = 0; __i < 4; ++__i)
       {
  const part __which = static_cast<part>(__p.field[__i]);
  switch (__which)
    {
    case money_base::symbol:
      if (__io.flags() & ios_base::showbase)
        __res.append(__lc->_M_curr_symbol,
       __lc->_M_curr_symbol_size);
      break;
    case money_base::sign:



      if (__sign_size)
        __res += __sign[0];
      break;
    case money_base::value:
      __res += __value;
      break;
    case money_base::space:



      if (__testipad)
        __res.append(__width - __len, __fill);
      else
        __res += __fill;
      break;
    case money_base::none:
      if (__testipad)
        __res.append(__width - __len, __fill);
      break;
    }
       }


     if (__sign_size > 1)
       __res.append(__sign + 1, __sign_size - 1);


     __len = __res.size();
     if (__width > __len)
       {
  if (__f == ios_base::left)

    __res.append(__width - __len, __fill);
  else

    __res.insert(0, __width - __len, __fill);
  __len = __width;
       }


     __s = std::__write(__s, __res.data(), __len);
   }
 __io.width(0);
 return __s;
      }

  template<typename _CharT, typename _OutIter>
    _OutIter
    money_put<_CharT, _OutIter>::
    do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
    long double __units) const
    {
      const locale __loc = __io.getloc();
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);


      int __cs_size = 64;
      char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));


      int __len = std::__convert_from_v(__cs, __cs_size, "%.*Lf", __units,
     _S_get_c_locale(), 0);

      if (__len >= __cs_size)
 {
   __cs_size = __len + 1;
   __cs = static_cast<char*>(__builtin_alloca(__cs_size));
   __len = std::__convert_from_v(__cs, __cs_size, "%.*Lf", __units,
     _S_get_c_locale(), 0);
 }







      _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
          * __cs_size));
      __ctype.widen(__cs, __cs + __len, __ws);
      const string_type __digits(__ws, __len);
      return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
             : _M_insert<false>(__s, __io, __fill, __digits);
    }

  template<typename _CharT, typename _OutIter>
    _OutIter
    money_put<_CharT, _OutIter>::
    do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
    const string_type& __digits) const
    { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
             : _M_insert<false>(__s, __io, __fill, __digits); }





  template<typename _CharT, typename _InIter>
    time_base::dateorder
    time_get<_CharT, _InIter>::do_date_order() const
    { return time_base::no_order; }



  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
     ios_base::iostate& __err, tm* __tm,
     const _CharT* __format) const
    {
      const locale& __loc = __io._M_getloc();
      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
      const size_t __len = char_traits<_CharT>::length(__format);

      for (size_t __i = 0; __beg != __end && __i < __len && !__err; ++__i)
 {
   if (__ctype.narrow(__format[__i], 0) == '%')
     {

       char __c = __ctype.narrow(__format[++__i], 0);
       int __mem = 0;
       if (__c == 'E' || __c == 'O')
  __c = __ctype.narrow(__format[++__i], 0);
       switch (__c)
  {
    const char* __cs;
    _CharT __wcs[10];
  case 'a':

    const char_type* __days1[7];
    __tp._M_days_abbreviated(__days1);
    __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1,
       7, __io, __err);
    break;
  case 'A':

    const char_type* __days2[7];
    __tp._M_days(__days2);
    __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2,
       7, __io, __err);
    break;
  case 'h':
  case 'b':

    const char_type* __months1[12];
    __tp._M_months_abbreviated(__months1);
    __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
       __months1, 12, __io, __err);
    break;
  case 'B':

    const char_type* __months2[12];
    __tp._M_months(__months2);
    __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
       __months2, 12, __io, __err);
    break;
  case 'c':

    const char_type* __dt[2];
    __tp._M_date_time_formats(__dt);
    __beg = _M_extract_via_format(__beg, __end, __io, __err,
      __tm, __dt[0]);
    break;
  case 'd':

    __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2,
      __io, __err);
    break;
  case 'e':


    if (__ctype.is(ctype_base::space, *__beg))
      __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9,
        1, __io, __err);
    else
      __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31,
        2, __io, __err);
    break;
  case 'D':

    __cs = "%m/%d/%y";
    __ctype.widen(__cs, __cs + 9, __wcs);
    __beg = _M_extract_via_format(__beg, __end, __io, __err,
      __tm, __wcs);
    break;
  case 'H':

    __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2,
      __io, __err);
    break;
  case 'I':

    __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2,
      __io, __err);
    break;
  case 'm':

    __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2,
      __io, __err);
    if (!__err)
      __tm->tm_mon = __mem - 1;
    break;
  case 'M':

    __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2,
      __io, __err);
    break;
  case 'n':
    if (__ctype.narrow(*__beg, 0) == '\n')
      ++__beg;
    else
      __err |= ios_base::failbit;
    break;
  case 'R':

    __cs = "%H:%M";
    __ctype.widen(__cs, __cs + 6, __wcs);
    __beg = _M_extract_via_format(__beg, __end, __io, __err,
      __tm, __wcs);
    break;
  case 'S':



    __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2,



      __io, __err);
    break;
  case 't':
    if (__ctype.narrow(*__beg, 0) == '\t')
      ++__beg;
    else
      __err |= ios_base::failbit;
    break;
  case 'T':

    __cs = "%H:%M:%S";
    __ctype.widen(__cs, __cs + 9, __wcs);
    __beg = _M_extract_via_format(__beg, __end, __io, __err,
      __tm, __wcs);
    break;
  case 'x':

    const char_type* __dates[2];
    __tp._M_date_formats(__dates);
    __beg = _M_extract_via_format(__beg, __end, __io, __err,
      __tm, __dates[0]);
    break;
  case 'X':

    const char_type* __times[2];
    __tp._M_time_formats(__times);
    __beg = _M_extract_via_format(__beg, __end, __io, __err,
      __tm, __times[0]);
    break;
  case 'y':
  case 'C':

    __beg = _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2,
      __io, __err);
    break;
  case 'Y':

    __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
      __io, __err);
    if (!__err)
      __tm->tm_year = __mem - 1900;
    break;
  case 'Z':

    if (__ctype.is(ctype_base::upper, *__beg))
      {
        int __tmp;
        __beg = _M_extract_name(__beg, __end, __tmp,
           __timepunct_cache<_CharT>::_S_timezones,
           14, __io, __err);


        if (__beg != __end && !__err && __tmp == 0
     && (*__beg == __ctype.widen('-')
         || *__beg == __ctype.widen('+')))
   {
     __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2,
       __io, __err);
     __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2,
       __io, __err);
   }
      }
    else
      __err |= ios_base::failbit;
    break;
  default:

    __err |= ios_base::failbit;
  }
     }
   else
     {

       if (__format[__i] == *__beg)
  ++__beg;
       else
  __err |= ios_base::failbit;
     }
 }
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    _M_extract_num(iter_type __beg, iter_type __end, int& __member,
     int __min, int __max, size_t __len,
     ios_base& __io, ios_base::iostate& __err) const
    {
      const locale& __loc = __io._M_getloc();
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);


      int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);

      ++__min;
      size_t __i = 0;
      int __value = 0;
      for (; __beg != __end && __i < __len; ++__beg, ++__i)
 {
   const char __c = __ctype.narrow(*__beg, '*');
   if (__c >= '0' && __c <= '9')
     {
       __value = __value * 10 + (__c - '0');
       const int __valuec = __value * __mult;
       if (__valuec > __max || __valuec + __mult < __min)
  break;
       __mult /= 10;
     }
   else
     break;
 }
      if (__i == __len)
 __member = __value;
      else
 __err |= ios_base::failbit;
      return __beg;
    }



  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    _M_extract_name(iter_type __beg, iter_type __end, int& __member,
      const _CharT** __names, size_t __indexlen,
      ios_base& __io, ios_base::iostate& __err) const
    {
      typedef char_traits<_CharT> __traits_type;
      const locale& __loc = __io._M_getloc();
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

      int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int)
         * __indexlen));
      size_t __nmatches = 0;
      size_t __pos = 0;
      bool __testvalid = true;
      const char_type* __name;





      if (__beg != __end)
 {
   const char_type __c = *__beg;
   for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
     if (__c == __names[__i1][0]
  || __c == __ctype.toupper(__names[__i1][0]))
       __matches[__nmatches++] = __i1;
 }

      while (__nmatches > 1)
 {

   size_t __minlen = __traits_type::length(__names[__matches[0]]);
   for (size_t __i2 = 1; __i2 < __nmatches; ++__i2)
     __minlen = std::min(__minlen,
         __traits_type::length(__names[__matches[__i2]]));
   ++__beg, ++__pos;
   if (__pos < __minlen && __beg != __end)
     for (size_t __i3 = 0; __i3 < __nmatches;)
       {
  __name = __names[__matches[__i3]];
  if (__name[__pos] != *__beg)
    __matches[__i3] = __matches[--__nmatches];
  else
    ++__i3;
       }
   else
     break;
 }

      if (__nmatches == 1)
 {

   ++__beg, ++__pos;
   __name = __names[__matches[0]];
   const size_t __len = __traits_type::length(__name);
   while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
     ++__beg, ++__pos;

   if (__len == __pos)
     __member = __matches[0];
   else
     __testvalid = false;
 }
      else
 __testvalid = false;
      if (!__testvalid)
 __err |= ios_base::failbit;
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
  ios_base::iostate& __err, tm* __tm) const
    {
      const locale& __loc = __io._M_getloc();
      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
      const char_type* __times[2];
      __tp._M_time_formats(__times);
      __beg = _M_extract_via_format(__beg, __end, __io, __err,
        __tm, __times[0]);
      if (__beg == __end)
 __err |= ios_base::eofbit;
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
  ios_base::iostate& __err, tm* __tm) const
    {
      const locale& __loc = __io._M_getloc();
      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
      const char_type* __dates[2];
      __tp._M_date_formats(__dates);
      __beg = _M_extract_via_format(__beg, __end, __io, __err,
        __tm, __dates[0]);
      if (__beg == __end)
 __err |= ios_base::eofbit;
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
     ios_base::iostate& __err, tm* __tm) const
    {
      typedef char_traits<_CharT> __traits_type;
      const locale& __loc = __io._M_getloc();
      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
      const char_type* __days[7];
      __tp._M_days_abbreviated(__days);
      int __tmpwday;
      __beg = _M_extract_name(__beg, __end, __tmpwday, __days, 7, __io, __err);







      if (!__err && __beg != __end)
 {
   size_t __pos = __traits_type::length(__days[__tmpwday]);
   __tp._M_days(__days);
   const char_type* __name = __days[__tmpwday];
   if (__name[__pos] == *__beg)
     {

       const size_t __len = __traits_type::length(__name);
       while (__pos < __len && __beg != __end
       && __name[__pos] == *__beg)
  ++__beg, ++__pos;
       if (__len != __pos)
  __err |= ios_base::failbit;
     }
 }
      if (!__err)
 __tm->tm_wday = __tmpwday;

      if (__beg == __end)
 __err |= ios_base::eofbit;
      return __beg;
     }

  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    do_get_monthname(iter_type __beg, iter_type __end,
                     ios_base& __io, ios_base::iostate& __err, tm* __tm) const
    {
      typedef char_traits<_CharT> __traits_type;
      const locale& __loc = __io._M_getloc();
      const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
      const char_type* __months[12];
      __tp._M_months_abbreviated(__months);
      int __tmpmon;
      __beg = _M_extract_name(__beg, __end, __tmpmon, __months, 12,
         __io, __err);







      if (!__err && __beg != __end)
 {
   size_t __pos = __traits_type::length(__months[__tmpmon]);
   __tp._M_months(__months);
   const char_type* __name = __months[__tmpmon];
   if (__name[__pos] == *__beg)
     {

       const size_t __len = __traits_type::length(__name);
       while (__pos < __len && __beg != __end
       && __name[__pos] == *__beg)
  ++__beg, ++__pos;
       if (__len != __pos)
  __err |= ios_base::failbit;
     }
 }
      if (!__err)
 __tm->tm_mon = __tmpmon;

      if (__beg == __end)
 __err |= ios_base::eofbit;
      return __beg;
    }

  template<typename _CharT, typename _InIter>
    _InIter
    time_get<_CharT, _InIter>::
    do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
  ios_base::iostate& __err, tm* __tm) const
    {
      const locale& __loc = __io._M_getloc();
      const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

      size_t __i = 0;
      int __value = 0;
      for (; __beg != __end && __i < 4; ++__beg, ++__i)
 {
   const char __c = __ctype.narrow(*__beg, '*');
   if (__c >= '0' && __c <= '9')
     __value = __value * 10 + (__c - '0');
   else
     break;
 }
      if (__i == 2 || __i == 4)
 __tm->tm_year = __i == 2 ? __value : __value - 1900;
      else
 __err |= ios_base::failbit;
      if (__beg == __end)
 __err |= ios_base::eofbit;
      return __beg;
    }

  template<typename _CharT, typename _OutIter>
    _OutIter
    time_put<_CharT, _OutIter>::
    put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
 const _CharT* __beg, const _CharT* __end) const
    {
      const locale& __loc = __io._M_getloc();
      ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
      for (; __beg != __end; ++__beg)
 if (__ctype.narrow(*__beg, 0) != '%')
   {
     *__s = *__beg;
     ++__s;
   }
 else if (++__beg != __end)
   {
     char __format;
     char __mod = 0;
     const char __c = __ctype.narrow(*__beg, 0);
     if (__c != 'E' && __c != 'O')
       __format = __c;
     else if (++__beg != __end)
       {
  __mod = __c;
  __format = __ctype.narrow(*__beg, 0);
       }
     else
       break;
     __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
   }
 else
   break;
      return __s;
    }

  template<typename _CharT, typename _OutIter>
    _OutIter
    time_put<_CharT, _OutIter>::
    do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm,
    char __format, char __mod) const
    {
      const locale& __loc = __io._M_getloc();
      ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
      __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);



      const size_t __maxlen = 128;
      char_type* __res =
       static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __maxlen));






      char_type __fmt[4];
      __fmt[0] = __ctype.widen('%');
      if (!__mod)
 {
   __fmt[1] = __format;
   __fmt[2] = char_type();
 }
      else
 {
   __fmt[1] = __mod;
   __fmt[2] = __format;
   __fmt[3] = char_type();
 }

      __tp._M_put(__res, __maxlen, __fmt, __tm);


      return std::__write(__s, __res, char_traits<char_type>::length(__res));
    }



  template<typename _CharT>
    int
    collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const
    { return 0; }


  template<typename _CharT>
    size_t
    collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const
    { return 0; }

  template<typename _CharT>
    int
    collate<_CharT>::
    do_compare(const _CharT* __lo1, const _CharT* __hi1,
        const _CharT* __lo2, const _CharT* __hi2) const
    {


      const string_type __one(__lo1, __hi1);
      const string_type __two(__lo2, __hi2);

      const _CharT* __p = __one.c_str();
      const _CharT* __pend = __one.data() + __one.length();
      const _CharT* __q = __two.c_str();
      const _CharT* __qend = __two.data() + __two.length();




      for (;;)
 {
   const int __res = _M_compare(__p, __q);
   if (__res)
     return __res;

   __p += char_traits<_CharT>::length(__p);
   __q += char_traits<_CharT>::length(__q);
   if (__p == __pend && __q == __qend)
     return 0;
   else if (__p == __pend)
     return -1;
   else if (__q == __qend)
     return 1;

   __p++;
   __q++;
 }
    }

  template<typename _CharT>
    typename collate<_CharT>::string_type
    collate<_CharT>::
    do_transform(const _CharT* __lo, const _CharT* __hi) const
    {

      string_type __str(__lo, __hi);

      const _CharT* __p = __str.c_str();
      const _CharT* __pend = __str.data() + __str.length();

      size_t __len = (__hi - __lo) * 2;

      string_type __ret;




      for (;;)
 {

   _CharT* __c =
     static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len));
   size_t __res = _M_transform(__c, __p, __len);


   if (__res >= __len)
     {
       __len = __res + 1;
       __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
         * __len));
       __res = _M_transform(__c, __p, __res + 1);
     }

   __ret.append(__c, __res);
   __p += char_traits<_CharT>::length(__p);
   if (__p == __pend)
     return __ret;

   __p++;
   __ret.push_back(_CharT());
 }
    }

  template<typename _CharT>
    long
    collate<_CharT>::
    do_hash(const _CharT* __lo, const _CharT* __hi) const
    {
      unsigned long __val = 0;
      for (; __lo < __hi; ++__lo)
 __val = *__lo + ((__val << 7) |
         (__val >> (numeric_limits<unsigned long>::digits - 7)));
      return static_cast<long>(__val);
    }
# 2388 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc" 3
  template<typename _CharT, typename _Traits>
    void
    __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
       _CharT* __news, const _CharT* __olds,
       const streamsize __newlen,
       const streamsize __oldlen, const bool __num)
    {
      const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
      const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;


      if (__adjust == ios_base::left)
 {
   _Traits::copy(__news, const_cast<_CharT*>(__olds), __oldlen);
   _Traits::assign(__news + __oldlen, __plen, __fill);
   return;
 }

      size_t __mod = 0;
      if (__adjust == ios_base::internal && __num)
 {



          const locale& __loc = __io._M_getloc();
   const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);

   const bool __testsign = (__ctype.widen('-') == __olds[0]
       || __ctype.widen('+') == __olds[0]);
   const bool __testhex = (__ctype.widen('0') == __olds[0]
      && __oldlen > 1
      && (__ctype.widen('x') == __olds[1]
          || __ctype.widen('X') == __olds[1]));
   if (__testhex)
     {
       __news[0] = __olds[0];
       __news[1] = __olds[1];
       __mod = 2;
       __news += 2;
     }
   else if (__testsign)
     {
       __news[0] = __olds[0];
       __mod = 1;
       ++__news;
     }

 }
      _Traits::assign(__news, __plen, __fill);
      _Traits::copy(__news + __plen, const_cast<_CharT*>(__olds + __mod),
      __oldlen - __mod);
    }

  bool
  __verify_grouping(const char* __grouping, size_t __grouping_size,
      const string& __grouping_tmp)
  {
    const size_t __n = __grouping_tmp.size() - 1;
    const size_t __min = std::min(__n, __grouping_size - 1);
    size_t __i = __n;
    bool __test = true;




    for (size_t __j = 0; __j < __min && __test; --__i, ++__j)
      __test = __grouping_tmp[__i] == __grouping[__j];
    for (; __i && __test; --__i)
      __test = __grouping_tmp[__i] == __grouping[__min];


    __test &= __grouping_tmp[0] <= __grouping[__min];
    return __test;
  }

  template<typename _CharT>
    _CharT*
    __add_grouping(_CharT* __s, _CharT __sep,
     const char* __gbeg, size_t __gsize,
     const _CharT* __first, const _CharT* __last)
    {
      if (__last - __first > *__gbeg)
 {
   const bool __bump = __gsize != 1;
   __s = std::__add_grouping(__s, __sep, __gbeg + __bump,
        __gsize - __bump, __first,
        __last - *__gbeg);
   __first = __last - *__gbeg;
   *__s++ = __sep;
 }
      do
 *__s++ = *__first++;
      while (__first != __last);
      return __s;
    }





  extern template class moneypunct<char, false>;
  extern template class moneypunct<char, true>;
  extern template class moneypunct_byname<char, false>;
  extern template class moneypunct_byname<char, true>;
  extern template class money_get<char>;
  extern template class money_put<char>;
  extern template class numpunct<char>;
  extern template class numpunct_byname<char>;
  extern template class num_get<char>;
  extern template class num_put<char>;
  extern template class __timepunct<char>;
  extern template class time_put<char>;
  extern template class time_put_byname<char>;
  extern template class time_get<char>;
  extern template class time_get_byname<char>;
  extern template class messages<char>;
  extern template class messages_byname<char>;
  extern template class ctype_byname<char>;
  extern template class codecvt_byname<char, char, mbstate_t>;
  extern template class collate<char>;
  extern template class collate_byname<char>;

  extern template
    const codecvt<char, char, mbstate_t>&
    use_facet<codecvt<char, char, mbstate_t> >(const locale&);

  extern template
    const collate<char>&
    use_facet<collate<char> >(const locale&);

  extern template
    const numpunct<char>&
    use_facet<numpunct<char> >(const locale&);

  extern template
    const num_put<char>&
    use_facet<num_put<char> >(const locale&);

  extern template
    const num_get<char>&
    use_facet<num_get<char> >(const locale&);

  extern template
    const moneypunct<char, true>&
    use_facet<moneypunct<char, true> >(const locale&);

  extern template
    const moneypunct<char, false>&
    use_facet<moneypunct<char, false> >(const locale&);

  extern template
    const money_put<char>&
    use_facet<money_put<char> >(const locale&);

  extern template
    const money_get<char>&
    use_facet<money_get<char> >(const locale&);

  extern template
    const __timepunct<char>&
    use_facet<__timepunct<char> >(const locale&);

  extern template
    const time_put<char>&
    use_facet<time_put<char> >(const locale&);

  extern template
    const time_get<char>&
    use_facet<time_get<char> >(const locale&);

  extern template
    const messages<char>&
    use_facet<messages<char> >(const locale&);

  extern template
    bool
    has_facet<ctype<char> >(const locale&);

  extern template
    bool
    has_facet<codecvt<char, char, mbstate_t> >(const locale&);

  extern template
    bool
    has_facet<collate<char> >(const locale&);

  extern template
    bool
    has_facet<numpunct<char> >(const locale&);

  extern template
    bool
    has_facet<num_put<char> >(const locale&);

  extern template
    bool
    has_facet<num_get<char> >(const locale&);

  extern template
    bool
    has_facet<moneypunct<char> >(const locale&);

  extern template
    bool
    has_facet<money_put<char> >(const locale&);

  extern template
    bool
    has_facet<money_get<char> >(const locale&);

  extern template
    bool
    has_facet<__timepunct<char> >(const locale&);

  extern template
    bool
    has_facet<time_put<char> >(const locale&);

  extern template
    bool
    has_facet<time_get<char> >(const locale&);

  extern template
    bool
    has_facet<messages<char> >(const locale&);


  extern template class moneypunct<wchar_t, false>;
  extern template class moneypunct<wchar_t, true>;
  extern template class moneypunct_byname<wchar_t, false>;
  extern template class moneypunct_byname<wchar_t, true>;
  extern template class money_get<wchar_t>;
  extern template class money_put<wchar_t>;
  extern template class numpunct<wchar_t>;
  extern template class numpunct_byname<wchar_t>;
  extern template class num_get<wchar_t>;
  extern template class num_put<wchar_t>;
  extern template class __timepunct<wchar_t>;
  extern template class time_put<wchar_t>;
  extern template class time_put_byname<wchar_t>;
  extern template class time_get<wchar_t>;
  extern template class time_get_byname<wchar_t>;
  extern template class messages<wchar_t>;
  extern template class messages_byname<wchar_t>;
  extern template class ctype_byname<wchar_t>;
  extern template class codecvt_byname<wchar_t, char, mbstate_t>;
  extern template class collate<wchar_t>;
  extern template class collate_byname<wchar_t>;

  extern template
    const codecvt<wchar_t, char, mbstate_t>&
    use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);

  extern template
    const collate<wchar_t>&
    use_facet<collate<wchar_t> >(const locale&);

  extern template
    const numpunct<wchar_t>&
    use_facet<numpunct<wchar_t> >(const locale&);

  extern template
    const num_put<wchar_t>&
    use_facet<num_put<wchar_t> >(const locale&);

  extern template
    const num_get<wchar_t>&
    use_facet<num_get<wchar_t> >(const locale&);

  extern template
    const moneypunct<wchar_t, true>&
    use_facet<moneypunct<wchar_t, true> >(const locale&);

  extern template
    const moneypunct<wchar_t, false>&
    use_facet<moneypunct<wchar_t, false> >(const locale&);

  extern template
    const money_put<wchar_t>&
    use_facet<money_put<wchar_t> >(const locale&);

  extern template
    const money_get<wchar_t>&
    use_facet<money_get<wchar_t> >(const locale&);

  extern template
    const __timepunct<wchar_t>&
    use_facet<__timepunct<wchar_t> >(const locale&);

  extern template
    const time_put<wchar_t>&
    use_facet<time_put<wchar_t> >(const locale&);

  extern template
    const time_get<wchar_t>&
    use_facet<time_get<wchar_t> >(const locale&);

  extern template
    const messages<wchar_t>&
    use_facet<messages<wchar_t> >(const locale&);

 extern template
    bool
    has_facet<ctype<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);

  extern template
    bool
    has_facet<collate<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<numpunct<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<num_put<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<num_get<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<moneypunct<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<money_put<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<money_get<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<__timepunct<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<time_put<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<time_get<wchar_t> >(const locale&);

  extern template
    bool
    has_facet<messages<wchar_t> >(const locale&);


}
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/locale" 2 3
# 41 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ostream.tcc" 2 3

namespace std
{
  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>::sentry::
    sentry(basic_ostream<_CharT, _Traits>& __os)
    : _M_ok(false), _M_os(__os)
    {

      if (__os.tie() && __os.good())
 __os.tie()->flush();

      if (__os.good())
 _M_ok = true;
      else
 __os.setstate(ios_base::failbit);
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(__ostream_type& (*__pf)(__ostream_type&))
    {



      return __pf(*this);
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(__ios_type& (*__pf)(__ios_type&))
    {



      __pf(*this);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(ios_base& (*__pf)(ios_base&))
    {



      __pf(*this);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(bool __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if (__np.put(*this, *this, this->fill(), __n).failed())
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(long __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       bool __b = false;
       const char_type __c = this->fill();
       const ios_base::fmtflags __fmt = (this->flags()
      & ios_base::basefield);
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
  {
    const unsigned long __l = static_cast<unsigned long>(__n);
    __b = __np.put(*this, *this, __c, __l).failed();
  }
       else
  __b = __np.put(*this, *this, __c, __n).failed();
       if (__b)
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(unsigned long __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if (__np.put(*this, *this, this->fill(), __n).failed())
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }


  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(long long __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       bool __b = false;
       const char_type __c = this->fill();
       const ios_base::fmtflags __fmt = (this->flags()
      & ios_base::basefield);
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
  {
    const unsigned long long __l = (static_cast<
        unsigned long long>(__n));
    __b = __np.put(*this, *this, __c, __l).failed();
  }
       else
  __b = __np.put(*this, *this, __c, __n).failed();
       if (__b)
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(unsigned long long __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if (__np.put(*this, *this, this->fill(), __n).failed())
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }


  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(double __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if (__np.put(*this, *this, this->fill(), __n).failed())
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(long double __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if (__np.put(*this, *this, this->fill(), __n).failed())
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(const void* __n)
    {
      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_put_type& __np = __check_facet(this->_M_num_put);
       if (__np.put(*this, *this, this->fill(), __n).failed())
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    operator<<(__streambuf_type* __sbin)
    {
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this);
      if (__cerb && __sbin)
 {
   try
     {
       if (!__copy_streambufs(__sbin, this->rdbuf()))
  __err |= ios_base::failbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::failbit); }
 }
      else if (!__sbin)
 __err |= ios_base::badbit;
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    put(char_type __c)
    {






      sentry __cerb(*this);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const int_type __put = this->rdbuf()->sputc(__c);
       if (traits_type::eq_int_type(__put, traits_type::eof()))
  __err |= ios_base::badbit;
     }
   catch (...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    write(const _CharT* __s, streamsize __n)
    {







      sentry __cerb(*this);
      if (__cerb)
 {
   try
     { _M_write(__s, __n); }
   catch (...)
     { this->_M_setstate(ios_base::badbit); }
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    flush()
    {



      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      try
 {
   if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
     __err |= ios_base::badbit;
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    typename basic_ostream<_CharT, _Traits>::pos_type
    basic_ostream<_CharT, _Traits>::
    tellp()
    {
      pos_type __ret = pos_type(-1);
      try
 {
   if (!this->fail())
     __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      return __ret;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    seekp(pos_type __pos)
    {
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      try
 {
   if (!this->fail())
     {


       const pos_type __p = this->rdbuf()->pubseekpos(__pos,
            ios_base::out);


       if (__p == pos_type(off_type(-1)))
  __err |= ios_base::failbit;
     }
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    basic_ostream<_CharT, _Traits>::
    seekp(off_type __off, ios_base::seekdir __dir)
    {
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      try
 {
   if (!this->fail())
     {


       const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
            ios_base::out);


       if (__p == pos_type(off_type(-1)))
  __err |= ios_base::failbit;
     }
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      if (__err)
 this->setstate(__err);
      return *this;
    }


  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    {
      typedef basic_ostream<_CharT, _Traits> __ostream_type;
      typename __ostream_type::sentry __cerb(__out);
      if (__cerb)
 {
   try
     {
       const streamsize __w = __out.width();
       streamsize __len = 1;
       _CharT* __cs = &__c;
       if (__w > __len)
  {
    __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
              * __w));
    __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
       &__c, __w, __len, false);
    __len = __w;
  }
       __out._M_write(__cs, __len);
       __out.width(0);
     }
   catch(...)
     { __out._M_setstate(ios_base::badbit); }
 }
      return __out;
    }


  template <class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    {
      typedef basic_ostream<char, _Traits> __ostream_type;
      typename __ostream_type::sentry __cerb(__out);
      if (__cerb)
 {
   try
     {
       const streamsize __w = __out.width();
       streamsize __len = 1;
       char* __cs = &__c;
       if (__w > __len)
  {
    __cs = static_cast<char*>(__builtin_alloca(__w));
    __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
            &__c, __w, __len, false);
    __len = __w;
  }
       __out._M_write(__cs, __len);
       __out.width(0);
     }
   catch(...)
     { __out._M_setstate(ios_base::badbit); }
 }
      return __out;
     }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    {
      typedef basic_ostream<_CharT, _Traits> __ostream_type;
      typename __ostream_type::sentry __cerb(__out);
      if (__cerb && __s)
 {
   try
     {
       const streamsize __w = __out.width();
       streamsize __len = static_cast<streamsize>(_Traits::length(__s));
       if (__w > __len)
  {
    _CharT* __cs = (static_cast<
      _CharT*>(__builtin_alloca(sizeof(_CharT)
           * __w)));
    __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
       __s, __w, __len, false);
    __s = __cs;
    __len = __w;
  }
       __out._M_write(__s, __len);
       __out.width(0);
     }
   catch(...)
     { __out._M_setstate(ios_base::badbit); }
 }
      else if (!__s)
 __out.setstate(ios_base::badbit);
      return __out;
    }

  template<typename _CharT, typename _Traits>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    {
      typedef basic_ostream<_CharT, _Traits> __ostream_type;



      typedef char_traits<char> __traits_type;
      typename __ostream_type::sentry __cerb(__out);
      if (__cerb && __s)
 {
   size_t __clen = __traits_type::length(__s);
   _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
              * __clen));
   for (size_t __i = 0; __i < __clen; ++__i)
     __ws[__i] = __out.widen(__s[__i]);
   _CharT* __str = __ws;

   try
     {
       const streamsize __w = __out.width();
       streamsize __len = static_cast<streamsize>(__clen);
       if (__w > __len)
  {
    _CharT* __cs = (static_cast<
      _CharT*>(__builtin_alloca(sizeof(_CharT)
           * __w)));
    __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
       __ws, __w, __len, false);
    __str = __cs;
    __len = __w;
  }
       __out._M_write(__str, __len);
       __out.width(0);
     }
   catch(...)
     { __out._M_setstate(ios_base::badbit); }
 }
      else if (!__s)
 __out.setstate(ios_base::badbit);
      return __out;
    }


  template<class _Traits>
    basic_ostream<char, _Traits>&
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    {
      typedef basic_ostream<char, _Traits> __ostream_type;
      typename __ostream_type::sentry __cerb(__out);
      if (__cerb && __s)
 {
   try
     {
       const streamsize __w = __out.width();
       streamsize __len = static_cast<streamsize>(_Traits::length(__s));
       if (__w > __len)
  {
    char* __cs = static_cast<char*>(__builtin_alloca(__w));
    __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
       __s, __w, __len, false);
    __s = __cs;
    __len = __w;
  }
       __out._M_write(__s, __len);
       __out.width(0);
     }
   catch(...)
     { __out._M_setstate(ios_base::badbit); }
 }
      else if (!__s)
 __out.setstate(ios_base::badbit);
      return __out;
    }


  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_ostream<_CharT, _Traits>&
    operator<<(basic_ostream<_CharT, _Traits>& __out,
        const basic_string<_CharT, _Traits, _Alloc>& __str)
    {
      typedef basic_ostream<_CharT, _Traits> __ostream_type;
      typename __ostream_type::sentry __cerb(__out);
      if (__cerb)
 {
   const streamsize __w = __out.width();
   streamsize __len = static_cast<streamsize>(__str.size());
   const _CharT* __s = __str.data();



   if (__w > __len)
     {
       _CharT* __cs = (static_cast<
         _CharT*>(__builtin_alloca(sizeof(_CharT) * __w)));
       __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, __s,
          __w, __len, false);
       __s = __cs;
       __len = __w;
     }
   __out._M_write(__s, __len);
   __out.width(0);
 }
      return __out;
    }





  extern template class basic_ostream<char>;
  extern template ostream& endl(ostream&);
  extern template ostream& ends(ostream&);
  extern template ostream& flush(ostream&);
  extern template ostream& operator<<(ostream&, char);
  extern template ostream& operator<<(ostream&, unsigned char);
  extern template ostream& operator<<(ostream&, signed char);
  extern template ostream& operator<<(ostream&, const char*);
  extern template ostream& operator<<(ostream&, const unsigned char*);
  extern template ostream& operator<<(ostream&, const signed char*);


  extern template class basic_ostream<wchar_t>;
  extern template wostream& endl(wostream&);
  extern template wostream& ends(wostream&);
  extern template wostream& flush(wostream&);
  extern template wostream& operator<<(wostream&, wchar_t);
  extern template wostream& operator<<(wostream&, char);
  extern template wostream& operator<<(wostream&, const wchar_t*);
  extern template wostream& operator<<(wostream&, const char*);


}
# 546 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/ostream" 2 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3




namespace std
{
# 58 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
  template<typename _CharT, typename _Traits>
    class basic_istream : virtual public basic_ios<_CharT, _Traits>
    {
    public:

      typedef _CharT char_type;
      typedef typename _Traits::int_type int_type;
      typedef typename _Traits::pos_type pos_type;
      typedef typename _Traits::off_type off_type;
      typedef _Traits traits_type;


      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
      typedef basic_ios<_CharT, _Traits> __ios_type;
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
        __num_get_type;
      typedef ctype<_CharT> __ctype_type;

      template<typename _CharT2, typename _Traits2>
        friend basic_istream<_CharT2, _Traits2>&
        operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2&);

      template<typename _CharT2, typename _Traits2>
        friend basic_istream<_CharT2, _Traits2>&
        operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);

    protected:







      streamsize _M_gcount;

    public:
# 104 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      explicit
      basic_istream(__streambuf_type* __sb): _M_gcount(streamsize(0))
      { this->init(__sb); }






      virtual
      ~basic_istream()
      { _M_gcount = streamsize(0); }


      class sentry;
      friend class sentry;
# 131 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      inline __istream_type&
      operator>>(__istream_type& (*__pf)(__istream_type&));

      inline __istream_type&
      operator>>(__ios_type& (*__pf)(__ios_type&));

      inline __istream_type&
      operator>>(ios_base& (*__pf)(ios_base&));
# 169 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      operator>>(bool& __n);

      __istream_type&
      operator>>(short& __n);

      __istream_type&
      operator>>(unsigned short& __n);

      __istream_type&
      operator>>(int& __n);

      __istream_type&
      operator>>(unsigned int& __n);

      __istream_type&
      operator>>(long& __n);

      __istream_type&
      operator>>(unsigned long& __n);


      __istream_type&
      operator>>(long long& __n);

      __istream_type&
      operator>>(unsigned long long& __n);


      __istream_type&
      operator>>(float& __f);

      __istream_type&
      operator>>(double& __f);

      __istream_type&
      operator>>(long double& __f);

      __istream_type&
      operator>>(void*& __p);
# 230 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      operator>>(__streambuf_type* __sb);
# 240 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      inline streamsize
      gcount() const
      { return _M_gcount; }
# 272 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      int_type
      get();
# 286 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      get(char_type& __c);
# 313 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      get(char_type* __s, streamsize __n, char_type __delim);
# 324 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      inline __istream_type&
      get(char_type* __s, streamsize __n)
      { return this->get(__s, __n, this->widen('\n')); }
# 347 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      get(__streambuf_type& __sb, char_type __delim);
# 357 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      inline __istream_type&
      get(__streambuf_type& __sb)
      { return this->get(__sb, this->widen('\n')); }
# 386 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      getline(char_type* __s, streamsize __n, char_type __delim);
# 397 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      inline __istream_type&
      getline(char_type* __s, streamsize __n)
      { return this->getline(__s, __n, this->widen('\n')); }
# 416 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      ignore(streamsize __n = 1, int_type __delim = traits_type::eof());
# 427 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      int_type
      peek();
# 445 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      read(char_type* __s, streamsize __n);
# 464 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      streamsize
      readsome(char_type* __s, streamsize __n);
# 480 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      putback(char_type __c);
# 495 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      unget();
# 513 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      int
      sync();
# 527 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      pos_type
      tellg();
# 542 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      seekg(pos_type);
# 558 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      __istream_type&
      seekg(off_type, ios_base::seekdir);


    protected:
      explicit
      basic_istream(): _M_gcount(streamsize(0)) { }
    };
# 578 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
  template<typename _CharT, typename _Traits>
    class basic_istream<_CharT, _Traits>::sentry
    {
    public:

      typedef _Traits traits_type;
      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef typename __istream_type::__ctype_type __ctype_type;
      typedef typename _Traits::int_type __int_type;
# 610 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      explicit
      sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
# 620 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
      operator bool() const { return _M_ok; }

    private:
      bool _M_ok;
    };
# 639 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);

  template<class _Traits>
    basic_istream<char, _Traits>&
    operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
    { return (__in >> reinterpret_cast<char&>(__c)); }

  template<class _Traits>
    basic_istream<char, _Traits>&
    operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
    { return (__in >> reinterpret_cast<char&>(__c)); }
# 680 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);

  template<class _Traits>
    basic_istream<char,_Traits>&
    operator>>(basic_istream<char,_Traits>& __in, unsigned char* __s)
    { return (__in >> reinterpret_cast<char*>(__s)); }

  template<class _Traits>
    basic_istream<char,_Traits>&
    operator>>(basic_istream<char,_Traits>& __in, signed char* __s)
    { return (__in >> reinterpret_cast<char*>(__s)); }
# 702 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
  template<typename _CharT, typename _Traits>
    class basic_iostream
    : public basic_istream<_CharT, _Traits>,
      public basic_ostream<_CharT, _Traits>
    {
    public:



      typedef _CharT char_type;
      typedef typename _Traits::int_type int_type;
      typedef typename _Traits::pos_type pos_type;
      typedef typename _Traits::off_type off_type;
      typedef _Traits traits_type;


      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef basic_ostream<_CharT, _Traits> __ostream_type;







      explicit
      basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
      : __istream_type(), __ostream_type()
      { this->init(__sb); }




      virtual
      ~basic_iostream() { }

    protected:
      explicit
      basic_iostream() : __istream_type(), __ostream_type()
      { }
    };
# 765 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 3
  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    ws(basic_istream<_CharT, _Traits>& __is);
}


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/istream.tcc" 1 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/istream.tcc" 3
       
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/istream.tcc" 3




namespace std
{
  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>::sentry::
    sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
    {
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      if (__in.good())
 {
   if (__in.tie())
     __in.tie()->flush();
   if (!__noskip && (__in.flags() & ios_base::skipws))
     {
       const __int_type __eof = traits_type::eof();
       __streambuf_type* __sb = __in.rdbuf();
       __int_type __c = __sb->sgetc();

       const __ctype_type& __ct = __check_facet(__in._M_ctype);
       while (!traits_type::eq_int_type(__c, __eof)
       && __ct.is(ctype_base::space,
    traits_type::to_char_type(__c)))
  __c = __sb->snextc();




       if (traits_type::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
     }
 }

      if (__in.good() && __err == ios_base::goodbit)
 _M_ok = true;
      else
 {
   __err |= ios_base::failbit;
   __in.setstate(__err);
 }
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(__istream_type& (*__pf)(__istream_type&))
    { return __pf(*this); }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(__ios_type& (*__pf)(__ios_type&))
    {
      __pf(*this);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(ios_base& (*__pf)(ios_base&))
    {
      __pf(*this);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(bool& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(short& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       long __l;
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __l);


       if (!(__err & ios_base::failbit)
    && (numeric_limits<short>::min() <= __l
        && __l <= numeric_limits<short>::max()))
  __n = __l;
       else
                __err |= ios_base::failbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(unsigned short& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(int& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       long __l;
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __l);


       if (!(__err & ios_base::failbit)
    && (numeric_limits<int>::min() <= __l
        && __l <= numeric_limits<int>::max()))
  __n = __l;
       else
                __err |= ios_base::failbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(unsigned int& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(long& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(unsigned long& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }


  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(long long& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(unsigned long long& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }


  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(float& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(double& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(long double& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(void*& __n)
    {
      sentry __cerb(*this, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __num_get_type& __ng = __check_facet(this->_M_num_get);
       __ng.get(*this, 0, *this, __err, __n);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    operator>>(__streambuf_type* __sbout)
    {
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this, false);
      if (__cerb && __sbout)
 {
   try
     {
       if (!__copy_streambufs(this->rdbuf(), __sbout))
  __err |= ios_base::failbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::failbit); }
 }
      else if (!__sbout)
 __err |= ios_base::failbit;
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    typename basic_istream<_CharT, _Traits>::int_type
    basic_istream<_CharT, _Traits>::
    get(void)
    {
      const int_type __eof = traits_type::eof();
      int_type __c = __eof;
      _M_gcount = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this, true);
      if (__cerb)
 {
   try
     {
       __c = this->rdbuf()->sbumpc();

       if (!traits_type::eq_int_type(__c, __eof))
  _M_gcount = 1;
       else
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
 }
      if (!_M_gcount)
 __err |= ios_base::failbit;
      if (__err)
 this->setstate(__err);
      return __c;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    get(char_type& __c)
    {
      _M_gcount = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this, true);
      if (__cerb)
 {
   try
     {
       const int_type __cb = this->rdbuf()->sbumpc();

       if (!traits_type::eq_int_type(__cb, traits_type::eof()))
  {
    _M_gcount = 1;
    __c = traits_type::to_char_type(__cb);
  }
       else
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
 }
      if (!_M_gcount)
 __err |= ios_base::failbit;
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    get(char_type* __s, streamsize __n, char_type __delim)
    {
      _M_gcount = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this, true);
      if (__cerb)
 {
   try
     {
       const int_type __idelim = traits_type::to_int_type(__delim);
       const int_type __eof = traits_type::eof();
       __streambuf_type* __sb = this->rdbuf();
       int_type __c = __sb->sgetc();

       while (_M_gcount + 1 < __n
       && !traits_type::eq_int_type(__c, __eof)
       && !traits_type::eq_int_type(__c, __idelim))
  {
    *__s++ = traits_type::to_char_type(__c);
    ++_M_gcount;
    __c = __sb->snextc();
  }
       if (traits_type::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
 }
      *__s = char_type();
      if (!_M_gcount)
 __err |= ios_base::failbit;
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    get(__streambuf_type& __sb, char_type __delim)
    {
      _M_gcount = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this, true);
      if (__cerb)
 {
   try
     {
       const int_type __idelim = traits_type::to_int_type(__delim);
       const int_type __eof = traits_type::eof();
       __streambuf_type* __this_sb = this->rdbuf();
       int_type __c = __this_sb->sgetc();
       char_type __c2 = traits_type::to_char_type(__c);

       while (!traits_type::eq_int_type(__c, __eof)
       && !traits_type::eq_int_type(__c, __idelim)
       && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
  {
    ++_M_gcount;
    __c = __this_sb->snextc();
    __c2 = traits_type::to_char_type(__c);
  }
       if (traits_type::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
 }
      if (!_M_gcount)
 __err |= ios_base::failbit;
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    getline(char_type* __s, streamsize __n, char_type __delim)
    {
      _M_gcount = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      sentry __cerb(*this, true);
      if (__cerb)
 {
          try
     {
       const int_type __idelim = traits_type::to_int_type(__delim);
       const int_type __eof = traits_type::eof();
       __streambuf_type* __sb = this->rdbuf();
       int_type __c = __sb->sgetc();

       while (_M_gcount + 1 < __n
       && !traits_type::eq_int_type(__c, __eof)
       && !traits_type::eq_int_type(__c, __idelim))
  {
    streamsize __size = std::min(streamsize(__sb->egptr()
         - __sb->gptr()),
            __n - _M_gcount - 1);
    if (__size > 1)
      {
        const char_type* __p = traits_type::find(__sb->gptr(),
              __size,
              __delim);
        if (__p)
   __size = __p - __sb->gptr();
        traits_type::copy(__s, __sb->gptr(), __size);
        __s += __size;
        __sb->gbump(__size);
        _M_gcount += __size;
        __c = __sb->sgetc();
      }
    else
      {
        *__s++ = traits_type::to_char_type(__c);
        ++_M_gcount;
        __c = __sb->snextc();
      }
  }

       if (traits_type::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
       else if (traits_type::eq_int_type(__c, __idelim))
  {
    ++_M_gcount;
    __sb->sbumpc();
  }
       else
  __err |= ios_base::failbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
 }
      *__s = char_type();
      if (!_M_gcount)
 __err |= ios_base::failbit;
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    ignore(streamsize __n, int_type __delim)
    {
      _M_gcount = 0;
      sentry __cerb(*this, true);
      if (__cerb && __n > 0)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const int_type __eof = traits_type::eof();
       __streambuf_type* __sb = this->rdbuf();
       int_type __c;

       if (__n != numeric_limits<streamsize>::max())
  --__n;
       while (_M_gcount <= __n
       && !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof))
  {
    ++_M_gcount;
    if (traits_type::eq_int_type(__c, __delim))
      break;
  }
       if (traits_type::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    typename basic_istream<_CharT, _Traits>::int_type
    basic_istream<_CharT, _Traits>::
    peek(void)
    {
      int_type __c = traits_type::eof();
      _M_gcount = 0;
      sentry __cerb(*this, true);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       __c = this->rdbuf()->sgetc();
       if (traits_type::eq_int_type(__c, traits_type::eof()))
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return __c;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    read(char_type* __s, streamsize __n)
    {
      _M_gcount = 0;
      sentry __cerb(*this, true);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       _M_gcount = this->rdbuf()->sgetn(__s, __n);
       if (_M_gcount != __n)
  __err |= (ios_base::eofbit | ios_base::failbit);
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    streamsize
    basic_istream<_CharT, _Traits>::
    readsome(char_type* __s, streamsize __n)
    {
      _M_gcount = 0;
      sentry __cerb(*this, true);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {

       const streamsize __num = this->rdbuf()->in_avail();
       if (__num > 0)
  _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
       else if (__num == -1)
  __err |= ios_base::eofbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return _M_gcount;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    putback(char_type __c)
    {


      _M_gcount = 0;
      sentry __cerb(*this, true);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const int_type __eof = traits_type::eof();
       __streambuf_type* __sb = this->rdbuf();
       if (!__sb
    || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    unget(void)
    {


      _M_gcount = 0;
      sentry __cerb(*this, true);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const int_type __eof = traits_type::eof();
       __streambuf_type* __sb = this->rdbuf();
       if (!__sb
    || traits_type::eq_int_type(__sb->sungetc(), __eof))
  __err |= ios_base::badbit;
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return *this;
    }

  template<typename _CharT, typename _Traits>
    int
    basic_istream<_CharT, _Traits>::
    sync(void)
    {


      int __ret = -1;
      sentry __cerb(*this, true);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       __streambuf_type* __sb = this->rdbuf();
       if (__sb)
  {
    if (__sb->pubsync() == -1)
      __err |= ios_base::badbit;
    else
      __ret = 0;
  }
     }
   catch(...)
     { this->_M_setstate(ios_base::badbit); }
   if (__err)
     this->setstate(__err);
 }
      return __ret;
    }

  template<typename _CharT, typename _Traits>
    typename basic_istream<_CharT, _Traits>::pos_type
    basic_istream<_CharT, _Traits>::
    tellg(void)
    {


      pos_type __ret = pos_type(-1);
      try
 {
   if (!this->fail())
     __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      return __ret;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    seekg(pos_type __pos)
    {


      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      try
 {
   if (!this->fail())
     {

       const pos_type __p = this->rdbuf()->pubseekpos(__pos,
            ios_base::in);


       if (__p == pos_type(off_type(-1)))
  __err |= ios_base::failbit;
     }
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      if (__err)
 this->setstate(__err);
      return *this;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    basic_istream<_CharT, _Traits>::
    seekg(off_type __off, ios_base::seekdir __dir)
    {


      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      try
 {
   if (!this->fail())
     {

       const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
            ios_base::in);


       if (__p == pos_type(off_type(-1)))
  __err |= ios_base::failbit;
     }
 }
      catch(...)
 { this->_M_setstate(ios_base::badbit); }
      if (__err)
 this->setstate(__err);
      return *this;
    }


  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
    {
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef typename __istream_type::int_type __int_type;

      typename __istream_type::sentry __cerb(__in, false);
      if (__cerb)
 {
   ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
   try
     {
       const __int_type __cb = __in.rdbuf()->sbumpc();
       if (!_Traits::eq_int_type(__cb, _Traits::eof()))
  __c = _Traits::to_char_type(__cb);
       else
  __err |= (ios_base::eofbit | ios_base::failbit);
     }
   catch(...)
     { __in._M_setstate(ios_base::badbit); }
   if (__err)
     __in.setstate(__err);
 }
      return __in;
    }

  template<typename _CharT, typename _Traits>
    basic_istream<_CharT, _Traits>&
    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
    {
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef typename __istream_type::__streambuf_type __streambuf_type;
      typedef typename _Traits::int_type int_type;
      typedef _CharT char_type;
      typedef ctype<_CharT> __ctype_type;

      streamsize __extracted = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      typename __istream_type::sentry __cerb(__in, false);
      if (__cerb)
 {
   try
     {

       streamsize __num = __in.width();
       if (__num <= 0)
  __num = numeric_limits<streamsize>::max();

       const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());

       const int_type __eof = _Traits::eof();
       __streambuf_type* __sb = __in.rdbuf();
       int_type __c = __sb->sgetc();

       while (__extracted < __num - 1
       && !_Traits::eq_int_type(__c, __eof)
       && !__ct.is(ctype_base::space,
     _Traits::to_char_type(__c)))
  {
    *__s++ = _Traits::to_char_type(__c);
    ++__extracted;
    __c = __sb->snextc();
  }
       if (_Traits::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;



       *__s = char_type();
       __in.width(0);
     }
   catch(...)
     { __in._M_setstate(ios_base::badbit); }
 }
      if (!__extracted)
 __err |= ios_base::failbit;
      if (__err)
 __in.setstate(__err);
      return __in;
    }


  template<typename _CharT, typename _Traits>
    basic_istream<_CharT,_Traits>&
    ws(basic_istream<_CharT,_Traits>& __in)
    {
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef typename __istream_type::__streambuf_type __streambuf_type;
      typedef typename __istream_type::__ctype_type __ctype_type;
      typedef typename __istream_type::int_type __int_type;

      const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
      const __int_type __eof = _Traits::eof();
      __streambuf_type* __sb = __in.rdbuf();
      __int_type __c = __sb->sgetc();

      while (!_Traits::eq_int_type(__c, __eof)
      && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
 __c = __sb->snextc();

       if (_Traits::eq_int_type(__c, __eof))
  __in.setstate(ios_base::eofbit);
      return __in;
    }


  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_istream<_CharT, _Traits>&
    operator>>(basic_istream<_CharT, _Traits>& __in,
        basic_string<_CharT, _Traits, _Alloc>& __str)
    {
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef typename __istream_type::int_type __int_type;
      typedef typename __istream_type::__streambuf_type __streambuf_type;
      typedef typename __istream_type::__ctype_type __ctype_type;
      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef typename __string_type::size_type __size_type;

      __size_type __extracted = 0;
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      typename __istream_type::sentry __cerb(__in, false);
      if (__cerb)
 {
   try
     {

       __str.erase();
       _CharT __buf[128];
       __size_type __len = 0;
       const streamsize __w = __in.width();
       const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
                                : __str.max_size();
       const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
       const __int_type __eof = _Traits::eof();
       __streambuf_type* __sb = __in.rdbuf();
       __int_type __c = __sb->sgetc();

       while (__extracted < __n
       && !_Traits::eq_int_type(__c, __eof)
       && !__ct.is(ctype_base::space, _Traits::to_char_type(__c)))
  {
    if (__len == sizeof(__buf) / sizeof(_CharT))
      {
        __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
        __len = 0;
      }
    __buf[__len++] = _Traits::to_char_type(__c);
    ++__extracted;
    __c = __sb->snextc();
  }
       __str.append(__buf, __len);

       if (_Traits::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
       __in.width(0);
     }
   catch(...)
     {



       __in._M_setstate(ios_base::badbit);
     }
 }

      if (!__extracted)
 __err |= ios_base::failbit;
      if (__err)
 __in.setstate(__err);
      return __in;
    }

  template<typename _CharT, typename _Traits, typename _Alloc>
    basic_istream<_CharT, _Traits>&
    getline(basic_istream<_CharT, _Traits>& __in,
     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
    {
      typedef basic_istream<_CharT, _Traits> __istream_type;
      typedef typename __istream_type::int_type __int_type;
      typedef typename __istream_type::__streambuf_type __streambuf_type;
      typedef typename __istream_type::__ctype_type __ctype_type;
      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef typename __string_type::size_type __size_type;

      __size_type __extracted = 0;
      const __size_type __n = __str.max_size();
      ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
      typename __istream_type::sentry __cerb(__in, true);
      if (__cerb)
 {
   try
     {

       __str.erase();
       _CharT __buf[128];
       __size_type __len = 0;
       const __int_type __idelim = _Traits::to_int_type(__delim);
       const __int_type __eof = _Traits::eof();
       __streambuf_type* __sb = __in.rdbuf();
       __int_type __c = __sb->sgetc();

       while (__extracted < __n
       && !_Traits::eq_int_type(__c, __eof)
       && !_Traits::eq_int_type(__c, __idelim))
  {
    if (__len == sizeof(__buf) / sizeof(_CharT))
      {
        __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
        __len = 0;
      }
    __buf[__len++] = _Traits::to_char_type(__c);
    ++__extracted;
    __c = __sb->snextc();
  }
       __str.append(__buf, __len);

       if (_Traits::eq_int_type(__c, __eof))
  __err |= ios_base::eofbit;
       else if (_Traits::eq_int_type(__c, __idelim))
  {
    ++__extracted;
    __sb->sbumpc();
  }
       else
  __err |= ios_base::failbit;
     }
   catch(...)
     {



       __in._M_setstate(ios_base::badbit);
     }
 }
      if (!__extracted)
 __err |= ios_base::failbit;
      if (__err)
 __in.setstate(__err);
      return __in;
    }

  template<class _CharT, class _Traits, class _Alloc>
    inline basic_istream<_CharT,_Traits>&
    getline(basic_istream<_CharT, _Traits>& __in,
     basic_string<_CharT,_Traits,_Alloc>& __str)
    { return getline(__in, __str, __in.widen('\n')); }





  extern template class basic_istream<char>;
  extern template istream& ws(istream&);
  extern template istream& operator>>(istream&, char&);
  extern template istream& operator>>(istream&, char*);
  extern template istream& operator>>(istream&, unsigned char&);
  extern template istream& operator>>(istream&, signed char&);
  extern template istream& operator>>(istream&, unsigned char*);
  extern template istream& operator>>(istream&, signed char*);

  extern template class basic_iostream<char>;


  extern template class basic_istream<wchar_t>;
  extern template wistream& ws(wistream&);
  extern template wistream& operator>>(wistream&, wchar_t&);
  extern template wistream& operator>>(wistream&, wchar_t*);

  extern template class basic_iostream<wchar_t>;


}
# 772 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/istream" 2 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 2 3

namespace std
{
# 63 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream" 3
  extern istream cin;
  extern ostream cout;
  extern ostream cerr;
  extern ostream clog;


  extern wistream wcin;
  extern wostream wcout;
  extern wostream wcerr;
  extern wostream wclog;




  static ios_base::Init __ioinit;
}
# 29 "checked_defs.hh" 2
# 1 "/usr/local/include/gmpxx.h" 1 3
# 28 "/usr/local/include/gmpxx.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/utility" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/utility" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/utility" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_relops.h" 1 3
# 74 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_relops.h" 3
namespace std
{
  namespace rel_ops
  {
# 90 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_relops.h" 3
    template <class _Tp>
      inline bool
      operator!=(const _Tp& __x, const _Tp& __y)
      { return !(__x == __y); }
# 103 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_relops.h" 3
    template <class _Tp>
      inline bool
      operator>(const _Tp& __x, const _Tp& __y)
      { return __y < __x; }
# 116 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_relops.h" 3
    template <class _Tp>
      inline bool
      operator<=(const _Tp& __x, const _Tp& __y)
      { return !(__y < __x); }
# 129 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_relops.h" 3
    template <class _Tp>
      inline bool
      operator>=(const _Tp& __x, const _Tp& __y)
      { return !(__x < __y); }

  }
}
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/utility" 2 3
# 29 "/usr/local/include/gmpxx.h" 2 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/stdexcept" 1 3
# 42 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/stdexcept" 3
       
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/stdexcept" 3




namespace std
{





  class logic_error : public exception
  {
    string _M_msg;

  public:

    explicit
    logic_error(const string& __arg);

    virtual
    ~logic_error() throw();



    virtual const char*
    what() const throw();
  };



  class domain_error : public logic_error
  {
  public:
    explicit domain_error(const string& __arg);
  };


  class invalid_argument : public logic_error
  {
  public:
    explicit invalid_argument(const string& __arg);
  };



  class length_error : public logic_error
  {
  public:
    explicit length_error(const string& __arg);
  };



  class out_of_range : public logic_error
  {
  public:
    explicit out_of_range(const string& __arg);
  };






  class runtime_error : public exception
  {
    string _M_msg;

  public:

    explicit
    runtime_error(const string& __arg);

    virtual
    ~runtime_error() throw();



    virtual const char*
    what() const throw();
  };


  class range_error : public runtime_error
  {
  public:
    explicit range_error(const string& __arg);
  };


  class overflow_error : public runtime_error
  {
  public:
    explicit overflow_error(const string& __arg);
  };


  class underflow_error : public runtime_error
  {
  public:
    explicit underflow_error(const string& __arg);
  };
}
# 31 "/usr/local/include/gmpxx.h" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cfloat" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cfloat" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cfloat" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/include/float.h" 1 3 4
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cfloat" 2 3
# 32 "/usr/local/include/gmpxx.h" 2 3
# 1 "/usr/local/include/gmp.h" 1 3
# 140 "/usr/local/include/gmp.h" 3
typedef unsigned long int mp_limb_t;
typedef long int mp_limb_signed_t;


typedef unsigned long int mp_bitcnt_t;




typedef struct
{
  int _mp_alloc;

  int _mp_size;


  mp_limb_t *_mp_d;
} __mpz_struct;




typedef __mpz_struct MP_INT;
typedef __mpz_struct mpz_t[1];

typedef mp_limb_t * mp_ptr;
typedef const mp_limb_t * mp_srcptr;







typedef long int mp_size_t;
typedef long int mp_exp_t;


typedef struct
{
  __mpz_struct _mp_num;
  __mpz_struct _mp_den;
} __mpq_struct;

typedef __mpq_struct MP_RAT;
typedef __mpq_struct mpq_t[1];

typedef struct
{
  int _mp_prec;



  int _mp_size;


  mp_exp_t _mp_exp;
  mp_limb_t *_mp_d;
} __mpf_struct;


typedef __mpf_struct mpf_t[1];


typedef enum
{
  GMP_RAND_ALG_DEFAULT = 0,
  GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT
} gmp_randalg_t;


typedef struct
{
  mpz_t _mp_seed;
  gmp_randalg_t _mp_alg;
  union {
    void *_mp_lc;
  } _mp_algdata;
} __gmp_randstate_struct;
typedef __gmp_randstate_struct gmp_randstate_t[1];



typedef const __mpz_struct *mpz_srcptr;
typedef __mpz_struct *mpz_ptr;
typedef const __mpf_struct *mpf_srcptr;
typedef __mpf_struct *mpf_ptr;
typedef const __mpq_struct *mpq_srcptr;
typedef __mpq_struct *mpq_ptr;
# 476 "/usr/local/include/gmp.h" 3
extern "C" {
using std::FILE;



 void __gmp_set_memory_functions (void *(*) (size_t),
          void *(*) (void *, size_t, size_t),
          void (*) (void *, size_t)) throw ();


 void __gmp_get_memory_functions (void *(**) (size_t),
                                      void *(**) (void *, size_t, size_t),
                                      void (**) (void *, size_t)) throw ();


 extern const int __gmp_bits_per_limb;


 extern int __gmp_errno;


 extern const char * const __gmp_version;






 void __gmp_randinit (gmp_randstate_t, gmp_randalg_t, ...);


 void __gmp_randinit_default (gmp_randstate_t);


 void __gmp_randinit_lc_2exp (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t);


 int __gmp_randinit_lc_2exp_size (gmp_randstate_t, mp_bitcnt_t);


 void __gmp_randinit_mt (gmp_randstate_t);


 void __gmp_randinit_set (gmp_randstate_t, const __gmp_randstate_struct *);


 void __gmp_randseed (gmp_randstate_t, mpz_srcptr);


 void __gmp_randseed_ui (gmp_randstate_t, unsigned long int);


 void __gmp_randclear (gmp_randstate_t);


 unsigned long __gmp_urandomb_ui (gmp_randstate_t, unsigned long);


 unsigned long __gmp_urandomm_ui (gmp_randstate_t, unsigned long);





 int __gmp_asprintf (char **, const char *, ...);



 int __gmp_fprintf (FILE *, const char *, ...);
# 558 "/usr/local/include/gmp.h" 3
 int __gmp_printf (const char *, ...);


 int __gmp_snprintf (char *, size_t, const char *, ...);


 int __gmp_sprintf (char *, const char *, ...);
# 596 "/usr/local/include/gmp.h" 3
 int __gmp_fscanf (FILE *, const char *, ...);



 int __gmp_scanf (const char *, ...);


 int __gmp_sscanf (const char *, const char *, ...);
# 625 "/usr/local/include/gmp.h" 3
 void *__gmpz_realloc (mpz_ptr, mp_size_t);



 void __gmpz_abs (mpz_ptr, mpz_srcptr);



 void __gmpz_add (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_add_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_addmul (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_addmul_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_and (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_array_init (mpz_ptr, mp_size_t, mp_size_t);


 void __gmpz_bin_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_bin_uiui (mpz_ptr, unsigned long int, unsigned long int);


 void __gmpz_cdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_cdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 unsigned long int __gmpz_cdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_cdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);


 unsigned long int __gmpz_cdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_cdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_cdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 unsigned long int __gmpz_cdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 unsigned long int __gmpz_cdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__));


 void __gmpz_clear (mpz_ptr);


 void __gmpz_clears (mpz_ptr, ...);


 void __gmpz_clrbit (mpz_ptr, mp_bitcnt_t);


 int __gmpz_cmp (mpz_srcptr, mpz_srcptr) throw () __attribute__ ((__pure__));


 int __gmpz_cmp_d (mpz_srcptr, double) __attribute__ ((__pure__));


 int __gmpz_cmp_si (mpz_srcptr, signed long int) throw () __attribute__ ((__pure__));


 int __gmpz_cmp_ui (mpz_srcptr, unsigned long int) throw () __attribute__ ((__pure__));


 int __gmpz_cmpabs (mpz_srcptr, mpz_srcptr) throw () __attribute__ ((__pure__));


 int __gmpz_cmpabs_d (mpz_srcptr, double) __attribute__ ((__pure__));


 int __gmpz_cmpabs_ui (mpz_srcptr, unsigned long int) throw () __attribute__ ((__pure__));


 void __gmpz_com (mpz_ptr, mpz_srcptr);


 void __gmpz_combit (mpz_ptr, mp_bitcnt_t);


 int __gmpz_congruent_p (mpz_srcptr, mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__));


 int __gmpz_congruent_2exp_p (mpz_srcptr, mpz_srcptr, mp_bitcnt_t) throw () __attribute__ ((__pure__));


 int __gmpz_congruent_ui_p (mpz_srcptr, unsigned long, unsigned long) __attribute__ ((__pure__));


 void __gmpz_divexact (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_divexact_ui (mpz_ptr, mpz_srcptr, unsigned long);


 int __gmpz_divisible_p (mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__));


 int __gmpz_divisible_ui_p (mpz_srcptr, unsigned long) __attribute__ ((__pure__));


 int __gmpz_divisible_2exp_p (mpz_srcptr, mp_bitcnt_t) throw () __attribute__ ((__pure__));


 void __gmpz_dump (mpz_srcptr);


 void *__gmpz_export (void *, size_t *, int, size_t, int, size_t, mpz_srcptr);


 void __gmpz_fac_ui (mpz_ptr, unsigned long int);


 void __gmpz_2fac_ui (mpz_ptr, unsigned long int);


 void __gmpz_mfac_uiui (mpz_ptr, unsigned long int, unsigned long int);


 void __gmpz_primorial_ui (mpz_ptr, unsigned long int);


 void __gmpz_fdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_fdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 unsigned long int __gmpz_fdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_fdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);


 unsigned long int __gmpz_fdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_fdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_fdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 unsigned long int __gmpz_fdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 unsigned long int __gmpz_fdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__));


 void __gmpz_fib_ui (mpz_ptr, unsigned long int);


 void __gmpz_fib2_ui (mpz_ptr, mpz_ptr, unsigned long int);


 int __gmpz_fits_sint_p (mpz_srcptr) throw () __attribute__ ((__pure__));


 int __gmpz_fits_slong_p (mpz_srcptr) throw () __attribute__ ((__pure__));


 int __gmpz_fits_sshort_p (mpz_srcptr) throw () __attribute__ ((__pure__));



 int __gmpz_fits_uint_p (mpz_srcptr) throw () __attribute__ ((__pure__));




 int __gmpz_fits_ulong_p (mpz_srcptr) throw () __attribute__ ((__pure__));




 int __gmpz_fits_ushort_p (mpz_srcptr) throw () __attribute__ ((__pure__));



 void __gmpz_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr);


 unsigned long int __gmpz_gcd_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_gcdext (mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);


 double __gmpz_get_d (mpz_srcptr) __attribute__ ((__pure__));


 double __gmpz_get_d_2exp (signed long int *, mpz_srcptr);


 long int __gmpz_get_si (mpz_srcptr) throw () __attribute__ ((__pure__));


 char *__gmpz_get_str (char *, int, mpz_srcptr);



 unsigned long int __gmpz_get_ui (mpz_srcptr) throw () __attribute__ ((__pure__));




 mp_limb_t __gmpz_getlimbn (mpz_srcptr, mp_size_t) throw () __attribute__ ((__pure__));



 mp_bitcnt_t __gmpz_hamdist (mpz_srcptr, mpz_srcptr) throw () __attribute__ ((__pure__));


 void __gmpz_import (mpz_ptr, size_t, int, size_t, int, size_t, const void *);


 void __gmpz_init (mpz_ptr);


 void __gmpz_init2 (mpz_ptr, mp_bitcnt_t);


 void __gmpz_inits (mpz_ptr, ...);


 void __gmpz_init_set (mpz_ptr, mpz_srcptr);


 void __gmpz_init_set_d (mpz_ptr, double);


 void __gmpz_init_set_si (mpz_ptr, signed long int);


 int __gmpz_init_set_str (mpz_ptr, const char *, int);


 void __gmpz_init_set_ui (mpz_ptr, unsigned long int);



 size_t __gmpz_inp_raw (mpz_ptr, FILE *);




 size_t __gmpz_inp_str (mpz_ptr, FILE *, int);



 int __gmpz_invert (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_ior (mpz_ptr, mpz_srcptr, mpz_srcptr);


 int __gmpz_jacobi (mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__));




 int __gmpz_kronecker_si (mpz_srcptr, long) __attribute__ ((__pure__));


 int __gmpz_kronecker_ui (mpz_srcptr, unsigned long) __attribute__ ((__pure__));


 int __gmpz_si_kronecker (long, mpz_srcptr) __attribute__ ((__pure__));


 int __gmpz_ui_kronecker (unsigned long, mpz_srcptr) __attribute__ ((__pure__));


 void __gmpz_lcm (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_lcm_ui (mpz_ptr, mpz_srcptr, unsigned long);




 void __gmpz_lucnum_ui (mpz_ptr, unsigned long int);


 void __gmpz_lucnum2_ui (mpz_ptr, mpz_ptr, unsigned long int);


 int __gmpz_millerrabin (mpz_srcptr, int) __attribute__ ((__pure__));


 void __gmpz_mod (mpz_ptr, mpz_srcptr, mpz_srcptr);




 void __gmpz_mul (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_mul_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 void __gmpz_mul_si (mpz_ptr, mpz_srcptr, long int);


 void __gmpz_mul_ui (mpz_ptr, mpz_srcptr, unsigned long int);



 void __gmpz_neg (mpz_ptr, mpz_srcptr);



 void __gmpz_nextprime (mpz_ptr, mpz_srcptr);



 size_t __gmpz_out_raw (FILE *, mpz_srcptr);




 size_t __gmpz_out_str (FILE *, int, mpz_srcptr);



 int __gmpz_perfect_power_p (mpz_srcptr) __attribute__ ((__pure__));



 int __gmpz_perfect_square_p (mpz_srcptr) __attribute__ ((__pure__));




 mp_bitcnt_t __gmpz_popcount (mpz_srcptr) throw () __attribute__ ((__pure__));



 void __gmpz_pow_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_powm (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_powm_sec (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_powm_ui (mpz_ptr, mpz_srcptr, unsigned long int, mpz_srcptr);


 int __gmpz_probab_prime_p (mpz_srcptr, int) __attribute__ ((__pure__));


 void __gmpz_random (mpz_ptr, mp_size_t);


 void __gmpz_random2 (mpz_ptr, mp_size_t);


 void __gmpz_realloc2 (mpz_ptr, mp_bitcnt_t);


 mp_bitcnt_t __gmpz_remove (mpz_ptr, mpz_srcptr, mpz_srcptr);


 int __gmpz_root (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_rootrem (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_rrandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);


 mp_bitcnt_t __gmpz_scan0 (mpz_srcptr, mp_bitcnt_t) throw () __attribute__ ((__pure__));


 mp_bitcnt_t __gmpz_scan1 (mpz_srcptr, mp_bitcnt_t) throw () __attribute__ ((__pure__));


 void __gmpz_set (mpz_ptr, mpz_srcptr);


 void __gmpz_set_d (mpz_ptr, double);


 void __gmpz_set_f (mpz_ptr, mpf_srcptr);



 void __gmpz_set_q (mpz_ptr, mpq_srcptr);



 void __gmpz_set_si (mpz_ptr, signed long int);


 int __gmpz_set_str (mpz_ptr, const char *, int);


 void __gmpz_set_ui (mpz_ptr, unsigned long int);


 void __gmpz_setbit (mpz_ptr, mp_bitcnt_t);



 size_t __gmpz_size (mpz_srcptr) throw () __attribute__ ((__pure__));



 size_t __gmpz_sizeinbase (mpz_srcptr, int) throw () __attribute__ ((__pure__));


 void __gmpz_sqrt (mpz_ptr, mpz_srcptr);


 void __gmpz_sqrtrem (mpz_ptr, mpz_ptr, mpz_srcptr);


 void __gmpz_sub (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_sub_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_ui_sub (mpz_ptr, unsigned long int, mpz_srcptr);


 void __gmpz_submul (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_submul_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_swap (mpz_ptr, mpz_ptr) throw ();


 unsigned long int __gmpz_tdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__));


 void __gmpz_tdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_tdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 unsigned long int __gmpz_tdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_tdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);


 unsigned long int __gmpz_tdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);


 void __gmpz_tdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);


 void __gmpz_tdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);


 unsigned long int __gmpz_tdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);


 int __gmpz_tstbit (mpz_srcptr, mp_bitcnt_t) throw () __attribute__ ((__pure__));


 void __gmpz_ui_pow_ui (mpz_ptr, unsigned long int, unsigned long int);


 void __gmpz_urandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);


 void __gmpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);



 void __gmpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr);






 void __gmpq_abs (mpq_ptr, mpq_srcptr);



 void __gmpq_add (mpq_ptr, mpq_srcptr, mpq_srcptr);


 void __gmpq_canonicalize (mpq_ptr);


 void __gmpq_clear (mpq_ptr);


 void __gmpq_clears (mpq_ptr, ...);


 int __gmpq_cmp (mpq_srcptr, mpq_srcptr) __attribute__ ((__pure__));


 int __gmpq_cmp_si (mpq_srcptr, long, unsigned long) __attribute__ ((__pure__));


 int __gmpq_cmp_ui (mpq_srcptr, unsigned long int, unsigned long int) __attribute__ ((__pure__));


 void __gmpq_div (mpq_ptr, mpq_srcptr, mpq_srcptr);


 void __gmpq_div_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);


 int __gmpq_equal (mpq_srcptr, mpq_srcptr) throw () __attribute__ ((__pure__));


 void __gmpq_get_num (mpz_ptr, mpq_srcptr);


 void __gmpq_get_den (mpz_ptr, mpq_srcptr);


 double __gmpq_get_d (mpq_srcptr) __attribute__ ((__pure__));


 char *__gmpq_get_str (char *, int, mpq_srcptr);


 void __gmpq_init (mpq_ptr);


 void __gmpq_inits (mpq_ptr, ...);



 size_t __gmpq_inp_str (mpq_ptr, FILE *, int);



 void __gmpq_inv (mpq_ptr, mpq_srcptr);


 void __gmpq_mul (mpq_ptr, mpq_srcptr, mpq_srcptr);


 void __gmpq_mul_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);



 void __gmpq_neg (mpq_ptr, mpq_srcptr);




 size_t __gmpq_out_str (FILE *, int, mpq_srcptr);



 void __gmpq_set (mpq_ptr, mpq_srcptr);


 void __gmpq_set_d (mpq_ptr, double);


 void __gmpq_set_den (mpq_ptr, mpz_srcptr);


 void __gmpq_set_f (mpq_ptr, mpf_srcptr);


 void __gmpq_set_num (mpq_ptr, mpz_srcptr);


 void __gmpq_set_si (mpq_ptr, signed long int, unsigned long int);


 int __gmpq_set_str (mpq_ptr, const char *, int);


 void __gmpq_set_ui (mpq_ptr, unsigned long int, unsigned long int);


 void __gmpq_set_z (mpq_ptr, mpz_srcptr);


 void __gmpq_sub (mpq_ptr, mpq_srcptr, mpq_srcptr);


 void __gmpq_swap (mpq_ptr, mpq_ptr) throw ();





 void __gmpf_abs (mpf_ptr, mpf_srcptr);


 void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr);


 void __gmpf_add_ui (mpf_ptr, mpf_srcptr, unsigned long int);

 void __gmpf_ceil (mpf_ptr, mpf_srcptr);


 void __gmpf_clear (mpf_ptr);


 void __gmpf_clears (mpf_ptr, ...);


 int __gmpf_cmp (mpf_srcptr, mpf_srcptr) throw () __attribute__ ((__pure__));


 int __gmpf_cmp_d (mpf_srcptr, double) __attribute__ ((__pure__));


 int __gmpf_cmp_si (mpf_srcptr, signed long int) throw () __attribute__ ((__pure__));


 int __gmpf_cmp_ui (mpf_srcptr, unsigned long int) throw () __attribute__ ((__pure__));


 void __gmpf_div (mpf_ptr, mpf_srcptr, mpf_srcptr);


 void __gmpf_div_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);


 void __gmpf_div_ui (mpf_ptr, mpf_srcptr, unsigned long int);


 void __gmpf_dump (mpf_srcptr);


 int __gmpf_eq (mpf_srcptr, mpf_srcptr, mp_bitcnt_t) __attribute__ ((__pure__));


 int __gmpf_fits_sint_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 int __gmpf_fits_slong_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 int __gmpf_fits_sshort_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 int __gmpf_fits_uint_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 int __gmpf_fits_ulong_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 int __gmpf_fits_ushort_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 void __gmpf_floor (mpf_ptr, mpf_srcptr);


 double __gmpf_get_d (mpf_srcptr) __attribute__ ((__pure__));


 double __gmpf_get_d_2exp (signed long int *, mpf_srcptr);


 mp_bitcnt_t __gmpf_get_default_prec (void) throw () __attribute__ ((__pure__));


 mp_bitcnt_t __gmpf_get_prec (mpf_srcptr) throw () __attribute__ ((__pure__));


 long __gmpf_get_si (mpf_srcptr) throw () __attribute__ ((__pure__));


 char *__gmpf_get_str (char *, mp_exp_t *, int, size_t, mpf_srcptr);


 unsigned long __gmpf_get_ui (mpf_srcptr) throw () __attribute__ ((__pure__));


 void __gmpf_init (mpf_ptr);


 void __gmpf_init2 (mpf_ptr, mp_bitcnt_t);


 void __gmpf_inits (mpf_ptr, ...);


 void __gmpf_init_set (mpf_ptr, mpf_srcptr);


 void __gmpf_init_set_d (mpf_ptr, double);


 void __gmpf_init_set_si (mpf_ptr, signed long int);


 int __gmpf_init_set_str (mpf_ptr, const char *, int);


 void __gmpf_init_set_ui (mpf_ptr, unsigned long int);



 size_t __gmpf_inp_str (mpf_ptr, FILE *, int);



 int __gmpf_integer_p (mpf_srcptr) throw () __attribute__ ((__pure__));


 void __gmpf_mul (mpf_ptr, mpf_srcptr, mpf_srcptr);


 void __gmpf_mul_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);


 void __gmpf_mul_ui (mpf_ptr, mpf_srcptr, unsigned long int);


 void __gmpf_neg (mpf_ptr, mpf_srcptr);



 size_t __gmpf_out_str (FILE *, int, size_t, mpf_srcptr);



 void __gmpf_pow_ui (mpf_ptr, mpf_srcptr, unsigned long int);


 void __gmpf_random2 (mpf_ptr, mp_size_t, mp_exp_t);


 void __gmpf_reldiff (mpf_ptr, mpf_srcptr, mpf_srcptr);


 void __gmpf_set (mpf_ptr, mpf_srcptr);


 void __gmpf_set_d (mpf_ptr, double);


 void __gmpf_set_default_prec (mp_bitcnt_t) throw ();


 void __gmpf_set_prec (mpf_ptr, mp_bitcnt_t);


 void __gmpf_set_prec_raw (mpf_ptr, mp_bitcnt_t) throw ();


 void __gmpf_set_q (mpf_ptr, mpq_srcptr);


 void __gmpf_set_si (mpf_ptr, signed long int);


 int __gmpf_set_str (mpf_ptr, const char *, int);


 void __gmpf_set_ui (mpf_ptr, unsigned long int);


 void __gmpf_set_z (mpf_ptr, mpz_srcptr);


 size_t __gmpf_size (mpf_srcptr) throw () __attribute__ ((__pure__));


 void __gmpf_sqrt (mpf_ptr, mpf_srcptr);


 void __gmpf_sqrt_ui (mpf_ptr, unsigned long int);


 void __gmpf_sub (mpf_ptr, mpf_srcptr, mpf_srcptr);


 void __gmpf_sub_ui (mpf_ptr, mpf_srcptr, unsigned long int);


 void __gmpf_swap (mpf_ptr, mpf_ptr) throw ();


 void __gmpf_trunc (mpf_ptr, mpf_srcptr);


 void __gmpf_ui_div (mpf_ptr, unsigned long int, mpf_srcptr);


 void __gmpf_ui_sub (mpf_ptr, unsigned long int, mpf_srcptr);


 void __gmpf_urandomb (mpf_t, gmp_randstate_t, mp_bitcnt_t);
# 1447 "/usr/local/include/gmp.h" 3
 mp_limb_t __gmpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);




 mp_limb_t __gmpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) throw ();



 mp_limb_t __gmpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);


 mp_limb_t __gmpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);



 int __gmpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) throw () __attribute__ ((__pure__));






 mp_limb_t __gmpn_divexact_by3c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);





 mp_limb_t __gmpn_divrem (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t);


 mp_limb_t __gmpn_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);


 mp_limb_t __gmpn_divrem_2 (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr);


 mp_limb_t __gmpn_div_qr_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);


 mp_size_t __gmpn_gcd (mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t);


 mp_limb_t __gmpn_gcd_1 (mp_srcptr, mp_size_t, mp_limb_t) __attribute__ ((__pure__));


 mp_limb_t __gmpn_gcdext_1 (mp_limb_signed_t *, mp_limb_signed_t *, mp_limb_t, mp_limb_t);


 mp_size_t __gmpn_gcdext (mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t);


 size_t __gmpn_get_str (unsigned char *, int, mp_ptr, mp_size_t);


 mp_bitcnt_t __gmpn_hamdist (mp_srcptr, mp_srcptr, mp_size_t) throw () __attribute__ ((__pure__));


 mp_limb_t __gmpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);


 mp_limb_t __gmpn_mod_1 (mp_srcptr, mp_size_t, mp_limb_t) __attribute__ ((__pure__));


 mp_limb_t __gmpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);


 mp_limb_t __gmpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);


 void __gmpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);


 void __gmpn_sqr (mp_ptr, mp_srcptr, mp_size_t);



 mp_limb_t __gmpn_neg (mp_ptr, mp_srcptr, mp_size_t);




 void __gmpn_com (mp_ptr, mp_srcptr, mp_size_t);



 int __gmpn_perfect_square_p (mp_srcptr, mp_size_t) __attribute__ ((__pure__));


 int __gmpn_perfect_power_p (mp_srcptr, mp_size_t) __attribute__ ((__pure__));


 mp_bitcnt_t __gmpn_popcount (mp_srcptr, mp_size_t) throw () __attribute__ ((__pure__));


 mp_size_t __gmpn_pow_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);



 mp_limb_t __gmpn_preinv_mod_1 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __attribute__ ((__pure__));


 void __gmpn_random (mp_ptr, mp_size_t);


 void __gmpn_random2 (mp_ptr, mp_size_t);


 mp_limb_t __gmpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);


 mp_bitcnt_t __gmpn_scan0 (mp_srcptr, mp_bitcnt_t) __attribute__ ((__pure__));


 mp_bitcnt_t __gmpn_scan1 (mp_srcptr, mp_bitcnt_t) __attribute__ ((__pure__));


 mp_size_t __gmpn_set_str (mp_ptr, const unsigned char *, size_t, int);


 mp_size_t __gmpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);



 mp_limb_t __gmpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);




 mp_limb_t __gmpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) throw ();



 mp_limb_t __gmpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);


 mp_limb_t __gmpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);


 void __gmpn_tdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);


 void __gmpn_and_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_andn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_nand_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_ior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_iorn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_nior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_xor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

 void __gmpn_xnor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);


 void __gmpn_copyi (mp_ptr, mp_srcptr, mp_size_t);

 void __gmpn_copyd (mp_ptr, mp_srcptr, mp_size_t);

 void __gmpn_zero (mp_ptr, mp_size_t);
# 1630 "/usr/local/include/gmp.h" 3
extern __inline__ void
__gmpz_abs (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
{
  if (__gmp_w != __gmp_u)
    __gmpz_set (__gmp_w, __gmp_u);
  __gmp_w->_mp_size = ((__gmp_w->_mp_size) >= 0 ? (__gmp_w->_mp_size) : -(__gmp_w->_mp_size));
}
# 1654 "/usr/local/include/gmp.h" 3
extern __inline__

int
__gmpz_fits_uint_p (mpz_srcptr __gmp_z) throw ()
{
  mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (~ (unsigned) 0)));;
}




extern __inline__

int
__gmpz_fits_ulong_p (mpz_srcptr __gmp_z) throw ()
{
  mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (~ (unsigned long) 0)));;
}




extern __inline__

int
__gmpz_fits_ushort_p (mpz_srcptr __gmp_z) throw ()
{
  mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= ((unsigned short) ~0)));;
}




extern __inline__

unsigned long
__gmpz_get_ui (mpz_srcptr __gmp_z) throw ()
{
  mp_ptr __gmp_p = __gmp_z->_mp_d;
  mp_size_t __gmp_n = __gmp_z->_mp_size;
  mp_limb_t __gmp_l = __gmp_p[0];






  return (__gmp_n != 0 ? __gmp_l : 0);
# 1710 "/usr/local/include/gmp.h" 3
}




extern __inline__

mp_limb_t
__gmpz_getlimbn (mpz_srcptr __gmp_z, mp_size_t __gmp_n) throw ()
{
  mp_limb_t __gmp_result = 0;
  if (__builtin_expect ((__gmp_n >= 0 && __gmp_n < ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : -(__gmp_z->_mp_size))) != 0, 1))
    __gmp_result = __gmp_z->_mp_d[__gmp_n];
  return __gmp_result;
}



extern __inline__ void
__gmpz_neg (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
{
  if (__gmp_w != __gmp_u)
    __gmpz_set (__gmp_w, __gmp_u);
  __gmp_w->_mp_size = - __gmp_w->_mp_size;
}




extern __inline__

int
__gmpz_perfect_square_p (mpz_srcptr __gmp_a)
{
  mp_size_t __gmp_asize;
  int __gmp_result;

  __gmp_asize = __gmp_a->_mp_size;
  __gmp_result = (__gmp_asize >= 0);
  if (__builtin_expect ((__gmp_asize > 0) != 0, 1))
    __gmp_result = __gmpn_perfect_square_p (__gmp_a->_mp_d, __gmp_asize);
  return __gmp_result;
}




extern __inline__

mp_bitcnt_t
__gmpz_popcount (mpz_srcptr __gmp_u) throw ()
{
  mp_size_t __gmp_usize;
  mp_bitcnt_t __gmp_result;

  __gmp_usize = __gmp_u->_mp_size;
  __gmp_result = (__gmp_usize < 0 ? (~ (unsigned long) 0) : 0);
  if (__builtin_expect ((__gmp_usize > 0) != 0, 1))
    __gmp_result = __gmpn_popcount (__gmp_u->_mp_d, __gmp_usize);
  return __gmp_result;
}




extern __inline__

void
__gmpz_set_q (mpz_ptr __gmp_w, mpq_srcptr __gmp_u)
{
  __gmpz_tdiv_q (__gmp_w, (&((__gmp_u)->_mp_num)), (&((__gmp_u)->_mp_den)));
}




extern __inline__

size_t
__gmpz_size (mpz_srcptr __gmp_z) throw ()
{
  return ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : -(__gmp_z->_mp_size));
}






extern __inline__ void
__gmpq_abs (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
{
  if (__gmp_w != __gmp_u)
    __gmpq_set (__gmp_w, __gmp_u);
  __gmp_w->_mp_num._mp_size = ((__gmp_w->_mp_num._mp_size) >= 0 ? (__gmp_w->_mp_num._mp_size) : -(__gmp_w->_mp_num._mp_size));
}



extern __inline__ void
__gmpq_neg (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
{
  if (__gmp_w != __gmp_u)
    __gmpq_set (__gmp_w, __gmp_u);
  __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size;
}
# 2052 "/usr/local/include/gmp.h" 3
extern __inline__

mp_limb_t
__gmpn_add (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
{
  mp_limb_t __gmp_c;
  do { mp_size_t __gmp_i; mp_limb_t __gmp_x; __gmp_i = (__gmp_ysize); if (__gmp_i != 0) { if (__gmpn_add_n (__gmp_wp, __gmp_xp, __gmp_yp, __gmp_i)) { do { if (__gmp_i >= (__gmp_xsize)) { (__gmp_c) = 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while ((((__gmp_wp)[__gmp_i++] = (__gmp_x + 1) & ((~ (static_cast<mp_limb_t> (0))) >> 0)) == 0)); } } if ((__gmp_wp) != (__gmp_xp)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_xsize); __gmp_j++) (__gmp_wp)[__gmp_j] = (__gmp_xp)[__gmp_j]; } while (0); (__gmp_c) = 0; __gmp_done: ; } while (0);
  return __gmp_c;
}




extern __inline__

mp_limb_t
__gmpn_add_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) throw ()
{
  mp_limb_t __gmp_c;
  do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_r; __gmp_x = (__gmp_src)[0]; __gmp_r = __gmp_x + (__gmp_n); (__gmp_dst)[0] = __gmp_r; if (((__gmp_r) < ((__gmp_n)))) { (__gmp_c) = 1; for (__gmp_i = 1; __gmp_i < (__gmp_size);) { __gmp_x = (__gmp_src)[__gmp_i]; __gmp_r = __gmp_x + 1; (__gmp_dst)[__gmp_i] = __gmp_r; ++__gmp_i; if (!((__gmp_r) < (1))) { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; break; } } } else { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (1); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; } } while (0);
  return __gmp_c;
}




extern __inline__

int
__gmpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) throw ()
{
  int __gmp_result;
  do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_y; (__gmp_result) = 0; __gmp_i = (__gmp_size); while (--__gmp_i >= 0) { __gmp_x = (__gmp_xp)[__gmp_i]; __gmp_y = (__gmp_yp)[__gmp_i]; if (__gmp_x != __gmp_y) { (__gmp_result) = (__gmp_x > __gmp_y ? 1 : -1); break; } } } while (0);
  return __gmp_result;
}




extern __inline__

mp_limb_t
__gmpn_sub (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
{
  mp_limb_t __gmp_c;
  do { mp_size_t __gmp_i; mp_limb_t __gmp_x; __gmp_i = (__gmp_ysize); if (__gmp_i != 0) { if (__gmpn_sub_n (__gmp_wp, __gmp_xp, __gmp_yp, __gmp_i)) { do { if (__gmp_i >= (__gmp_xsize)) { (__gmp_c) = 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while ((((__gmp_wp)[__gmp_i++] = (__gmp_x - 1) & ((~ (static_cast<mp_limb_t> (0))) >> 0)), __gmp_x == 0)); } } if ((__gmp_wp) != (__gmp_xp)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_xsize); __gmp_j++) (__gmp_wp)[__gmp_j] = (__gmp_xp)[__gmp_j]; } while (0); (__gmp_c) = 0; __gmp_done: ; } while (0);
  return __gmp_c;
}




extern __inline__

mp_limb_t
__gmpn_sub_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) throw ()
{
  mp_limb_t __gmp_c;
  do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_r; __gmp_x = (__gmp_src)[0]; __gmp_r = __gmp_x - (__gmp_n); (__gmp_dst)[0] = __gmp_r; if (((__gmp_x) < ((__gmp_n)))) { (__gmp_c) = 1; for (__gmp_i = 1; __gmp_i < (__gmp_size);) { __gmp_x = (__gmp_src)[__gmp_i]; __gmp_r = __gmp_x - 1; (__gmp_dst)[__gmp_i] = __gmp_r; ++__gmp_i; if (!((__gmp_x) < (1))) { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; break; } } } else { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (1); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; } } while (0);
  return __gmp_c;
}




extern __inline__

mp_limb_t
__gmpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
{
  mp_limb_t __gmp_ul, __gmp_cy;
  __gmp_cy = 0;
  do {
      __gmp_ul = *__gmp_up++;
      *__gmp_rp++ = -__gmp_ul - __gmp_cy;
      __gmp_cy |= __gmp_ul != 0;
  } while (--__gmp_n != 0);
  return __gmp_cy;
}



}
# 2178 "/usr/local/include/gmp.h" 3
 std::ostream& operator<< (std::ostream &, mpz_srcptr);
 std::ostream& operator<< (std::ostream &, mpq_srcptr);
 std::ostream& operator<< (std::ostream &, mpf_srcptr);
 std::istream& operator>> (std::istream &, mpz_ptr);
 std::istream& operator>> (std::istream &, mpq_ptr);
 std::istream& operator>> (std::istream &, mpf_ptr);
# 2209 "/usr/local/include/gmp.h" 3
enum
{
  GMP_ERROR_NONE = 0,
  GMP_ERROR_UNSUPPORTED_ARGUMENT = 1,
  GMP_ERROR_DIVISION_BY_ZERO = 2,
  GMP_ERROR_SQRT_OF_NEGATIVE = 4,
  GMP_ERROR_INVALID_ARGUMENT = 8
};
# 33 "/usr/local/include/gmpxx.h" 2 3
# 68 "/usr/local/include/gmpxx.h" 3
inline void __mpz_set_ui_safe(mpz_ptr p, unsigned long l)
{
  p->_mp_size = (l != 0);
  p->_mp_d[0] = l & ((~ (static_cast<mp_limb_t> (0))) >> 0);





}

inline void __mpz_set_si_safe(mpz_ptr p, long l)
{
  if(l < 0)
  {
    __mpz_set_ui_safe(p, -static_cast<unsigned long>(l));
    __gmpz_neg(p, p);
  }
  else
    __mpz_set_ui_safe(p, l);

}
# 126 "/usr/local/include/gmpxx.h" 3
inline unsigned long __gmpxx_abs_ui (signed long l)
{
  return l >= 0 ? static_cast<unsigned long>(l)
   : -static_cast<unsigned long>(l);
}







struct __gmp_unary_plus
{
  static void eval(mpz_ptr z, mpz_srcptr w) { __gmpz_set(z, w); }
  static void eval(mpq_ptr q, mpq_srcptr r) { __gmpq_set(q, r); }
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_set(f, g); }
};

struct __gmp_unary_minus
{
  static void eval(mpz_ptr z, mpz_srcptr w) { __gmpz_neg(z, w); }
  static void eval(mpq_ptr q, mpq_srcptr r) { __gmpq_neg(q, r); }
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_neg(f, g); }
};

struct __gmp_unary_com
{
  static void eval(mpz_ptr z, mpz_srcptr w) { __gmpz_com(z, w); }
};

struct __gmp_binary_plus
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_add(z, w, v); }

  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  {


    if (false && l == 0)
    {
      if (z != w) __gmpz_set(z, w);
    }
    else
      __gmpz_add_ui(z, w, l);
  }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  {
    if (l >= 0)
      eval(z, w, static_cast<unsigned long>(l));
    else
      __gmpz_sub_ui(z, w, -static_cast<unsigned long>(l));
  }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_add (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { eval(z, w, d); }

  static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
  { __gmpq_add(q, r, s); }

  static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
  {
    if (false && l == 0)
    {
      if (q != r) __gmpq_set(q, r);
    }
    else
    {
      if (q == r)
        __gmpz_addmul_ui((&((q)->_mp_num)), (&((q)->_mp_den)), l);
      else
      {
        __gmpz_mul_ui((&((q)->_mp_num)), (&((r)->_mp_den)), l);
        __gmpz_add((&((q)->_mp_num)), (&((q)->_mp_num)), (&((r)->_mp_num)));
        __gmpz_set((&((q)->_mp_den)), (&((r)->_mp_den)));
      }
    }
  }
  static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
  { eval(q, r, l); }
  static inline void eval(mpq_ptr q, mpq_srcptr r, signed long int l);

  static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
  { eval(q, r, l); }
  static void eval(mpq_ptr q, mpq_srcptr r, double d)
  {
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    __gmpq_add(q, r, temp);
    __gmpq_clear(temp);
  }
  static void eval(mpq_ptr q, double d, mpq_srcptr r)
  { eval(q, r, d); }

  static void eval(mpq_ptr q, mpq_srcptr r, mpz_srcptr z)
  {
    if (q == r)
      __gmpz_addmul((&((q)->_mp_num)), (&((q)->_mp_den)), z);
    else
    {
      __gmpz_mul((&((q)->_mp_num)), (&((r)->_mp_den)), z);
      __gmpz_add((&((q)->_mp_num)), (&((q)->_mp_num)), (&((r)->_mp_num)));
      __gmpz_set((&((q)->_mp_den)), (&((r)->_mp_den)));
    }
  }
  static void eval(mpq_ptr q, mpz_srcptr z, mpq_srcptr r)
  { eval(q, r, z); }

  static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
  { __gmpf_add(f, g, h); }

  static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
  { __gmpf_add_ui(f, g, l); }
  static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
  { __gmpf_add_ui(f, g, l); }
  static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
  {
    if (l >= 0)
      __gmpf_add_ui(f, g, l);
    else
      __gmpf_sub_ui(f, g, -static_cast<unsigned long>(l));
  }
  static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
  { eval(f, g, l); }
  static void eval(mpf_ptr f, mpf_srcptr g, double d)
  {
    mpf_t temp;
    __gmpf_init2(temp, 8*sizeof(double));
    __gmpf_set_d(temp, d);
    __gmpf_add(f, g, temp);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, double d, mpf_srcptr g)
  { eval(f, g, d); }
};

struct __gmp_binary_minus
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_sub(z, w, v); }

  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  {
    if (false && l == 0)
    {
      if (z != w) __gmpz_set(z, w);
    }
    else
      __gmpz_sub_ui(z, w, l);
  }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  {
    if (false && l == 0)
    {
      __gmpz_neg(z, w);
    }
    else
      __gmpz_ui_sub(z, l, w);
  }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  {
    if (l >= 0)
      eval(z, w, static_cast<unsigned long>(l));
    else
      __gmpz_add_ui(z, w, -static_cast<unsigned long>(l));
  }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  {
    if (l >= 0)
      eval(z, static_cast<unsigned long>(l), w);
    else
      {
        __gmpz_add_ui(z, w, -static_cast<unsigned long>(l));
        __gmpz_neg(z, z);
      }
  }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_sub (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_sub (z, temp, w); }

  static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
  { __gmpq_sub(q, r, s); }

  static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
  {
    if (false && l == 0)
    {
      if (q != r) __gmpq_set(q, r);
    }
    else
    {
      if (q == r)
        __gmpz_submul_ui((&((q)->_mp_num)), (&((q)->_mp_den)), l);
      else
      {
        __gmpz_mul_ui((&((q)->_mp_num)), (&((r)->_mp_den)), l);
        __gmpz_sub((&((q)->_mp_num)), (&((r)->_mp_num)), (&((q)->_mp_num)));
        __gmpz_set((&((q)->_mp_den)), (&((r)->_mp_den)));
      }
    }
  }
  static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
  { eval(q, r, l); __gmpq_neg(q, q); }
  static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
  {
    if (l >= 0)
      eval(q, r, static_cast<unsigned long>(l));
    else
      __gmp_binary_plus::eval(q, r, -static_cast<unsigned long>(l));
  }
  static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
  { eval(q, r, l); __gmpq_neg(q, q); }
  static void eval(mpq_ptr q, mpq_srcptr r, double d)
  {
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    __gmpq_sub(q, r, temp);
    __gmpq_clear(temp);
  }
  static void eval(mpq_ptr q, double d, mpq_srcptr r)
  {
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    __gmpq_sub(q, temp, r);
    __gmpq_clear(temp);
  }

  static void eval(mpq_ptr q, mpq_srcptr r, mpz_srcptr z)
  {
    if (q == r)
      __gmpz_submul((&((q)->_mp_num)), (&((q)->_mp_den)), z);
    else
    {
      __gmpz_mul((&((q)->_mp_num)), (&((r)->_mp_den)), z);
      __gmpz_sub((&((q)->_mp_num)), (&((r)->_mp_num)), (&((q)->_mp_num)));
      __gmpz_set((&((q)->_mp_den)), (&((r)->_mp_den)));
    }
  }
  static void eval(mpq_ptr q, mpz_srcptr z, mpq_srcptr r)
  { eval(q, r, z); __gmpq_neg(q, q); }

  static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
  { __gmpf_sub(f, g, h); }

  static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
  { __gmpf_sub_ui(f, g, l); }
  static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
  { __gmpf_ui_sub(f, l, g); }
  static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
  {
    if (l >= 0)
      __gmpf_sub_ui(f, g, l);
    else
      __gmpf_add_ui(f, g, -static_cast<unsigned long>(l));
  }
  static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
  {
    if (l >= 0)
      __gmpf_sub_ui(f, g, l);
    else
      __gmpf_add_ui(f, g, -static_cast<unsigned long>(l));
    __gmpf_neg(f, f);
  }
  static void eval(mpf_ptr f, mpf_srcptr g, double d)
  {
    mpf_t temp;
    __gmpf_init2(temp, 8*sizeof(double));
    __gmpf_set_d(temp, d);
    __gmpf_sub(f, g, temp);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, double d, mpf_srcptr g)
  {
    mpf_t temp;
    __gmpf_init2(temp, 8*sizeof(double));
    __gmpf_set_d(temp, d);
    __gmpf_sub(f, temp, g);
    __gmpf_clear(temp);
  }
};


inline void
__gmp_binary_plus::eval(mpq_ptr q, mpq_srcptr r, signed long int l)
{
  if (l >= 0)
    eval(q, r, static_cast<unsigned long>(l));
  else
    __gmp_binary_minus::eval(q, r, -static_cast<unsigned long>(l));
}

struct __gmp_binary_lshift
{
  static void eval(mpz_ptr z, mpz_srcptr w, mp_bitcnt_t l)
  {
    if (false && (l == 0))
    {
      if (z != w) __gmpz_set(z, w);
    }
    else
      __gmpz_mul_2exp(z, w, l);
  }
  static void eval(mpq_ptr q, mpq_srcptr r, mp_bitcnt_t l)
  {
    if (false && (l == 0))
    {
      if (q != r) __gmpq_set(q, r);
    }
    else
      __gmpq_mul_2exp(q, r, l);
  }
  static void eval(mpf_ptr f, mpf_srcptr g, mp_bitcnt_t l)
  { __gmpf_mul_2exp(f, g, l); }
};

struct __gmp_binary_rshift
{
  static void eval(mpz_ptr z, mpz_srcptr w, mp_bitcnt_t l)
  {
    if (false && (l == 0))
    {
      if (z != w) __gmpz_set(z, w);
    }
    else
      __gmpz_fdiv_q_2exp(z, w, l);
  }
  static void eval(mpq_ptr q, mpq_srcptr r, mp_bitcnt_t l)
  {
    if (false && (l == 0))
    {
      if (q != r) __gmpq_set(q, r);
    }
    else
      __gmpq_div_2exp(q, r, l);
  }
  static void eval(mpf_ptr f, mpf_srcptr g, mp_bitcnt_t l)
  { __gmpf_div_2exp(f, g, l); }
};

struct __gmp_binary_multiplies
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_mul(z, w, v); }

  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  {


    if (false && (l & (l-1)) == 0)
    {
      if (l == 0)
      {
        z->_mp_size = 0;
      }
      else
      {
        __gmp_binary_lshift::eval(z, w, __builtin_ctzl(l));
      }
    }
    else

      __gmpz_mul_ui(z, w, l);
  }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  {
    if (false)
    {
      if (l >= 0)
        eval(z, w, static_cast<unsigned long>(l));
      else
      {
        eval(z, w, -static_cast<unsigned long>(l));
 __gmpz_neg(z, z);
      }
    }
    else
      __gmpz_mul_si (z, w, l);
  }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_mul (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { eval(z, w, d); }

  static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
  { __gmpq_mul(q, r, s); }

  static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
  {

    if (false && (l & (l-1)) == 0)
    {
      if (l == 0)
      {
 __gmpq_set_ui(q, 0, 1);
      }
      else
      {
        __gmp_binary_lshift::eval(q, r, __builtin_ctzl(l));
      }
    }
    else

    {
      mpq_t temp; mp_limb_t limbs[1 +1]; (&((temp)->_mp_num))->_mp_d = limbs; __mpz_set_ui_safe ((&((temp)->_mp_num)), l); (&((temp)->_mp_den))->_mp_d = limbs + 1; (&((temp)->_mp_den))->_mp_size = 1; (&((temp)->_mp_den))->_mp_d[0] = 1;
      __gmpq_mul (q, r, temp);
    }
  }
  static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
  { eval(q, r, l); }
  static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
  {
    if (false)
    {
      if (l >= 0)
        eval(q, r, static_cast<unsigned long>(l));
      else
      {
        eval(q, r, -static_cast<unsigned long>(l));
 __gmpq_neg(q, q);
      }
    }
    else
    {
      mpq_t temp; mp_limb_t limbs[1 +1]; (&((temp)->_mp_num))->_mp_d = limbs; __mpz_set_si_safe ((&((temp)->_mp_num)), l); (&((temp)->_mp_den))->_mp_d = limbs + 1; (&((temp)->_mp_den))->_mp_size = 1; (&((temp)->_mp_den))->_mp_d[0] = 1;
      __gmpq_mul (q, r, temp);
    }
  }
  static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
  { eval(q, r, l); }
  static void eval(mpq_ptr q, mpq_srcptr r, double d)
  {
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    __gmpq_mul(q, r, temp);
    __gmpq_clear(temp);
  }
  static void eval(mpq_ptr q, double d, mpq_srcptr r)
  { eval(q, r, d); }

  static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
  { __gmpf_mul(f, g, h); }

  static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
  { __gmpf_mul_ui(f, g, l); }
  static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
  { __gmpf_mul_ui(f, g, l); }
  static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
  {
    if (l >= 0)
      __gmpf_mul_ui(f, g, l);
    else
      {
 __gmpf_mul_ui(f, g, -static_cast<unsigned long>(l));
 __gmpf_neg(f, f);
      }
  }
  static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
  { eval(f, g, l); }
  static void eval(mpf_ptr f, mpf_srcptr g, double d)
  {
    mpf_t temp;
    __gmpf_init2(temp, 8*sizeof(double));
    __gmpf_set_d(temp, d);
    __gmpf_mul(f, g, temp);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, double d, mpf_srcptr g)
  { eval(f, g, d); }
};

struct __gmp_binary_divides
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_tdiv_q(z, w, v); }

  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  {


    if (false && (l & (l-1)) == 0 && l != 0)
    {
      if (l == 1)
      {
        if (z != w) __gmpz_set(z, w);
      }
      else
        __gmpz_tdiv_q_2exp(z, w, __builtin_ctzl(l));

    }
    else

      __gmpz_tdiv_q_ui(z, w, l);
  }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  {
    if (((w)->_mp_size < 0 ? -1 : (w)->_mp_size > 0) >= 0)
      {
 if (__gmpz_fits_ulong_p(w))
   __gmpz_set_ui(z, l / __gmpz_get_ui(w));
 else
   __gmpz_set_ui(z, 0);
      }
    else
      {
 __gmpz_neg(z, w);
 if (__gmpz_fits_ulong_p(z))
   {
     __gmpz_set_ui(z, l / __gmpz_get_ui(z));
     __gmpz_neg(z, z);
   }
 else
   __gmpz_set_ui(z, 0);
      }
  }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  {
    if (l >= 0)
      eval(z, w, static_cast<unsigned long>(l));
    else
      {
 eval(z, w, -static_cast<unsigned long>(l));
 __gmpz_neg(z, z);
      }
  }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  {
    if (__gmpz_fits_slong_p(w))
      __gmpz_set_si(z, l / __gmpz_get_si(w));
    else
      {


        __gmpz_set_si (z, (__gmpz_cmpabs_ui (w, __gmpxx_abs_ui(l)) == 0 ? -1 : 0));
      }
  }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_tdiv_q (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_tdiv_q (z, temp, w); }

  static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
  { __gmpq_div(q, r, s); }

  static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
  {

    if (false && (l & (l-1)) == 0 && l != 0)
      __gmp_binary_rshift::eval(q, r, __builtin_ctzl(l));
    else

    {
      mpq_t temp; mp_limb_t limbs[1 +1]; (&((temp)->_mp_num))->_mp_d = limbs; __mpz_set_ui_safe ((&((temp)->_mp_num)), l); (&((temp)->_mp_den))->_mp_d = limbs + 1; (&((temp)->_mp_den))->_mp_size = 1; (&((temp)->_mp_den))->_mp_d[0] = 1;
      __gmpq_div (q, r, temp);
    }
  }
  static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
  { mpq_t temp; mp_limb_t limbs[1 +1]; (&((temp)->_mp_num))->_mp_d = limbs; __mpz_set_ui_safe ((&((temp)->_mp_num)), l); (&((temp)->_mp_den))->_mp_d = limbs + 1; (&((temp)->_mp_den))->_mp_size = 1; (&((temp)->_mp_den))->_mp_d[0] = 1; __gmpq_div (q, temp, r); }
  static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
  {
    if (false)
    {
      if (l >= 0)
        eval(q, r, static_cast<unsigned long>(l));
      else
      {
        eval(q, r, -static_cast<unsigned long>(l));
 __gmpq_neg(q, q);
      }
    }
    else
    {
      mpq_t temp; mp_limb_t limbs[1 +1]; (&((temp)->_mp_num))->_mp_d = limbs; __mpz_set_si_safe ((&((temp)->_mp_num)), l); (&((temp)->_mp_den))->_mp_d = limbs + 1; (&((temp)->_mp_den))->_mp_size = 1; (&((temp)->_mp_den))->_mp_d[0] = 1;
      __gmpq_div (q, r, temp);
    }
  }
  static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
  { mpq_t temp; mp_limb_t limbs[1 +1]; (&((temp)->_mp_num))->_mp_d = limbs; __mpz_set_si_safe ((&((temp)->_mp_num)), l); (&((temp)->_mp_den))->_mp_d = limbs + 1; (&((temp)->_mp_den))->_mp_size = 1; (&((temp)->_mp_den))->_mp_d[0] = 1; __gmpq_div (q, temp, r); }
  static void eval(mpq_ptr q, mpq_srcptr r, double d)
  {
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    __gmpq_div(q, r, temp);
    __gmpq_clear(temp);
  }
  static void eval(mpq_ptr q, double d, mpq_srcptr r)
  {
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    __gmpq_div(q, temp, r);
    __gmpq_clear(temp);
  }

  static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
  { __gmpf_div(f, g, h); }

  static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
  { __gmpf_div_ui(f, g, l); }
  static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
  { __gmpf_ui_div(f, l, g); }
  static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
  {
    if (l >= 0)
      __gmpf_div_ui(f, g, l);
    else
      {
 __gmpf_div_ui(f, g, -static_cast<unsigned long>(l));
 __gmpf_neg(f, f);
      }
  }
  static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
  {
    if (l >= 0)
      __gmpf_ui_div(f, l, g);
    else
      {
 __gmpf_ui_div(f, -static_cast<unsigned long>(l), g);
 __gmpf_neg(f, f);
      }
  }
  static void eval(mpf_ptr f, mpf_srcptr g, double d)
  {
    mpf_t temp;
    __gmpf_init2(temp, 8*sizeof(double));
    __gmpf_set_d(temp, d);
    __gmpf_div(f, g, temp);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, double d, mpf_srcptr g)
  {
    mpf_t temp;
    __gmpf_init2(temp, 8*sizeof(double));
    __gmpf_set_d(temp, d);
    __gmpf_div(f, temp, g);
    __gmpf_clear(temp);
  }
};

struct __gmp_binary_modulus
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_tdiv_r(z, w, v); }

  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  { __gmpz_tdiv_r_ui(z, w, l); }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  {
    if (((w)->_mp_size < 0 ? -1 : (w)->_mp_size > 0) >= 0)
      {
 if (__gmpz_fits_ulong_p(w))
   __gmpz_set_ui(z, l % __gmpz_get_ui(w));
 else
   __gmpz_set_ui(z, l);
      }
    else
      {
 __gmpz_neg(z, w);
 if (__gmpz_fits_ulong_p(z))
   __gmpz_set_ui(z, l % __gmpz_get_ui(z));
 else
   __gmpz_set_ui(z, l);
      }
  }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  {
    __gmpz_tdiv_r_ui (z, w, __gmpxx_abs_ui(l));
  }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  {
    if (__gmpz_fits_slong_p(w))
      __gmpz_set_si(z, l % __gmpz_get_si(w));
    else
      {


        __gmpz_set_si (z, __gmpz_cmpabs_ui (w, __gmpxx_abs_ui(l)) == 0 ? 0 : l);
      }
  }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_tdiv_r (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_tdiv_r (z, temp, w); }
};

struct __gmp_binary_and
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_and(z, w, v); }

  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  { mpz_t temp; mp_limb_t limbs[1]; temp->_mp_d = limbs; __mpz_set_ui_safe (temp, l); __gmpz_and (z, w, temp); }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  { mpz_t temp; mp_limb_t limbs[1]; temp->_mp_d = limbs; __mpz_set_si_safe (temp, l); __gmpz_and (z, w, temp); }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_and (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { eval(z, w, d); }
};

struct __gmp_binary_ior
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_ior(z, w, v); }
  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  { mpz_t temp; mp_limb_t limbs[1]; temp->_mp_d = limbs; __mpz_set_ui_safe (temp, l); __gmpz_ior (z, w, temp); }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  { mpz_t temp; mp_limb_t limbs[1]; temp->_mp_d = limbs; __mpz_set_si_safe (temp, l); __gmpz_ior (z, w, temp); }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_ior (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { eval(z, w, d); }
};

struct __gmp_binary_xor
{
  static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
  { __gmpz_xor(z, w, v); }
  static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
  { mpz_t temp; mp_limb_t limbs[1]; temp->_mp_d = limbs; __mpz_set_ui_safe (temp, l); __gmpz_xor (z, w, temp); }
  static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
  { mpz_t temp; mp_limb_t limbs[1]; temp->_mp_d = limbs; __mpz_set_si_safe (temp, l); __gmpz_xor (z, w, temp); }
  static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
  { eval(z, w, l); }
  static void eval(mpz_ptr z, mpz_srcptr w, double d)
  { mpz_t temp; mp_limb_t limbs[(2 + 1024 / (32 - 0))]; temp->_mp_d = limbs; temp->_mp_alloc = (2 + 1024 / (32 - 0)); __gmpz_set_d (temp, d); __gmpz_xor (z, w, temp); }
  static void eval(mpz_ptr z, double d, mpz_srcptr w)
  { eval(z, w, d); }
};

struct __gmp_binary_equal
{
  static bool eval(mpz_srcptr z, mpz_srcptr w) { return __gmpz_cmp(z, w) == 0; }

  static bool eval(mpz_srcptr z, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)) == 0; }
  static bool eval(unsigned long int l, mpz_srcptr z)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)) == 0; }
  static bool eval(mpz_srcptr z, signed long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)) == 0; }
  static bool eval(signed long int l, mpz_srcptr z)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)) == 0; }
  static bool eval(mpz_srcptr z, double d)
  { return __gmpz_cmp_d(z, d) == 0; }
  static bool eval(double d, mpz_srcptr z)
  { return __gmpz_cmp_d(z, d) == 0; }

  static bool eval(mpq_srcptr q, mpq_srcptr r)
  { return __gmpq_equal(q, r) != 0; }

  static bool eval(mpq_srcptr q, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)) == 0; }
  static bool eval(unsigned long int l, mpq_srcptr q)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)) == 0; }
  static bool eval(mpq_srcptr q, signed long int l)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)) == 0; }
  static bool eval(signed long int l, mpq_srcptr q)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)) == 0; }
  static bool eval(mpq_srcptr q, double d)
  {
    bool b;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    b = (__gmpq_equal(q, temp) != 0);
    __gmpq_clear(temp);
    return b;
  }
  static bool eval(double d, mpq_srcptr q)
  {
    return eval(q, d);
  }

  static bool eval(mpf_srcptr f, mpf_srcptr g) { return __gmpf_cmp(f, g) == 0; }

  static bool eval(mpf_srcptr f, unsigned long int l)
  { return __gmpf_cmp_ui(f, l) == 0; }
  static bool eval(unsigned long int l, mpf_srcptr f)
  { return __gmpf_cmp_ui(f, l) == 0; }
  static bool eval(mpf_srcptr f, signed long int l)
  { return __gmpf_cmp_si(f, l) == 0; }
  static bool eval(signed long int l, mpf_srcptr f)
  { return __gmpf_cmp_si(f, l) == 0; }
  static bool eval(mpf_srcptr f, double d)
  { return __gmpf_cmp_d(f, d) == 0; }
  static bool eval(double d, mpf_srcptr f)
  { return __gmpf_cmp_d(f, d) == 0; }
};

struct __gmp_binary_less
{
  static bool eval(mpz_srcptr z, mpz_srcptr w) { return __gmpz_cmp(z, w) < 0; }

  static bool eval(mpz_srcptr z, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)) < 0; }
  static bool eval(unsigned long int l, mpz_srcptr z)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)) > 0; }
  static bool eval(mpz_srcptr z, signed long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)) < 0; }
  static bool eval(signed long int l, mpz_srcptr z)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)) > 0; }
  static bool eval(mpz_srcptr z, double d)
  { return __gmpz_cmp_d(z, d) < 0; }
  static bool eval(double d, mpz_srcptr z)
  { return __gmpz_cmp_d(z, d) > 0; }

  static bool eval(mpq_srcptr q, mpq_srcptr r) { return __gmpq_cmp(q, r) < 0; }

  static bool eval(mpq_srcptr q, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)) < 0; }
  static bool eval(unsigned long int l, mpq_srcptr q)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)) > 0; }
  static bool eval(mpq_srcptr q, signed long int l)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)) < 0; }
  static bool eval(signed long int l, mpq_srcptr q)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)) > 0; }
  static bool eval(mpq_srcptr q, double d)
  {
    bool b;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    b = (__gmpq_cmp(q, temp) < 0);
    __gmpq_clear(temp);
    return b;
  }
  static bool eval(double d, mpq_srcptr q)
  {
    bool b;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    b = (__gmpq_cmp(temp, q) < 0);
    __gmpq_clear(temp);
    return b;
  }

  static bool eval(mpf_srcptr f, mpf_srcptr g) { return __gmpf_cmp(f, g) < 0; }

  static bool eval(mpf_srcptr f, unsigned long int l)
  { return __gmpf_cmp_ui(f, l) < 0; }
  static bool eval(unsigned long int l, mpf_srcptr f)
  { return __gmpf_cmp_ui(f, l) > 0; }
  static bool eval(mpf_srcptr f, signed long int l)
  { return __gmpf_cmp_si(f, l) < 0; }
  static bool eval(signed long int l, mpf_srcptr f)
  { return __gmpf_cmp_si(f, l) > 0; }
  static bool eval(mpf_srcptr f, double d)
  { return __gmpf_cmp_d(f, d) < 0; }
  static bool eval(double d, mpf_srcptr f)
  { return __gmpf_cmp_d(f, d) > 0; }
};

struct __gmp_binary_greater
{
  static bool eval(mpz_srcptr z, mpz_srcptr w) { return __gmpz_cmp(z, w) > 0; }

  static bool eval(mpz_srcptr z, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)) > 0; }
  static bool eval(unsigned long int l, mpz_srcptr z)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)) < 0; }
  static bool eval(mpz_srcptr z, signed long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)) > 0; }
  static bool eval(signed long int l, mpz_srcptr z)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)) < 0; }
  static bool eval(mpz_srcptr z, double d)
  { return __gmpz_cmp_d(z, d) > 0; }
  static bool eval(double d, mpz_srcptr z)
  { return __gmpz_cmp_d(z, d) < 0; }

  static bool eval(mpq_srcptr q, mpq_srcptr r) { return __gmpq_cmp(q, r) > 0; }

  static bool eval(mpq_srcptr q, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)) > 0; }
  static bool eval(unsigned long int l, mpq_srcptr q)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)) < 0; }
  static bool eval(mpq_srcptr q, signed long int l)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)) > 0; }
  static bool eval(signed long int l, mpq_srcptr q)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)) < 0; }
  static bool eval(mpq_srcptr q, double d)
  {
    bool b;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    b = (__gmpq_cmp(q, temp) > 0);
    __gmpq_clear(temp);
    return b;
  }
  static bool eval(double d, mpq_srcptr q)
  {
    bool b;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    b = (__gmpq_cmp(temp, q) > 0);
    __gmpq_clear(temp);
    return b;
  }

  static bool eval(mpf_srcptr f, mpf_srcptr g) { return __gmpf_cmp(f, g) > 0; }

  static bool eval(mpf_srcptr f, unsigned long int l)
  { return __gmpf_cmp_ui(f, l) > 0; }
  static bool eval(unsigned long int l, mpf_srcptr f)
  { return __gmpf_cmp_ui(f, l) < 0; }
  static bool eval(mpf_srcptr f, signed long int l)
  { return __gmpf_cmp_si(f, l) > 0; }
  static bool eval(signed long int l, mpf_srcptr f)
  { return __gmpf_cmp_si(f, l) < 0; }
  static bool eval(mpf_srcptr f, double d)
  { return __gmpf_cmp_d(f, d) > 0; }
  static bool eval(double d, mpf_srcptr f)
  { return __gmpf_cmp_d(f, d) < 0; }
};

struct __gmp_unary_increment
{
  static void eval(mpz_ptr z) { __gmpz_add_ui(z, z, 1); }
  static void eval(mpq_ptr q)
  { __gmpz_add((&((q)->_mp_num)), (&((q)->_mp_num)), (&((q)->_mp_den))); }
  static void eval(mpf_ptr f) { __gmpf_add_ui(f, f, 1); }
};

struct __gmp_unary_decrement
{
  static void eval(mpz_ptr z) { __gmpz_sub_ui(z, z, 1); }
  static void eval(mpq_ptr q)
  { __gmpz_sub((&((q)->_mp_num)), (&((q)->_mp_num)), (&((q)->_mp_den))); }
  static void eval(mpf_ptr f) { __gmpf_sub_ui(f, f, 1); }
};

struct __gmp_abs_function
{
  static void eval(mpz_ptr z, mpz_srcptr w) { __gmpz_abs(z, w); }
  static void eval(mpq_ptr q, mpq_srcptr r) { __gmpq_abs(q, r); }
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_abs(f, g); }
};

struct __gmp_trunc_function
{
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_trunc(f, g); }
};

struct __gmp_floor_function
{
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_floor(f, g); }
};

struct __gmp_ceil_function
{
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_ceil(f, g); }
};

struct __gmp_sqrt_function
{
  static void eval(mpz_ptr z, mpz_srcptr w) { __gmpz_sqrt(z, w); }
  static void eval(mpf_ptr f, mpf_srcptr g) { __gmpf_sqrt(f, g); }
};

struct __gmp_hypot_function
{
  static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
  {
    mpf_t temp;
    __gmpf_init2(temp, __gmpf_get_prec(f));
    __gmpf_mul(temp, g, g);
    __gmpf_mul(f, h, h);
    __gmpf_add(f, f, temp);
    __gmpf_sqrt(f, f);
    __gmpf_clear(temp);
  }

  static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
  {
    mpf_t temp;
    __gmpf_init2(temp, __gmpf_get_prec(f));
    __gmpf_mul(temp, g, g);
    __gmpf_set_ui(f, l);
    __gmpf_mul(f, f, f);
    __gmpf_add(f, f, temp);
    __gmpf_sqrt(f, f);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
  { eval(f, g, l); }
  static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
  {
    mpf_t temp;
    __gmpf_init2(temp, __gmpf_get_prec(f));
    __gmpf_mul(temp, g, g);
    __gmpf_set_si(f, l);
    __gmpf_mul(f, f, f);
    __gmpf_add(f, f, temp);
    __gmpf_sqrt(f, f);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
  { eval(f, g, l); }
  static void eval(mpf_ptr f, mpf_srcptr g, double d)
  {
    mpf_t temp;
    __gmpf_init2(temp, __gmpf_get_prec(f));
    __gmpf_mul(temp, g, g);
    __gmpf_set_d(f, d);
    __gmpf_mul(f, f, f);
    __gmpf_add(f, f, temp);
    __gmpf_sqrt(f, f);
    __gmpf_clear(temp);
  }
  static void eval(mpf_ptr f, double d, mpf_srcptr g)
  { eval(f, g, d); }
};

struct __gmp_sgn_function
{
  static int eval(mpz_srcptr z) { return ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0); }
  static int eval(mpq_srcptr q) { return ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0); }
  static int eval(mpf_srcptr f) { return ((f)->_mp_size < 0 ? -1 : (f)->_mp_size > 0); }
};

struct __gmp_cmp_function
{
  static int eval(mpz_srcptr z, mpz_srcptr w) { return __gmpz_cmp(z, w); }

  static int eval(mpz_srcptr z, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)); }
  static int eval(unsigned long int l, mpz_srcptr z)
  { return -(__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __gmpz_cmp_ui (z,l)); }
  static int eval(mpz_srcptr z, signed long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)); }
  static int eval(signed long int l, mpz_srcptr z)
  { return -(__builtin_constant_p (l) && (l) == 0 ? ((z)->_mp_size < 0 ? -1 : (z)->_mp_size > 0) : __builtin_constant_p (l) && (l) > 0 ? __gmpz_cmp_ui (z, (static_cast<unsigned long int> (l))) : __gmpz_cmp_si (z,l)); }
  static int eval(mpz_srcptr z, double d)
  { return __gmpz_cmp_d(z, d); }
  static int eval(double d, mpz_srcptr z)
  { return -__gmpz_cmp_d(z, d); }

  static int eval(mpq_srcptr q, mpq_srcptr r) { return __gmpq_cmp(q, r); }

  static int eval(mpq_srcptr q, unsigned long int l)
  { return (__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)); }
  static int eval(unsigned long int l, mpq_srcptr q)
  { return -(__builtin_constant_p (l) && (l) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,l,1)); }
  static int eval(mpq_srcptr q, signed long int l)
  { return (__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)); }
  static int eval(signed long int l, mpq_srcptr q)
  { return -(__builtin_constant_p ((l) >= 0) && (l) >= 0 ? (__builtin_constant_p ((static_cast<unsigned long> (l))) && ((static_cast<unsigned long> (l))) == 0 ? ((q)->_mp_num._mp_size < 0 ? -1 : (q)->_mp_num._mp_size > 0) : __gmpq_cmp_ui (q,(static_cast<unsigned long> (l)),1)) : __gmpq_cmp_si (q, l, 1)); }
  static int eval(mpq_srcptr q, double d)
  {
    int i;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    i = __gmpq_cmp(q, temp);
    __gmpq_clear(temp);
    return i;
  }
  static int eval(double d, mpq_srcptr q)
  {
    int i;
    mpq_t temp;
    __gmpq_init(temp);
    __gmpq_set_d(temp, d);
    i = __gmpq_cmp(temp, q);
    __gmpq_clear(temp);
    return i;
  }

  static int eval(mpf_srcptr f, mpf_srcptr g) { return __gmpf_cmp(f, g); }

  static int eval(mpf_srcptr f, unsigned long int l)
  { return __gmpf_cmp_ui(f, l); }
  static int eval(unsigned long int l, mpf_srcptr f)
  { return -__gmpf_cmp_ui(f, l); }
  static int eval(mpf_srcptr f, signed long int l)
  { return __gmpf_cmp_si(f, l); }
  static int eval(signed long int l, mpf_srcptr f)
  { return -__gmpf_cmp_si(f, l); }
  static int eval(mpf_srcptr f, double d)
  { return __gmpf_cmp_d(f, d); }
  static int eval(double d, mpf_srcptr f)
  { return -__gmpf_cmp_d(f, d); }
};

struct __gmp_rand_function
{
  static void eval(mpz_ptr z, gmp_randstate_t s, mp_bitcnt_t l)
  { __gmpz_urandomb(z, s, l); }
  static void eval(mpz_ptr z, gmp_randstate_t s, mpz_srcptr w)
  { __gmpz_urandomm(z, s, w); }
  static void eval(mpf_ptr f, gmp_randstate_t s, mp_bitcnt_t prec)
  { __gmpf_urandomb(f, s, prec); }
};
# 1254 "/usr/local/include/gmpxx.h" 3
extern "C" {
  typedef void (*__gmp_freefunc_t) (void *, size_t);
}
struct __gmp_alloc_cstring
{
  char *str;
  __gmp_alloc_cstring(char *s) { str = s; }
  ~__gmp_alloc_cstring()
  {
    __gmp_freefunc_t freefunc;
    __gmp_get_memory_functions (__null, __null, &freefunc);
    (*freefunc) (str, std::strlen(str)+1);
  }
};



template <class T, class U>
class __gmp_expr;



template <class T>
struct __gmp_resolve_ref
{
  typedef T ref_type;
};

template <class T, class U>
struct __gmp_resolve_ref<__gmp_expr<T, U> >
{
  typedef const __gmp_expr<T, U> & ref_type;
};


template <class T, class U = T>
struct __gmp_resolve_expr;

template <>
struct __gmp_resolve_expr<mpz_t>
{
  typedef mpz_t value_type;
  typedef mpz_ptr ptr_type;
  typedef mpz_srcptr srcptr_type;
};

template <>
struct __gmp_resolve_expr<mpq_t>
{
  typedef mpq_t value_type;
  typedef mpq_ptr ptr_type;
  typedef mpq_srcptr srcptr_type;
};

template <>
struct __gmp_resolve_expr<mpf_t>
{
  typedef mpf_t value_type;
  typedef mpf_ptr ptr_type;
  typedef mpf_srcptr srcptr_type;
};

template <>
struct __gmp_resolve_expr<mpz_t, mpq_t>
{
  typedef mpq_t value_type;
};

template <>
struct __gmp_resolve_expr<mpq_t, mpz_t>
{
  typedef mpq_t value_type;
};

template <>
struct __gmp_resolve_expr<mpz_t, mpf_t>
{
  typedef mpf_t value_type;
};

template <>
struct __gmp_resolve_expr<mpf_t, mpz_t>
{
  typedef mpf_t value_type;
};

template <>
struct __gmp_resolve_expr<mpq_t, mpf_t>
{
  typedef mpf_t value_type;
};

template <>
struct __gmp_resolve_expr<mpf_t, mpq_t>
{
  typedef mpf_t value_type;
};
# 1397 "/usr/local/include/gmpxx.h" 3
template <class T, class Op>
struct __gmp_unary_expr
{
  const T &val;

  __gmp_unary_expr(const T &v) : val(v) { }
private:
  __gmp_unary_expr();
};

template <class T, class U, class Op>
struct __gmp_binary_expr
{
  typename __gmp_resolve_ref<T>::ref_type val1;
  typename __gmp_resolve_ref<U>::ref_type val2;

  __gmp_binary_expr(const T &v1, const U &v2) : val1(v1), val2(v2) { }
private:
  __gmp_binary_expr();
};
# 1455 "/usr/local/include/gmpxx.h" 3
template <>
class __gmp_expr<mpz_t, mpz_t>
{
private:
  typedef mpz_t value_type;
  value_type mp;
public:
  mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); }


  __gmp_expr() { __gmpz_init(mp); }

  __gmp_expr(const __gmp_expr &z) { __gmpz_init_set(mp, z.mp); }




  template <class T>
  __gmp_expr(const __gmp_expr<mpz_t, T> &expr)
  { __gmpz_init(mp); __gmp_set_expr(mp, expr); }
  template <class T, class U>
  explicit __gmp_expr(const __gmp_expr<T, U> &expr)
  { __gmpz_init(mp); __gmp_set_expr(mp, expr); }

  __gmp_expr(signed char c) { __gmpz_init_set_si(mp, c); }
  __gmp_expr(unsigned char c) { __gmpz_init_set_ui(mp, c); }

  __gmp_expr(signed int i) { __gmpz_init_set_si(mp, i); }
  __gmp_expr(unsigned int i) { __gmpz_init_set_ui(mp, i); }

  __gmp_expr(signed short int s) { __gmpz_init_set_si(mp, s); }
  __gmp_expr(unsigned short int s) { __gmpz_init_set_ui(mp, s); }

  __gmp_expr(signed long int l) { __gmpz_init_set_si(mp, l); }
  __gmp_expr(unsigned long int l) { __gmpz_init_set_ui(mp, l); }

  __gmp_expr(float f) { __gmpz_init_set_d(mp, f); }
  __gmp_expr(double d) { __gmpz_init_set_d(mp, d); }


  explicit __gmp_expr(const char *s, int base = 0)
  {
    if (__gmpz_init_set_str (mp, s, base) != 0)
      {
        __gmpz_clear (mp);
        throw std::invalid_argument ("mpz_set_str");
      }
  }
  explicit __gmp_expr(const std::string &s, int base = 0)
  {
    if (__gmpz_init_set_str(mp, s.c_str(), base) != 0)
      {
        __gmpz_clear (mp);
        throw std::invalid_argument ("mpz_set_str");
      }
  }

  explicit __gmp_expr(mpz_srcptr z) { __gmpz_init_set(mp, z); }

  ~__gmp_expr() { __gmpz_clear(mp); }

  void swap(__gmp_expr& z) { std::swap(*mp, *z.mp); }


  __gmp_expr & operator=(const __gmp_expr &z)
  { __gmpz_set(mp, z.mp); return *this; }




  template <class T, class U>
  __gmp_expr<value_type, value_type> & operator=(const __gmp_expr<T, U> &expr)
  { __gmp_set_expr(mp, expr); return *this; }

  __gmp_expr & operator=(signed char c) { __gmpz_set_si(mp, c); return *this; }
  __gmp_expr & operator=(unsigned char c) { __gmpz_set_ui(mp, c); return *this; }

  __gmp_expr & operator=(signed int i) { __gmpz_set_si(mp, i); return *this; }
  __gmp_expr & operator=(unsigned int i) { __gmpz_set_ui(mp, i); return *this; }

  __gmp_expr & operator=(signed short int s)
  { __gmpz_set_si(mp, s); return *this; }
  __gmp_expr & operator=(unsigned short int s)
  { __gmpz_set_ui(mp, s); return *this; }

  __gmp_expr & operator=(signed long int l)
  { __gmpz_set_si(mp, l); return *this; }
  __gmp_expr & operator=(unsigned long int l)
  { __gmpz_set_ui(mp, l); return *this; }

  __gmp_expr & operator=(float f) { __gmpz_set_d(mp, f); return *this; }
  __gmp_expr & operator=(double d) { __gmpz_set_d(mp, d); return *this; }



  __gmp_expr & operator=(const char *s)
  {
    if (__gmpz_set_str (mp, s, 0) != 0)
      throw std::invalid_argument ("mpz_set_str");
    return *this;
  }
  __gmp_expr & operator=(const std::string &s)
  {
    if (__gmpz_set_str(mp, s.c_str(), 0) != 0)
      throw std::invalid_argument ("mpz_set_str");
    return *this;
  }


  int set_str(const char *s, int base)
  { return __gmpz_set_str(mp, s, base); }
  int set_str(const std::string &s, int base)
  { return __gmpz_set_str(mp, s.c_str(), base); }
  std::string get_str(int base = 10) const
  {
    __gmp_alloc_cstring temp(__gmpz_get_str(0, base, mp));
    return std::string(temp.str);
  }


  mpz_srcptr __get_mp() const { return mp; }
  mpz_ptr __get_mp() { return mp; }
  mpz_srcptr get_mpz_t() const { return mp; }
  mpz_ptr get_mpz_t() { return mp; }

  signed long int get_si() const { return __gmpz_get_si(mp); }
  unsigned long int get_ui() const { return __gmpz_get_ui(mp); }
  double get_d() const { return __gmpz_get_d(mp); }



  bool fits_sint_p() const { return __gmpz_fits_sint_p(mp); }
  bool fits_uint_p() const { return __gmpz_fits_uint_p(mp); }
  bool fits_sshort_p() const { return __gmpz_fits_sshort_p(mp); }
  bool fits_ushort_p() const { return __gmpz_fits_ushort_p(mp); }
  bool fits_slong_p() const { return __gmpz_fits_slong_p(mp); }
  bool fits_ulong_p() const { return __gmpz_fits_ulong_p(mp); }
# 1601 "/usr/local/include/gmpxx.h" 3
  template <class T, class U> __gmp_expr<value_type, value_type> & operator+=(const __gmp_expr<T, U> &); __gmp_expr & operator+=(signed char); __gmp_expr & operator+=(unsigned char); __gmp_expr & operator+=(signed int); __gmp_expr & operator+=(unsigned int); __gmp_expr & operator+=(signed short int); __gmp_expr & operator+=(unsigned short int); __gmp_expr & operator+=(signed long int); __gmp_expr & operator+=(unsigned long int); __gmp_expr & operator+=(float); __gmp_expr & operator+=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator-=(const __gmp_expr<T, U> &); __gmp_expr & operator-=(signed char); __gmp_expr & operator-=(unsigned char); __gmp_expr & operator-=(signed int); __gmp_expr & operator-=(unsigned int); __gmp_expr & operator-=(signed short int); __gmp_expr & operator-=(unsigned short int); __gmp_expr & operator-=(signed long int); __gmp_expr & operator-=(unsigned long int); __gmp_expr & operator-=(float); __gmp_expr & operator-=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator*=(const __gmp_expr<T, U> &); __gmp_expr & operator*=(signed char); __gmp_expr & operator*=(unsigned char); __gmp_expr & operator*=(signed int); __gmp_expr & operator*=(unsigned int); __gmp_expr & operator*=(signed short int); __gmp_expr & operator*=(unsigned short int); __gmp_expr & operator*=(signed long int); __gmp_expr & operator*=(unsigned long int); __gmp_expr & operator*=(float); __gmp_expr & operator*=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator/=(const __gmp_expr<T, U> &); __gmp_expr & operator/=(signed char); __gmp_expr & operator/=(unsigned char); __gmp_expr & operator/=(signed int); __gmp_expr & operator/=(unsigned int); __gmp_expr & operator/=(signed short int); __gmp_expr & operator/=(unsigned short int); __gmp_expr & operator/=(signed long int); __gmp_expr & operator/=(unsigned long int); __gmp_expr & operator/=(float); __gmp_expr & operator/=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator%=(const __gmp_expr<T, U> &); __gmp_expr & operator%=(signed char); __gmp_expr & operator%=(unsigned char); __gmp_expr & operator%=(signed int); __gmp_expr & operator%=(unsigned int); __gmp_expr & operator%=(signed short int); __gmp_expr & operator%=(unsigned short int); __gmp_expr & operator%=(signed long int); __gmp_expr & operator%=(unsigned long int); __gmp_expr & operator%=(float); __gmp_expr & operator%=(double);

  template <class T, class U> __gmp_expr<value_type, value_type> & operator&=(const __gmp_expr<T, U> &); __gmp_expr & operator&=(signed char); __gmp_expr & operator&=(unsigned char); __gmp_expr & operator&=(signed int); __gmp_expr & operator&=(unsigned int); __gmp_expr & operator&=(signed short int); __gmp_expr & operator&=(unsigned short int); __gmp_expr & operator&=(signed long int); __gmp_expr & operator&=(unsigned long int); __gmp_expr & operator&=(float); __gmp_expr & operator&=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator|=(const __gmp_expr<T, U> &); __gmp_expr & operator|=(signed char); __gmp_expr & operator|=(unsigned char); __gmp_expr & operator|=(signed int); __gmp_expr & operator|=(unsigned int); __gmp_expr & operator|=(signed short int); __gmp_expr & operator|=(unsigned short int); __gmp_expr & operator|=(signed long int); __gmp_expr & operator|=(unsigned long int); __gmp_expr & operator|=(float); __gmp_expr & operator|=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator^=(const __gmp_expr<T, U> &); __gmp_expr & operator^=(signed char); __gmp_expr & operator^=(unsigned char); __gmp_expr & operator^=(signed int); __gmp_expr & operator^=(unsigned int); __gmp_expr & operator^=(signed short int); __gmp_expr & operator^=(unsigned short int); __gmp_expr & operator^=(signed long int); __gmp_expr & operator^=(unsigned long int); __gmp_expr & operator^=(float); __gmp_expr & operator^=(double);

  __gmp_expr & operator<<=(mp_bitcnt_t);
  __gmp_expr & operator>>=(mp_bitcnt_t);

  inline __gmp_expr & operator++(); inline __gmp_expr operator++(int);
  inline __gmp_expr & operator--(); inline __gmp_expr operator--(int);
};

typedef __gmp_expr<mpz_t, mpz_t> mpz_class;




template <>
class __gmp_expr<mpq_t, mpq_t>
{
private:
  typedef mpq_t value_type;
  value_type mp;
public:
  mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); }
  void canonicalize() { __gmpq_canonicalize(mp); }


  __gmp_expr() { __gmpq_init(mp); }

  __gmp_expr(const __gmp_expr &q)
  {
    __gmpz_init_set((&((mp)->_mp_num)), (&((q.mp)->_mp_num)));
    __gmpz_init_set((&((mp)->_mp_den)), (&((q.mp)->_mp_den)));
  }




  template <class T>
  __gmp_expr(const __gmp_expr<mpz_t, T> &expr)
  { __gmpq_init(mp); __gmp_set_expr(mp, expr); }
  template <class T>
  __gmp_expr(const __gmp_expr<mpq_t, T> &expr)
  { __gmpq_init(mp); __gmp_set_expr(mp, expr); }
  template <class T, class U>
  explicit __gmp_expr(const __gmp_expr<T, U> &expr)
  { __gmpq_init(mp); __gmp_set_expr(mp, expr); }

  __gmp_expr(signed char c) { __gmpq_init(mp); __gmpq_set_si(mp, c, 1); }
  __gmp_expr(unsigned char c) { __gmpq_init(mp); __gmpq_set_ui(mp, c, 1); }

  __gmp_expr(signed int i) { __gmpq_init(mp); __gmpq_set_si(mp, i, 1); }
  __gmp_expr(unsigned int i) { __gmpq_init(mp); __gmpq_set_ui(mp, i, 1); }

  __gmp_expr(signed short int s) { __gmpq_init(mp); __gmpq_set_si(mp, s, 1); }
  __gmp_expr(unsigned short int s) { __gmpq_init(mp); __gmpq_set_ui(mp, s, 1); }

  __gmp_expr(signed long int l) { __gmpq_init(mp); __gmpq_set_si(mp, l, 1); }
  __gmp_expr(unsigned long int l) { __gmpq_init(mp); __gmpq_set_ui(mp, l, 1); }

  __gmp_expr(float f) { __gmpq_init(mp); __gmpq_set_d(mp, f); }
  __gmp_expr(double d) { __gmpq_init(mp); __gmpq_set_d(mp, d); }


  explicit __gmp_expr(const char *s, int base = 0)
  {
    __gmpq_init (mp);


    if (s == 0)
      {

 __gmpz_set_si((&((mp)->_mp_den)), base);
      }
    else if (__gmpq_set_str(mp, s, base) != 0)
      {
        __gmpq_clear (mp);
        throw std::invalid_argument ("mpq_set_str");
      }
  }
  explicit __gmp_expr(const std::string &s, int base = 0)
  {
    __gmpq_init(mp);
    if (__gmpq_set_str (mp, s.c_str(), base) != 0)
      {
        __gmpq_clear (mp);
        throw std::invalid_argument ("mpq_set_str");
      }
  }
  explicit __gmp_expr(mpq_srcptr q)
  {
    __gmpz_init_set((&((mp)->_mp_num)), (&((q)->_mp_num)));
    __gmpz_init_set((&((mp)->_mp_den)), (&((q)->_mp_den)));
  }

  __gmp_expr(const mpz_class &num, const mpz_class &den)
  {
    __gmpz_init_set((&((mp)->_mp_num)), num.get_mpz_t());
    __gmpz_init_set((&((mp)->_mp_den)), den.get_mpz_t());
  }

  ~__gmp_expr() { __gmpq_clear(mp); }

  void swap(__gmp_expr& q) { std::swap(*mp, *q.mp); }


  __gmp_expr & operator=(const __gmp_expr &q)
  { __gmpq_set(mp, q.mp); return *this; }






  template <class T, class U>
  __gmp_expr<value_type, value_type> & operator=(const __gmp_expr<T, U> &expr)
  { __gmp_set_expr(mp, expr); return *this; }

  __gmp_expr & operator=(signed char c)
  { __gmpq_set_si(mp, c, 1); return *this; }
  __gmp_expr & operator=(unsigned char c)
  { __gmpq_set_ui(mp, c, 1); return *this; }

  __gmp_expr & operator=(signed int i) { __gmpq_set_si(mp, i, 1); return *this; }
  __gmp_expr & operator=(unsigned int i)
  { __gmpq_set_ui(mp, i, 1); return *this; }

  __gmp_expr & operator=(signed short int s)
  { __gmpq_set_si(mp, s, 1); return *this; }
  __gmp_expr & operator=(unsigned short int s)
  { __gmpq_set_ui(mp, s, 1); return *this; }

  __gmp_expr & operator=(signed long int l)
  { __gmpq_set_si(mp, l, 1); return *this; }
  __gmp_expr & operator=(unsigned long int l)
  { __gmpq_set_ui(mp, l, 1); return *this; }

  __gmp_expr & operator=(float f) { __gmpq_set_d(mp, f); return *this; }
  __gmp_expr & operator=(double d) { __gmpq_set_d(mp, d); return *this; }



  __gmp_expr & operator=(const char *s)
  {
    if (__gmpq_set_str (mp, s, 0) != 0)
      throw std::invalid_argument ("mpq_set_str");
    return *this;
  }
  __gmp_expr & operator=(const std::string &s)
  {
    if (__gmpq_set_str(mp, s.c_str(), 0) != 0)
      throw std::invalid_argument ("mpq_set_str");
    return *this;
  }


  int set_str(const char *s, int base)
  { return __gmpq_set_str(mp, s, base); }
  int set_str(const std::string &s, int base)
  { return __gmpq_set_str(mp, s.c_str(), base); }
  std::string get_str(int base = 10) const
  {
    __gmp_alloc_cstring temp(__gmpq_get_str(0, base, mp));
    return std::string(temp.str);
  }






  const mpz_class & get_num() const
  { return reinterpret_cast<const mpz_class &>(*(&((mp)->_mp_num))); }
  mpz_class & get_num()
  { return reinterpret_cast<mpz_class &>(*(&((mp)->_mp_num))); }
  const mpz_class & get_den() const
  { return reinterpret_cast<const mpz_class &>(*(&((mp)->_mp_den))); }
  mpz_class & get_den()
  { return reinterpret_cast<mpz_class &>(*(&((mp)->_mp_den))); }

  mpq_srcptr __get_mp() const { return mp; }
  mpq_ptr __get_mp() { return mp; }
  mpq_srcptr get_mpq_t() const { return mp; }
  mpq_ptr get_mpq_t() { return mp; }

  mpz_srcptr get_num_mpz_t() const { return (&((mp)->_mp_num)); }
  mpz_ptr get_num_mpz_t() { return (&((mp)->_mp_num)); }
  mpz_srcptr get_den_mpz_t() const { return (&((mp)->_mp_den)); }
  mpz_ptr get_den_mpz_t() { return (&((mp)->_mp_den)); }

  double get_d() const { return __gmpq_get_d(mp); }






  template <class T, class U> __gmp_expr<value_type, value_type> & operator+=(const __gmp_expr<T, U> &); __gmp_expr & operator+=(signed char); __gmp_expr & operator+=(unsigned char); __gmp_expr & operator+=(signed int); __gmp_expr & operator+=(unsigned int); __gmp_expr & operator+=(signed short int); __gmp_expr & operator+=(unsigned short int); __gmp_expr & operator+=(signed long int); __gmp_expr & operator+=(unsigned long int); __gmp_expr & operator+=(float); __gmp_expr & operator+=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator-=(const __gmp_expr<T, U> &); __gmp_expr & operator-=(signed char); __gmp_expr & operator-=(unsigned char); __gmp_expr & operator-=(signed int); __gmp_expr & operator-=(unsigned int); __gmp_expr & operator-=(signed short int); __gmp_expr & operator-=(unsigned short int); __gmp_expr & operator-=(signed long int); __gmp_expr & operator-=(unsigned long int); __gmp_expr & operator-=(float); __gmp_expr & operator-=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator*=(const __gmp_expr<T, U> &); __gmp_expr & operator*=(signed char); __gmp_expr & operator*=(unsigned char); __gmp_expr & operator*=(signed int); __gmp_expr & operator*=(unsigned int); __gmp_expr & operator*=(signed short int); __gmp_expr & operator*=(unsigned short int); __gmp_expr & operator*=(signed long int); __gmp_expr & operator*=(unsigned long int); __gmp_expr & operator*=(float); __gmp_expr & operator*=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator/=(const __gmp_expr<T, U> &); __gmp_expr & operator/=(signed char); __gmp_expr & operator/=(unsigned char); __gmp_expr & operator/=(signed int); __gmp_expr & operator/=(unsigned int); __gmp_expr & operator/=(signed short int); __gmp_expr & operator/=(unsigned short int); __gmp_expr & operator/=(signed long int); __gmp_expr & operator/=(unsigned long int); __gmp_expr & operator/=(float); __gmp_expr & operator/=(double);

  __gmp_expr & operator<<=(mp_bitcnt_t);
  __gmp_expr & operator>>=(mp_bitcnt_t);

  inline __gmp_expr & operator++(); inline __gmp_expr operator++(int);
  inline __gmp_expr & operator--(); inline __gmp_expr operator--(int);
};

typedef __gmp_expr<mpq_t, mpq_t> mpq_class;




template <>
class __gmp_expr<mpf_t, mpf_t>
{
private:
  typedef mpf_t value_type;
  value_type mp;
public:
  mp_bitcnt_t get_prec() const { return __gmpf_get_prec(mp); }

  void set_prec(mp_bitcnt_t prec) { __gmpf_set_prec(mp, prec); }
  void set_prec_raw(mp_bitcnt_t prec) { __gmpf_set_prec_raw(mp, prec); }


  __gmp_expr() { __gmpf_init(mp); }

  __gmp_expr(const __gmp_expr &f)
  { __gmpf_init2(mp, f.get_prec()); __gmpf_set(mp, f.mp); }




  __gmp_expr(const __gmp_expr &f, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set(mp, f.mp); }
  template <class T, class U>
  __gmp_expr(const __gmp_expr<T, U> &expr)
  { __gmpf_init2(mp, expr.get_prec()); __gmp_set_expr(mp, expr); }
  template <class T, class U>
  __gmp_expr(const __gmp_expr<T, U> &expr, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmp_set_expr(mp, expr); }

  __gmp_expr(signed char c) { __gmpf_init_set_si(mp, c); }
  __gmp_expr(signed char c, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_si(mp, c); }
  __gmp_expr(unsigned char c) { __gmpf_init_set_ui(mp, c); }
  __gmp_expr(unsigned char c, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_ui(mp, c); }

  __gmp_expr(signed int i) { __gmpf_init_set_si(mp, i); }
  __gmp_expr(signed int i, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_si(mp, i); }
  __gmp_expr(unsigned int i) { __gmpf_init_set_ui(mp, i); }
  __gmp_expr(unsigned int i, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_ui(mp, i); }

  __gmp_expr(signed short int s) { __gmpf_init_set_si(mp, s); }
  __gmp_expr(signed short int s, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_si(mp, s); }
  __gmp_expr(unsigned short int s) { __gmpf_init_set_ui(mp, s); }
  __gmp_expr(unsigned short int s, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_ui(mp, s); }

  __gmp_expr(signed long int l) { __gmpf_init_set_si(mp, l); }
  __gmp_expr(signed long int l, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_si(mp, l); }
  __gmp_expr(unsigned long int l) { __gmpf_init_set_ui(mp, l); }
  __gmp_expr(unsigned long int l, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_ui(mp, l); }

  __gmp_expr(float f) { __gmpf_init_set_d(mp, f); }
  __gmp_expr(float f, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_d(mp, f); }
  __gmp_expr(double d) { __gmpf_init_set_d(mp, d); }
  __gmp_expr(double d, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set_d(mp, d); }




  explicit __gmp_expr(const char *s)
  {
    if (__gmpf_init_set_str (mp, s, 0) != 0)
      {
        __gmpf_clear (mp);
        throw std::invalid_argument ("mpf_set_str");
      }
  }
  __gmp_expr(const char *s, mp_bitcnt_t prec, int base = 0)
  {
    __gmpf_init2(mp, prec);
    if (__gmpf_set_str(mp, s, base) != 0)
      {
        __gmpf_clear (mp);
        throw std::invalid_argument ("mpf_set_str");
      }
  }
  explicit __gmp_expr(const std::string &s)
  {
    if (__gmpf_init_set_str(mp, s.c_str(), 0) != 0)
      {
        __gmpf_clear (mp);
        throw std::invalid_argument ("mpf_set_str");
      }
  }
  __gmp_expr(const std::string &s, mp_bitcnt_t prec, int base = 0)
  {
    __gmpf_init2(mp, prec);
    if (__gmpf_set_str(mp, s.c_str(), base) != 0)
      {
        __gmpf_clear (mp);
        throw std::invalid_argument ("mpf_set_str");
      }
  }

  explicit __gmp_expr(mpf_srcptr f)
  { __gmpf_init2(mp, __gmpf_get_prec(f)); __gmpf_set(mp, f); }
  __gmp_expr(mpf_srcptr f, mp_bitcnt_t prec)
  { __gmpf_init2(mp, prec); __gmpf_set(mp, f); }

  ~__gmp_expr() { __gmpf_clear(mp); }

  void swap(__gmp_expr& f) { std::swap(*mp, *f.mp); }


  __gmp_expr & operator=(const __gmp_expr &f)
  { __gmpf_set(mp, f.mp); return *this; }




  template <class T, class U>
  __gmp_expr<value_type, value_type> & operator=(const __gmp_expr<T, U> &expr)
  { __gmp_set_expr(mp, expr); return *this; }

  __gmp_expr & operator=(signed char c) { __gmpf_set_si(mp, c); return *this; }
  __gmp_expr & operator=(unsigned char c) { __gmpf_set_ui(mp, c); return *this; }

  __gmp_expr & operator=(signed int i) { __gmpf_set_si(mp, i); return *this; }
  __gmp_expr & operator=(unsigned int i) { __gmpf_set_ui(mp, i); return *this; }

  __gmp_expr & operator=(signed short int s)
  { __gmpf_set_si(mp, s); return *this; }
  __gmp_expr & operator=(unsigned short int s)
  { __gmpf_set_ui(mp, s); return *this; }

  __gmp_expr & operator=(signed long int l)
  { __gmpf_set_si(mp, l); return *this; }
  __gmp_expr & operator=(unsigned long int l)
  { __gmpf_set_ui(mp, l); return *this; }

  __gmp_expr & operator=(float f) { __gmpf_set_d(mp, f); return *this; }
  __gmp_expr & operator=(double d) { __gmpf_set_d(mp, d); return *this; }



  __gmp_expr & operator=(const char *s)
  {
    if (__gmpf_set_str (mp, s, 0) != 0)
      throw std::invalid_argument ("mpf_set_str");
    return *this;
  }
  __gmp_expr & operator=(const std::string &s)
  {
    if (__gmpf_set_str(mp, s.c_str(), 0) != 0)
      throw std::invalid_argument ("mpf_set_str");
    return *this;
  }


  int set_str(const char *s, int base)
  { return __gmpf_set_str(mp, s, base); }
  int set_str(const std::string &s, int base)
  { return __gmpf_set_str(mp, s.c_str(), base); }
  std::string get_str(mp_exp_t &expo, int base = 10, size_t size = 0) const
  {
    __gmp_alloc_cstring temp(__gmpf_get_str(0, &expo, base, size, mp));
    return std::string(temp.str);
  }


  mpf_srcptr __get_mp() const { return mp; }
  mpf_ptr __get_mp() { return mp; }
  mpf_srcptr get_mpf_t() const { return mp; }
  mpf_ptr get_mpf_t() { return mp; }

  signed long int get_si() const { return __gmpf_get_si(mp); }
  unsigned long int get_ui() const { return __gmpf_get_ui(mp); }
  double get_d() const { return __gmpf_get_d(mp); }



  bool fits_sint_p() const { return __gmpf_fits_sint_p(mp); }
  bool fits_uint_p() const { return __gmpf_fits_uint_p(mp); }
  bool fits_sshort_p() const { return __gmpf_fits_sshort_p(mp); }
  bool fits_ushort_p() const { return __gmpf_fits_ushort_p(mp); }
  bool fits_slong_p() const { return __gmpf_fits_slong_p(mp); }
  bool fits_ulong_p() const { return __gmpf_fits_ulong_p(mp); }
# 2016 "/usr/local/include/gmpxx.h" 3
  template <class T, class U> __gmp_expr<value_type, value_type> & operator+=(const __gmp_expr<T, U> &); __gmp_expr & operator+=(signed char); __gmp_expr & operator+=(unsigned char); __gmp_expr & operator+=(signed int); __gmp_expr & operator+=(unsigned int); __gmp_expr & operator+=(signed short int); __gmp_expr & operator+=(unsigned short int); __gmp_expr & operator+=(signed long int); __gmp_expr & operator+=(unsigned long int); __gmp_expr & operator+=(float); __gmp_expr & operator+=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator-=(const __gmp_expr<T, U> &); __gmp_expr & operator-=(signed char); __gmp_expr & operator-=(unsigned char); __gmp_expr & operator-=(signed int); __gmp_expr & operator-=(unsigned int); __gmp_expr & operator-=(signed short int); __gmp_expr & operator-=(unsigned short int); __gmp_expr & operator-=(signed long int); __gmp_expr & operator-=(unsigned long int); __gmp_expr & operator-=(float); __gmp_expr & operator-=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator*=(const __gmp_expr<T, U> &); __gmp_expr & operator*=(signed char); __gmp_expr & operator*=(unsigned char); __gmp_expr & operator*=(signed int); __gmp_expr & operator*=(unsigned int); __gmp_expr & operator*=(signed short int); __gmp_expr & operator*=(unsigned short int); __gmp_expr & operator*=(signed long int); __gmp_expr & operator*=(unsigned long int); __gmp_expr & operator*=(float); __gmp_expr & operator*=(double);
  template <class T, class U> __gmp_expr<value_type, value_type> & operator/=(const __gmp_expr<T, U> &); __gmp_expr & operator/=(signed char); __gmp_expr & operator/=(unsigned char); __gmp_expr & operator/=(signed int); __gmp_expr & operator/=(unsigned int); __gmp_expr & operator/=(signed short int); __gmp_expr & operator/=(unsigned short int); __gmp_expr & operator/=(signed long int); __gmp_expr & operator/=(unsigned long int); __gmp_expr & operator/=(float); __gmp_expr & operator/=(double);

  __gmp_expr & operator<<=(mp_bitcnt_t);
  __gmp_expr & operator>>=(mp_bitcnt_t);

  inline __gmp_expr & operator++(); inline __gmp_expr operator++(int);
  inline __gmp_expr & operator--(); inline __gmp_expr operator--(int);
};

typedef __gmp_expr<mpf_t, mpf_t> mpf_class;
# 2057 "/usr/local/include/gmpxx.h" 3
template <class T, class U>
inline std::ostream & operator<<
(std::ostream &o, const __gmp_expr<T, U> &expr)
{
  __gmp_expr<T, T> const& temp(expr);
  return o << temp.__get_mp();
}

template <class T>
inline std::istream & operator>>(std::istream &i, __gmp_expr<T, T> &expr)
{
  return i >> expr.__get_mp();
}
# 2084 "/usr/local/include/gmpxx.h" 3
inline void __gmp_set_expr(mpz_ptr z, const mpz_class &w)
{
  __gmpz_set(z, w.get_mpz_t());
}

template <class T>
inline void __gmp_set_expr(mpz_ptr z, const __gmp_expr<mpz_t, T> &expr)
{
  expr.eval(z);
}

template <class T>
inline void __gmp_set_expr(mpz_ptr z, const __gmp_expr<mpq_t, T> &expr)
{
  mpq_class const& temp(expr);
  __gmpz_set_q(z, temp.get_mpq_t());
}

template <class T>
inline void __gmp_set_expr(mpz_ptr z, const __gmp_expr<mpf_t, T> &expr)
{
  mpf_class const& temp(expr);
  __gmpz_set_f(z, temp.get_mpf_t());
}

inline void __gmp_set_expr(mpq_ptr q, const mpz_class &z)
{
  __gmpq_set_z(q, z.get_mpz_t());
}

template <class T>
inline void __gmp_set_expr(mpq_ptr q, const __gmp_expr<mpz_t, T> &expr)
{
  __gmp_set_expr((&((q)->_mp_num)), expr);
  __gmpz_set_ui((&((q)->_mp_den)), 1);
}

inline void __gmp_set_expr(mpq_ptr q, const mpq_class &r)
{
  __gmpq_set(q, r.get_mpq_t());
}

template <class T>
inline void __gmp_set_expr(mpq_ptr q, const __gmp_expr<mpq_t, T> &expr)
{
  expr.eval(q);
}

template <class T>
inline void __gmp_set_expr(mpq_ptr q, const __gmp_expr<mpf_t, T> &expr)
{
  mpf_class const& temp(expr);
  __gmpq_set_f(q, temp.get_mpf_t());
}

template <class T>
inline void __gmp_set_expr(mpf_ptr f, const __gmp_expr<mpz_t, T> &expr)
{
  mpz_class const& temp(expr);
  __gmpf_set_z(f, temp.get_mpz_t());
}

template <class T>
inline void __gmp_set_expr(mpf_ptr f, const __gmp_expr<mpq_t, T> &expr)
{
  mpq_class const& temp(expr);
  __gmpf_set_q(f, temp.get_mpq_t());
}

inline void __gmp_set_expr(mpf_ptr f, const mpf_class &g)
{
  __gmpf_set(f, g.get_mpf_t());
}

template <class T>
inline void __gmp_set_expr(mpf_ptr f, const __gmp_expr<mpf_t, T> &expr)
{
  expr.eval(f);
}




template <class T>
class __gmp_temp
{
  __gmp_expr<T, T> val;
  public:
  template<class U, class V>
  __gmp_temp(U const& u, V) : val (u) {}
  typename __gmp_resolve_expr<T>::srcptr_type
  __get_mp() const { return val.__get_mp(); }
};

template <>
class __gmp_temp <mpf_t>
{
  mpf_class val;
  public:
  template<class U>
  __gmp_temp(U const& u, mpf_ptr res) : val (u, __gmpf_get_prec(res)) {}
  mpf_srcptr __get_mp() const { return val.__get_mp(); }
};
# 2207 "/usr/local/include/gmpxx.h" 3
template <class T, class Op>
class __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, T>, Op> >
{
private:
  typedef __gmp_expr<T, T> val_type;

  __gmp_unary_expr<val_type, Op> expr;
public:
  explicit __gmp_expr(const val_type &val) : expr(val) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  { Op::eval(p, expr.val.__get_mp()); }
  const val_type & get_val() const { return expr.val; }
  mp_bitcnt_t get_prec() const { return expr.val.get_prec(); }
};




template <class T, class U, class Op>
class __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, Op> >
{
private:
  typedef __gmp_expr<T, U> val_type;

  __gmp_unary_expr<val_type, Op> expr;
public:
  explicit __gmp_expr(const val_type &val) : expr(val) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  { expr.val.eval(p); Op::eval(p, p); }
  const val_type & get_val() const { return expr.val; }
  mp_bitcnt_t get_prec() const { return expr.val.get_prec(); }
};
# 2253 "/usr/local/include/gmpxx.h" 3
template <class T, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<T, T>, Op> >
{
private:
  typedef __gmp_expr<T, T> val1_type;
  typedef __gmp_expr<T, T> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  { Op::eval(p, expr.val1.__get_mp(), expr.val2.__get_mp()); }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};




template <class T, class U, class Op>
class __gmp_expr<T, __gmp_binary_expr<__gmp_expr<T, T>, U, Op> >
{
private:
  typedef __gmp_expr<T, T> val1_type;
  typedef U val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  { Op::eval(p, expr.val1.__get_mp(), expr.val2); }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const { return expr.val1.get_prec(); }
};

template <class T, class U, class Op>
class __gmp_expr<T, __gmp_binary_expr<U, __gmp_expr<T, T>, Op> >
{
private:
  typedef U val1_type;
  typedef __gmp_expr<T, T> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  { Op::eval(p, expr.val1, expr.val2.__get_mp()); }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const { return expr.val2.get_prec(); }
};




template <class T, class U, class V, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<U, V>, Op> >
{
private:
  typedef __gmp_expr<T, T> val1_type;
  typedef __gmp_expr<U, V> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    if(p != expr.val1.__get_mp())
    {
      __gmp_set_expr(p, expr.val2);
      Op::eval(p, expr.val1.__get_mp(), p);
    }
    else
    {
      __gmp_temp<T> temp(expr.val2, p);
      Op::eval(p, expr.val1.__get_mp(), temp.__get_mp());
    }
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};

template <class T, class U, class V, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<U, V>, __gmp_expr<T, T>, Op> >
{
private:
  typedef __gmp_expr<U, V> val1_type;
  typedef __gmp_expr<T, T> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    if(p != expr.val2.__get_mp())
    {
      __gmp_set_expr(p, expr.val1);
      Op::eval(p, p, expr.val2.__get_mp());
    }
    else
    {
      __gmp_temp<T> temp(expr.val1, p);
      Op::eval(p, temp.__get_mp(), expr.val2.__get_mp());
    }
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};

template <class T, class U, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<T, U>, Op> >
{
private:
  typedef __gmp_expr<T, T> val1_type;
  typedef __gmp_expr<T, U> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    if(p != expr.val1.__get_mp())
    {
      __gmp_set_expr(p, expr.val2);
      Op::eval(p, expr.val1.__get_mp(), p);
    }
    else
    {
      __gmp_temp<T> temp(expr.val2, p);
      Op::eval(p, expr.val1.__get_mp(), temp.__get_mp());
    }
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};

template <class T, class U, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<T, T>, Op> >
{
private:
  typedef __gmp_expr<T, U> val1_type;
  typedef __gmp_expr<T, T> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    if(p != expr.val2.__get_mp())
    {
      __gmp_set_expr(p, expr.val1);
      Op::eval(p, p, expr.val2.__get_mp());
    }
    else
    {
      __gmp_temp<T> temp(expr.val1, p);
      Op::eval(p, temp.__get_mp(), expr.val2.__get_mp());
    }
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};




template <class T, class U, class V, class Op>
class __gmp_expr<T, __gmp_binary_expr<__gmp_expr<T, U>, V, Op> >
{
private:
  typedef __gmp_expr<T, U> val1_type;
  typedef V val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    expr.val1.eval(p);
    Op::eval(p, p, expr.val2);
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const { return expr.val1.get_prec(); }
};

template <class T, class U, class V, class Op>
class __gmp_expr<T, __gmp_binary_expr<U, __gmp_expr<T, V>, Op> >
{
private:
  typedef U val1_type;
  typedef __gmp_expr<T, V> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    expr.val2.eval(p);
    Op::eval(p, expr.val1, p);
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const { return expr.val2.get_prec(); }
};




template <class T, class U, class V, class W, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, Op> >
{
private:
  typedef __gmp_expr<T, U> val1_type;
  typedef __gmp_expr<V, W> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    __gmp_temp<T> temp2(expr.val2, p);
    expr.val1.eval(p);
    Op::eval(p, p, temp2.__get_mp());
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};

template <class T, class U, class V, class W, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<U, V>, __gmp_expr<T, W>, Op> >
{
private:
  typedef __gmp_expr<U, V> val1_type;
  typedef __gmp_expr<T, W> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    __gmp_temp<T> temp1(expr.val1, p);
    expr.val2.eval(p);
    Op::eval(p, temp1.__get_mp(), p);
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};

template <class T, class U, class V, class Op>
class __gmp_expr
<T, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<T, V>, Op> >
{
private:
  typedef __gmp_expr<T, U> val1_type;
  typedef __gmp_expr<T, V> val2_type;

  __gmp_binary_expr<val1_type, val2_type, Op> expr;
public:
  __gmp_expr(const val1_type &val1, const val2_type &val2)
    : expr(val1, val2) { }
  void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
  {
    __gmp_temp<T> temp2(expr.val2, p);
    expr.val1.eval(p);
    Op::eval(p, p, temp2.__get_mp());
  }
  const val1_type & get_val1() const { return expr.val1; }
  const val2_type & get_val2() const { return expr.val2; }
  mp_bitcnt_t get_prec() const
  {
    mp_bitcnt_t prec1 = expr.val1.get_prec(),
      prec2 = expr.val2.get_prec();
    return (prec1 > prec2) ? prec1 : prec2;
  }
};
# 2772 "/usr/local/include/gmpxx.h" 3
template <> class __gmp_expr<mpq_t, __gmp_binary_expr<mpz_class, mpq_class, __gmp_binary_plus> > { private: typedef mpz_class val1_type; typedef mpq_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { __gmp_binary_plus::eval(q, expr.val1.get_mpz_t(), expr.val2.get_mpq_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <> class __gmp_expr<mpq_t, __gmp_binary_expr<mpq_class, mpz_class, __gmp_binary_plus> > { private: typedef mpq_class val1_type; typedef mpz_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { __gmp_binary_plus::eval(q, expr.val1.get_mpq_t(), expr.val2.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpq_t, T>, __gmp_binary_plus> > { private: typedef mpz_class val1_type; typedef __gmp_expr<mpq_t, T> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpq_class temp(expr.val2); __gmp_binary_plus::eval(q, expr.val1.get_mpz_t(), temp.get_mpq_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<mpq_class, __gmp_expr<mpz_t, T>, __gmp_binary_plus> > { private: typedef mpq_class val1_type; typedef __gmp_expr<mpz_t, T> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp(expr.val2); __gmp_binary_plus::eval(q, expr.val1.get_mpq_t(), temp.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, mpq_class, __gmp_binary_plus> > { private: typedef __gmp_expr<mpz_t, T> val1_type; typedef mpq_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp(expr.val1); __gmp_binary_plus::eval(q, temp.get_mpz_t(), expr.val2.get_mpq_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<__gmp_expr<mpq_t, T>, mpz_class, __gmp_binary_plus> > { private: typedef __gmp_expr<mpq_t, T> val1_type; typedef mpz_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpq_class temp(expr.val1); __gmp_binary_plus::eval(q, temp.get_mpq_t(), expr.val2.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T, class U> class __gmp_expr<mpq_t, __gmp_binary_expr <__gmp_expr<mpz_t, T>, __gmp_expr<mpq_t, U>, __gmp_binary_plus> > { private: typedef __gmp_expr<mpz_t, T> val1_type; typedef __gmp_expr<mpq_t, U> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp1(expr.val1); expr.val2.eval(q); __gmp_binary_plus::eval(q, temp1.get_mpz_t(), q); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T, class U> class __gmp_expr<mpq_t, __gmp_binary_expr <__gmp_expr<mpq_t, T>, __gmp_expr<mpz_t, U>, __gmp_binary_plus> > { private: typedef __gmp_expr<mpq_t, T> val1_type; typedef __gmp_expr<mpz_t, U> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_plus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp2(expr.val2); expr.val1.eval(q); __gmp_binary_plus::eval(q, q, temp2.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } };
template <> class __gmp_expr<mpq_t, __gmp_binary_expr<mpz_class, mpq_class, __gmp_binary_minus> > { private: typedef mpz_class val1_type; typedef mpq_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { __gmp_binary_minus::eval(q, expr.val1.get_mpz_t(), expr.val2.get_mpq_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <> class __gmp_expr<mpq_t, __gmp_binary_expr<mpq_class, mpz_class, __gmp_binary_minus> > { private: typedef mpq_class val1_type; typedef mpz_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { __gmp_binary_minus::eval(q, expr.val1.get_mpq_t(), expr.val2.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpq_t, T>, __gmp_binary_minus> > { private: typedef mpz_class val1_type; typedef __gmp_expr<mpq_t, T> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpq_class temp(expr.val2); __gmp_binary_minus::eval(q, expr.val1.get_mpz_t(), temp.get_mpq_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<mpq_class, __gmp_expr<mpz_t, T>, __gmp_binary_minus> > { private: typedef mpq_class val1_type; typedef __gmp_expr<mpz_t, T> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp(expr.val2); __gmp_binary_minus::eval(q, expr.val1.get_mpq_t(), temp.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, mpq_class, __gmp_binary_minus> > { private: typedef __gmp_expr<mpz_t, T> val1_type; typedef mpq_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp(expr.val1); __gmp_binary_minus::eval(q, temp.get_mpz_t(), expr.val2.get_mpq_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T> class __gmp_expr <mpq_t, __gmp_binary_expr<__gmp_expr<mpq_t, T>, mpz_class, __gmp_binary_minus> > { private: typedef __gmp_expr<mpq_t, T> val1_type; typedef mpz_class val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpq_class temp(expr.val1); __gmp_binary_minus::eval(q, temp.get_mpq_t(), expr.val2.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T, class U> class __gmp_expr<mpq_t, __gmp_binary_expr <__gmp_expr<mpz_t, T>, __gmp_expr<mpq_t, U>, __gmp_binary_minus> > { private: typedef __gmp_expr<mpz_t, T> val1_type; typedef __gmp_expr<mpq_t, U> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp1(expr.val1); expr.val2.eval(q); __gmp_binary_minus::eval(q, temp1.get_mpz_t(), q); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } }; template <class T, class U> class __gmp_expr<mpq_t, __gmp_binary_expr <__gmp_expr<mpq_t, T>, __gmp_expr<mpz_t, U>, __gmp_binary_minus> > { private: typedef __gmp_expr<mpq_t, T> val1_type; typedef __gmp_expr<mpz_t, U> val2_type; __gmp_binary_expr<val1_type, val2_type, __gmp_binary_minus> expr; public: __gmp_expr(const val1_type &val1, const val2_type &val2) : expr(val1, val2) { } void eval(mpq_ptr q) const { mpz_class temp2(expr.val2); expr.val1.eval(q); __gmp_binary_minus::eval(q, q, temp2.get_mpz_t()); } const val1_type & get_val1() const { return expr.val1; } const val2_type & get_val2() const { return expr.val2; } mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); } };
# 3066 "/usr/local/include/gmpxx.h" 3
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_unary_plus> > operator+(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_unary_plus> >(expr); }
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_unary_minus> > operator-(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_unary_minus> >(expr); }
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_unary_com> > operator~(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_unary_com> >(expr); }

template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_plus> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_plus> > operator+(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_plus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_plus> > operator+(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_plus> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_minus> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_minus> > operator-(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_minus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_minus> > operator-(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_minus> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_multiplies> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_multiplies> > operator*(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_multiplies> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_multiplies> > operator*(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_multiplies> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_divides> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_divides> > operator/(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_divides> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_divides> > operator/(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_divides> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_modulus> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_modulus> > operator%(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_modulus> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_modulus> > operator%(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_modulus> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_and> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> > operator&(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_and> > operator&(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_and> > operator&(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_and> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_and> > operator&(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_and> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_ior> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_ior> > operator|(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_ior> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_ior> > operator|(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_ior> >(t, expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_binary_xor> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_xor> > operator^(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_binary_xor> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_xor> > operator^(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_binary_xor> >(t, expr); }

template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, mp_bitcnt_t, __gmp_binary_lshift> > operator<<(const __gmp_expr<T, U> &expr, mp_bitcnt_t l) { return __gmp_expr<T, __gmp_binary_expr <__gmp_expr<T, U>, mp_bitcnt_t, __gmp_binary_lshift> >(expr, l); }
template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, mp_bitcnt_t, __gmp_binary_rshift> > operator>>(const __gmp_expr<T, U> &expr, mp_bitcnt_t l) { return __gmp_expr<T, __gmp_binary_expr <__gmp_expr<T, U>, mp_bitcnt_t, __gmp_binary_rshift> >(expr, l); }

template <class T, class U, class V, class W> inline bool operator==(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return __gmp_binary_equal::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator==(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator==(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator==(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator==(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator==(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator==(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator==(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator==(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator==(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline bool operator==(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator==(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_equal::eval(static_cast<double>(t), temp.__get_mp()); }
template <class T, class U, class V, class W> inline bool operator!=(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return ! __gmp_binary_equal::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator!=(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator!=(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator!=(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator!=(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator!=(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator!=(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator!=(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator!=(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator!=(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline bool operator!=(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator!=(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_equal::eval(static_cast<double>(t), temp.__get_mp()); }
template <class T, class U, class V, class W> inline bool operator<(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return __gmp_binary_less::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator<(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator<(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_less::eval(static_cast<double>(t), temp.__get_mp()); }
template <class T, class U, class V, class W> inline bool operator<=(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return ! __gmp_binary_greater::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<=(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<=(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<=(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<=(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<=(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<=(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator<=(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator<=(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator<=(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline bool operator<=(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator<=(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_greater::eval(static_cast<double>(t), temp.__get_mp()); }
template <class T, class U, class V, class W> inline bool operator>(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return __gmp_binary_greater::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator>(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator>(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_binary_greater::eval(static_cast<double>(t), temp.__get_mp()); }
template <class T, class U, class V, class W> inline bool operator>=(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return ! __gmp_binary_less::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>=(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>=(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>=(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>=(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>=(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>=(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline bool operator>=(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline bool operator>=(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator>=(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline bool operator>=(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline bool operator>=(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return ! __gmp_binary_less::eval(static_cast<double>(t), temp.__get_mp()); }

template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_abs_function> > abs(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_abs_function> >(expr); }
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_trunc_function> > trunc(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_trunc_function> >(expr); }
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_floor_function> > floor(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_floor_function> >(expr); }
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_ceil_function> > ceil(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_ceil_function> >(expr); }
template <class T, class U> inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_sqrt_function> > sqrt(const __gmp_expr<T, U> &expr) { return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, __gmp_sqrt_function> >(expr); }
template <class T, class U, class V, class W> inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, __gmp_hypot_function> > (expr1, expr2); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, signed char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(signed char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, unsigned char t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(unsigned char t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, signed int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(signed int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, unsigned int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(unsigned int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, signed short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(signed short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, unsigned short int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(unsigned short int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, signed long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, signed long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(signed long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<signed long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, unsigned long int t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, unsigned long int, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(unsigned long int t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<unsigned long int, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, float t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(float t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_hypot_function> > hypot(const __gmp_expr<T, U> &expr, double t) { return __gmp_expr <T, __gmp_binary_expr<__gmp_expr<T, U>, double, __gmp_hypot_function> >(expr, t); } template <class T, class U> inline __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_hypot_function> > hypot(double t, const __gmp_expr<T, U> &expr) { return __gmp_expr <T, __gmp_binary_expr<double, __gmp_expr<T, U>, __gmp_hypot_function> >(t, expr); }

template <class T, class U> inline int sgn(const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_sgn_function::eval(temp.__get_mp()); }
template <class T, class U, class V, class W> inline int cmp(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) { typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; __gmp_expr<eval_type, eval_type> const& temp1(expr1); __gmp_expr<eval_type, eval_type> const& temp2(expr2); return __gmp_cmp_function::eval(temp1.__get_mp(), temp2.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, signed char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline int cmp(signed char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, unsigned char t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline int cmp(unsigned char t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, signed int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline int cmp(signed int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, unsigned int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline int cmp(unsigned int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, signed short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline int cmp(signed short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, unsigned short int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline int cmp(unsigned short int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, signed long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<signed long int>(t)); } template <class T, class U> inline int cmp(signed long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<signed long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, unsigned long int t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<unsigned long int>(t)); } template <class T, class U> inline int cmp(unsigned long int t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<unsigned long int>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, float t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline int cmp(float t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<double>(t), temp.__get_mp()); } template <class T, class U> inline int cmp(const __gmp_expr<T, U> &expr, double t) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(temp.__get_mp(), static_cast<double>(t)); } template <class T, class U> inline int cmp(double t, const __gmp_expr<T, U> &expr) { __gmp_expr<T, T> const& temp(expr); return __gmp_cmp_function::eval(static_cast<double>(t), temp.__get_mp()); }

template <class T>
void swap(__gmp_expr<T, T>& x, __gmp_expr<T, T>& y)
{ x.swap(y); }



template <class T, class U> inline mpz_class & mpz_class::operator+=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_plus> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator+=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_plus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator+=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_plus> >(*this, t)); return *this; }
template <class T, class U> inline mpz_class & mpz_class::operator-=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_minus> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator-=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_minus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator-=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_minus> >(*this, t)); return *this; }
template <class T, class U> inline mpz_class & mpz_class::operator*=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_multiplies> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator*=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator*=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_multiplies> >(*this, t)); return *this; }
template <class T, class U> inline mpz_class & mpz_class::operator/=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_divides> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator/=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_divides> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator/=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_divides> >(*this, t)); return *this; }
template <class T, class U> inline mpz_class & mpz_class::operator%=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_modulus> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator%=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_modulus> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator%=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_modulus> >(*this, t)); return *this; }

template <class T, class U> inline mpz_class & mpz_class::operator&=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_and> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator&=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_and> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator&=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_and> >(*this, t)); return *this; }
template <class T, class U> inline mpz_class & mpz_class::operator|=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_ior> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator|=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_ior> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator|=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_ior> >(*this, t)); return *this; }
template <class T, class U> inline mpz_class & mpz_class::operator^=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, __gmp_expr<T, U>, __gmp_binary_xor> >(*this, expr)); return *this; } inline mpz_class & mpz_class::operator^=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, signed long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, unsigned long int, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(float t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_xor> >(*this, t)); return *this; } inline mpz_class & mpz_class::operator^=(double t) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, double, __gmp_binary_xor> >(*this, t)); return *this; }

inline mpz_class & mpz_class::operator<<=(mp_bitcnt_t l) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, mp_bitcnt_t, __gmp_binary_lshift> >(*this, l)); return *this; }
inline mpz_class & mpz_class::operator>>=(mp_bitcnt_t l) { __gmp_set_expr(mp, __gmp_expr<mpz_t, __gmp_binary_expr <mpz_class, mp_bitcnt_t, __gmp_binary_rshift> >(*this, l)); return *this; }

inline mpz_class & mpz_class::operator++() { __gmp_unary_increment::eval(mp); return *this; } inline mpz_class mpz_class::operator++(int) { mpz_class temp(*this); __gmp_unary_increment::eval(mp); return temp; }
inline mpz_class & mpz_class::operator--() { __gmp_unary_decrement::eval(mp); return *this; } inline mpz_class mpz_class::operator--(int) { mpz_class temp(*this); __gmp_unary_decrement::eval(mp); return temp; }



template <class T, class U> inline mpq_class & mpq_class::operator+=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, __gmp_expr<T, U>, __gmp_binary_plus> >(*this, expr)); return *this; } inline mpq_class & mpq_class::operator+=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(float t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_plus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator+=(double t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_plus> >(*this, t)); return *this; }
template <class T, class U> inline mpq_class & mpq_class::operator-=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, __gmp_expr<T, U>, __gmp_binary_minus> >(*this, expr)); return *this; } inline mpq_class & mpq_class::operator-=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(float t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_minus> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator-=(double t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_minus> >(*this, t)); return *this; }
template <class T, class U> inline mpq_class & mpq_class::operator*=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, __gmp_expr<T, U>, __gmp_binary_multiplies> >(*this, expr)); return *this; } inline mpq_class & mpq_class::operator*=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(float t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator*=(double t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_multiplies> >(*this, t)); return *this; }
template <class T, class U> inline mpq_class & mpq_class::operator/=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, __gmp_expr<T, U>, __gmp_binary_divides> >(*this, expr)); return *this; } inline mpq_class & mpq_class::operator/=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(float t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_divides> >(*this, t)); return *this; } inline mpq_class & mpq_class::operator/=(double t) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, double, __gmp_binary_divides> >(*this, t)); return *this; }

inline mpq_class & mpq_class::operator<<=(mp_bitcnt_t l) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, mp_bitcnt_t, __gmp_binary_lshift> >(*this, l)); return *this; }
inline mpq_class & mpq_class::operator>>=(mp_bitcnt_t l) { __gmp_set_expr(mp, __gmp_expr<mpq_t, __gmp_binary_expr <mpq_class, mp_bitcnt_t, __gmp_binary_rshift> >(*this, l)); return *this; }

inline mpq_class & mpq_class::operator++() { __gmp_unary_increment::eval(mp); return *this; } inline mpq_class mpq_class::operator++(int) { mpq_class temp(*this); __gmp_unary_increment::eval(mp); return temp; }
inline mpq_class & mpq_class::operator--() { __gmp_unary_decrement::eval(mp); return *this; } inline mpq_class mpq_class::operator--(int) { mpq_class temp(*this); __gmp_unary_decrement::eval(mp); return temp; }



template <class T, class U> inline mpf_class & mpf_class::operator+=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, __gmp_expr<T, U>, __gmp_binary_plus> >(*this, expr)); return *this; } inline mpf_class & mpf_class::operator+=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(float t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_plus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator+=(double t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_plus> >(*this, t)); return *this; }
template <class T, class U> inline mpf_class & mpf_class::operator-=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, __gmp_expr<T, U>, __gmp_binary_minus> >(*this, expr)); return *this; } inline mpf_class & mpf_class::operator-=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(float t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_minus> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator-=(double t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_minus> >(*this, t)); return *this; }
template <class T, class U> inline mpf_class & mpf_class::operator*=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, __gmp_expr<T, U>, __gmp_binary_multiplies> >(*this, expr)); return *this; } inline mpf_class & mpf_class::operator*=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(float t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_multiplies> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator*=(double t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_multiplies> >(*this, t)); return *this; }
template <class T, class U> inline mpf_class & mpf_class::operator/=(const __gmp_expr<T, U> &expr) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, __gmp_expr<T, U>, __gmp_binary_divides> >(*this, expr)); return *this; } inline mpf_class & mpf_class::operator/=(signed char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(unsigned char t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(signed int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(unsigned int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(signed short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(unsigned short int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(signed long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, signed long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(unsigned long int t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, unsigned long int, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(float t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_divides> >(*this, t)); return *this; } inline mpf_class & mpf_class::operator/=(double t) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, double, __gmp_binary_divides> >(*this, t)); return *this; }

inline mpf_class & mpf_class::operator<<=(mp_bitcnt_t l) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, mp_bitcnt_t, __gmp_binary_lshift> >(*this, l)); return *this; }
inline mpf_class & mpf_class::operator>>=(mp_bitcnt_t l) { __gmp_set_expr(mp, __gmp_expr<mpf_t, __gmp_binary_expr <mpf_class, mp_bitcnt_t, __gmp_binary_rshift> >(*this, l)); return *this; }

inline mpf_class & mpf_class::operator++() { __gmp_unary_increment::eval(mp); return *this; } inline mpf_class mpf_class::operator++(int) { mpf_class temp(*this); __gmp_unary_increment::eval(mp); return temp; }
inline mpf_class & mpf_class::operator--() { __gmp_unary_decrement::eval(mp); return *this; } inline mpf_class mpf_class::operator--(int) { mpf_class temp(*this); __gmp_unary_decrement::eval(mp); return temp; }





class __gmp_urandomb_value { };
class __gmp_urandomm_value { };

template <>
class __gmp_expr<mpz_t, __gmp_urandomb_value>
{
private:
  __gmp_randstate_struct *state;
  mp_bitcnt_t bits;
public:
  __gmp_expr(gmp_randstate_t s, mp_bitcnt_t l) : state(s), bits(l) { }
  void eval(mpz_ptr z) const { __gmp_rand_function::eval(z, state, bits); }
  mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); }
};

template <>
class __gmp_expr<mpz_t, __gmp_urandomm_value>
{
private:
  __gmp_randstate_struct *state;
  mpz_class range;
public:
  __gmp_expr(gmp_randstate_t s, const mpz_class &z) : state(s), range(z) { }
  void eval(mpz_ptr z) const
  { __gmp_rand_function::eval(z, state, range.get_mpz_t()); }
  mp_bitcnt_t get_prec() const { return __gmpf_get_default_prec(); }
};

template <>
class __gmp_expr<mpf_t, __gmp_urandomb_value>
{
private:
  __gmp_randstate_struct *state;
  mp_bitcnt_t bits;
public:
  __gmp_expr(gmp_randstate_t s, mp_bitcnt_t l) : state(s), bits(l) { }
  void eval(mpf_ptr f) const
  {
    __gmp_rand_function::eval(f, state,
 (bits>0) ? bits : __gmpf_get_prec(f));
  }
  mp_bitcnt_t get_prec() const
  {
    if (bits == 0)
      return __gmpf_get_default_prec();
    else
      return bits;
  }
};

extern "C" {
  typedef void __gmp_randinit_default_t (gmp_randstate_t);
  typedef void __gmp_randinit_lc_2exp_t (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t);
  typedef int __gmp_randinit_lc_2exp_size_t (gmp_randstate_t, mp_bitcnt_t);
}

class gmp_randclass
{
private:
  gmp_randstate_t state;


  gmp_randclass(const gmp_randclass &);
  void operator=(const gmp_randclass &);
public:

  gmp_randclass(gmp_randalg_t alg, unsigned long int size)
  {
    switch (alg)
      {
      case GMP_RAND_ALG_LC:
      default:
 __gmp_randinit(state, alg, size);
 break;
      }
  }


  gmp_randclass(__gmp_randinit_default_t* f) { f(state); }


  gmp_randclass(__gmp_randinit_lc_2exp_t* f,
  mpz_class z, unsigned long int l1, mp_bitcnt_t l2)
  { f(state, z.get_mpz_t(), l1, l2); }


  gmp_randclass(__gmp_randinit_lc_2exp_size_t* f,
  mp_bitcnt_t size)
  {
    if (f (state, size) == 0)
      throw std::length_error ("gmp_randinit_lc_2exp_size");
  }

  ~gmp_randclass() { __gmp_randclear(state); }


  void seed();
  void seed(unsigned long int s) { __gmp_randseed_ui(state, s); }
  void seed(const mpz_class &z) { __gmp_randseed(state, z.get_mpz_t()); }


  __gmp_expr<mpz_t, __gmp_urandomb_value> get_z_bits(mp_bitcnt_t l)
  { return __gmp_expr<mpz_t, __gmp_urandomb_value>(state, l); }
  __gmp_expr<mpz_t, __gmp_urandomb_value> get_z_bits(const mpz_class &z)
  { return get_z_bits(z.get_ui()); }


  __gmp_expr<mpz_t, __gmp_urandomm_value> get_z_range(const mpz_class &z)
  { return __gmp_expr<mpz_t, __gmp_urandomm_value>(state, z); }

  __gmp_expr<mpf_t, __gmp_urandomb_value> get_f(mp_bitcnt_t prec = 0)
  { return __gmp_expr<mpf_t, __gmp_urandomb_value>(state, prec); }
};




namespace std {
  template <> class numeric_limits<mpz_class>
  {
  public:
    static const bool is_specialized = true;
    static mpz_class min() { return mpz_class(); }
    static mpz_class max() { return mpz_class(); }
    static mpz_class lowest() { return mpz_class(); }
    static const int digits = 0;
    static const int digits10 = 0;
    static const int max_digits10 = 0;
    static const bool is_signed = true;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static mpz_class epsilon() { return mpz_class(); }
    static mpz_class round_error() { return mpz_class(); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static mpz_class infinity() { return mpz_class(); }
    static mpz_class quiet_NaN() { return mpz_class(); }
    static mpz_class signaling_NaN() { return mpz_class(); }
    static mpz_class denorm_min() { return mpz_class(); }
    static const bool is_iec559 = false;
    static const bool is_bounded = false;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  template <> class numeric_limits<mpq_class>
  {
  public:
    static const bool is_specialized = true;
    static mpq_class min() { return mpq_class(); }
    static mpq_class max() { return mpq_class(); }
    static mpq_class lowest() { return mpq_class(); }
    static const int digits = 0;
    static const int digits10 = 0;
    static const int max_digits10 = 0;
    static const bool is_signed = true;
    static const bool is_integer = false;
    static const bool is_exact = true;
    static const int radix = 2;
    static mpq_class epsilon() { return mpq_class(); }
    static mpq_class round_error() { return mpq_class(); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static mpq_class infinity() { return mpq_class(); }
    static mpq_class quiet_NaN() { return mpq_class(); }
    static mpq_class signaling_NaN() { return mpq_class(); }
    static mpq_class denorm_min() { return mpq_class(); }
    static const bool is_iec559 = false;
    static const bool is_bounded = false;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  template <> class numeric_limits<mpf_class>
  {
  public:
    static const bool is_specialized = true;
    static mpf_class min() { return mpf_class(); }
    static mpf_class max() { return mpf_class(); }
    static mpf_class lowest() { return mpf_class(); }
    static const int digits = 0;
    static const int digits10 = 0;
    static const int max_digits10 = 0;
    static const bool is_signed = true;
    static const bool is_integer = false;
    static const bool is_exact = false;
    static const int radix = 2;
    static mpf_class epsilon() { return mpf_class(); }
    static mpf_class round_error() { return mpf_class(); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static mpf_class infinity() { return mpf_class(); }
    static mpf_class quiet_NaN() { return mpf_class(); }
    static mpf_class signaling_NaN() { return mpf_class(); }
    static mpf_class denorm_min() { return mpf_class(); }
    static const bool is_iec559 = false;
    static const bool is_bounded = false;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_indeterminate;
  };
}
# 30 "checked_defs.hh" 2
# 1 "mp_std_bits_defs.hh" 1
# 34 "mp_std_bits_defs.hh"
void swap(mpz_class& x, mpz_class& y);




void swap(mpq_class& x, mpq_class& y);
# 173 "mp_std_bits_defs.hh"
# 1 "mp_std_bits_inlines.hh" 1
# 28 "mp_std_bits_inlines.hh"
inline void
swap(mpz_class& x, mpz_class& y) {
  __gmpz_swap(x.get_mpz_t(), y.get_mpz_t());
}

inline void
swap(mpq_class& x, mpq_class& y) {
  __gmpq_swap(x.get_mpq_t(), y.get_mpq_t());
}
# 174 "mp_std_bits_defs.hh" 2
# 31 "checked_defs.hh" 2
# 1 "Temp_defs.hh" 1
# 27 "Temp_defs.hh"
# 1 "meta_programming.hh" 1
# 29 "meta_programming.hh"
namespace Parma_Polyhedra_Library {
# 102 "meta_programming.hh"
template <bool b>
struct Compile_Time_Check;
# 114 "meta_programming.hh"
template <>
struct Compile_Time_Check<true> {
};
# 142 "meta_programming.hh"
template <bool b>
struct Bool {
  enum const_bool_value {
    value = b
  };
};
# 156 "meta_programming.hh"
struct True : public Bool<true> {
};
# 166 "meta_programming.hh"
struct False : public Bool<false> {
};
# 178 "meta_programming.hh"
template <typename T1, typename T2>
struct Is_Same : public False {
};
# 191 "meta_programming.hh"
template <typename T>
struct Is_Same<T, T> : public True {
};
# 222 "meta_programming.hh"
template <typename Base, typename Derived>
struct Is_Same_Or_Derived {




  struct Any {

    template <typename T>
    Any(const T&);
  };


  static char func(const Base&);


  static double func(Any);


  static const Derived& derived_object();

  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_245 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(sizeof(char) != sizeof(double))>) };



  enum const_bool_value {







    value = (sizeof(func(derived_object())) == sizeof(char))
  };
};
# 269 "meta_programming.hh"
template <bool b, typename T = void>
struct Enable_If {
};

template <typename Type, Type, typename T = void>
struct Enable_If_Is {
  typedef T type;
};
# 304 "meta_programming.hh"
template <typename T>
struct Enable_If<true, T> {
  typedef T type;
};

template <typename T>
struct Is_Native : public False {
};

template <> struct Is_Native<char> : public True { };
template <> struct Is_Native<signed char> : public True { };
template <> struct Is_Native<signed short> : public True { };
template <> struct Is_Native<signed int> : public True { };
template <> struct Is_Native<signed long> : public True { };
template <> struct Is_Native<signed long long> : public True { };
template <> struct Is_Native<unsigned char> : public True { };
template <> struct Is_Native<unsigned short> : public True { };
template <> struct Is_Native<unsigned int> : public True { };
template <> struct Is_Native<unsigned long> : public True { };
template <> struct Is_Native<unsigned long long> : public True { };


template <> struct Is_Native<float> : public True { };


template <> struct Is_Native<double> : public True { };


template <> struct Is_Native<long double> : public True { };


template <> struct Is_Native<mpz_class> : public True { };

template <> struct Is_Native<mpq_class> : public True { };

}
# 28 "Temp_defs.hh" 2
# 1 "Slow_Copy.hh" 1
# 30 "Slow_Copy.hh"
namespace Parma_Polyhedra_Library {






template <typename T>
struct Slow_Copy : public False {
};






template <>
struct Slow_Copy<mpz_class> : public True {
};






template <>
struct Slow_Copy<mpq_class> : public True {
};

}
# 29 "Temp_defs.hh" 2

namespace Parma_Polyhedra_Library {




template <typename T>
class Temp_Item {
public:

  static Temp_Item& obtain();


  static void release(Temp_Item& p);


  T& item();

private:

  T item_;


  Temp_Item* next;


  static Temp_Item* free_list_head;


  Temp_Item();


  Temp_Item(const Temp_Item&);


  Temp_Item& operator=(const Temp_Item&);
};




template <typename T>
class Temp_Reference_Holder {
public:

  Temp_Reference_Holder();


  ~Temp_Reference_Holder();


  T& item();

private:

  Temp_Reference_Holder(const Temp_Reference_Holder&);


  Temp_Reference_Holder& operator=(const Temp_Reference_Holder&);


  Temp_Item<T>& held;
};




template <typename T>
class Temp_Value_Holder {
public:

  Temp_Value_Holder();


  T& item();

private:

  Temp_Value_Holder(const Temp_Value_Holder&);


  Temp_Value_Holder& operator=(const Temp_Value_Holder&);


  T item_;
};




template <typename T, typename Enable = void>
class Dirty_Temp;




template <typename T>
class Dirty_Temp<T, typename Enable_If<Slow_Copy<T>::value>::type>
  : public Temp_Reference_Holder<T> {
};




template <typename T>
class Dirty_Temp<T, typename Enable_If<!Slow_Copy<T>::value>::type>
  : public Temp_Value_Holder<T> {
};

}

# 1 "Temp_inlines.hh" 1
# 29 "Temp_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline
Temp_Item<T>::Temp_Item()
  : item_() {
}

template <typename T>
inline T&
Temp_Item<T>::item() {
    return item_;
}

template <typename T>
inline Temp_Item<T>&
Temp_Item<T>::obtain() {
  if (free_list_head != 0) {
    Temp_Item* const p = free_list_head;
    free_list_head = free_list_head->next;
    return *p;
  }
  else
    return *new Temp_Item();
}

template <typename T>
inline void
Temp_Item<T>::release(Temp_Item& p) {
  p.next = free_list_head;
  free_list_head = &p;
}

template <typename T>
inline
Temp_Reference_Holder<T>::Temp_Reference_Holder()
  : held(Temp_Item<T>::obtain()) {
}

template <typename T>
inline
Temp_Reference_Holder<T>::~Temp_Reference_Holder() {
  Temp_Item<T>::release(held);
}

template <typename T>
inline T&
Temp_Reference_Holder<T>::item() {
  return held.item();
}

template <typename T>
inline
Temp_Value_Holder<T>::Temp_Value_Holder() {
}

template <typename T>
inline T&
Temp_Value_Holder<T>::item() {
  return item_;
}

}
# 141 "Temp_defs.hh" 2
# 1 "Temp_templates.hh" 1
# 27 "Temp_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
Temp_Item<T>* Temp_Item<T>::free_list_head = 0;

}
# 142 "Temp_defs.hh" 2
# 32 "checked_defs.hh" 2
# 1 "Rounding_Dir_defs.hh" 1
# 27 "Rounding_Dir_defs.hh"
# 1 "Result_defs.hh" 1
# 27 "Result_defs.hh"
namespace Parma_Polyhedra_Library {

enum Result_Class {

  VC_NORMAL = 0U << 4,


  VC_MINUS_INFINITY = 1U << 4,


  VC_PLUS_INFINITY = 2U << 4,


  VC_NAN = 3U << 4,

  VC_MASK = VC_NAN
};


enum Result_Relation {

  VR_EMPTY = 0U,


  VR_EQ = 1U,


  VR_LT = 2U,


  VR_GT = 4U,


  VR_NE = VR_LT | VR_GT,


  VR_LE = VR_EQ | VR_LT,


  VR_GE = VR_EQ | VR_GT,


  VR_LGE = VR_LT | VR_EQ | VR_GT,

  VR_MASK = VR_LGE
};



enum Result {

  V_EMPTY = VR_EMPTY,


  V_EQ = static_cast<unsigned>(VR_EQ),


  V_LT = static_cast<unsigned>(VR_LT),


  V_GT = static_cast<unsigned>(VR_GT),


  V_NE = VR_NE,


  V_LE = VR_LE,


  V_GE = VR_GE,


  V_LGE = VR_LGE,


  V_OVERFLOW = 1U << 6,


  V_LT_INF = V_LT | V_OVERFLOW,


  V_GT_SUP = V_GT | V_OVERFLOW,


  V_LT_PLUS_INFINITY = V_LT | static_cast<unsigned>(VC_PLUS_INFINITY),


  V_GT_MINUS_INFINITY = V_GT | static_cast<unsigned>(VC_MINUS_INFINITY),


  V_EQ_MINUS_INFINITY = V_EQ | static_cast<unsigned>(VC_MINUS_INFINITY),


  V_EQ_PLUS_INFINITY = V_EQ | static_cast<unsigned>(VC_PLUS_INFINITY),


  V_NAN = static_cast<unsigned>(VC_NAN),


  V_CVT_STR_UNK = V_NAN | (1U << 8),


  V_DIV_ZERO = V_NAN | (2U << 8),


  V_INF_ADD_INF = V_NAN | (3U << 8),


  V_INF_DIV_INF = V_NAN | (4U << 8),


  V_INF_MOD = V_NAN | (5U << 8),


  V_INF_MUL_ZERO = V_NAN | (6U << 8),


  V_INF_SUB_INF = V_NAN | (7U << 8),


  V_MOD_ZERO = V_NAN | (8U << 8),


  V_SQRT_NEG = V_NAN | (9U << 8),


  V_UNKNOWN_NEG_OVERFLOW = V_NAN | (10U << 8),


  V_UNKNOWN_POS_OVERFLOW = V_NAN | (11U << 8),


  V_UNREPRESENTABLE = 1U << 7

};





Result operator&(Result x, Result y);


Result operator|(Result x, Result y);


Result operator-(Result x, Result y);





Result_Class result_class(Result r);




Result_Relation result_relation(Result r);


Result result_relation_class(Result r);



}

# 1 "Result_inlines.hh" 1
# 27 "Result_inlines.hh"
# 1 "assert.hh" 1
# 99 "assert.hh"
namespace Parma_Polyhedra_Library {
# 110 "assert.hh"
void ppl_unreachable() __attribute__((weak, noreturn));







void ppl_unreachable_msg(const char* msg,
                         const char* file, unsigned int line,
                         const char* function) __attribute__((weak, noreturn));







void ppl_assertion_failed(const char* assertion_text,
                          const char* file, unsigned int line,
                          const char* function) __attribute__((weak, noreturn));
# 143 "assert.hh"
template <typename T>
bool copy_contains(T x_copy, T y_copy) {
  return x_copy.contains(y_copy);
}

}
# 28 "Result_inlines.hh" 2

namespace Parma_Polyhedra_Library {


inline Result
operator&(Result x, Result y) {
  const unsigned res = static_cast<unsigned>(x) & static_cast<unsigned>(y);
  return static_cast<Result>(res);
}


inline Result
operator|(Result x, Result y) {
  const unsigned res = static_cast<unsigned>(x) | static_cast<unsigned>(y);
  return static_cast<Result>(res);
}


inline Result
operator-(Result x, Result y) {
  const Result y_neg = static_cast<Result>(~static_cast<unsigned>(y));
  return x & y_neg;
}


inline Result_Class
result_class(Result r) {
  const Result rc = r & static_cast<Result>(VC_MASK);
  return static_cast<Result_Class>(rc);
}


inline Result_Relation
result_relation(Result r) {
  const Result rc = r & static_cast<Result>(VR_MASK);
  return static_cast<Result_Relation>(rc);
}


inline Result
result_relation_class(Result r) {
  return r & (static_cast<Result>(VR_MASK) | static_cast<Result>(VC_MASK));
}

inline int
result_overflow(Result r) {
  switch (result_class(r)) {
  case VC_NORMAL:
    switch (r) {
    case V_LT_INF:
      return -1;
    case V_GT_SUP:
      return 1;
    default:
      break;
    }
    break;
  case VC_MINUS_INFINITY:
    return -1;
  case VC_PLUS_INFINITY:
    return 1;
  default:
    break;
  }
  return 0;
}

inline bool
result_representable(Result r) {
  return (r & V_UNREPRESENTABLE) != V_UNREPRESENTABLE;
}

}
# 194 "Result_defs.hh" 2
# 28 "Rounding_Dir_defs.hh" 2
# 1 "fpu_defs.hh" 1
# 27 "fpu_defs.hh"
# 1 "fpu_types.hh" 1
# 20 "fpu_types.hh"
namespace Parma_Polyhedra_Library {

enum fpu_rounding_direction_type {};
enum fpu_rounding_control_word_type {};

}
# 28 "fpu_defs.hh" 2
# 1 "compiler.hh" 1
# 29 "compiler.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3

# 1 "/usr/include/assert.h" 1 3 4
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 2 3
# 30 "compiler.hh" 2

namespace Parma_Polyhedra_Library {
# 47 "compiler.hh"
template <typename T>
inline void
PPL_CC_FLUSH(const T& x) {

  __asm__ __volatile__ ("" : "+m" (const_cast<T&>(x)));




}
# 67 "compiler.hh"
template <typename T>
struct Suppress_Uninitialized_Warnings_Type {
  typedef T synonym;
};
# 137 "compiler.hh"
inline unsigned int
clz(unsigned int u) {
  (static_cast<void> (0));

  return static_cast<unsigned int>(__builtin_clz(u));







}

inline unsigned int
clz(unsigned long ul) {
  (static_cast<void> (0));

  return static_cast<unsigned int>(__builtin_clzl(ul));







}

inline unsigned int
clz(unsigned long long ull) {
  (static_cast<void> (0));

  return static_cast<unsigned int>(__builtin_clzll(ull));







}


inline unsigned int
ctz(unsigned int u) {
  (static_cast<void> (0));

  return static_cast<unsigned int>(__builtin_ctz(u));







}

inline unsigned int
ctz(unsigned long ul) {
  (static_cast<void> (0));

  return static_cast<unsigned int>(__builtin_ctzl(ul));







}

inline unsigned int
ctz(unsigned long long ull) {
  (static_cast<void> (0));

  return static_cast<unsigned int>(__builtin_ctzll(ull));







}

}
# 29 "fpu_defs.hh" 2

namespace Parma_Polyhedra_Library {





void
fpu_initialize_control_functions();


fpu_rounding_direction_type
fpu_get_rounding_direction();


void
fpu_set_rounding_direction(fpu_rounding_direction_type dir);





fpu_rounding_control_word_type
fpu_save_rounding_direction(fpu_rounding_direction_type dir);






fpu_rounding_control_word_type
fpu_save_rounding_direction_reset_inexact(fpu_rounding_direction_type dir);


void
fpu_restore_rounding_direction(fpu_rounding_control_word_type w);


void
fpu_reset_inexact();







int
fpu_check_inexact();



}




# 1 "fpu-ia32_inlines.hh" 1
# 27 "fpu-ia32_inlines.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csetjmp" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csetjmp" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csetjmp" 3

# 1 "/usr/include/setjmp.h" 1 3 4
# 28 "/usr/include/setjmp.h" 3 4
extern "C" {

# 1 "/usr/include/bits/setjmp.h" 1 3 4
# 38 "/usr/include/bits/setjmp.h" 3 4
typedef int __jmp_buf[6];
# 31 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/bits/sigset.h" 1 3 4
# 32 "/usr/include/setjmp.h" 2 3 4




typedef struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  } jmp_buf[1];




extern int setjmp (jmp_buf __env) throw ();







extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) throw ();




extern int _setjmp (struct __jmp_buf_tag __env[1]) throw ();
# 76 "/usr/include/setjmp.h" 3 4




extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     throw () __attribute__ ((__noreturn__));







extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     throw () __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 108 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     throw () __attribute__ ((__noreturn__));


}
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csetjmp" 2 3
# 59 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csetjmp" 3
namespace std
{
  using ::jmp_buf;
  using ::longjmp;
}
# 28 "fpu-ia32_inlines.hh" 2
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csignal" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csignal" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csignal" 3

# 1 "/usr/include/signal.h" 1 3 4
# 31 "/usr/include/signal.h" 3 4
extern "C" {

# 1 "/usr/include/bits/sigset.h" 1 3 4
# 103 "/usr/include/bits/sigset.h" 3 4
extern int __sigismember (__const __sigset_t *, int);
extern int __sigaddset (__sigset_t *, int);
extern int __sigdelset (__sigset_t *, int);
# 117 "/usr/include/bits/sigset.h" 3 4
extern __inline int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; }
extern __inline int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); }
extern __inline int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); }
# 34 "/usr/include/signal.h" 2 3 4







typedef __sig_atomic_t sig_atomic_t;

# 58 "/usr/include/signal.h" 3 4
# 1 "/usr/include/bits/signum.h" 1 3 4
# 59 "/usr/include/signal.h" 2 3 4
# 75 "/usr/include/signal.h" 3 4
typedef void (*__sighandler_t) (int);




extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
     throw ();

extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
     throw ();







extern __sighandler_t signal (int __sig, __sighandler_t __handler)
     throw ();
# 104 "/usr/include/signal.h" 3 4





extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
     throw ();






extern int kill (__pid_t __pid, int __sig) throw ();






extern int killpg (__pid_t __pgrp, int __sig) throw ();




extern int raise (int __sig) throw ();




extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
     throw ();
extern int gsignal (int __sig) throw ();




extern void psignal (int __sig, __const char *__s);
# 153 "/usr/include/signal.h" 3 4
extern int __sigpause (int __sig_or_mask, int __is_sig);
# 162 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
# 181 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) throw () __attribute__ ((__deprecated__));


extern int sigsetmask (int __mask) throw () __attribute__ ((__deprecated__));


extern int siggetmask (void) throw () __attribute__ ((__deprecated__));
# 196 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;




typedef __sighandler_t sig_t;
# 212 "/usr/include/signal.h" 3 4
# 1 "/usr/include/bits/siginfo.h" 1 3 4
# 25 "/usr/include/bits/siginfo.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 26 "/usr/include/bits/siginfo.h" 2 3 4







typedef union sigval
  {
    int sival_int;
    void *sival_ptr;
  } sigval_t;
# 51 "/usr/include/bits/siginfo.h" 3 4
typedef struct siginfo
  {
    int si_signo;
    int si_errno;

    int si_code;

    union
      {
 int _pad[((128 / sizeof (int)) - 3)];


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
   } _kill;


 struct
   {
     int si_tid;
     int si_overrun;
     sigval_t si_sigval;
   } _timer;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     sigval_t si_sigval;
   } _rt;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     int si_status;
     __clock_t si_utime;
     __clock_t si_stime;
   } _sigchld;


 struct
   {
     void *si_addr;
   } _sigfault;


 struct
   {
     long int si_band;
     int si_fd;
   } _sigpoll;
      } _sifields;
  } siginfo_t;
# 129 "/usr/include/bits/siginfo.h" 3 4
enum
{
  SI_ASYNCNL = -60,

  SI_TKILL = -6,

  SI_SIGIO,

  SI_ASYNCIO,

  SI_MESGQ,

  SI_TIMER,

  SI_QUEUE,

  SI_USER,

  SI_KERNEL = 0x80

};



enum
{
  ILL_ILLOPC = 1,

  ILL_ILLOPN,

  ILL_ILLADR,

  ILL_ILLTRP,

  ILL_PRVOPC,

  ILL_PRVREG,

  ILL_COPROC,

  ILL_BADSTK

};


enum
{
  FPE_INTDIV = 1,

  FPE_INTOVF,

  FPE_FLTDIV,

  FPE_FLTOVF,

  FPE_FLTUND,

  FPE_FLTRES,

  FPE_FLTINV,

  FPE_FLTSUB

};


enum
{
  SEGV_MAPERR = 1,

  SEGV_ACCERR

};


enum
{
  BUS_ADRALN = 1,

  BUS_ADRERR,

  BUS_OBJERR

};


enum
{
  TRAP_BRKPT = 1,

  TRAP_TRACE

};


enum
{
  CLD_EXITED = 1,

  CLD_KILLED,

  CLD_DUMPED,

  CLD_TRAPPED,

  CLD_STOPPED,

  CLD_CONTINUED

};


enum
{
  POLL_IN = 1,

  POLL_OUT,

  POLL_MSG,

  POLL_ERR,

  POLL_PRI,

  POLL_HUP

};
# 273 "/usr/include/bits/siginfo.h" 3 4
typedef struct sigevent
  {
    sigval_t sigev_value;
    int sigev_signo;
    int sigev_notify;

    union
      {
 int _pad[((64 / sizeof (int)) - 3)];



 __pid_t _tid;

 struct
   {
     void (*_function) (sigval_t);
     void *_attribute;
   } _sigev_thread;
      } _sigev_un;
  } sigevent_t;






enum
{
  SIGEV_SIGNAL = 0,

  SIGEV_NONE,

  SIGEV_THREAD,


  SIGEV_THREAD_ID = 4

};
# 213 "/usr/include/signal.h" 2 3 4



extern int sigemptyset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));


extern int sigfillset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));


extern int sigaddset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));


extern int sigdelset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));


extern int sigismember (__const sigset_t *__set, int __signo)
     throw () __attribute__ ((__nonnull__ (1)));



extern int sigisemptyset (__const sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));


extern int sigandset (sigset_t *__set, __const sigset_t *__left,
        __const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));


extern int sigorset (sigset_t *__set, __const sigset_t *__left,
       __const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));




# 1 "/usr/include/bits/sigaction.h" 1 3 4
# 25 "/usr/include/bits/sigaction.h" 3 4
struct sigaction
  {


    union
      {

 __sighandler_t sa_handler;

 void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;







    __sigset_t sa_mask;


    int sa_flags;


    void (*sa_restorer) (void);
  };
# 247 "/usr/include/signal.h" 2 3 4


extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
   sigset_t *__restrict __oset) throw ();






extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1)));


extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
        struct sigaction *__restrict __oact) throw ();


extern int sigpending (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));






extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
     __attribute__ ((__nonnull__ (1, 2)));






extern int sigwaitinfo (__const sigset_t *__restrict __set,
   siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));






extern int sigtimedwait (__const sigset_t *__restrict __set,
    siginfo_t *__restrict __info,
    __const struct timespec *__restrict __timeout)
     __attribute__ ((__nonnull__ (1)));



extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
     throw ();
# 304 "/usr/include/signal.h" 3 4
extern __const char *__const _sys_siglist[65];
extern __const char *__const sys_siglist[65];


struct sigvec
  {
    __sighandler_t sv_handler;
    int sv_mask;

    int sv_flags;

  };
# 328 "/usr/include/signal.h" 3 4
extern int sigvec (int __sig, __const struct sigvec *__vec,
     struct sigvec *__ovec) throw ();



# 1 "/usr/include/bits/sigcontext.h" 1 3 4
# 28 "/usr/include/bits/sigcontext.h" 3 4
# 1 "/usr/include/asm/sigcontext.h" 1 3 4
# 18 "/usr/include/asm/sigcontext.h" 3 4
struct _fpreg {
 unsigned short significand[4];
 unsigned short exponent;
};

struct _fpxreg {
 unsigned short significand[4];
 unsigned short exponent;
 unsigned short padding[3];
};

struct _xmmreg {
 unsigned long element[4];
};

struct _fpstate {

 unsigned long cw;
 unsigned long sw;
 unsigned long tag;
 unsigned long ipoff;
 unsigned long cssel;
 unsigned long dataoff;
 unsigned long datasel;
 struct _fpreg _st[8];
 unsigned short status;
 unsigned short magic;


 unsigned long _fxsr_env[6];
 unsigned long mxcsr;
 unsigned long reserved;
 struct _fpxreg _fxsr_st[8];
 struct _xmmreg _xmm[8];
 unsigned long padding[56];
};



struct sigcontext {
 unsigned short gs, __gsh;
 unsigned short fs, __fsh;
 unsigned short es, __esh;
 unsigned short ds, __dsh;
 unsigned long edi;
 unsigned long esi;
 unsigned long ebp;
 unsigned long esp;
 unsigned long ebx;
 unsigned long edx;
 unsigned long ecx;
 unsigned long eax;
 unsigned long trapno;
 unsigned long err;
 unsigned long eip;
 unsigned short cs, __csh;
 unsigned long eflags;
 unsigned long esp_at_signal;
 unsigned short ss, __ssh;
 struct _fpstate * fpstate;
 unsigned long oldmask;
 unsigned long cr2;
};
# 29 "/usr/include/bits/sigcontext.h" 2 3 4
# 334 "/usr/include/signal.h" 2 3 4


extern int sigreturn (struct sigcontext *__scp) throw ();
# 346 "/usr/include/signal.h" 3 4
extern int siginterrupt (int __sig, int __interrupt) throw ();

# 1 "/usr/include/bits/sigstack.h" 1 3 4
# 26 "/usr/include/bits/sigstack.h" 3 4
struct sigstack
  {
    void *ss_sp;
    int ss_onstack;
  };



enum
{
  SS_ONSTACK = 1,

  SS_DISABLE

};
# 50 "/usr/include/bits/sigstack.h" 3 4
typedef struct sigaltstack
  {
    void *ss_sp;
    int ss_flags;
    size_t ss_size;
  } stack_t;
# 349 "/usr/include/signal.h" 2 3 4


# 1 "/usr/include/sys/ucontext.h" 1 3 4
# 27 "/usr/include/sys/ucontext.h" 3 4
# 1 "/usr/include/bits/sigcontext.h" 1 3 4
# 28 "/usr/include/sys/ucontext.h" 2 3 4



typedef int greg_t;





typedef greg_t gregset_t[19];



enum
{
  REG_GS = 0,

  REG_FS,

  REG_ES,

  REG_DS,

  REG_EDI,

  REG_ESI,

  REG_EBP,

  REG_ESP,

  REG_EBX,

  REG_EDX,

  REG_ECX,

  REG_EAX,

  REG_TRAPNO,

  REG_ERR,

  REG_EIP,

  REG_CS,

  REG_EFL,

  REG_UESP,

  REG_SS

};



struct _libc_fpreg
{
  unsigned short int significand[4];
  unsigned short int exponent;
};

struct _libc_fpstate
{
  unsigned long int cw;
  unsigned long int sw;
  unsigned long int tag;
  unsigned long int ipoff;
  unsigned long int cssel;
  unsigned long int dataoff;
  unsigned long int datasel;
  struct _libc_fpreg _st[8];
  unsigned long int status;
};


typedef struct _libc_fpstate *fpregset_t;


typedef struct
  {
    gregset_t gregs;


    fpregset_t fpregs;
    unsigned long int oldmask;
    unsigned long int cr2;
  } mcontext_t;


typedef struct ucontext
  {
    unsigned long int uc_flags;
    struct ucontext *uc_link;
    stack_t uc_stack;
    mcontext_t uc_mcontext;
    __sigset_t uc_sigmask;
    struct _libc_fpstate __fpregs_mem;
  } ucontext_t;
# 352 "/usr/include/signal.h" 2 3 4





extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
     throw () __attribute__ ((__deprecated__));



extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
   struct sigaltstack *__restrict __oss) throw ();







extern int sighold (int __sig) throw ();


extern int sigrelse (int __sig) throw ();


extern int sigignore (int __sig) throw ();


extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw ();





# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
# 387 "/usr/include/signal.h" 2 3 4







extern int __libc_current_sigrtmin (void) throw ();

extern int __libc_current_sigrtmax (void) throw ();



}
# 50 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/csignal" 2 3




namespace std
{
  using ::sig_atomic_t;
  using ::signal;
  using ::raise;
}
# 29 "fpu-ia32_inlines.hh" 2
# 57 "fpu-ia32_inlines.hh"
namespace Parma_Polyhedra_Library {

typedef struct {
  unsigned short control_word;
  unsigned short unused1;
  unsigned short status_word;
  unsigned short unused2;
  unsigned short tags;
  unsigned short unused3;
  unsigned int eip;
  unsigned short cs_selector;
  unsigned int opcode:11;
  unsigned int unused4:5;
  unsigned int data_offset;
  unsigned short data_selector;
  unsigned short unused5;
} ia32_fenv_t;

inline int
fpu_get_control() {
  unsigned short cw;
  __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw) : : "memory");
  return cw;
}

inline void
fpu_set_control(int c) {
  unsigned short cw = static_cast<unsigned short>(c);
  __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw) : "memory");
}

inline int
fpu_get_status() {
  unsigned short sw;
  __asm__ __volatile__ ("fnstsw %0" : "=a" (sw) : : "memory");
  return sw;
}

inline void
fpu_clear_status(unsigned short bits) {

  ia32_fenv_t env;
  __asm__ __volatile__ ("fnstenv %0" : "=m" (env));
  env.status_word = static_cast<unsigned short>(env.status_word & ~bits);
  __asm__ __volatile__ ("fldenv %0" : : "m" (env) : "memory");
}

inline void
fpu_clear_exceptions() {
  __asm__ __volatile__ ("fnclex" : : : "memory");
}


inline void
sse_set_control(unsigned int cw) {
  __asm__ __volatile__ ("ldmxcsr %0" : : "m" (*&cw) : "memory");
}

inline unsigned int
sse_get_control() {
  unsigned int cw;
  __asm__ __volatile__ ("stmxcsr %0" : "=m" (*&cw) : : "memory");
  return cw;
}


inline void
fpu_initialize_control_functions() {

  extern void detect_sse_unit();
  detect_sse_unit();

}

inline fpu_rounding_direction_type
fpu_get_rounding_direction() {
  return static_cast<fpu_rounding_direction_type>(fpu_get_control() & 0xc00);
}

inline void
fpu_set_rounding_direction(fpu_rounding_direction_type dir) {

  fpu_set_control(0x37f | dir);


  extern bool have_sse_unit;
  if (have_sse_unit)
    sse_set_control(0x1f80 | (dir << 3));

}

inline fpu_rounding_control_word_type
fpu_save_rounding_direction(fpu_rounding_direction_type dir) {

  fpu_set_control(0x37f | dir);


  extern bool have_sse_unit;
  if (have_sse_unit)
    sse_set_control(0x1f80 | (dir << 3));

  return static_cast<fpu_rounding_control_word_type>(0);
}

inline void
fpu_reset_inexact() {

  fpu_clear_exceptions();




  extern bool have_sse_unit;
  if (have_sse_unit)
    sse_set_control((0x1f80 | (0x800 << 3)));

}

inline void
fpu_restore_rounding_direction(fpu_rounding_control_word_type) {

  fpu_set_control((0x37f | 0x800));


  extern bool have_sse_unit;
  if (have_sse_unit)
    sse_set_control((0x1f80 | (0x800 << 3)));

}

inline int
fpu_check_inexact() {

  if (fpu_get_status() & 0x20)
    return 1;


  extern bool have_sse_unit;
  if (have_sse_unit && (sse_get_control() & 0x20))
    return 1;

  return 0;
}

}
# 87 "fpu_defs.hh" 2
# 29 "Rounding_Dir_defs.hh" 2

namespace Parma_Polyhedra_Library {



enum Rounding_Dir {



  ROUND_DOWN = 0U,




  ROUND_UP = 1U,




  ROUND_IGNORE = 6U,
  ROUND_NATIVE = ROUND_IGNORE,






  ROUND_NOT_NEEDED = 7U,

  ROUND_DIRECT = ROUND_UP,
  ROUND_INVERSE = ROUND_DOWN,

  ROUND_DIR_MASK = 7U,





  ROUND_STRICT_RELATION = 8U,

  ROUND_CHECK = ROUND_DIRECT | ROUND_STRICT_RELATION
};





Rounding_Dir operator&(Rounding_Dir x, Rounding_Dir y);


Rounding_Dir operator|(Rounding_Dir x, Rounding_Dir y);





Rounding_Dir inverse(Rounding_Dir dir);


Rounding_Dir round_dir(Rounding_Dir dir);


bool round_down(Rounding_Dir dir);


bool round_up(Rounding_Dir dir);


bool round_ignore(Rounding_Dir dir);


bool round_not_needed(Rounding_Dir dir);


bool round_not_requested(Rounding_Dir dir);


bool round_direct(Rounding_Dir dir);


bool round_inverse(Rounding_Dir dir);


bool round_strict_relation(Rounding_Dir dir);


fpu_rounding_direction_type round_fpu_dir(Rounding_Dir dir);



}

# 1 "Rounding_Dir_inlines.hh" 1
# 29 "Rounding_Dir_inlines.hh"
namespace Parma_Polyhedra_Library {


inline Rounding_Dir
operator&(Rounding_Dir x, Rounding_Dir y) {
  const unsigned res = static_cast<unsigned>(x) & static_cast<unsigned>(y);
  return static_cast<Rounding_Dir>(res);
}


inline Rounding_Dir
operator|(Rounding_Dir x, Rounding_Dir y) {
  const unsigned res = static_cast<unsigned>(x) | static_cast<unsigned>(y);
  return static_cast<Rounding_Dir>(res);
}


inline Rounding_Dir
round_dir(Rounding_Dir dir) {
  return dir & ROUND_DIR_MASK;
}


inline bool
round_down(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_DOWN;
}


inline bool
round_up(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_UP;
}


inline bool
round_ignore(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_IGNORE;
}


inline bool
round_not_needed(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_NOT_NEEDED;
}


inline bool
round_not_requested(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_IGNORE || round_dir(dir) == ROUND_NOT_NEEDED;
}


inline bool
round_direct(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_DIRECT;
}


inline bool
round_inverse(Rounding_Dir dir) {
  return round_dir(dir) == ROUND_INVERSE;
}


inline bool
round_strict_relation(Rounding_Dir dir) {
  return (dir & ROUND_STRICT_RELATION) == ROUND_STRICT_RELATION;
}




inline fpu_rounding_direction_type
round_fpu_dir(Rounding_Dir dir) {
  switch (round_dir(dir)) {
  case ROUND_UP:
    return static_cast<fpu_rounding_direction_type>(0x800);
  case ROUND_DOWN:
    return static_cast<fpu_rounding_direction_type>(0x400);
  case ROUND_IGNORE:
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return static_cast<fpu_rounding_direction_type>(0x800);
  }
}
# 124 "Rounding_Dir_inlines.hh"
inline Rounding_Dir
inverse(Rounding_Dir dir) {
  switch (round_dir(dir)) {
  case ROUND_UP:
    return ROUND_DOWN | (dir & ROUND_STRICT_RELATION);
  case ROUND_DOWN:
    return ROUND_UP | (dir & ROUND_STRICT_RELATION);
  case ROUND_IGNORE:
    return dir;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return dir;
  }
}

}
# 122 "Rounding_Dir_defs.hh" 2
# 33 "checked_defs.hh" 2
# 1 "Numeric_Format_defs.hh" 1
# 30 "Numeric_Format_defs.hh"
namespace Parma_Polyhedra_Library {

class Numeric_Format {
};

}
# 34 "checked_defs.hh" 2
# 1 "Float_defs.hh" 1
# 31 "Float_defs.hh"
# 1 "Concrete_Expression_types.hh" 1
# 16 "Concrete_Expression_types.hh"
namespace Parma_Polyhedra_Library {
# 27 "Concrete_Expression_types.hh"
template <typename Target>
class Concrete_Expression;




template <typename Target>
class Binary_Operator;




template <typename Target>
class Unary_Operator;




template <typename Target>
class Cast_Operator;




template <typename Target>
class Integer_Constant;




template <typename Target>
class Floating_Point_Constant;




template <typename Target>
class Approximable_Reference;

class Concrete_Expression_Type;
# 78 "Concrete_Expression_types.hh"
typedef int Concrete_Expression_Kind;







typedef int Concrete_Expression_BOP;







typedef int Concrete_Expression_UOP;

}
# 32 "Float_defs.hh" 2
# 1 "Variable_types.hh" 1
# 16 "Variable_types.hh"
namespace Parma_Polyhedra_Library {

class Variable;

}
# 33 "Float_defs.hh" 2
# 1 "Linear_Form_types.hh" 1
# 16 "Linear_Form_types.hh"
namespace Parma_Polyhedra_Library {

template <typename C>
class Linear_Form;

}
# 34 "Float_defs.hh" 2
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/set" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/set" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/set" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h" 1 3
# 70 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/cpp_type_traits.h" 1 3
# 40 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/cpp_type_traits.h" 3
       
# 41 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/cpp_type_traits.h" 3
# 69 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/cpp_type_traits.h" 3
namespace __gnu_internal
{
  typedef char __one;
  typedef char __two[2];

  template <typename _Tp>
  __one __test_type (int _Tp::*);
  template <typename _Tp>
  __two& __test_type (...);
}

namespace std
{

  template<typename, typename>
    struct __are_same
    {
      enum
 {
   _M_type = 0
 };
    };

  template<typename _Tp>
    struct __are_same<_Tp, _Tp>
    {
      enum
 {
   _M_type = 1
 };
    };


  template<typename, bool>
    struct __enable_if
    {
    };

  template<typename _Tp>
    struct __enable_if<_Tp, true>
    {
      typedef _Tp _M_type;
    };


  template<typename _Tp>
    struct __is_void
    {
      enum
 {
   _M_type = 0
 };
    };

  template<>
    struct __is_void<void>
    {
      enum
 {
   _M_type = 1
 };
    };




  template<typename _Tp>
    struct __is_integer
    {
      enum
 {
   _M_type = 0
 };
    };




  template<>
    struct __is_integer<bool>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<char>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<signed char>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<unsigned char>
    {
      enum
 {
   _M_type = 1
 };
    };


  template<>
    struct __is_integer<wchar_t>
    {
      enum
 {
   _M_type = 1
 };
    };


  template<>
    struct __is_integer<short>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<unsigned short>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<int>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<unsigned int>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<long>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<unsigned long>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<long long>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_integer<unsigned long long>
    {
      enum
 {
   _M_type = 1
 };
    };




  template<typename _Tp>
    struct __is_floating
    {
      enum
 {
   _M_type = 0
 };
    };


  template<>
    struct __is_floating<float>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_floating<double>
    {
      enum
 {
   _M_type = 1
 };
    };

  template<>
    struct __is_floating<long double>
    {
      enum
 {
   _M_type = 1
 };
    };




  template<typename _Tp>
    struct __is_arithmetic
    {
      enum
 {
   _M_type = __is_integer<_Tp>::_M_type || __is_floating<_Tp>::_M_type
 };
    };




  template<typename _Tp>
    struct __is_fundamental
    {
      enum
 {
   _M_type = __is_void<_Tp>::_M_type || __is_arithmetic<_Tp>::_M_type
 };
    };




  template<typename _Tp>
    struct __is_pod
    {
      enum
 {
   _M_type = (sizeof(__gnu_internal::__test_type<_Tp>(0))
       != sizeof(__gnu_internal::__one))
 };
    };

}
# 71 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h" 2 3

namespace std
{
# 90 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h" 3
  enum _Rb_tree_color { _S_red = false, _S_black = true };

  struct _Rb_tree_node_base
  {
    typedef _Rb_tree_node_base* _Base_ptr;
    typedef const _Rb_tree_node_base* _Const_Base_ptr;

    _Rb_tree_color _M_color;
    _Base_ptr _M_parent;
    _Base_ptr _M_left;
    _Base_ptr _M_right;

    static _Base_ptr
    _S_minimum(_Base_ptr __x)
    {
      while (__x->_M_left != 0) __x = __x->_M_left;
      return __x;
    }

    static _Const_Base_ptr
    _S_minimum(_Const_Base_ptr __x)
    {
      while (__x->_M_left != 0) __x = __x->_M_left;
      return __x;
    }

    static _Base_ptr
    _S_maximum(_Base_ptr __x)
    {
      while (__x->_M_right != 0) __x = __x->_M_right;
      return __x;
    }

    static _Const_Base_ptr
    _S_maximum(_Const_Base_ptr __x)
    {
      while (__x->_M_right != 0) __x = __x->_M_right;
      return __x;
    }
  };

  template<typename _Val>
    struct _Rb_tree_node : public _Rb_tree_node_base
    {
      typedef _Rb_tree_node<_Val>* _Link_type;
      _Val _M_value_field;
    };

  _Rb_tree_node_base*
  _Rb_tree_increment(_Rb_tree_node_base* __x);

  const _Rb_tree_node_base*
  _Rb_tree_increment(const _Rb_tree_node_base* __x);

  _Rb_tree_node_base*
  _Rb_tree_decrement(_Rb_tree_node_base* __x);

  const _Rb_tree_node_base*
  _Rb_tree_decrement(const _Rb_tree_node_base* __x);

  template<typename _Tp>
    struct _Rb_tree_iterator
    {
      typedef _Tp value_type;
      typedef _Tp& reference;
      typedef _Tp* pointer;

      typedef bidirectional_iterator_tag iterator_category;
      typedef ptrdiff_t difference_type;

      typedef _Rb_tree_iterator<_Tp> _Self;
      typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
      typedef _Rb_tree_node<_Tp>* _Link_type;

      _Rb_tree_iterator()
      : _M_node() { }

      _Rb_tree_iterator(_Link_type __x)
      : _M_node(__x) { }

      reference
      operator*() const
      { return static_cast<_Link_type>(_M_node)->_M_value_field; }

      pointer
      operator->() const
      { return &static_cast<_Link_type>(_M_node)->_M_value_field; }

      _Self&
      operator++()
      {
 _M_node = _Rb_tree_increment(_M_node);
 return *this;
      }

      _Self
      operator++(int)
      {
 _Self __tmp = *this;
 _M_node = _Rb_tree_increment(_M_node);
 return __tmp;
      }

      _Self&
      operator--()
      {
 _M_node = _Rb_tree_decrement(_M_node);
 return *this;
      }

      _Self
      operator--(int)
      {
 _Self __tmp = *this;
 _M_node = _Rb_tree_decrement(_M_node);
 return __tmp;
      }

      bool
      operator==(const _Self& __x) const
      { return _M_node == __x._M_node; }

      bool
      operator!=(const _Self& __x) const
      { return _M_node != __x._M_node; }

      _Base_ptr _M_node;
  };

  template<typename _Tp>
    struct _Rb_tree_const_iterator
    {
      typedef _Tp value_type;
      typedef const _Tp& reference;
      typedef const _Tp* pointer;

      typedef _Rb_tree_iterator<_Tp> iterator;

      typedef bidirectional_iterator_tag iterator_category;
      typedef ptrdiff_t difference_type;

      typedef _Rb_tree_const_iterator<_Tp> _Self;
      typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
      typedef const _Rb_tree_node<_Tp>* _Link_type;

      _Rb_tree_const_iterator()
      : _M_node() { }

      _Rb_tree_const_iterator(_Link_type __x)
      : _M_node(__x) { }

      _Rb_tree_const_iterator(const iterator& __it)
      : _M_node(__it._M_node) { }

      reference
      operator*() const
      { return static_cast<_Link_type>(_M_node)->_M_value_field; }

      pointer
      operator->() const
      { return &static_cast<_Link_type>(_M_node)->_M_value_field; }

      _Self&
      operator++()
      {
 _M_node = _Rb_tree_increment(_M_node);
 return *this;
      }

      _Self
      operator++(int)
      {
 _Self __tmp = *this;
 _M_node = _Rb_tree_increment(_M_node);
 return __tmp;
      }

      _Self&
      operator--()
      {
 _M_node = _Rb_tree_decrement(_M_node);
 return *this;
      }

      _Self
      operator--(int)
      {
 _Self __tmp = *this;
 _M_node = _Rb_tree_decrement(_M_node);
 return __tmp;
      }

      bool
      operator==(const _Self& __x) const
      { return _M_node == __x._M_node; }

      bool
      operator!=(const _Self& __x) const
      { return _M_node != __x._M_node; }

      _Base_ptr _M_node;
    };

  template<typename _Val>
    inline bool
    operator==(const _Rb_tree_iterator<_Val>& __x,
               const _Rb_tree_const_iterator<_Val>& __y)
    { return __x._M_node == __y._M_node; }

  template<typename _Val>
    inline bool
    operator!=(const _Rb_tree_iterator<_Val>& __x,
               const _Rb_tree_const_iterator<_Val>& __y)
    { return __x._M_node != __y._M_node; }

  void
  _Rb_tree_rotate_left(_Rb_tree_node_base* const __x,
                       _Rb_tree_node_base*& __root);

  void
  _Rb_tree_rotate_right(_Rb_tree_node_base* const __x,
                        _Rb_tree_node_base*& __root);

  void
  _Rb_tree_insert_and_rebalance(const bool __insert_left,
                                _Rb_tree_node_base* __x,
                                _Rb_tree_node_base* __p,
                                _Rb_tree_node_base& __header);

  _Rb_tree_node_base*
  _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
          _Rb_tree_node_base& __header);


  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc = allocator<_Val> >
    class _Rb_tree
    {
      typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
              _Node_allocator;

    protected:
      typedef _Rb_tree_node_base* _Base_ptr;
      typedef const _Rb_tree_node_base* _Const_Base_ptr;
      typedef _Rb_tree_node<_Val> _Rb_tree_node;

    public:
      typedef _Key key_type;
      typedef _Val value_type;
      typedef value_type* pointer;
      typedef const value_type* const_pointer;
      typedef value_type& reference;
      typedef const value_type& const_reference;
      typedef _Rb_tree_node* _Link_type;
      typedef const _Rb_tree_node* _Const_Link_type;
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef _Alloc allocator_type;

      allocator_type
      get_allocator() const
      { return *static_cast<const _Node_allocator*>(&this->_M_impl); }

    protected:
      _Rb_tree_node*
      _M_get_node()
      { return _M_impl._Node_allocator::allocate(1); }

      void
      _M_put_node(_Rb_tree_node* __p)
      { _M_impl._Node_allocator::deallocate(__p, 1); }

      _Link_type
      _M_create_node(const value_type& __x)
      {
 _Link_type __tmp = _M_get_node();
 try
   { std::_Construct(&__tmp->_M_value_field, __x); }
 catch(...)
   {
     _M_put_node(__tmp);
     throw;
   }
 return __tmp;
      }

      _Link_type
      _M_clone_node(_Const_Link_type __x)
      {
 _Link_type __tmp = _M_create_node(__x->_M_value_field);
 __tmp->_M_color = __x->_M_color;
 __tmp->_M_left = 0;
 __tmp->_M_right = 0;
 return __tmp;
      }

      void
      destroy_node(_Link_type __p)
      {
 std::_Destroy(&__p->_M_value_field);
 _M_put_node(__p);
      }

    protected:
      template<typename _Key_compare,
        bool _Is_pod_comparator = std::__is_pod<_Key_compare>::_M_type>
        struct _Rb_tree_impl : public _Node_allocator
        {
   _Key_compare _M_key_compare;
   _Rb_tree_node_base _M_header;
   size_type _M_node_count;

   _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
   const _Key_compare& __comp = _Key_compare())
   : _Node_allocator(__a), _M_key_compare(__comp), _M_node_count(0)
   {
     this->_M_header._M_color = _S_red;
     this->_M_header._M_parent = 0;
     this->_M_header._M_left = &this->_M_header;
     this->_M_header._M_right = &this->_M_header;
   }
 };



      template<typename _Key_compare>
        struct _Rb_tree_impl<_Key_compare, true> : public _Node_allocator
 {
   _Key_compare _M_key_compare;
   _Rb_tree_node_base _M_header;
   size_type _M_node_count;

   _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
   const _Key_compare& __comp = _Key_compare())
   : _Node_allocator(__a), _M_key_compare(__comp), _M_node_count(0)
   {
     this->_M_header._M_color = _S_red;
     this->_M_header._M_parent = 0;
     this->_M_header._M_left = &this->_M_header;
     this->_M_header._M_right = &this->_M_header;
   }
 };

      _Rb_tree_impl<_Compare> _M_impl;

    protected:
      _Base_ptr&
      _M_root()
      { return this->_M_impl._M_header._M_parent; }

      _Const_Base_ptr
      _M_root() const
      { return this->_M_impl._M_header._M_parent; }

      _Base_ptr&
      _M_leftmost()
      { return this->_M_impl._M_header._M_left; }

      _Const_Base_ptr
      _M_leftmost() const
      { return this->_M_impl._M_header._M_left; }

      _Base_ptr&
      _M_rightmost()
      { return this->_M_impl._M_header._M_right; }

      _Const_Base_ptr
      _M_rightmost() const
      { return this->_M_impl._M_header._M_right; }

      _Link_type
      _M_begin()
      { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }

      _Const_Link_type
      _M_begin() const
      { return static_cast<_Const_Link_type>(this->_M_impl._M_header._M_parent); }

      _Link_type
      _M_end()
      { return static_cast<_Link_type>(&this->_M_impl._M_header); }

      _Const_Link_type
      _M_end() const
      { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }

      static const_reference
      _S_value(_Const_Link_type __x)
      { return __x->_M_value_field; }

      static const _Key&
      _S_key(_Const_Link_type __x)
      { return _KeyOfValue()(_S_value(__x)); }

      static _Link_type
      _S_left(_Base_ptr __x)
      { return static_cast<_Link_type>(__x->_M_left); }

      static _Const_Link_type
      _S_left(_Const_Base_ptr __x)
      { return static_cast<_Const_Link_type>(__x->_M_left); }

      static _Link_type
      _S_right(_Base_ptr __x)
      { return static_cast<_Link_type>(__x->_M_right); }

      static _Const_Link_type
      _S_right(_Const_Base_ptr __x)
      { return static_cast<_Const_Link_type>(__x->_M_right); }

      static const_reference
      _S_value(_Const_Base_ptr __x)
      { return static_cast<_Const_Link_type>(__x)->_M_value_field; }

      static const _Key&
      _S_key(_Const_Base_ptr __x)
      { return _KeyOfValue()(_S_value(__x)); }

      static _Base_ptr
      _S_minimum(_Base_ptr __x)
      { return _Rb_tree_node_base::_S_minimum(__x); }

      static _Const_Base_ptr
      _S_minimum(_Const_Base_ptr __x)
      { return _Rb_tree_node_base::_S_minimum(__x); }

      static _Base_ptr
      _S_maximum(_Base_ptr __x)
      { return _Rb_tree_node_base::_S_maximum(__x); }

      static _Const_Base_ptr
      _S_maximum(_Const_Base_ptr __x)
      { return _Rb_tree_node_base::_S_maximum(__x); }

    public:
      typedef _Rb_tree_iterator<value_type> iterator;
      typedef _Rb_tree_const_iterator<value_type> const_iterator;

      typedef std::reverse_iterator<iterator> reverse_iterator;
      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;

    private:
      iterator
      _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v);

      _Link_type
      _M_copy(_Const_Link_type __x, _Link_type __p);

      void
      _M_erase(_Link_type __x);

    public:

      _Rb_tree()
      { }

      _Rb_tree(const _Compare& __comp)
      : _M_impl(allocator_type(), __comp)
      { }

      _Rb_tree(const _Compare& __comp, const allocator_type& __a)
      : _M_impl(__a, __comp)
      { }

      _Rb_tree(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x)
      : _M_impl(__x.get_allocator(), __x._M_impl._M_key_compare)
      {
 if (__x._M_root() != 0)
   {
     _M_root() = _M_copy(__x._M_begin(), _M_end());
     _M_leftmost() = _S_minimum(_M_root());
     _M_rightmost() = _S_maximum(_M_root());
     _M_impl._M_node_count = __x._M_impl._M_node_count;
   }
      }

      ~_Rb_tree()
      { _M_erase(_M_begin()); }

      _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>&
      operator=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x);


      _Compare
      key_comp() const
      { return _M_impl._M_key_compare; }

      iterator
      begin()
      { return static_cast<_Link_type>(this->_M_impl._M_header._M_left); }

      const_iterator
      begin() const
      { return static_cast<_Const_Link_type>(this->_M_impl._M_header._M_left); }

      iterator
      end()
      { return static_cast<_Link_type>(&this->_M_impl._M_header); }

      const_iterator
      end() const
      { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }

      reverse_iterator
      rbegin()
      { return reverse_iterator(end()); }

      const_reverse_iterator
      rbegin() const
      { return const_reverse_iterator(end()); }

      reverse_iterator
      rend()
      { return reverse_iterator(begin()); }

      const_reverse_iterator
      rend() const
      { return const_reverse_iterator(begin()); }

      bool
      empty() const
      { return _M_impl._M_node_count == 0; }

      size_type
      size() const
      { return _M_impl._M_node_count; }

      size_type
      max_size() const
      { return size_type(-1); }

      void
      swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __t);


      pair<iterator,bool>
      insert_unique(const value_type& __x);

      iterator
      insert_equal(const value_type& __x);

      iterator
      insert_unique(iterator __position, const value_type& __x);

      iterator
      insert_equal(iterator __position, const value_type& __x);

      template<typename _InputIterator>
      void
      insert_unique(_InputIterator __first, _InputIterator __last);

      template<typename _InputIterator>
      void
      insert_equal(_InputIterator __first, _InputIterator __last);

      void
      erase(iterator __position);

      size_type
      erase(const key_type& __x);

      void
      erase(iterator __first, iterator __last);

      void
      erase(const key_type* __first, const key_type* __last);

      void
      clear()
      {
        _M_erase(_M_begin());
        _M_leftmost() = _M_end();
        _M_root() = 0;
        _M_rightmost() = _M_end();
        _M_impl._M_node_count = 0;
      }


      iterator
      find(const key_type& __x);

      const_iterator
      find(const key_type& __x) const;

      size_type
      count(const key_type& __x) const;

      iterator
      lower_bound(const key_type& __x);

      const_iterator
      lower_bound(const key_type& __x) const;

      iterator
      upper_bound(const key_type& __x);

      const_iterator
      upper_bound(const key_type& __x) const;

      pair<iterator,iterator>
      equal_range(const key_type& __x);

      pair<const_iterator, const_iterator>
      equal_range(const key_type& __x) const;


      bool
      __rb_verify() const;
    };

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline bool
    operator==(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
        const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    {
      return __x.size() == __y.size()
      && std::equal(__x.begin(), __x.end(), __y.begin());
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline bool
    operator<(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
       const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    {
      return std::lexicographical_compare(__x.begin(), __x.end(),
       __y.begin(), __y.end());
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline bool
    operator!=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
        const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    { return !(__x == __y); }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline bool
    operator>(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
       const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    { return __y < __x; }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline bool
    operator<=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
        const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    { return !(__y < __x); }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline bool
    operator>=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
        const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    { return !(__x < __y); }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline void
    swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x,
  _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y)
    { __x.swap(__y); }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>&
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    operator=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x)
    {
      if (this != &__x)
 {

   clear();
   _M_impl._M_key_compare = __x._M_impl._M_key_compare;
   if (__x._M_root() != 0)
     {
       _M_root() = _M_copy(__x._M_begin(), _M_end());
       _M_leftmost() = _S_minimum(_M_root());
       _M_rightmost() = _S_maximum(_M_root());
       _M_impl._M_node_count = __x._M_impl._M_node_count;
     }
 }
      return *this;
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    _M_insert(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
    {
      _Link_type __z = _M_create_node(__v);
      bool __insert_left;

      __insert_left = __x != 0 || __p == _M_end()
               || _M_impl._M_key_compare(_KeyOfValue()(__v),
      _S_key(__p));

      _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
        this->_M_impl._M_header);
      ++_M_impl._M_node_count;
      return iterator(__z);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    insert_equal(const _Val& __v)
    {
      _Link_type __x = _M_begin();
      _Link_type __y = _M_end();
      while (__x != 0)
 {
   __y = __x;
   __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
         _S_left(__x) : _S_right(__x);
 }
      return _M_insert(__x, __y, __v);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    void
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __t)
    {
      if (_M_root() == 0)
      {
 if (__t._M_root() != 0)
 {
   _M_root() = __t._M_root();
   _M_leftmost() = __t._M_leftmost();
   _M_rightmost() = __t._M_rightmost();
          _M_root()->_M_parent = _M_end();

   __t._M_root() = 0;
   __t._M_leftmost() = __t._M_end();
   __t._M_rightmost() = __t._M_end();
 }
      }
      else if (__t._M_root() == 0)
      {
 __t._M_root() = _M_root();
 __t._M_leftmost() = _M_leftmost();
 __t._M_rightmost() = _M_rightmost();
        __t._M_root()->_M_parent = __t._M_end();

 _M_root() = 0;
 _M_leftmost() = _M_end();
 _M_rightmost() = _M_end();
      }
      else
      {
 std::swap(_M_root(),__t._M_root());
 std::swap(_M_leftmost(),__t._M_leftmost());
 std::swap(_M_rightmost(),__t._M_rightmost());

 _M_root()->_M_parent = _M_end();
 __t._M_root()->_M_parent = __t._M_end();
      }

      std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
      std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    pair<typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator,
    bool>
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    insert_unique(const _Val& __v)
    {
      _Link_type __x = _M_begin();
      _Link_type __y = _M_end();
      bool __comp = true;
      while (__x != 0)
 {
   __y = __x;
   __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x));
   __x = __comp ? _S_left(__x) : _S_right(__x);
 }
      iterator __j = iterator(__y);
      if (__comp)
 if (__j == begin())
   return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
 else
   --__j;
      if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
 return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
      return pair<iterator,bool>(__j, false);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
    insert_unique(iterator __position, const _Val& __v)
    {
      if (__position._M_node == _M_leftmost())
 {

   if (size() > 0
       && _M_impl._M_key_compare(_KeyOfValue()(__v),
     _S_key(__position._M_node)))
     return _M_insert(__position._M_node, __position._M_node, __v);

   else
     return insert_unique(__v).first;
 }
      else if (__position._M_node == _M_end())
 {

   if (_M_impl._M_key_compare(_S_key(_M_rightmost()),
         _KeyOfValue()(__v)))
     return _M_insert(0, _M_rightmost(), __v);
   else
     return insert_unique(__v).first;
 }
      else
 {
   iterator __before = __position;
   --__before;
   if (_M_impl._M_key_compare(_S_key(__before._M_node),
         _KeyOfValue()(__v))
       && _M_impl._M_key_compare(_KeyOfValue()(__v),
     _S_key(__position._M_node)))
     {
       if (_S_right(__before._M_node) == 0)
  return _M_insert(0, __before._M_node, __v);
       else
  return _M_insert(__position._M_node, __position._M_node, __v);

     }
   else
     return insert_unique(__v).first;
 }
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    insert_equal(iterator __position, const _Val& __v)
    {
      if (__position._M_node == _M_leftmost())
 {

   if (size() > 0
       && !_M_impl._M_key_compare(_S_key(__position._M_node),
      _KeyOfValue()(__v)))
     return _M_insert(__position._M_node, __position._M_node, __v);

   else
     return insert_equal(__v);
 }
      else if (__position._M_node == _M_end())
 {

   if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
          _S_key(_M_rightmost())))
     return _M_insert(0, _M_rightmost(), __v);
   else
     return insert_equal(__v);
 }
      else
 {
   iterator __before = __position;
   --__before;
   if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
          _S_key(__before._M_node))
       && !_M_impl._M_key_compare(_S_key(__position._M_node),
      _KeyOfValue()(__v)))
     {
       if (_S_right(__before._M_node) == 0)
  return _M_insert(0, __before._M_node, __v);
       else
  return _M_insert(__position._M_node, __position._M_node, __v);

     }
   else
     return insert_equal(__v);
 }
    }

  template<typename _Key, typename _Val, typename _KoV,
           typename _Cmp, typename _Alloc>
    template<class _II>
      void
      _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>::
      insert_equal(_II __first, _II __last)
      {
 for ( ; __first != __last; ++__first)
   insert_equal(*__first);
      }

  template<typename _Key, typename _Val, typename _KoV,
           typename _Cmp, typename _Alloc>
    template<class _II>
    void
    _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>::
    insert_unique(_II __first, _II __last)
    {
      for ( ; __first != __last; ++__first)
 insert_unique(*__first);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline void
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(iterator __position)
    {
      _Link_type __y =
 static_cast<_Link_type>(_Rb_tree_rebalance_for_erase(__position._M_node,
            this->_M_impl._M_header));
      destroy_node(__y);
      --_M_impl._M_node_count;
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(const _Key& __x)
    {
      pair<iterator,iterator> __p = equal_range(__x);
      size_type __n = std::distance(__p.first, __p.second);
      erase(__p.first, __p.second);
      return __n;
    }

  template<typename _Key, typename _Val, typename _KoV,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
    _Rb_tree<_Key,_Val,_KoV,_Compare,_Alloc>::
    _M_copy(_Const_Link_type __x, _Link_type __p)
    {

      _Link_type __top = _M_clone_node(__x);
      __top->_M_parent = __p;

      try
 {
   if (__x->_M_right)
     __top->_M_right = _M_copy(_S_right(__x), __top);
   __p = __top;
   __x = _S_left(__x);

   while (__x != 0)
     {
       _Link_type __y = _M_clone_node(__x);
       __p->_M_left = __y;
       __y->_M_parent = __p;
       if (__x->_M_right)
  __y->_M_right = _M_copy(_S_right(__x), __y);
       __p = __y;
       __x = _S_left(__x);
     }
 }
      catch(...)
 {
   _M_erase(__top);
   throw;
 }
      return __top;
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    void
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::_M_erase(_Link_type __x)
    {

      while (__x != 0)
 {
   _M_erase(_S_right(__x));
   _Link_type __y = _S_left(__x);
   destroy_node(__x);
   __x = __y;
 }
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    void
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    erase(iterator __first, iterator __last)
    {
      if (__first == begin() && __last == end())
 clear();
      else
 while (__first != __last) erase(__first++);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    void
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    erase(const _Key* __first, const _Key* __last)
    {
      while (__first != __last)
 erase(*__first++);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k)
    {
      _Link_type __x = _M_begin();
      _Link_type __y = _M_end();

      while (__x != 0)
 if (!_M_impl._M_key_compare(_S_key(__x), __k))
   __y = __x, __x = _S_left(__x);
 else
   __x = _S_right(__x);

      iterator __j = iterator(__y);
      return (__j == end()
   || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j;
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    find(const _Key& __k) const
    {
      _Const_Link_type __x = _M_begin();
      _Const_Link_type __y = _M_end();

     while (__x != 0)
       {
  if (!_M_impl._M_key_compare(_S_key(__x), __k))
    __y = __x, __x = _S_left(__x);
  else
    __x = _S_right(__x);
       }
     const_iterator __j = const_iterator(__y);
     return (__j == end()
   || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j;
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    count(const _Key& __k) const
    {
      pair<const_iterator, const_iterator> __p = equal_range(__k);
      const size_type __n = std::distance(__p.first, __p.second);
      return __n;
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    lower_bound(const _Key& __k)
    {
      _Link_type __x = _M_begin();
      _Link_type __y = _M_end();

      while (__x != 0)
 if (!_M_impl._M_key_compare(_S_key(__x), __k))
   __y = __x, __x = _S_left(__x);
 else
   __x = _S_right(__x);

      return iterator(__y);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    lower_bound(const _Key& __k) const
    {
      _Const_Link_type __x = _M_begin();
      _Const_Link_type __y = _M_end();

      while (__x != 0)
 if (!_M_impl._M_key_compare(_S_key(__x), __k))
   __y = __x, __x = _S_left(__x);
 else
   __x = _S_right(__x);

      return const_iterator(__y);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    upper_bound(const _Key& __k)
    {
      _Link_type __x = _M_begin();
      _Link_type __y = _M_end();

      while (__x != 0)
 if (_M_impl._M_key_compare(__k, _S_key(__x)))
   __y = __x, __x = _S_left(__x);
 else
   __x = _S_right(__x);

      return iterator(__y);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    upper_bound(const _Key& __k) const
    {
      _Const_Link_type __x = _M_begin();
      _Const_Link_type __y = _M_end();

      while (__x != 0)
 if (_M_impl._M_key_compare(__k, _S_key(__x)))
   __y = __x, __x = _S_left(__x);
 else
   __x = _S_right(__x);

      return const_iterator(__y);
    }

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    inline
    pair<typename _Rb_tree<_Key,_Val,_KeyOfValue,
      _Compare,_Alloc>::iterator,
  typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator>
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::
    equal_range(const _Key& __k)
    { return pair<iterator, iterator>(lower_bound(__k), upper_bound(__k)); }

  template<typename _Key, typename _Val, typename _KoV,
           typename _Compare, typename _Alloc>
    inline
    pair<typename _Rb_tree<_Key, _Val, _KoV,
      _Compare, _Alloc>::const_iterator,
  typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::const_iterator>
    _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
    equal_range(const _Key& __k) const
    { return pair<const_iterator, const_iterator>(lower_bound(__k),
        upper_bound(__k)); }

  unsigned int
  _Rb_tree_black_count(const _Rb_tree_node_base* __node,
                       const _Rb_tree_node_base* __root);

  template<typename _Key, typename _Val, typename _KeyOfValue,
           typename _Compare, typename _Alloc>
    bool
    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
    {
      if (_M_impl._M_node_count == 0 || begin() == end())
 return _M_impl._M_node_count == 0 && begin() == end()
        && this->_M_impl._M_header._M_left == _M_end()
        && this->_M_impl._M_header._M_right == _M_end();

      unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
      for (const_iterator __it = begin(); __it != end(); ++__it)
 {
   _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
   _Const_Link_type __L = _S_left(__x);
   _Const_Link_type __R = _S_right(__x);

   if (__x->_M_color == _S_red)
     if ((__L && __L->_M_color == _S_red)
  || (__R && __R->_M_color == _S_red))
       return false;

   if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
     return false;
   if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
     return false;

   if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
     return false;
 }

      if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
 return false;
      if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
 return false;
      return true;
    }
}
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/set" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
namespace std
{

  template<class _Key, class _Compare = less<_Key>,
    class _Alloc = allocator<_Key> >
    class set;

  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator==(const set<_Key,_Compare,_Alloc>& __x,
        const set<_Key,_Compare,_Alloc>& __y);

  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator<(const set<_Key,_Compare,_Alloc>& __x,
       const set<_Key,_Compare,_Alloc>& __y);
# 106 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
  template<class _Key, class _Compare, class _Alloc>
    class set
    {

     
     


    public:



      typedef _Key key_type;
      typedef _Key value_type;
      typedef _Compare key_compare;
      typedef _Compare value_compare;


    private:
      typedef _Rb_tree<key_type, value_type,
         _Identity<value_type>, key_compare, _Alloc> _Rep_type;
      _Rep_type _M_t;
    public:


      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;



      typedef typename _Rep_type::const_iterator iterator;
      typedef typename _Rep_type::const_iterator const_iterator;
      typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
      typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
      typedef typename _Rep_type::size_type size_type;
      typedef typename _Rep_type::difference_type difference_type;
      typedef typename _Rep_type::allocator_type allocator_type;




      set()
      : _M_t(_Compare(), allocator_type()) {}







      explicit set(const _Compare& __comp,
     const allocator_type& __a = allocator_type())
      : _M_t(__comp, __a) {}
# 171 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      template<class _InputIterator>
        set(_InputIterator __first, _InputIterator __last)
        : _M_t(_Compare(), allocator_type())
        { _M_t.insert_unique(__first, __last); }
# 187 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      template<class _InputIterator>
        set(_InputIterator __first, _InputIterator __last,
     const _Compare& __comp,
     const allocator_type& __a = allocator_type())
 : _M_t(__comp, __a)
        { _M_t.insert_unique(__first, __last); }
# 201 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      set(const set<_Key,_Compare,_Alloc>& __x)
      : _M_t(__x._M_t) { }
# 211 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      set<_Key,_Compare,_Alloc>&
      operator=(const set<_Key, _Compare, _Alloc>& __x)
      {
 _M_t = __x._M_t;
 return *this;
      }




      key_compare
      key_comp() const
      { return _M_t.key_comp(); }

      value_compare
      value_comp() const
      { return _M_t.key_comp(); }

      allocator_type
      get_allocator() const
      { return _M_t.get_allocator(); }





      iterator
      begin() const
      { return _M_t.begin(); }





      iterator
      end() const
      { return _M_t.end(); }






      reverse_iterator
      rbegin() const
      { return _M_t.rbegin(); }






      reverse_iterator
      rend() const
      { return _M_t.rend(); }


      bool
      empty() const
      { return _M_t.empty(); }


      size_type
      size() const
      { return _M_t.size(); }


      size_type
      max_size() const
      { return _M_t.max_size(); }
# 293 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      void
      swap(set<_Key,_Compare,_Alloc>& __x)
      { _M_t.swap(__x._M_t); }
# 311 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      pair<iterator,bool>
      insert(const value_type& __x)
      {
 pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x);
 return pair<iterator, bool>(__p.first, __p.second);
      }
# 337 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      iterator
      insert(iterator __position, const value_type& __x)
      {
 typedef typename _Rep_type::iterator _Rep_iterator;
 return _M_t.insert_unique((_Rep_iterator&)__position, __x);
      }
# 352 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      template<class _InputIterator>
      void
      insert(_InputIterator __first, _InputIterator __last)
      { _M_t.insert_unique(__first, __last); }
# 366 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      void
      erase(iterator __position)
      {
 typedef typename _Rep_type::iterator _Rep_iterator;
 _M_t.erase((_Rep_iterator&)__position);
      }
# 384 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      size_type
      erase(const key_type& __x) { return _M_t.erase(__x); }
# 398 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      void
      erase(iterator __first, iterator __last)
      {
 typedef typename _Rep_type::iterator _Rep_iterator;
 _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
      }







      void
      clear()
      { _M_t.clear(); }
# 425 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      size_type
      count(const key_type& __x) const
      { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
# 443 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      iterator
      find(const key_type& __x)
      { return _M_t.find(__x); }

      const_iterator
      find(const key_type& __x) const
      { return _M_t.find(__x); }
# 464 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      iterator
      lower_bound(const key_type& __x)
      { return _M_t.lower_bound(__x); }

      const_iterator
      lower_bound(const key_type& __x) const
      { return _M_t.lower_bound(__x); }
# 480 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      iterator
      upper_bound(const key_type& __x)
      { return _M_t.upper_bound(__x); }

      const_iterator
      upper_bound(const key_type& __x) const
      { return _M_t.upper_bound(__x); }
# 505 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
      pair<iterator,iterator>
      equal_range(const key_type& __x)
      { return _M_t.equal_range(__x); }

      pair<const_iterator,const_iterator>
      equal_range(const key_type& __x) const
      { return _M_t.equal_range(__x); }


      template<class _K1, class _C1, class _A1>
        friend bool
        operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);

      template<class _K1, class _C1, class _A1>
        friend bool
        operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
    };
# 534 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator==(const set<_Key,_Compare,_Alloc>& __x,
        const set<_Key,_Compare,_Alloc>& __y)
    { return __x._M_t == __y._M_t; }
# 551 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_set.h" 3
  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator<(const set<_Key,_Compare,_Alloc>& __x,
       const set<_Key,_Compare,_Alloc>& __y)
    { return __x._M_t < __y._M_t; }


  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator!=(const set<_Key,_Compare,_Alloc>& __x,
        const set<_Key,_Compare,_Alloc>& __y)
    { return !(__x == __y); }


  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator>(const set<_Key,_Compare,_Alloc>& __x,
       const set<_Key,_Compare,_Alloc>& __y)
    { return __y < __x; }


  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator<=(const set<_Key,_Compare,_Alloc>& __x,
        const set<_Key,_Compare,_Alloc>& __y)
    { return !(__y < __x); }


  template<class _Key, class _Compare, class _Alloc>
    inline bool
    operator>=(const set<_Key,_Compare,_Alloc>& __x,
        const set<_Key,_Compare,_Alloc>& __y)
    { return !(__x < __y); }


  template<class _Key, class _Compare, class _Alloc>
    inline void
    swap(set<_Key,_Compare,_Alloc>& __x, set<_Key,_Compare,_Alloc>& __y)
    { __x.swap(__y); }

}
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/set" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
namespace std
{


  template <class _Key, class _Compare = less<_Key>,
     class _Alloc = allocator<_Key> >
    class multiset;

  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator==(const multiset<_Key,_Compare,_Alloc>& __x,
        const multiset<_Key,_Compare,_Alloc>& __y);

  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator<(const multiset<_Key,_Compare,_Alloc>& __x,
       const multiset<_Key,_Compare,_Alloc>& __y);
# 104 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
  template <class _Key, class _Compare, class _Alloc>
    class multiset
    {

     
     


    public:

      typedef _Key key_type;
      typedef _Key value_type;
      typedef _Compare key_compare;
      typedef _Compare value_compare;

    private:

      typedef _Rb_tree<key_type, value_type,
         _Identity<value_type>, key_compare, _Alloc> _Rep_type;

      _Rep_type _M_t;

    public:
      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;



      typedef typename _Rep_type::const_iterator iterator;
      typedef typename _Rep_type::const_iterator const_iterator;
      typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
      typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
      typedef typename _Rep_type::size_type size_type;
      typedef typename _Rep_type::difference_type difference_type;
      typedef typename _Rep_type::allocator_type allocator_type;






      multiset()
      : _M_t(_Compare(), allocator_type()) { }

      explicit
      multiset(const _Compare& __comp,
        const allocator_type& __a = allocator_type())
      : _M_t(__comp, __a) { }
# 164 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      template <class _InputIterator>
        multiset(_InputIterator __first, _InputIterator __last)
 : _M_t(_Compare(), allocator_type())
        { _M_t.insert_equal(__first, __last); }
# 180 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      template <class _InputIterator>
        multiset(_InputIterator __first, _InputIterator __last,
   const _Compare& __comp,
   const allocator_type& __a = allocator_type())
 : _M_t(__comp, __a)
        { _M_t.insert_equal(__first, __last); }
# 194 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      multiset(const multiset<_Key,_Compare,_Alloc>& __x)
      : _M_t(__x._M_t) { }
# 204 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      multiset<_Key,_Compare,_Alloc>&
      operator=(const multiset<_Key,_Compare,_Alloc>& __x)
      {
 _M_t = __x._M_t;
 return *this;
      }




      key_compare
      key_comp() const
      { return _M_t.key_comp(); }

      value_compare
      value_comp() const
      { return _M_t.key_comp(); }

      allocator_type
      get_allocator() const
      { return _M_t.get_allocator(); }






      iterator
      begin() const
      { return _M_t.begin(); }






      iterator
      end() const
      { return _M_t.end(); }






      reverse_iterator
      rbegin() const
      { return _M_t.rbegin(); }






      reverse_iterator
      rend() const
      { return _M_t.rend(); }


      bool
      empty() const
      { return _M_t.empty(); }


      size_type
      size() const
      { return _M_t.size(); }


      size_type
      max_size() const
      { return _M_t.max_size(); }
# 288 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      void
      swap(multiset<_Key,_Compare,_Alloc>& __x)
      { _M_t.swap(__x._M_t); }
# 304 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      iterator
      insert(const value_type& __x)
      { return _M_t.insert_equal(__x); }
# 328 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      iterator
      insert(iterator __position, const value_type& __x)
      {
 typedef typename _Rep_type::iterator _Rep_iterator;
 return _M_t.insert_equal((_Rep_iterator&)__position, __x);
      }
# 343 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      template <class _InputIterator>
        void
        insert(_InputIterator __first, _InputIterator __last)
        { _M_t.insert_equal(__first, __last); }
# 358 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      void
      erase(iterator __position)
      {
 typedef typename _Rep_type::iterator _Rep_iterator;
 _M_t.erase((_Rep_iterator&)__position);
      }
# 376 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      size_type
      erase(const key_type& __x)
      { return _M_t.erase(__x); }
# 391 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      void
      erase(iterator __first, iterator __last)
      {
 typedef typename _Rep_type::iterator _Rep_iterator;
 _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
      }







      void
      clear()
      { _M_t.clear(); }
# 415 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      size_type
      count(const key_type& __x) const
      { return _M_t.count(__x); }
# 433 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      iterator
      find(const key_type& __x)
      { return _M_t.find(__x); }

      const_iterator
      find(const key_type& __x) const
      { return _M_t.find(__x); }
# 454 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      iterator
      lower_bound(const key_type& __x)
      { return _M_t.lower_bound(__x); }

      const_iterator
      lower_bound(const key_type& __x) const
      { return _M_t.lower_bound(__x); }
# 470 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      iterator
      upper_bound(const key_type& __x)
      { return _M_t.upper_bound(__x); }

      const_iterator
      upper_bound(const key_type& __x) const
      { return _M_t.upper_bound(__x); }
# 495 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
      pair<iterator,iterator>
      equal_range(const key_type& __x)
      { return _M_t.equal_range(__x); }

      pair<const_iterator,const_iterator>
      equal_range(const key_type& __x) const
      { return _M_t.equal_range(__x); }

      template <class _K1, class _C1, class _A1>
        friend bool
        operator== (const multiset<_K1,_C1,_A1>&,
      const multiset<_K1,_C1,_A1>&);

      template <class _K1, class _C1, class _A1>
        friend bool
        operator< (const multiset<_K1,_C1,_A1>&,
     const multiset<_K1,_C1,_A1>&);
    };
# 525 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator==(const multiset<_Key,_Compare,_Alloc>& __x,
        const multiset<_Key,_Compare,_Alloc>& __y)
    { return __x._M_t == __y._M_t; }
# 542 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h" 3
  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator<(const multiset<_Key,_Compare,_Alloc>& __x,
       const multiset<_Key,_Compare,_Alloc>& __y)
    { return __x._M_t < __y._M_t; }


  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
        const multiset<_Key,_Compare,_Alloc>& __y)
    { return !(__x == __y); }


  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator>(const multiset<_Key,_Compare,_Alloc>& __x,
       const multiset<_Key,_Compare,_Alloc>& __y)
    { return __y < __x; }


  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator<=(const multiset<_Key,_Compare,_Alloc>& __x,
        const multiset<_Key,_Compare,_Alloc>& __y)
    { return !(__y < __x); }


  template <class _Key, class _Compare, class _Alloc>
    inline bool
    operator>=(const multiset<_Key,_Compare,_Alloc>& __x,
        const multiset<_Key,_Compare,_Alloc>& __y)
    { return !(__x < __y); }


  template <class _Key, class _Compare, class _Alloc>
    inline void
    swap(multiset<_Key,_Compare,_Alloc>& __x,
  multiset<_Key,_Compare,_Alloc>& __y)
    { __x.swap(__y); }

}
# 69 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/set" 2 3
# 35 "Float_defs.hh" 2
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 1 3
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 3
       
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 3




# 1 "/usr/include/math.h" 1 3 4
# 29 "/usr/include/math.h" 3 4
extern "C" {



# 1 "/usr/include/bits/huge_val.h" 1 3 4
# 34 "/usr/include/math.h" 2 3 4

# 1 "/usr/include/bits/huge_valf.h" 1 3 4
# 36 "/usr/include/math.h" 2 3 4
# 1 "/usr/include/bits/huge_vall.h" 1 3 4
# 37 "/usr/include/math.h" 2 3 4


# 1 "/usr/include/bits/inf.h" 1 3 4
# 40 "/usr/include/math.h" 2 3 4


# 1 "/usr/include/bits/nan.h" 1 3 4
# 43 "/usr/include/math.h" 2 3 4



# 1 "/usr/include/bits/mathdef.h" 1 3 4
# 36 "/usr/include/bits/mathdef.h" 3 4
typedef long double float_t;

typedef long double double_t;
# 47 "/usr/include/math.h" 2 3 4
# 70 "/usr/include/math.h" 3 4
# 1 "/usr/include/bits/mathcalls.h" 1 3 4
# 53 "/usr/include/bits/mathcalls.h" 3 4


extern double acos (double __x) throw (); extern double __acos (double __x) throw ();

extern double asin (double __x) throw (); extern double __asin (double __x) throw ();

extern double atan (double __x) throw (); extern double __atan (double __x) throw ();

extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();


extern double cos (double __x) throw (); extern double __cos (double __x) throw ();

extern double sin (double __x) throw (); extern double __sin (double __x) throw ();

extern double tan (double __x) throw (); extern double __tan (double __x) throw ();




extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();

extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();

extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();




extern void sincos (double __x, double *__sinx, double *__cosx) throw (); extern void __sincos (double __x, double *__sinx, double *__cosx) throw ();






extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();

extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();

extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();







extern double exp (double __x) throw (); extern double __exp (double __x) throw ();


extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();


extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();


extern double log (double __x) throw (); extern double __log (double __x) throw ();


extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();


extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ();




extern double exp10 (double __x) throw (); extern double __exp10 (double __x) throw ();

extern double pow10 (double __x) throw (); extern double __pow10 (double __x) throw ();





extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();


extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();


extern double logb (double __x) throw (); extern double __logb (double __x) throw ();






extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();


extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();








extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();


extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();





extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();






extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();








extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));


extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));


extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));


extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();




extern int __isinf (double __value) throw () __attribute__ ((__const__));


extern int __finite (double __value) throw () __attribute__ ((__const__));





extern int isinf (double __value) throw () __attribute__ ((__const__));


extern int finite (double __value) throw () __attribute__ ((__const__));


extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();



extern double significand (double __x) throw (); extern double __significand (double __x) throw ();





extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));






extern double nan (__const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (__const char *__tagb) throw () __attribute__ ((__const__));





extern int __isnan (double __value) throw () __attribute__ ((__const__));



extern int isnan (double __value) throw () __attribute__ ((__const__));


extern double j0 (double) throw (); extern double __j0 (double) throw ();
extern double j1 (double) throw (); extern double __j1 (double) throw ();
extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
extern double y0 (double) throw (); extern double __y0 (double) throw ();
extern double y1 (double) throw (); extern double __y1 (double) throw ();
extern double yn (int, double) throw (); extern double __yn (int, double) throw ();






extern double erf (double) throw (); extern double __erf (double) throw ();
extern double erfc (double) throw (); extern double __erfc (double) throw ();
extern double lgamma (double) throw (); extern double __lgamma (double) throw ();






extern double tgamma (double) throw (); extern double __tgamma (double) throw ();





extern double gamma (double) throw (); extern double __gamma (double) throw ();






extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();







extern double rint (double __x) throw (); extern double __rint (double __x) throw ();


extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));

extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));



extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();



extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();



extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();




extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();



extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();



extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));



extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));




extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();






extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();



extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();



extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();


extern double fmax (double __x, double __y) throw (); extern double __fmax (double __x, double __y) throw ();


extern double fmin (double __x, double __y) throw (); extern double __fmin (double __x, double __y) throw ();



extern int __fpclassify (double __value) throw ()
     __attribute__ ((__const__));


extern int __signbit (double __value) throw ()
     __attribute__ ((__const__));



extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();








extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
# 71 "/usr/include/math.h" 2 3 4
# 93 "/usr/include/math.h" 3 4
# 1 "/usr/include/bits/mathcalls.h" 1 3 4
# 53 "/usr/include/bits/mathcalls.h" 3 4


extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();

extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();

extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();

extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();


extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();

extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();

extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();




extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();

extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();

extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();




extern void sincosf (float __x, float *__sinx, float *__cosx) throw (); extern void __sincosf (float __x, float *__sinx, float *__cosx) throw ();






extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();

extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();

extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();







extern float expf (float __x) throw (); extern float __expf (float __x) throw ();


extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();


extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();


extern float logf (float __x) throw (); extern float __logf (float __x) throw ();


extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();


extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ();




extern float exp10f (float __x) throw (); extern float __exp10f (float __x) throw ();

extern float pow10f (float __x) throw (); extern float __pow10f (float __x) throw ();





extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();


extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();


extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();






extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();


extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();








extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();


extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();





extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();






extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();








extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));


extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));


extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));


extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();




extern int __isinff (float __value) throw () __attribute__ ((__const__));


extern int __finitef (float __value) throw () __attribute__ ((__const__));





extern int isinff (float __value) throw () __attribute__ ((__const__));


extern int finitef (float __value) throw () __attribute__ ((__const__));


extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();



extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();





extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));






extern float nanf (__const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) throw () __attribute__ ((__const__));





extern int __isnanf (float __value) throw () __attribute__ ((__const__));



extern int isnanf (float __value) throw () __attribute__ ((__const__));


extern float j0f (float) throw (); extern float __j0f (float) throw ();
extern float j1f (float) throw (); extern float __j1f (float) throw ();
extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
extern float y0f (float) throw (); extern float __y0f (float) throw ();
extern float y1f (float) throw (); extern float __y1f (float) throw ();
extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();






extern float erff (float) throw (); extern float __erff (float) throw ();
extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();






extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();





extern float gammaf (float) throw (); extern float __gammaf (float) throw ();






extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();







extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();


extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));

extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));



extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();



extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();



extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();




extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();



extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();



extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));



extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));




extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();






extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();



extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();



extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();


extern float fmaxf (float __x, float __y) throw (); extern float __fmaxf (float __x, float __y) throw ();


extern float fminf (float __x, float __y) throw (); extern float __fminf (float __x, float __y) throw ();



extern int __fpclassifyf (float __value) throw ()
     __attribute__ ((__const__));


extern int __signbitf (float __value) throw ()
     __attribute__ ((__const__));



extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();








extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
# 94 "/usr/include/math.h" 2 3 4
# 114 "/usr/include/math.h" 3 4
# 1 "/usr/include/bits/mathcalls.h" 1 3 4
# 53 "/usr/include/bits/mathcalls.h" 3 4


extern long double acosl (long double __x) throw (); extern long double __acosl (long double __x) throw ();

extern long double asinl (long double __x) throw (); extern long double __asinl (long double __x) throw ();

extern long double atanl (long double __x) throw (); extern long double __atanl (long double __x) throw ();

extern long double atan2l (long double __y, long double __x) throw (); extern long double __atan2l (long double __y, long double __x) throw ();


extern long double cosl (long double __x) throw (); extern long double __cosl (long double __x) throw ();

extern long double sinl (long double __x) throw (); extern long double __sinl (long double __x) throw ();

extern long double tanl (long double __x) throw (); extern long double __tanl (long double __x) throw ();




extern long double coshl (long double __x) throw (); extern long double __coshl (long double __x) throw ();

extern long double sinhl (long double __x) throw (); extern long double __sinhl (long double __x) throw ();

extern long double tanhl (long double __x) throw (); extern long double __tanhl (long double __x) throw ();




extern void sincosl (long double __x, long double *__sinx, long double *__cosx) throw (); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) throw ();






extern long double acoshl (long double __x) throw (); extern long double __acoshl (long double __x) throw ();

extern long double asinhl (long double __x) throw (); extern long double __asinhl (long double __x) throw ();

extern long double atanhl (long double __x) throw (); extern long double __atanhl (long double __x) throw ();







extern long double expl (long double __x) throw (); extern long double __expl (long double __x) throw ();


extern long double frexpl (long double __x, int *__exponent) throw (); extern long double __frexpl (long double __x, int *__exponent) throw ();


extern long double ldexpl (long double __x, int __exponent) throw (); extern long double __ldexpl (long double __x, int __exponent) throw ();


extern long double logl (long double __x) throw (); extern long double __logl (long double __x) throw ();


extern long double log10l (long double __x) throw (); extern long double __log10l (long double __x) throw ();


extern long double modfl (long double __x, long double *__iptr) throw (); extern long double __modfl (long double __x, long double *__iptr) throw ();




extern long double exp10l (long double __x) throw (); extern long double __exp10l (long double __x) throw ();

extern long double pow10l (long double __x) throw (); extern long double __pow10l (long double __x) throw ();





extern long double expm1l (long double __x) throw (); extern long double __expm1l (long double __x) throw ();


extern long double log1pl (long double __x) throw (); extern long double __log1pl (long double __x) throw ();


extern long double logbl (long double __x) throw (); extern long double __logbl (long double __x) throw ();






extern long double exp2l (long double __x) throw (); extern long double __exp2l (long double __x) throw ();


extern long double log2l (long double __x) throw (); extern long double __log2l (long double __x) throw ();








extern long double powl (long double __x, long double __y) throw (); extern long double __powl (long double __x, long double __y) throw ();


extern long double sqrtl (long double __x) throw (); extern long double __sqrtl (long double __x) throw ();





extern long double hypotl (long double __x, long double __y) throw (); extern long double __hypotl (long double __x, long double __y) throw ();






extern long double cbrtl (long double __x) throw (); extern long double __cbrtl (long double __x) throw ();








extern long double ceill (long double __x) throw () __attribute__ ((__const__)); extern long double __ceill (long double __x) throw () __attribute__ ((__const__));


extern long double fabsl (long double __x) throw () __attribute__ ((__const__)); extern long double __fabsl (long double __x) throw () __attribute__ ((__const__));


extern long double floorl (long double __x) throw () __attribute__ ((__const__)); extern long double __floorl (long double __x) throw () __attribute__ ((__const__));


extern long double fmodl (long double __x, long double __y) throw (); extern long double __fmodl (long double __x, long double __y) throw ();




extern int __isinfl (long double __value) throw () __attribute__ ((__const__));


extern int __finitel (long double __value) throw () __attribute__ ((__const__));





extern int isinfl (long double __value) throw () __attribute__ ((__const__));


extern int finitel (long double __value) throw () __attribute__ ((__const__));


extern long double dreml (long double __x, long double __y) throw (); extern long double __dreml (long double __x, long double __y) throw ();



extern long double significandl (long double __x) throw (); extern long double __significandl (long double __x) throw ();





extern long double copysignl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) throw () __attribute__ ((__const__));






extern long double nanl (__const char *__tagb) throw () __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) throw () __attribute__ ((__const__));





extern int __isnanl (long double __value) throw () __attribute__ ((__const__));



extern int isnanl (long double __value) throw () __attribute__ ((__const__));


extern long double j0l (long double) throw (); extern long double __j0l (long double) throw ();
extern long double j1l (long double) throw (); extern long double __j1l (long double) throw ();
extern long double jnl (int, long double) throw (); extern long double __jnl (int, long double) throw ();
extern long double y0l (long double) throw (); extern long double __y0l (long double) throw ();
extern long double y1l (long double) throw (); extern long double __y1l (long double) throw ();
extern long double ynl (int, long double) throw (); extern long double __ynl (int, long double) throw ();






extern long double erfl (long double) throw (); extern long double __erfl (long double) throw ();
extern long double erfcl (long double) throw (); extern long double __erfcl (long double) throw ();
extern long double lgammal (long double) throw (); extern long double __lgammal (long double) throw ();






extern long double tgammal (long double) throw (); extern long double __tgammal (long double) throw ();





extern long double gammal (long double) throw (); extern long double __gammal (long double) throw ();






extern long double lgammal_r (long double, int *__signgamp) throw (); extern long double __lgammal_r (long double, int *__signgamp) throw ();







extern long double rintl (long double __x) throw (); extern long double __rintl (long double __x) throw ();


extern long double nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__));

extern long double nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__));



extern long double remainderl (long double __x, long double __y) throw (); extern long double __remainderl (long double __x, long double __y) throw ();



extern long double scalbnl (long double __x, int __n) throw (); extern long double __scalbnl (long double __x, int __n) throw ();



extern int ilogbl (long double __x) throw (); extern int __ilogbl (long double __x) throw ();




extern long double scalblnl (long double __x, long int __n) throw (); extern long double __scalblnl (long double __x, long int __n) throw ();



extern long double nearbyintl (long double __x) throw (); extern long double __nearbyintl (long double __x) throw ();



extern long double roundl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundl (long double __x) throw () __attribute__ ((__const__));



extern long double truncl (long double __x) throw () __attribute__ ((__const__)); extern long double __truncl (long double __x) throw () __attribute__ ((__const__));




extern long double remquol (long double __x, long double __y, int *__quo) throw (); extern long double __remquol (long double __x, long double __y, int *__quo) throw ();






extern long int lrintl (long double __x) throw (); extern long int __lrintl (long double __x) throw ();
extern long long int llrintl (long double __x) throw (); extern long long int __llrintl (long double __x) throw ();



extern long int lroundl (long double __x) throw (); extern long int __lroundl (long double __x) throw ();
extern long long int llroundl (long double __x) throw (); extern long long int __llroundl (long double __x) throw ();



extern long double fdiml (long double __x, long double __y) throw (); extern long double __fdiml (long double __x, long double __y) throw ();


extern long double fmaxl (long double __x, long double __y) throw (); extern long double __fmaxl (long double __x, long double __y) throw ();


extern long double fminl (long double __x, long double __y) throw (); extern long double __fminl (long double __x, long double __y) throw ();



extern int __fpclassifyl (long double __value) throw ()
     __attribute__ ((__const__));


extern int __signbitl (long double __value) throw ()
     __attribute__ ((__const__));



extern long double fmal (long double __x, long double __y, long double __z) throw (); extern long double __fmal (long double __x, long double __y, long double __z) throw ();








extern long double scalbl (long double __x, long double __n) throw (); extern long double __scalbl (long double __x, long double __n) throw ();
# 115 "/usr/include/math.h" 2 3 4
# 130 "/usr/include/math.h" 3 4
extern int signgam;
# 171 "/usr/include/math.h" 3 4
enum
  {
    FP_NAN,

    FP_INFINITE,

    FP_ZERO,

    FP_SUBNORMAL,

    FP_NORMAL

  };
# 257 "/usr/include/math.h" 3 4
typedef enum
{
  _IEEE_ = -1,
  _SVID_,
  _XOPEN_,
  _POSIX_,
  _ISOC_
} _LIB_VERSION_TYPE;




extern _LIB_VERSION_TYPE _LIB_VERSION;
# 280 "/usr/include/math.h" 3 4
struct __exception



  {
    int type;
    char *name;
    double arg1;
    double arg2;
    double retval;
  };


extern int matherr (struct __exception *__exc) throw ();
# 382 "/usr/include/math.h" 3 4
# 1 "/usr/include/bits/mathinline.h" 1 3 4
# 127 "/usr/include/bits/mathinline.h" 3 4
__inline int
__signbitf (float __x) throw ()
{
  __extension__ union { float __f; int __i; } __u = { __f: __x };
  return __u.__i < 0;
}
__inline int
__signbit (double __x) throw ()
{
  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
  return __u.__i[1] < 0;
}
__inline int
__signbitl (long double __x) throw ()
{
  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
  return (__u.__i[2] & 0x8000) != 0;
}
# 291 "/usr/include/bits/mathinline.h" 3 4
__inline double __sgn (double) throw (); __inline double __sgn (double __x) throw () { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } __inline float __sgnf (float) throw (); __inline float __sgnf (float __x) throw () { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } __inline long double __sgnl (long double) throw (); __inline long double __sgnl (long double __x) throw () { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); }
# 433 "/usr/include/bits/mathinline.h" 3 4
__inline long double __atan2l (long double __y, long double __x) throw () { return __builtin_atan2l (__y, __x); }
# 473 "/usr/include/bits/mathinline.h" 3 4
__inline double fabs (double __x) throw () { return __builtin_fabs (__x); }

__inline float fabsf (float __x) throw () { return __builtin_fabsf (__x); }
__inline long double fabsl (long double __x) throw () { return __builtin_fabsl (__x); }

__inline long double __fabsl (long double __x) throw () { return __builtin_fabsl (__x); }
# 506 "/usr/include/bits/mathinline.h" 3 4
__inline long double __sgn1l (long double) throw (); __inline long double __sgn1l (long double __x) throw () { __extension__ union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x }; __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; __n.__xi[1] = 0x80000000; __n.__xi[0] = 0; return __n.__xld; }
# 530 "/usr/include/bits/mathinline.h" 3 4
__inline double floor (double __x) throw () { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } __inline float floorf (float __x) throw () { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } __inline long double floorl (long double __x) throw () { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; }
# 541 "/usr/include/bits/mathinline.h" 3 4
__inline double ceil (double __x) throw () { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } __inline float ceilf (float __x) throw () { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } __inline long double ceill (long double __x) throw () { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; }
# 653 "/usr/include/bits/mathinline.h" 3 4
__inline long int
lrintf (float __x) throw ()
{
  long int __lrintres; __asm__ __volatile__ ("fistpl %0" : "=m" (__lrintres) : "t" (__x) : "st"); return __lrintres;
}
__inline long int
lrint (double __x) throw ()
{
  long int __lrintres; __asm__ __volatile__ ("fistpl %0" : "=m" (__lrintres) : "t" (__x) : "st"); return __lrintres;
}
__inline long int
lrintl (long double __x) throw ()
{
  long int __lrintres; __asm__ __volatile__ ("fistpl %0" : "=m" (__lrintres) : "t" (__x) : "st"); return __lrintres;
}
# 676 "/usr/include/bits/mathinline.h" 3 4
__inline long long int
llrintf (float __x) throw ()
{
  long long int __llrintres; __asm__ __volatile__ ("fistpll %0" : "=m" (__llrintres) : "t" (__x) : "st"); return __llrintres;
}
__inline long long int
llrint (double __x) throw ()
{
  long long int __llrintres; __asm__ __volatile__ ("fistpll %0" : "=m" (__llrintres) : "t" (__x) : "st"); return __llrintres;
}
__inline long long int
llrintl (long double __x) throw ()
{
  long long int __llrintres; __asm__ __volatile__ ("fistpll %0" : "=m" (__llrintres) : "t" (__x) : "st"); return __llrintres;
}
# 713 "/usr/include/bits/mathinline.h" 3 4
__inline int
__finite (double __x) throw ()
{
  return (__extension__
   (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
      | 0x800fffffu) + 1) >> 31));
}
# 383 "/usr/include/math.h" 2 3 4
# 438 "/usr/include/math.h" 3 4
}
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 2 3
# 81 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 3
namespace std
{


  template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int);

  inline double
  abs(double __x)
  { return __builtin_fabs(__x); }

  inline float
  abs(float __x)
  { return __builtin_fabsf(__x); }

  inline long double
  abs(long double __x)
  { return __builtin_fabsl(__x); }

  using ::acos;

  inline float
  acos(float __x)
  { return __builtin_acosf(__x); }

  inline long double
  acos(long double __x)
  { return __builtin_acosl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    acos(_Tp __x)
    {
      return __builtin_acos(__x);
    }

  using ::asin;

  inline float
  asin(float __x)
  { return __builtin_asinf(__x); }

  inline long double
  asin(long double __x)
  { return __builtin_asinl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    asin(_Tp __x)
    { return __builtin_asin(__x); }

  using ::atan;

  inline float
  atan(float __x)
  { return __builtin_atanf(__x); }

  inline long double
  atan(long double __x)
  { return __builtin_atanl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    atan(_Tp __x)
    { return __builtin_atan(__x); }

  using ::atan2;

  inline float
  atan2(float __y, float __x)
  { return __builtin_atan2f(__y, __x); }

  inline long double
  atan2(long double __y, long double __x)
  { return __builtin_atan2l(__y, __x); }

  template<typename _Tp, typename _Up>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type
                                        && __is_integer<_Up>::_M_type>::_M_type
    atan2(_Tp __y, _Up __x)
    { return __builtin_atan2(__y, __x); }

  using ::ceil;

  inline float
  ceil(float __x)
  { return __builtin_ceilf(__x); }

  inline long double
  ceil(long double __x)
  { return __builtin_ceill(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    ceil(_Tp __x)
    { return __builtin_ceil(__x); }

  using ::cos;

  inline float
  cos(float __x)
  { return __builtin_cosf(__x); }

  inline long double
  cos(long double __x)
  { return __builtin_cosl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    cos(_Tp __x)
    { return __builtin_cos(__x); }

  using ::cosh;

  inline float
  cosh(float __x)
  { return __builtin_coshf(__x); }

  inline long double
  cosh(long double __x)
  { return __builtin_coshl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    cosh(_Tp __x)
    { return __builtin_cosh(__x); }

  using ::exp;

  inline float
  exp(float __x)
  { return __builtin_expf(__x); }

  inline long double
  exp(long double __x)
  { return __builtin_expl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    exp(_Tp __x)
    { return __builtin_exp(__x); }

  using ::fabs;

  inline float
  fabs(float __x)
  { return __builtin_fabsf(__x); }

  inline long double
  fabs(long double __x)
  { return __builtin_fabsl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    fabs(_Tp __x)
    { return __builtin_fabs(__x); }

  using ::floor;

  inline float
  floor(float __x)
  { return __builtin_floorf(__x); }

  inline long double
  floor(long double __x)
  { return __builtin_floorl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    floor(_Tp __x)
    { return __builtin_floor(__x); }

  using ::fmod;

  inline float
  fmod(float __x, float __y)
  { return __builtin_fmodf(__x, __y); }

  inline long double
  fmod(long double __x, long double __y)
  { return __builtin_fmodl(__x, __y); }

  using ::frexp;

  inline float
  frexp(float __x, int* __exp)
  { return __builtin_frexpf(__x, __exp); }

  inline long double
  frexp(long double __x, int* __exp)
  { return __builtin_frexpl(__x, __exp); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    frexp(_Tp __x, int* __exp)
    { return __builtin_frexp(__x, __exp); }

  using ::ldexp;

  inline float
  ldexp(float __x, int __exp)
  { return __builtin_ldexpf(__x, __exp); }

  inline long double
  ldexp(long double __x, int __exp)
  { return __builtin_ldexpl(__x, __exp); }

  template<typename _Tp>
  inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
  ldexp(_Tp __x, int __exp)
  { return __builtin_ldexp(__x, __exp); }

  using ::log;

  inline float
  log(float __x)
  { return __builtin_logf(__x); }

  inline long double
  log(long double __x)
  { return __builtin_logl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    log(_Tp __x)
    { return __builtin_log(__x); }

  using ::log10;

  inline float
  log10(float __x)
  { return __builtin_log10f(__x); }

  inline long double
  log10(long double __x)
  { return __builtin_log10l(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    log10(_Tp __x)
    { return __builtin_log10(__x); }

  using ::modf;

  inline float
  modf(float __x, float* __iptr)
  { return __builtin_modff(__x, __iptr); }

  inline long double
  modf(long double __x, long double* __iptr)
  { return __builtin_modfl(__x, __iptr); }

  template<typename _Tp>
    inline _Tp
    __pow_helper(_Tp __x, int __n)
    {
      return __n < 0
        ? _Tp(1)/__cmath_power(__x, -__n)
        : __cmath_power(__x, __n);
    }

  using ::pow;

  inline float
  pow(float __x, float __y)
  { return __builtin_powf(__x, __y); }

  inline long double
  pow(long double __x, long double __y)
  { return __builtin_powl(__x, __y); }

  inline double
  pow(double __x, int __i)
  { return __pow_helper(__x, __i); }

  inline float
  pow(float __x, int __n)
  { return __pow_helper(__x, __n); }

  inline long double
  pow(long double __x, int __n)
  { return __pow_helper(__x, __n); }

  using ::sin;

  inline float
  sin(float __x)
  { return __builtin_sinf(__x); }

  inline long double
  sin(long double __x)
  { return __builtin_sinl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    sin(_Tp __x)
    { return __builtin_sin(__x); }

  using ::sinh;

  inline float
  sinh(float __x)
  { return __builtin_sinhf(__x); }

  inline long double
  sinh(long double __x)
  { return __builtin_sinhl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    sinh(_Tp __x)
    { return __builtin_sinh(__x); }

  using ::sqrt;

  inline float
  sqrt(float __x)
  { return __builtin_sqrtf(__x); }

  inline long double
  sqrt(long double __x)
  { return __builtin_sqrtl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    sqrt(_Tp __x)
    { return __builtin_sqrt(__x); }

  using ::tan;

  inline float
  tan(float __x)
  { return __builtin_tanf(__x); }

  inline long double
  tan(long double __x)
  { return __builtin_tanl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    tan(_Tp __x)
    { return __builtin_tan(__x); }

  using ::tanh;

  inline float
  tanh(float __x)
  { return __builtin_tanhf(__x); }

  inline long double
  tanh(long double __x)
  { return __builtin_tanhl(__x); }

  template<typename _Tp>
    inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
    tanh(_Tp __x)
    { return __builtin_tanh(__x); }
}






namespace __gnu_cxx
{
  template<typename _Tp>
    inline int
    __capture_fpclassify(_Tp __f) { return (sizeof (__f) == sizeof (float) ? __fpclassifyf (__f) : sizeof (__f) == sizeof (double) ? __fpclassify (__f) : __fpclassifyl (__f)); }

  template<typename _Tp>
    inline int
    __capture_isfinite(_Tp __f) { return (sizeof (__f) == sizeof (float) ? __finitef (__f) : sizeof (__f) == sizeof (double) ? __finite (__f) : __finitel (__f)); }

  template<typename _Tp>
    inline int
    __capture_isinf(_Tp __f) { return (sizeof (__f) == sizeof (float) ? __isinff (__f) : sizeof (__f) == sizeof (double) ? __isinf (__f) : __isinfl (__f)); }

  template<typename _Tp>
    inline int
    __capture_isnan(_Tp __f) { return (sizeof (__f) == sizeof (float) ? __isnanf (__f) : sizeof (__f) == sizeof (double) ? __isnan (__f) : __isnanl (__f)); }

  template<typename _Tp>
    inline int
    __capture_isnormal(_Tp __f) { return ((sizeof (__f) == sizeof (float) ? __fpclassifyf (__f) : sizeof (__f) == sizeof (double) ? __fpclassify (__f) : __fpclassifyl (__f)) == FP_NORMAL); }

  template<typename _Tp>
    inline int
    __capture_signbit(_Tp __f) { return (sizeof (__f) == sizeof (float) ? __signbitf (__f) : sizeof (__f) == sizeof (double) ? __signbit (__f) : __signbitl (__f)); }

  template<typename _Tp>
    inline int
    __capture_isgreater(_Tp __f1, _Tp __f2)
    { return __builtin_isgreater(__f1, __f2); }

  template<typename _Tp>
    inline int
    __capture_isgreaterequal(_Tp __f1, _Tp __f2)
    { return __builtin_isgreaterequal(__f1, __f2); }

  template<typename _Tp>
    inline int
    __capture_isless(_Tp __f1, _Tp __f2) { return __builtin_isless(__f1, __f2); }

  template<typename _Tp>
    inline int
    __capture_islessequal(_Tp __f1, _Tp __f2)
    { return __builtin_islessequal(__f1, __f2); }

  template<typename _Tp>
    inline int
    __capture_islessgreater(_Tp __f1, _Tp __f2)
    { return __builtin_islessgreater(__f1, __f2); }

  template<typename _Tp>
    inline int
    __capture_isunordered(_Tp __f1, _Tp __f2)
    { return __builtin_isunordered(__f1, __f2); }
}
# 518 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 3
namespace __gnu_cxx
{
  template<typename _Tp>
    inline int
    fpclassify(_Tp __f) { return __capture_fpclassify(__f); }

  template<typename _Tp>
    inline int
    isfinite(_Tp __f) { return __capture_isfinite(__f); }

  template<typename _Tp>
    inline int
    isinf(_Tp __f) { return __capture_isinf(__f); }

  template<typename _Tp>
    inline int
    isnan(_Tp __f) { return __capture_isnan(__f); }

  template<typename _Tp>
    inline int
    isnormal(_Tp __f) { return __capture_isnormal(__f); }

  template<typename _Tp>
    inline int
    signbit(_Tp __f) { return __capture_signbit(__f); }

  template<typename _Tp>
    inline int
    isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); }

  template<typename _Tp>
    inline int
    isgreaterequal(_Tp __f1, _Tp __f2)
    { return __capture_isgreaterequal(__f1, __f2); }

  template<typename _Tp>
    inline int
    isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); }

  template<typename _Tp>
    inline int
    islessequal(_Tp __f1, _Tp __f2)
    { return __capture_islessequal(__f1, __f2); }

  template<typename _Tp>
    inline int
    islessgreater(_Tp __f1, _Tp __f2)
    { return __capture_islessgreater(__f1, __f2); }

  template<typename _Tp>
    inline int
    isunordered(_Tp __f1, _Tp __f2)
    { return __capture_isunordered(__f1, __f2); }
}

namespace std
{
  using __gnu_cxx::fpclassify;
  using __gnu_cxx::isfinite;
  using __gnu_cxx::isinf;
  using __gnu_cxx::isnan;
  using __gnu_cxx::isnormal;
  using __gnu_cxx::signbit;
  using __gnu_cxx::isgreater;
  using __gnu_cxx::isgreaterequal;
  using __gnu_cxx::isless;
  using __gnu_cxx::islessequal;
  using __gnu_cxx::islessgreater;
  using __gnu_cxx::isunordered;
}




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/cmath.tcc" 1 3
# 35 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/cmath.tcc" 3
namespace std
{
  template<typename _Tp>
    inline _Tp
    __cmath_power(_Tp __x, unsigned int __n)
    {
      _Tp __y = __n % 2 ? __x : 1;

      while (__n >>= 1)
        {
          __x = __x * __x;
          if (__n % 2)
            __y = __y * __x;
        }

      return __y;
    }
}
# 593 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cmath" 2 3
# 36 "Float_defs.hh" 2
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/map" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/map" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/map" 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
namespace std
{
# 89 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
  template <typename _Key, typename _Tp, typename _Compare = less<_Key>,
            typename _Alloc = allocator<pair<const _Key, _Tp> > >
    class map
    {

     
     


    public:
      typedef _Key key_type;
      typedef _Tp mapped_type;
      typedef pair<const _Key, _Tp> value_type;
      typedef _Compare key_compare;

      class value_compare
      : public binary_function<value_type, value_type, bool>
      {
 friend class map<_Key,_Tp,_Compare,_Alloc>;
      protected:
 _Compare comp;

 value_compare(_Compare __c)
 : comp(__c) { }

      public:
 bool operator()(const value_type& __x, const value_type& __y) const
 { return comp(__x.first, __y.first); }
      };

    private:

      typedef _Rb_tree<key_type, value_type,
         _Select1st<value_type>, key_compare, _Alloc> _Rep_type;

      _Rep_type _M_t;

    public:


      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;
      typedef typename _Rep_type::allocator_type allocator_type;
      typedef typename _Rep_type::iterator iterator;
      typedef typename _Rep_type::const_iterator const_iterator;
      typedef typename _Rep_type::size_type size_type;
      typedef typename _Rep_type::difference_type difference_type;
      typedef typename _Rep_type::reverse_iterator reverse_iterator;
      typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;







      map()
      : _M_t(_Compare(), allocator_type()) { }





      explicit
      map(const _Compare& __comp, const allocator_type& __a = allocator_type())
      : _M_t(__comp, __a) { }
# 165 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      map(const map& __x)
      : _M_t(__x._M_t) { }
# 177 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      template <typename _InputIterator>
        map(_InputIterator __first, _InputIterator __last)
 : _M_t(_Compare(), allocator_type())
        { _M_t.insert_unique(__first, __last); }
# 193 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      template <typename _InputIterator>
        map(_InputIterator __first, _InputIterator __last,
     const _Compare& __comp, const allocator_type& __a = allocator_type())
 : _M_t(__comp, __a)
        { _M_t.insert_unique(__first, __last); }
# 215 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      map&
      operator=(const map& __x)
      {
 _M_t = __x._M_t;
 return *this;
      }


      allocator_type
      get_allocator() const
      { return _M_t.get_allocator(); }







      iterator
      begin()
      { return _M_t.begin(); }






      const_iterator
      begin() const
      { return _M_t.begin(); }





      iterator
      end()
      { return _M_t.end(); }






      const_iterator
      end() const
      { return _M_t.end(); }






      reverse_iterator
      rbegin()
      { return _M_t.rbegin(); }






      const_reverse_iterator
      rbegin() const
      { return _M_t.rbegin(); }






      reverse_iterator
      rend()
      { return _M_t.rend(); }






      const_reverse_iterator
      rend() const
      { return _M_t.rend(); }





      bool
      empty() const
      { return _M_t.empty(); }


      size_type
      size() const
      { return _M_t.size(); }


      size_type
      max_size() const
      { return _M_t.max_size(); }
# 330 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      mapped_type&
      operator[](const key_type& __k)
      {



 iterator __i = lower_bound(__k);

 if (__i == end() || key_comp()(__k, (*__i).first))
          __i = insert(__i, value_type(__k, mapped_type()));
 return (*__i).second;
      }
# 358 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      pair<iterator,bool>
      insert(const value_type& __x)
      { return _M_t.insert_unique(__x); }
# 382 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      iterator
      insert(iterator position, const value_type& __x)
      { return _M_t.insert_unique(position, __x); }
# 394 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      template <typename _InputIterator>
        void
        insert(_InputIterator __first, _InputIterator __last)
        { _M_t.insert_unique(__first, __last); }
# 408 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      void
      erase(iterator __position)
      { _M_t.erase(__position); }
# 423 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      size_type
      erase(const key_type& __x)
      { return _M_t.erase(__x); }
# 438 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      void
      erase(iterator __first, iterator __last)
      { _M_t.erase(__first, __last); }
# 453 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      void
      swap(map& __x)
      { _M_t.swap(__x._M_t); }







      void
      clear()
      { _M_t.clear(); }






      key_compare
      key_comp() const
      { return _M_t.key_comp(); }





      value_compare
      value_comp() const
      { return value_compare(_M_t.key_comp()); }
# 496 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      iterator
      find(const key_type& __x)
      { return _M_t.find(__x); }
# 511 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      const_iterator
      find(const key_type& __x) const
      { return _M_t.find(__x); }
# 523 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      size_type
      count(const key_type& __x) const
      { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
# 538 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      iterator
      lower_bound(const key_type& __x)
      { return _M_t.lower_bound(__x); }
# 553 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      const_iterator
      lower_bound(const key_type& __x) const
      { return _M_t.lower_bound(__x); }







      iterator
      upper_bound(const key_type& __x)
      { return _M_t.upper_bound(__x); }







      const_iterator
      upper_bound(const key_type& __x) const
      { return _M_t.upper_bound(__x); }
# 592 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      pair<iterator,iterator>
      equal_range(const key_type& __x)
      { return _M_t.equal_range(__x); }
# 611 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
      pair<const_iterator,const_iterator>
      equal_range(const key_type& __x) const
      { return _M_t.equal_range(__x); }

      template <typename _K1, typename _T1, typename _C1, typename _A1>
        friend bool
        operator== (const map<_K1,_T1,_C1,_A1>&,
      const map<_K1,_T1,_C1,_A1>&);

      template <typename _K1, typename _T1, typename _C1, typename _A1>
        friend bool
        operator< (const map<_K1,_T1,_C1,_A1>&,
     const map<_K1,_T1,_C1,_A1>&);
    };
# 636 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator==(const map<_Key,_Tp,_Compare,_Alloc>& __x,
               const map<_Key,_Tp,_Compare,_Alloc>& __y)
    { return __x._M_t == __y._M_t; }
# 653 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_map.h" 3
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x,
              const map<_Key,_Tp,_Compare,_Alloc>& __y)
    { return __x._M_t < __y._M_t; }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
               const map<_Key,_Tp,_Compare,_Alloc>& __y)
    { return !(__x == __y); }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator>(const map<_Key,_Tp,_Compare,_Alloc>& __x,
              const map<_Key,_Tp,_Compare,_Alloc>& __y)
    { return __y < __x; }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator<=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
               const map<_Key,_Tp,_Compare,_Alloc>& __y)
    { return !(__y < __x); }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator>=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
               const map<_Key,_Tp,_Compare,_Alloc>& __y)
    { return !(__x < __y); }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline void
    swap(map<_Key,_Tp,_Compare,_Alloc>& __x, map<_Key,_Tp,_Compare,_Alloc>& __y)
    { __x.swap(__y); }
}
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/map" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 1 3
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
namespace std
{


  template <typename _Key, typename _Tp,
            typename _Compare = less<_Key>,
            typename _Alloc = allocator<pair<const _Key, _Tp> > >
    class multimap;

  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
        const multimap<_Key,_Tp,_Compare,_Alloc>& __y);

  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
       const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
# 106 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    class multimap
    {

     
     


    public:
      typedef _Key key_type;
      typedef _Tp mapped_type;
      typedef pair<const _Key, _Tp> value_type;
      typedef _Compare key_compare;

      class value_compare
      : public binary_function<value_type, value_type, bool>
      {
 friend class multimap<_Key,_Tp,_Compare,_Alloc>;
      protected:
 _Compare comp;

 value_compare(_Compare __c)
 : comp(__c) { }

      public:
 bool operator()(const value_type& __x, const value_type& __y) const
 { return comp(__x.first, __y.first); }
      };

    private:

      typedef _Rb_tree<key_type, value_type,
         _Select1st<value_type>, key_compare, _Alloc> _Rep_type;

      _Rep_type _M_t;

    public:


      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;
      typedef typename _Rep_type::allocator_type allocator_type;
      typedef typename _Rep_type::iterator iterator;
      typedef typename _Rep_type::const_iterator const_iterator;
      typedef typename _Rep_type::size_type size_type;
      typedef typename _Rep_type::difference_type difference_type;
      typedef typename _Rep_type::reverse_iterator reverse_iterator;
      typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;






      multimap()
      : _M_t(_Compare(), allocator_type()) { }





      explicit
      multimap(const _Compare& __comp,
        const allocator_type& __a = allocator_type())
      : _M_t(__comp, __a) { }
# 181 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      multimap(const multimap& __x)
      : _M_t(__x._M_t) { }
# 193 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      template <typename _InputIterator>
        multimap(_InputIterator __first, _InputIterator __last)
 : _M_t(_Compare(), allocator_type())
        { _M_t.insert_equal(__first, __last); }
# 209 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      template <typename _InputIterator>
        multimap(_InputIterator __first, _InputIterator __last,
   const _Compare& __comp,
   const allocator_type& __a = allocator_type())
        : _M_t(__comp, __a)
        { _M_t.insert_equal(__first, __last); }
# 232 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      multimap&
      operator=(const multimap& __x)
      {
 _M_t = __x._M_t;
 return *this;
      }


      allocator_type
      get_allocator() const
      { return _M_t.get_allocator(); }







      iterator
      begin()
      { return _M_t.begin(); }






      const_iterator
      begin() const
      { return _M_t.begin(); }






      iterator
      end()
      { return _M_t.end(); }






      const_iterator
      end() const
      { return _M_t.end(); }






      reverse_iterator
      rbegin()
      { return _M_t.rbegin(); }






      const_reverse_iterator
      rbegin() const
      { return _M_t.rbegin(); }






      reverse_iterator
      rend()
      { return _M_t.rend(); }






      const_reverse_iterator
      rend() const
      { return _M_t.rend(); }



      bool
      empty() const
      { return _M_t.empty(); }


      size_type
      size() const
      { return _M_t.size(); }


      size_type
      max_size() const
      { return _M_t.max_size(); }
# 346 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      iterator
      insert(const value_type& __x)
      { return _M_t.insert_equal(__x); }
# 370 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      iterator
      insert(iterator __position, const value_type& __x)
      { return _M_t.insert_equal(__position, __x); }
# 382 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      template <typename _InputIterator>
        void
        insert(_InputIterator __first, _InputIterator __last)
        { _M_t.insert_equal(__first, __last); }
# 397 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      void
      erase(iterator __position)
      { _M_t.erase(__position); }
# 412 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      size_type
      erase(const key_type& __x)
      { return _M_t.erase(__x); }
# 427 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      void
      erase(iterator __first, iterator __last)
      { _M_t.erase(__first, __last); }
# 442 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      void
      swap(multimap& __x)
      { _M_t.swap(__x._M_t); }







      void
      clear()
      { _M_t.clear(); }






      key_compare
      key_comp() const
      { return _M_t.key_comp(); }





      value_compare
      value_comp() const
      { return value_compare(_M_t.key_comp()); }
# 485 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      iterator
      find(const key_type& __x)
      { return _M_t.find(__x); }
# 500 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      const_iterator
      find(const key_type& __x) const
      { return _M_t.find(__x); }






      size_type
      count(const key_type& __x) const
      { return _M_t.count(__x); }
# 524 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      iterator
      lower_bound(const key_type& __x)
      { return _M_t.lower_bound(__x); }
# 539 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      const_iterator
      lower_bound(const key_type& __x) const
      { return _M_t.lower_bound(__x); }







      iterator
      upper_bound(const key_type& __x)
      { return _M_t.upper_bound(__x); }







      const_iterator
      upper_bound(const key_type& __x) const
      { return _M_t.upper_bound(__x); }
# 576 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      pair<iterator,iterator>
      equal_range(const key_type& __x)
      { return _M_t.equal_range(__x); }
# 593 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
      pair<const_iterator,const_iterator>
      equal_range(const key_type& __x) const
      { return _M_t.equal_range(__x); }

      template <typename _K1, typename _T1, typename _C1, typename _A1>
        friend bool
        operator== (const multimap<_K1,_T1,_C1,_A1>&,
      const multimap<_K1,_T1,_C1,_A1>&);

      template <typename _K1, typename _T1, typename _C1, typename _A1>
        friend bool
        operator< (const multimap<_K1,_T1,_C1,_A1>&,
     const multimap<_K1,_T1,_C1,_A1>&);
  };
# 618 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
               const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { return __x._M_t == __y._M_t; }
# 635 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multimap.h" 3
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
              const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { return __x._M_t < __y._M_t; }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
               const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { return !(__x == __y); }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator>(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
              const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { return __y < __x; }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator<=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
               const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { return !(__y < __x); }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline bool
    operator>=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
               const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { return !(__x < __y); }


  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
    inline void
    swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
         multimap<_Key,_Tp,_Compare,_Alloc>& __y)
    { __x.swap(__y); }
}
# 69 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/map" 2 3
# 37 "Float_defs.hh" 2
# 45 "Float_defs.hh"
namespace Parma_Polyhedra_Library {




struct float_ieee754_half {
  uint16_t word;
  static const uint16_t SGN_MASK = 0x8000U;
  static const uint16_t EXP_MASK = 0xfc00U;
  static const uint16_t WRD_MAX = 0x7bffU;
  static const uint16_t POS_INF = 0x7c00U;
  static const uint16_t NEG_INF = 0xfc00U;
  static const uint16_t POS_ZERO = 0x0000U;
  static const uint16_t NEG_ZERO = 0x8000U;
  static const unsigned int BASE = 2;
  static const unsigned int EXPONENT_BITS = 5;
  static const unsigned int MANTISSA_BITS = 10;
  static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1;
  static const int EXPONENT_BIAS = EXPONENT_MAX;
  static const int EXPONENT_MIN = -EXPONENT_MAX + 1;
  static const int EXPONENT_MIN_DENORM = EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS);
  static const Floating_Point_Format floating_point_format = IEEE754_HALF;
  int inf_sign() const;
  bool is_nan() const;
  int zero_sign() const;
  bool sign_bit() const;
  void negate();
  void dec();
  void inc();
  void set_max(bool negative);
  void build(bool negative, mpz_t mantissa, int exponent);

};




struct float_ieee754_single {
  uint32_t word;
  static const uint32_t SGN_MASK = 0x80000000U;
  static const uint32_t EXP_MASK = 0x7f800000U;
  static const uint32_t WRD_MAX = 0x7f7fffffU;
  static const uint32_t POS_INF = 0x7f800000U;
  static const uint32_t NEG_INF = 0xff800000U;
  static const uint32_t POS_ZERO = 0x00000000U;
  static const uint32_t NEG_ZERO = 0x80000000U;
  static const unsigned int BASE = 2;
  static const unsigned int EXPONENT_BITS = 8;
  static const unsigned int MANTISSA_BITS = 23;
  static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1;
  static const int EXPONENT_BIAS = EXPONENT_MAX;
  static const int EXPONENT_MIN = -EXPONENT_MAX + 1;
  static const int EXPONENT_MIN_DENORM = EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS);
  static const Floating_Point_Format floating_point_format = IEEE754_SINGLE;
  int inf_sign() const;
  bool is_nan() const;
  int zero_sign() const;
  bool sign_bit() const;
  void negate();
  void dec();
  void inc();
  void set_max(bool negative);
  void build(bool negative, mpz_t mantissa, int exponent);
};
# 121 "Float_defs.hh"
struct float_ieee754_double {




  uint32_t lsp;
  uint32_t msp;

  static const uint32_t MSP_SGN_MASK = 0x80000000U;
  static const uint32_t MSP_POS_INF = 0x7ff00000U;
  static const uint32_t MSP_NEG_INF = 0xfff00000U;
  static const uint32_t MSP_POS_ZERO = 0x00000000U;
  static const uint32_t MSP_NEG_ZERO = 0x80000000U;
  static const uint32_t LSP_INF = 0;
  static const uint32_t LSP_ZERO = 0;
  static const uint32_t MSP_MAX = 0x7fefffffU;
  static const uint32_t LSP_MAX = 0xffffffffU;
  static const unsigned int BASE = 2;
  static const unsigned int EXPONENT_BITS = 11;
  static const unsigned int MANTISSA_BITS = 52;
  static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1;
  static const int EXPONENT_BIAS = EXPONENT_MAX;
  static const int EXPONENT_MIN = -EXPONENT_MAX + 1;
  static const int EXPONENT_MIN_DENORM = EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS);
  static const Floating_Point_Format floating_point_format = IEEE754_DOUBLE;
  int inf_sign() const;
  bool is_nan() const;
  int zero_sign() const;
  bool sign_bit() const;
  void negate();
  void dec();
  void inc();
  void set_max(bool negative);
  void build(bool negative, mpz_t mantissa, int exponent);
};




struct float_ibm_single {
  uint32_t word;
  static const uint32_t SGN_MASK = 0x80000000U;
  static const uint32_t EXP_MASK = 0x7f000000U;
  static const uint32_t WRD_MAX = 0x7fffffffU;
  static const uint32_t POS_INF = 0x7f000000U;
  static const uint32_t NEG_INF = 0xff000000U;
  static const uint32_t POS_ZERO = 0x00000000U;
  static const uint32_t NEG_ZERO = 0x80000000U;
  static const unsigned int BASE = 16;
  static const unsigned int EXPONENT_BITS = 7;
  static const unsigned int MANTISSA_BITS = 24;
  static const int EXPONENT_BIAS = 64;
  static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1;
  static const int EXPONENT_MIN = -EXPONENT_MAX + 1;
  static const int EXPONENT_MIN_DENORM = EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS);
  static const Floating_Point_Format floating_point_format = IBM_SINGLE;
  int inf_sign() const;
  bool is_nan() const;
  int zero_sign() const;
  bool sign_bit() const;
  void negate();
  void dec();
  void inc();
  void set_max(bool negative);
  void build(bool negative, mpz_t mantissa, int exponent);
};




struct float_ibm_double {
  static const unsigned int BASE = 16;
  static const unsigned int EXPONENT_BITS = 7;
  static const unsigned int MANTISSA_BITS = 56;
  static const int EXPONENT_BIAS = 64;
};




struct float_intel_double_extended {




  uint64_t lsp;
  uint32_t msp;

  static const uint32_t MSP_SGN_MASK = 0x00008000U;
  static const uint32_t MSP_POS_INF = 0x00007fffU;
  static const uint32_t MSP_NEG_INF = 0x0000ffffU;
  static const uint32_t MSP_POS_ZERO = 0x00000000U;
  static const uint32_t MSP_NEG_ZERO = 0x00008000U;
  static const uint64_t LSP_INF = static_cast<uint64_t>(0x8000000000000000ULL);
  static const uint64_t LSP_ZERO = 0;
  static const uint32_t MSP_MAX = 0x00007ffeU;
  static const uint64_t LSP_DMAX = static_cast<uint64_t>(0x7fffffffffffffffULL);
  static const uint64_t LSP_NMAX = static_cast<uint64_t>(0xffffffffffffffffULL);
  static const unsigned int BASE = 2;
  static const unsigned int EXPONENT_BITS = 15;
  static const unsigned int MANTISSA_BITS = 63;
  static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1;
  static const int EXPONENT_BIAS = EXPONENT_MAX;
  static const int EXPONENT_MIN = -EXPONENT_MAX + 1;
  static const int EXPONENT_MIN_DENORM = EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS);
  static const Floating_Point_Format floating_point_format =
                                     INTEL_DOUBLE_EXTENDED;
  int inf_sign() const;
  bool is_nan() const;
  int zero_sign() const;
  bool sign_bit() const;
  void negate();
  void dec();
  void inc();
  void set_max(bool negative);
  void build(bool negative, mpz_t mantissa, int exponent);
};




struct float_ieee754_quad {




  uint64_t lsp;
  uint64_t msp;

  static const uint64_t MSP_SGN_MASK = static_cast<uint64_t>(0x8000000000000000ULL);
  static const uint64_t MSP_POS_INF = static_cast<uint64_t>(0x7fff000000000000ULL);
  static const uint64_t MSP_NEG_INF = static_cast<uint64_t>(0xffff000000000000ULL);
  static const uint64_t MSP_POS_ZERO = static_cast<uint64_t>(0x0000000000000000ULL);
  static const uint64_t MSP_NEG_ZERO = static_cast<uint64_t>(0x8000000000000000ULL);
  static const uint64_t LSP_INF = 0;
  static const uint64_t LSP_ZERO = 0;
  static const uint64_t MSP_MAX = static_cast<uint64_t>(0x7ffeffffffffffffULL);
  static const uint64_t LSP_MAX = static_cast<uint64_t>(0xffffffffffffffffULL);
  static const unsigned int BASE = 2;
  static const unsigned int EXPONENT_BITS = 15;
  static const unsigned int MANTISSA_BITS = 112;
  static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1;
  static const int EXPONENT_BIAS = EXPONENT_MAX;
  static const int EXPONENT_MIN = -EXPONENT_MAX + 1;
  static const int EXPONENT_MIN_DENORM = EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS);
  static const Floating_Point_Format floating_point_format = IEEE754_QUAD;
  int inf_sign() const;
  bool is_nan() const;
  int zero_sign() const;
  bool sign_bit() const;
  void negate();
  void dec();
  void inc();
  void set_max(bool negative);
  void build(bool negative, mpz_t mantissa, int exponent);
};




template <typename T>
class Float : public False { };


template <>
class Float<float> : public True {
public:



  typedef float_ieee754_single Binary;
# 307 "Float_defs.hh"
  union {
    float number;
    Binary binary;
  } u;
  Float();
  Float(float v);
  float value();
};



template <>
class Float<double> : public True {
public:





  typedef float_ieee754_double Binary;
# 336 "Float_defs.hh"
  union {
    double number;
    Binary binary;
  } u;
  Float();
  Float(double v);
  double value();
};



template <>
class Float<long double> : public True {
public:
# 361 "Float_defs.hh"
  typedef float_intel_double_extended Binary;



  union {
    long double number;
    Binary binary;
  } u;
  Float();
  Float(long double v);
  long double value();
};
# 384 "Float_defs.hh"
unsigned int msb_position(unsigned long long v);
# 399 "Float_defs.hh"
template <typename Target, typename FP_Interval_Type>
class FP_Oracle {
public:
# 415 "Float_defs.hh"
  virtual bool get_interval(dimension_type dim, FP_Interval_Type& result) const
    = 0;
# 426 "Float_defs.hh"
  virtual bool get_fp_constant_value(
               const Floating_Point_Constant<Target>& expr,
                     FP_Interval_Type& result) const = 0;
# 438 "Float_defs.hh"
  virtual bool get_integer_expr_value(const Concrete_Expression<Target>& expr,
                                      FP_Interval_Type& result) const = 0;
# 451 "Float_defs.hh"
  virtual bool get_associated_dimensions(
          const Approximable_Reference<Target>& expr,
          std::set<dimension_type>& result) const = 0;

};
# 464 "Float_defs.hh"
bool is_less_precise_than(Floating_Point_Format f1, Floating_Point_Format f2);
# 482 "Float_defs.hh"
template <typename FP_Interval_Type>
const FP_Interval_Type&
compute_absolute_error(Floating_Point_Format analyzed_format);





template <typename FP_Interval_Type>
void
discard_occurrences(std::map<dimension_type,
                             Linear_Form<FP_Interval_Type> >& lf_store,
                    Variable var);





template <typename FP_Interval_Type>
void
affine_form_image(std::map<dimension_type,
                           Linear_Form<FP_Interval_Type> >& lf_store,
                  Variable var,
                  const Linear_Form<FP_Interval_Type>& lf);





template <typename FP_Interval_Type>
void
upper_bound_assign(std::map<dimension_type,
                            Linear_Form<FP_Interval_Type> >& ls1,
                   const std::map<dimension_type,
                                  Linear_Form<FP_Interval_Type> >& ls2);

}

# 1 "Float_inlines.hh" 1
# 28 "Float_inlines.hh"
# 1 "Variable_defs.hh" 1
# 28 "Variable_defs.hh"
# 1 "Init_types.hh" 1
# 16 "Init_types.hh"
namespace Parma_Polyhedra_Library {

class Init;

}
# 29 "Variable_defs.hh" 2




namespace Parma_Polyhedra_Library {

namespace IO_Operators {



std::ostream&
operator<<(std::ostream& s, const Variable v);

}



bool less(Variable v, Variable w);


void
swap(Variable& x, Variable& y);

}
# 85 "Variable_defs.hh"
class Parma_Polyhedra_Library::Variable {

public:






  explicit Variable(dimension_type i);


  dimension_type id() const;


  static dimension_type max_space_dimension();





  dimension_type space_dimension() const;


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  bool OK() const;


  typedef void output_function_type(std::ostream& s, const Variable v);


  static void default_output_function(std::ostream& s, const Variable v);


  static void set_output_function(output_function_type* p);


  static output_function_type* get_output_function();



  struct Compare {

    bool operator()(Variable x, Variable y) const;
  };


  void m_swap(Variable& v);

private:

  dimension_type varid;


  friend class Init;

  friend std::ostream&
  Parma_Polyhedra_Library::IO_Operators::operator<<(std::ostream& s,
                                                    const Variable v);


  static output_function_type* current_output_function;

};

# 1 "Variable_inlines.hh" 1
# 27 "Variable_inlines.hh"
# 1 "globals_defs.hh" 1
# 28 "globals_defs.hh"
# 1 "C_Integer.hh" 1
# 59 "C_Integer.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
struct C_Integer : public False { };

template <>
struct C_Integer<char> : public True {
  enum const_bool_value {

    is_signed = true



  };
  typedef void smaller_type;
  typedef void smaller_signed_type;
  typedef void smaller_unsigned_type;

  typedef unsigned char other_type;



  static const char min = static_cast<char>((-127 - 1));
  static const char max = static_cast<char>(127);
};

template <>
struct C_Integer<signed char> : public True {
  enum const_bool_value {
    is_signed = true
  };
  typedef void smaller_type;
  typedef void smaller_signed_type;
  typedef void smaller_unsigned_type;
  typedef unsigned char other_type;
  static const signed char min = static_cast<signed char>((-127 - 1));
  static const signed char max = static_cast<signed char>(127);
};

template <>
struct C_Integer<signed short> : public True {
  enum const_bool_value {
    is_signed = true
  };
  typedef signed char smaller_type;
  typedef signed char smaller_signed_type;
  typedef unsigned char smaller_unsigned_type;
  typedef unsigned short other_type;
  static const signed short min = static_cast<signed short>((-32767 - 1));
  static const signed short max = static_cast<signed short>(32767);
};

template <>
struct C_Integer<signed int> : public True {
  enum const_bool_value {
    is_signed = true
  };
  typedef signed short smaller_type;
  typedef signed short smaller_signed_type;
  typedef unsigned short smaller_unsigned_type;
  typedef unsigned int other_type;
  static const signed int min = (-2147483647 - 1);
  static const signed int max = 2147483647;
};

template <>
struct C_Integer<signed long> : public True {
  enum const_bool_value {
    is_signed = true
  };
  typedef signed int smaller_type;
  typedef signed int smaller_signed_type;
  typedef unsigned int smaller_unsigned_type;
  typedef unsigned long other_type;
  static const signed long min = (-2147483647L - 1L);
  static const signed long max = 2147483647L;
};

template <>
struct C_Integer<signed long long> : public True {
  enum const_bool_value {
    is_signed = true
  };
  typedef signed long smaller_type;
  typedef signed long smaller_signed_type;
  typedef unsigned long smaller_unsigned_type;
  typedef unsigned long long other_type;
  static const signed long long min = (-9223372036854775807LL -1);
  static const signed long long max = 9223372036854775807LL;
};

template <>
struct C_Integer<unsigned char> : public True {
  enum const_bool_value {
    is_signed = false
  };
  typedef void smaller_type;
  typedef void smaller_signed_type;
  typedef void smaller_unsigned_type;
  typedef signed char other_type;
  static const unsigned char min = static_cast<unsigned char>(0U);
  static const unsigned char max = static_cast<unsigned char>((127 * 2 + 1));
};

template <>
struct C_Integer<unsigned short> : public True {
  enum const_bool_value {
    is_signed = false
  };
  typedef unsigned char smaller_type;
  typedef signed char smaller_signed_type;
  typedef unsigned char smaller_unsigned_type;
  typedef signed short other_type;
  static const unsigned short min = static_cast<unsigned short>(0U);
  static const unsigned short max = static_cast<unsigned short>((32767 * 2 + 1));
};

template <>
struct C_Integer<unsigned int> : public True {
  enum const_bool_value {
    is_signed = false
  };
  typedef unsigned short smaller_type;
  typedef signed short smaller_signed_type;
  typedef unsigned short smaller_unsigned_type;
  typedef signed int other_type;
  static const unsigned int min = 0U;
  static const unsigned int max = (2147483647 * 2U + 1U);
};

template <>
struct C_Integer<unsigned long> : public True {
  enum const_bool_value {
    is_signed = false
  };
  typedef unsigned int smaller_type;
  typedef signed int smaller_signed_type;
  typedef unsigned int smaller_unsigned_type;
  typedef signed long other_type;
  static const unsigned long min = 0UL;
  static const unsigned long max = (2147483647L * 2UL + 1UL);
};

template <>
struct C_Integer<unsigned long long> : public True {
  enum const_bool_value {
    is_signed = false
  };
  typedef unsigned long smaller_type;
  typedef signed long smaller_signed_type;
  typedef unsigned long smaller_unsigned_type;
  typedef signed long long other_type;
  static const unsigned long long min = 0ULL;
  static const unsigned long long max = (9223372036854775807LL * 2ULL + 1);
};

}
# 29 "globals_defs.hh" 2
# 98 "globals_defs.hh"
namespace Parma_Polyhedra_Library {


dimension_type
not_a_dimension();




int32_t
hash_code_from_dimension(dimension_type dim);
# 118 "globals_defs.hh"
template <typename T>
inline typename Enable_If<Slow_Copy<T>::value, void>::type
swap(T&, T&) {
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_121 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!Slow_Copy<T>::value)>) };
}
# 154 "globals_defs.hh"
dimension_type
compute_capacity(dimension_type requested_size,
                 dimension_type maximum_size);
# 167 "globals_defs.hh"
struct Weightwatch_Traits {

  typedef unsigned long long Threshold;


  typedef unsigned long long Delta;


  static const Threshold& get();


  static bool less_than(const Threshold& a, const Threshold& b);
# 192 "globals_defs.hh"
  static Delta compute_delta(unsigned long unscaled, unsigned scale);


  static void from_delta(Threshold& threshold, const Delta& delta);


  static Threshold weight;







  static void (*check_function)(void);
};
# 237 "globals_defs.hh"
class Throwable {
public:

  virtual void throw_me() const = 0;


  virtual ~Throwable();
};
# 269 "globals_defs.hh"
extern const Throwable* volatile abandon_expensive_computations;
# 279 "globals_defs.hh"
void
maybe_abandon();






struct Recycle_Input {
};
# 399 "globals_defs.hh"
bool is_space(char c);

template <typename T, long long v, typename Enable = void>
struct Fit : public False {
};

template <typename T, long long v>
struct Fit<T, v, typename Enable_If<C_Integer<T>::value>::type> {
  enum {
    value = (v >= static_cast<long long>(C_Integer<T>::min)
             && v <= static_cast<long long>(C_Integer<T>::max))
  };
};

template <typename T, T v>
struct TConstant {
  static const T value = v;
};


template <typename T, T v>
const T TConstant<T, v>::value;

template <typename T, long long v, bool prefer_signed = true,
          typename Enable = void>
struct Constant_ : public TConstant<T, v> {
};

template <typename T, long long v, bool prefer_signed>
struct Constant_<T, v, prefer_signed,
                 typename Enable_If<(Fit<typename C_Integer<T>::smaller_signed_type, v>::value
                                     && (prefer_signed
                                         || !Fit<typename C_Integer<T>::smaller_unsigned_type, v>::value))>::type>
  : public Constant_<typename C_Integer<T>::smaller_signed_type, v, prefer_signed> {
};

template <typename T, long long v, bool prefer_signed>
struct Constant_<T, v, prefer_signed,
                 typename Enable_If<(Fit<typename C_Integer<T>::smaller_unsigned_type, v>::value
                                     && (!prefer_signed
                                         || !Fit<typename C_Integer<T>::smaller_signed_type, v>::value))>::type>
  : public Constant_<typename C_Integer<T>::smaller_unsigned_type, v, prefer_signed> {
};

template <long long v, bool prefer_signed = true>
struct Constant : public Constant_<long long, v, prefer_signed> {
};
# 458 "globals_defs.hh"
template <typename T>
typename Enable_If<Is_Native<T>::value, memory_size_type>::type
total_memory_in_bytes(const T&);







template <typename T>
typename Enable_If<Is_Native<T>::value, memory_size_type>::type
external_memory_in_bytes(const T&);




memory_size_type
total_memory_in_bytes(const mpz_class& x);




memory_size_type
external_memory_in_bytes(const mpz_class& x);




memory_size_type
total_memory_in_bytes(const mpq_class& x);




memory_size_type
external_memory_in_bytes(const mpq_class& x);






template <typename T, typename Enable = void>
struct Has_OK : public False { };

template <typename T>
struct Has_OK<T, typename Enable_If_Is<bool (T::*)() const, &T::OK>::type>
  : public True {
};

template <typename T>
inline typename Enable_If<Has_OK<T>::value, bool>::type
f_OK(const T& to) {
  return to.OK();
}



inline bool f_OK(const char&) { return true; }
inline bool f_OK(const signed char&) { return true; }
inline bool f_OK(const unsigned char&) { return true; }
inline bool f_OK(const signed short&) { return true; }
inline bool f_OK(const unsigned short&) { return true; }
inline bool f_OK(const signed int&) { return true; }
inline bool f_OK(const unsigned int&) { return true; }
inline bool f_OK(const signed long&) { return true; }
inline bool f_OK(const unsigned long&) { return true; }
inline bool f_OK(const signed long long&) { return true; }
inline bool f_OK(const unsigned long long&) { return true; }
inline bool f_OK(const float&) { return true; }
inline bool f_OK(const double&) { return true; }
inline bool f_OK(const long double&) { return true; }
inline bool f_OK(const mpz_class&) { return true; }
inline bool f_OK(const mpq_class&) { return true; }

void ascii_dump(std::ostream& s, Representation r);
bool ascii_load(std::istream& s, Representation& r);

dimension_type
check_space_dimension_overflow(dimension_type dim,
                               dimension_type max,
                               const char* domain,
                               const char* method,
                               const char* reason);

template <typename RA_Container>
typename RA_Container::iterator
nth_iter(RA_Container& cont, dimension_type n);

template <typename RA_Container>
typename RA_Container::const_iterator
nth_iter(const RA_Container& cont, dimension_type n);

dimension_type
least_significant_one_mask(dimension_type i);

}






# 1 "globals_inlines.hh" 1
# 29 "globals_inlines.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 3

# 1 "/usr/include/assert.h" 1 3 4
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cassert" 2 3
# 30 "globals_inlines.hh" 2





namespace Parma_Polyhedra_Library {

inline dimension_type
not_a_dimension() {
  return std::numeric_limits<dimension_type>::max();
}

inline int32_t
hash_code_from_dimension(dimension_type dim) {
  const dimension_type divisor = 1U << (32 - 1);
  dim = dim % divisor;
  return static_cast<int32_t>(dim);
}

inline const Weightwatch_Traits::Threshold&
Weightwatch_Traits::get() {
  return weight;
}

inline bool
Weightwatch_Traits::less_than(const Threshold& a, const Threshold& b) {
  return b - a < (1ULL << (((sizeof(Threshold)) * static_cast<std::size_t>(8)) - 1));
}

inline Weightwatch_Traits::Delta
Weightwatch_Traits::compute_delta(unsigned long unscaled, unsigned scale) {
  if ((std::numeric_limits<Delta>::max() >> scale) < unscaled)
    throw std::invalid_argument("PPL::Weightwatch_Traits::"
                                "compute_delta(u, s):\n"
                                "values of u and s cause wrap around.");
  return static_cast<Delta>(unscaled) << scale;
}

inline void
Weightwatch_Traits::from_delta(Threshold& threshold, const Delta& delta) {
  threshold = weight + delta;
}

inline
Throwable::~Throwable() {
}

inline void
maybe_abandon() {




  if (Weightwatch_Traits::check_function != 0)
    Weightwatch_Traits::check_function();
  if (const Throwable* const p = abandon_expensive_computations)
    p->throw_me();
}

inline dimension_type
compute_capacity(const dimension_type requested_size,
                 const dimension_type maximum_size) {
  (static_cast<void> (0));

  return (requested_size < maximum_size/2)
    ? (2*(requested_size + 1))
    : maximum_size;




}

template <typename T>
inline typename
Enable_If<Is_Native<T>::value, memory_size_type>::type
external_memory_in_bytes(const T&) {
  return 0;
}

template <typename T>
inline typename
Enable_If<Is_Native<T>::value, memory_size_type>::type
total_memory_in_bytes(const T&) {
  return sizeof(T);
}

inline memory_size_type
external_memory_in_bytes(const mpz_class& x) {
  return static_cast<memory_size_type>(x.get_mpz_t()[0]._mp_alloc)
    * 4;
}

inline memory_size_type
total_memory_in_bytes(const mpz_class& x) {
  return sizeof(x) + external_memory_in_bytes(x);
}

inline memory_size_type
external_memory_in_bytes(const mpq_class& x) {
  return external_memory_in_bytes(x.get_num())
    + external_memory_in_bytes(x.get_den());
}

inline memory_size_type
total_memory_in_bytes(const mpq_class& x) {
  return sizeof(x) + external_memory_in_bytes(x);
}

inline void
ascii_dump(std::ostream& s, Representation r) {
  if (r == DENSE)
    s << "DENSE";
  else
    s << "SPARSE";
}

inline bool
ascii_load(std::istream& is, Representation& r) {
  std::string s;
  if (!(is >> s))
    return false;

  if (s == "DENSE") {
    r = DENSE;
    return true;
  }
  if (s == "SPARSE") {
    r = SPARSE;
    return true;
  }
  return false;
}

inline bool
is_space(char c) {
  return isspace(c) != 0;
}

template <typename RA_Container>
inline typename RA_Container::iterator
nth_iter(RA_Container& cont, dimension_type n) {
  typedef typename RA_Container::difference_type diff_t;
  return cont.begin() + static_cast<diff_t>(n);
}

template <typename RA_Container>
inline typename RA_Container::const_iterator
nth_iter(const RA_Container& cont, dimension_type n) {
  typedef typename RA_Container::difference_type diff_t;
  return cont.begin() + static_cast<diff_t>(n);
}

inline dimension_type
least_significant_one_mask(const dimension_type i) {
  return i & (~i + 1U);
}

}
# 563 "globals_defs.hh" 2
# 28 "Variable_inlines.hh" 2


namespace Parma_Polyhedra_Library {

inline dimension_type
Variable::max_space_dimension() {
  return not_a_dimension() - 1;
}

inline
Variable::Variable(dimension_type i)
  : varid((i < max_space_dimension())
          ? i
          : (throw std::length_error("PPL::Variable::Variable(i):\n"
                                     "i exceeds the maximum allowed "
                                     "variable identifier."), i)) {
}

inline dimension_type
Variable::id() const {
  return varid;
}

inline dimension_type
Variable::space_dimension() const {
  return varid + 1;
}

inline memory_size_type
Variable::external_memory_in_bytes() const {
  return 0;
}

inline memory_size_type
Variable::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline void
Variable::set_output_function(output_function_type* p) {
  current_output_function = p;
}

inline Variable::output_function_type*
Variable::get_output_function() {
  return current_output_function;
}


inline bool
less(const Variable v, const Variable w) {
  return v.id() < w.id();
}

inline bool
Variable::Compare::operator()(const Variable x, const Variable y) const {
  return less(x, y);
}

inline void
Variable::m_swap(Variable& v) {
  using std::swap;
  swap(varid, v.varid);
}

inline void
swap(Variable& x, Variable& y) {
  x.m_swap(y);
}

}
# 156 "Variable_defs.hh" 2
# 29 "Float_inlines.hh" 2
# 1 "Linear_Form_defs.hh" 1
# 28 "Linear_Form_defs.hh"
# 1 "Linear_Expression_types.hh" 1
# 16 "Linear_Expression_types.hh"
namespace Parma_Polyhedra_Library {

class Linear_Expression;

}
# 29 "Linear_Form_defs.hh" 2


# 1 "Float_defs.hh" 1
# 32 "Linear_Form_defs.hh" 2
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 1 3
# 36 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 3
namespace std
{

  void
  __throw_bad_exception(void);


  void
  __throw_bad_alloc(void);


  void
  __throw_bad_cast(void);

  void
  __throw_bad_typeid(void);


  void
  __throw_logic_error(const char* __s);

  void
  __throw_domain_error(const char* __s);

  void
  __throw_invalid_argument(const char* __s);

  void
  __throw_length_error(const char* __s);

  void
  __throw_out_of_range(const char* __s);

  void
  __throw_runtime_error(const char* __s);

  void
  __throw_range_error(const char* __s);

  void
  __throw_overflow_error(const char* __s);

  void
  __throw_underflow_error(const char* __s);


  void
  __throw_ios_failure(const char* __s);
}
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 2 3




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 1 3
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 1 3
# 36 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 3
namespace std
{

  void
  __throw_bad_exception(void);


  void
  __throw_bad_alloc(void);


  void
  __throw_bad_cast(void);

  void
  __throw_bad_typeid(void);


  void
  __throw_logic_error(const char* __s);

  void
  __throw_domain_error(const char* __s);

  void
  __throw_invalid_argument(const char* __s);

  void
  __throw_length_error(const char* __s);

  void
  __throw_out_of_range(const char* __s);

  void
  __throw_runtime_error(const char* __s);

  void
  __throw_range_error(const char* __s);

  void
  __throw_overflow_error(const char* __s);

  void
  __throw_underflow_error(const char* __s);


  void
  __throw_ios_failure(const char* __s);
}
# 66 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 2 3


namespace std
{





  template<typename _Tp, typename _Alloc>
    struct _Vector_base
    {
      struct _Vector_impl
 : public _Alloc {
 _Tp* _M_start;
 _Tp* _M_finish;
 _Tp* _M_end_of_storage;
 _Vector_impl (_Alloc const& __a)
   : _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
 { }
      };

    public:
      typedef _Alloc allocator_type;

      allocator_type
      get_allocator() const { return *static_cast<const _Alloc*>(&this->_M_impl); }

      _Vector_base(const allocator_type& __a) : _M_impl(__a)
      { }

      _Vector_base(size_t __n, const allocator_type& __a)
 : _M_impl(__a)
      {
 this->_M_impl._M_start = this->_M_allocate(__n);
 this->_M_impl._M_finish = this->_M_impl._M_start;
 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
      }

      ~_Vector_base()
      { _M_deallocate(this->_M_impl._M_start,
        this->_M_impl._M_end_of_storage - this->_M_impl._M_start); }

    public:
      _Vector_impl _M_impl;

      _Tp*
      _M_allocate(size_t __n) { return _M_impl.allocate(__n); }

      void
      _M_deallocate(_Tp* __p, size_t __n)
      { if (__p) _M_impl.deallocate(__p, __n); }
    };
# 140 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
  template<typename _Tp, typename _Alloc = allocator<_Tp> >
    class vector : protected _Vector_base<_Tp, _Alloc>
    {

     

      typedef _Vector_base<_Tp, _Alloc> _Base;
      typedef vector<_Tp, _Alloc> vector_type;

    public:
      typedef _Tp value_type;
      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;
      typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
      typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
      const_iterator;
      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
      typedef std::reverse_iterator<iterator> reverse_iterator;
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef typename _Base::allocator_type allocator_type;

    protected:





      using _Base::_M_allocate;
      using _Base::_M_deallocate;
      using _Base::_M_impl;

    public:





      explicit
      vector(const allocator_type& __a = allocator_type())
      : _Base(__a) { }
# 191 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      vector(size_type __n, const value_type& __value,
      const allocator_type& __a = allocator_type())
      : _Base(__n, __a)
      { this->_M_impl._M_finish = std::uninitialized_fill_n(this->_M_impl._M_start,
          __n, __value); }
# 204 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      explicit
      vector(size_type __n)
      : _Base(__n, allocator_type())
      { this->_M_impl._M_finish = std::uninitialized_fill_n(this->_M_impl._M_start,
          __n, value_type()); }
# 219 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      vector(const vector& __x)
      : _Base(__x.size(), __x.get_allocator())
      { this->_M_impl._M_finish = std::uninitialized_copy(__x.begin(), __x.end(),
        this->_M_impl._M_start);
      }
# 240 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      template<typename _InputIterator>
        vector(_InputIterator __first, _InputIterator __last,
        const allocator_type& __a = allocator_type())
 : _Base(__a)
        {

   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   _M_initialize_dispatch(__first, __last, _Integral());
 }







      ~vector() { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); }
# 266 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      vector&
      operator=(const vector& __x);
# 279 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      assign(size_type __n, const value_type& __val)
      { _M_fill_assign(__n, __val); }
# 295 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      template<typename _InputIterator>
        void
        assign(_InputIterator __first, _InputIterator __last)
        {

   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   _M_assign_dispatch(__first, __last, _Integral());
 }


      using _Base::get_allocator;







      iterator
      begin() { return iterator (this->_M_impl._M_start); }






      const_iterator
      begin() const { return const_iterator (this->_M_impl._M_start); }






      iterator
      end() { return iterator (this->_M_impl._M_finish); }






      const_iterator
      end() const { return const_iterator (this->_M_impl._M_finish); }






      reverse_iterator
      rbegin() { return reverse_iterator(end()); }






      const_reverse_iterator
      rbegin() const { return const_reverse_iterator(end()); }






      reverse_iterator
      rend() { return reverse_iterator(begin()); }






      const_reverse_iterator
      rend() const { return const_reverse_iterator(begin()); }



      size_type
      size() const { return size_type(end() - begin()); }


      size_type
      max_size() const { return size_type(-1) / sizeof(value_type); }
# 392 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      resize(size_type __new_size, const value_type& __x)
      {
 if (__new_size < size())
   erase(begin() + __new_size, end());
 else
   insert(end(), __new_size - size(), __x);
      }
# 411 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      resize(size_type __new_size) { resize(__new_size, value_type()); }





      size_type
      capacity() const
      { return size_type(const_iterator(this->_M_impl._M_end_of_storage) - begin()); }





      bool
      empty() const { return begin() == end(); }
# 446 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      reserve(size_type __n);
# 461 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      reference
      operator[](size_type __n) { return *(begin() + __n); }
# 475 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      const_reference
      operator[](size_type __n) const { return *(begin() + __n); }

    protected:

      void
      _M_range_check(size_type __n) const
      {
 if (__n >= this->size())
   __throw_out_of_range(("vector::_M_range_check"));
      }

    public:
# 499 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      reference
      at(size_type __n) { _M_range_check(__n); return (*this)[__n]; }
# 513 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      const_reference
      at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; }





      reference
      front() { return *begin(); }





      const_reference
      front() const { return *begin(); }





      reference
      back() { return *(end() - 1); }





      const_reference
      back() const { return *(end() - 1); }
# 555 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      push_back(const value_type& __x)
      {
 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
   {
     std::_Construct(this->_M_impl._M_finish, __x);
     ++this->_M_impl._M_finish;
   }
 else
   _M_insert_aux(end(), __x);
      }
# 576 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      pop_back()
      {
 --this->_M_impl._M_finish;
 std::_Destroy(this->_M_impl._M_finish);
      }
# 594 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      iterator
      insert(iterator __position, const value_type& __x);
# 610 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      insert(iterator __position, size_type __n, const value_type& __x)
      { _M_fill_insert(__position, __n, __x); }
# 628 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      template<typename _InputIterator>
        void
        insert(iterator __position, _InputIterator __first,
        _InputIterator __last)
        {

   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   _M_insert_dispatch(__position, __first, __last, _Integral());
 }
# 653 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      iterator
      erase(iterator __position);
# 674 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      iterator
      erase(iterator __first, iterator __last);
# 686 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
      void
      swap(vector& __x)
      {
 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
 std::swap(this->_M_impl._M_end_of_storage, __x._M_impl._M_end_of_storage);
      }







      void
      clear() { erase(begin(), end()); }

    protected:






      template<typename _ForwardIterator>
        pointer
        _M_allocate_and_copy(size_type __n,
        _ForwardIterator __first, _ForwardIterator __last)
        {
   pointer __result = this->_M_allocate(__n);
   try
     {
       std::uninitialized_copy(__first, __last, __result);
       return __result;
     }
   catch(...)
     {
       _M_deallocate(__result, __n);
       throw;
     }
 }





      template<typename _Integer>
        void
        _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
        {
   this->_M_impl._M_start = _M_allocate(__n);
   this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
   this->_M_impl._M_finish = std::uninitialized_fill_n(this->_M_impl._M_start,
            __n, __value);
 }


      template<typename _InputIterator>
        void
        _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
          __false_type)
        {
   typedef typename iterator_traits<_InputIterator>::iterator_category
     _IterCategory;
   _M_range_initialize(__first, __last, _IterCategory());
 }


      template<typename _InputIterator>
        void
        _M_range_initialize(_InputIterator __first,
       _InputIterator __last, input_iterator_tag)
        {
   for ( ; __first != __last; ++__first)
     push_back(*__first);
 }


      template<typename _ForwardIterator>
        void
        _M_range_initialize(_ForwardIterator __first,
       _ForwardIterator __last, forward_iterator_tag)
        {
   size_type __n = std::distance(__first, __last);
   this->_M_impl._M_start = this->_M_allocate(__n);
   this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
   this->_M_impl._M_finish = std::uninitialized_copy(__first, __last,
          this->_M_impl._M_start);
 }






      template<typename _Integer>
        void
        _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
        {
   _M_fill_assign(static_cast<size_type>(__n),
    static_cast<value_type>(__val));
 }


      template<typename _InputIterator>
        void
        _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
      __false_type)
        {
   typedef typename iterator_traits<_InputIterator>::iterator_category
     _IterCategory;
   _M_assign_aux(__first, __last, _IterCategory());
 }


      template<typename _InputIterator>
        void
        _M_assign_aux(_InputIterator __first, _InputIterator __last,
        input_iterator_tag);


      template<typename _ForwardIterator>
        void
        _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
        forward_iterator_tag);



      void
      _M_fill_assign(size_type __n, const value_type& __val);





      template<typename _Integer>
        void
        _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
      __true_type)
        {
   _M_fill_insert(__pos, static_cast<size_type>(__n),
    static_cast<value_type>(__val));
 }


      template<typename _InputIterator>
        void
        _M_insert_dispatch(iterator __pos, _InputIterator __first,
      _InputIterator __last, __false_type)
        {
   typedef typename iterator_traits<_InputIterator>::iterator_category
     _IterCategory;
   _M_range_insert(__pos, __first, __last, _IterCategory());
 }


      template<typename _InputIterator>
        void
        _M_range_insert(iterator __pos, _InputIterator __first,
   _InputIterator __last, input_iterator_tag);


      template<typename _ForwardIterator>
        void
        _M_range_insert(iterator __pos, _ForwardIterator __first,
   _ForwardIterator __last, forward_iterator_tag);



      void
      _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);


      void
      _M_insert_aux(iterator __position, const value_type& __x);
    };
# 874 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
  template<typename _Tp, typename _Alloc>
    inline bool
    operator==(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
    {
      return __x.size() == __y.size() &&
             std::equal(__x.begin(), __x.end(), __y.begin());
    }
# 893 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h" 3
  template<typename _Tp, typename _Alloc>
    inline bool
    operator<(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
    {
      return std::lexicographical_compare(__x.begin(), __x.end(),
       __y.begin(), __y.end());
    }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator!=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
    { return !(__x == __y); }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator>(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
    { return __y < __x; }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator<=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
    { return !(__y < __x); }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator>=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
    { return !(__x < __y); }


  template<typename _Tp, typename _Alloc>
    inline void
    swap(vector<_Tp,_Alloc>& __x, vector<_Tp,_Alloc>& __y)
    { __x.swap(__y); }
}
# 72 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 2 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_bvector.h" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_bvector.h" 3
namespace std
{
  typedef unsigned long _Bit_type;
  enum { _S_word_bit = int(8 * sizeof(_Bit_type)) };

  struct _Bit_reference
  {
    _Bit_type * _M_p;
    _Bit_type _M_mask;

    _Bit_reference(_Bit_type * __x, _Bit_type __y)
    : _M_p(__x), _M_mask(__y) { }

    _Bit_reference() : _M_p(0), _M_mask(0) { }

    operator bool() const { return !!(*_M_p & _M_mask); }

    _Bit_reference&
    operator=(bool __x)
    {
      if (__x)
 *_M_p |= _M_mask;
      else
 *_M_p &= ~_M_mask;
      return *this;
    }

    _Bit_reference&
    operator=(const _Bit_reference& __x)
    { return *this = bool(__x); }

    bool
    operator==(const _Bit_reference& __x) const
    { return bool(*this) == bool(__x); }

    bool
    operator<(const _Bit_reference& __x) const
    { return !bool(*this) && bool(__x); }

    void
    flip() { *_M_p ^= _M_mask; }
  };

  struct _Bit_iterator_base : public iterator<random_access_iterator_tag, bool>
  {
    _Bit_type * _M_p;
    unsigned int _M_offset;

    _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
    : _M_p(__x), _M_offset(__y) { }

    void
    _M_bump_up()
    {
      if (_M_offset++ == _S_word_bit - 1)
 {
   _M_offset = 0;
   ++_M_p;
 }
    }

    void
    _M_bump_down()
    {
      if (_M_offset-- == 0)
 {
   _M_offset = _S_word_bit - 1;
   --_M_p;
 }
    }

    void
    _M_incr(ptrdiff_t __i)
    {
      difference_type __n = __i + _M_offset;
      _M_p += __n / _S_word_bit;
      __n = __n % _S_word_bit;
      if (__n < 0)
 {
   _M_offset = static_cast<unsigned int>(__n + _S_word_bit);
   --_M_p;
 }
      else
 _M_offset = static_cast<unsigned int>(__n);
    }

    bool
    operator==(const _Bit_iterator_base& __i) const
    { return _M_p == __i._M_p && _M_offset == __i._M_offset; }

    bool
    operator<(const _Bit_iterator_base& __i) const
    {
      return _M_p < __i._M_p
      || (_M_p == __i._M_p && _M_offset < __i._M_offset);
    }

    bool
    operator!=(const _Bit_iterator_base& __i) const
    { return !(*this == __i); }

    bool
    operator>(const _Bit_iterator_base& __i) const
    { return __i < *this; }

    bool
    operator<=(const _Bit_iterator_base& __i) const
    { return !(__i < *this); }

    bool
    operator>=(const _Bit_iterator_base& __i) const
    { return !(*this < __i); }
  };

  inline ptrdiff_t
  operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
  {
    return _S_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
  }

  struct _Bit_iterator : public _Bit_iterator_base
  {
    typedef _Bit_reference reference;
    typedef _Bit_reference* pointer;
    typedef _Bit_iterator iterator;

    _Bit_iterator() : _Bit_iterator_base(0, 0) { }
    _Bit_iterator(_Bit_type * __x, unsigned int __y)
    : _Bit_iterator_base(__x, __y) { }

    reference
    operator*() const { return reference(_M_p, 1UL << _M_offset); }

    iterator&
    operator++()
    {
      _M_bump_up();
      return *this;
    }

    iterator
    operator++(int)
    {
      iterator __tmp = *this;
      _M_bump_up();
      return __tmp;
    }

    iterator&
    operator--()
    {
      _M_bump_down();
      return *this;
    }

    iterator
    operator--(int)
    {
      iterator __tmp = *this;
      _M_bump_down();
      return __tmp;
    }

    iterator&
    operator+=(difference_type __i)
    {
      _M_incr(__i);
      return *this;
    }

    iterator&
    operator-=(difference_type __i)
    {
      *this += -__i;
      return *this;
    }

    iterator
    operator+(difference_type __i) const
    {
      iterator __tmp = *this;
      return __tmp += __i;
    }

    iterator
    operator-(difference_type __i) const
    {
      iterator __tmp = *this;
      return __tmp -= __i;
    }

    reference
    operator[](difference_type __i)
    { return *(*this + __i); }
  };

  inline _Bit_iterator
  operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; }


  struct _Bit_const_iterator : public _Bit_iterator_base
  {
    typedef bool reference;
    typedef bool const_reference;
    typedef const bool* pointer;
    typedef _Bit_const_iterator const_iterator;

    _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
    _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
    : _Bit_iterator_base(__x, __y) { }
    _Bit_const_iterator(const _Bit_iterator& __x)
    : _Bit_iterator_base(__x._M_p, __x._M_offset) { }

    const_reference
    operator*() const
    { return _Bit_reference(_M_p, 1UL << _M_offset); }

    const_iterator&
    operator++()
    {
      _M_bump_up();
      return *this;
    }

    const_iterator
    operator++(int)
    {
      const_iterator __tmp = *this;
      _M_bump_up();
      return __tmp;
    }

    const_iterator&
    operator--()
    {
      _M_bump_down();
      return *this;
    }

    const_iterator
    operator--(int)
    {
      const_iterator __tmp = *this;
      _M_bump_down();
      return __tmp;
    }

    const_iterator&
    operator+=(difference_type __i)
    {
      _M_incr(__i);
      return *this;
    }

    const_iterator&
    operator-=(difference_type __i)
    {
      *this += -__i;
      return *this;
    }

    const_iterator
    operator+(difference_type __i) const {
      const_iterator __tmp = *this;
      return __tmp += __i;
    }

    const_iterator
    operator-(difference_type __i) const
    {
      const_iterator __tmp = *this;
      return __tmp -= __i;
    }

    const_reference
    operator[](difference_type __i)
    { return *(*this + __i); }
  };

  inline _Bit_const_iterator
  operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
  { return __x + __n; }

  template<class _Alloc>
    class _Bvector_base
    {
      typedef typename _Alloc::template rebind<_Bit_type>::other
        _Bit_alloc_type;

      struct _Bvector_impl : public _Bit_alloc_type
      {
 _Bit_iterator _M_start;
 _Bit_iterator _M_finish;
 _Bit_type* _M_end_of_storage;
 _Bvector_impl(const _Bit_alloc_type& __a)
 : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
 { }
      };

    public:
      typedef _Alloc allocator_type;

      allocator_type
      get_allocator() const
      { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }

      _Bvector_base(const allocator_type& __a) : _M_impl(__a) { }

      ~_Bvector_base() { this->_M_deallocate(); }

    protected:
      _Bvector_impl _M_impl;

      _Bit_type*
      _M_allocate(size_t __n)
      { return _M_impl.allocate((__n + _S_word_bit - 1) / _S_word_bit); }

      void
      _M_deallocate()
      {
 if (_M_impl._M_start._M_p)
   _M_impl.deallocate(_M_impl._M_start._M_p,
       _M_impl._M_end_of_storage - _M_impl._M_start._M_p);
      }
    };
}




namespace std
{
# 414 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_bvector.h" 3
template<typename _Alloc>
  class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
  {
  public:
    typedef bool value_type;
    typedef size_t size_type;
    typedef ptrdiff_t difference_type;
    typedef _Bit_reference reference;
    typedef bool const_reference;
    typedef _Bit_reference* pointer;
    typedef const bool* const_pointer;

    typedef _Bit_iterator iterator;
    typedef _Bit_const_iterator const_iterator;

    typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
    typedef std::reverse_iterator<iterator> reverse_iterator;

    typedef typename _Bvector_base<_Alloc>::allocator_type allocator_type;

    allocator_type get_allocator() const
    { return _Bvector_base<_Alloc>::get_allocator(); }

  protected:
    using _Bvector_base<_Alloc>::_M_allocate;
    using _Bvector_base<_Alloc>::_M_deallocate;

  protected:
    void _M_initialize(size_type __n)
    {
      _Bit_type* __q = this->_M_allocate(__n);
      this->_M_impl._M_end_of_storage = __q
                                + (__n + _S_word_bit - 1) / _S_word_bit;
      this->_M_impl._M_start = iterator(__q, 0);
      this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
    }

    void _M_insert_aux(iterator __position, bool __x)
    {
      if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
 {
   std::copy_backward(__position, this->_M_impl._M_finish,
        this->_M_impl._M_finish + 1);
   *__position = __x;
   ++this->_M_impl._M_finish;
 }
      else
 {
   const size_type __len = size() ? 2 * size()
                                  : static_cast<size_type>(_S_word_bit);
   _Bit_type * __q = this->_M_allocate(__len);
   iterator __i = std::copy(begin(), __position, iterator(__q, 0));
   *__i++ = __x;
   this->_M_impl._M_finish = std::copy(__position, end(), __i);
   this->_M_deallocate();
   this->_M_impl._M_end_of_storage = __q + (__len + _S_word_bit - 1)
        / _S_word_bit;
   this->_M_impl._M_start = iterator(__q, 0);
 }
    }

    template<class _InputIterator>
    void _M_initialize_range(_InputIterator __first, _InputIterator __last,
                             input_iterator_tag)
    {
      this->_M_impl._M_start = iterator();
      this->_M_impl._M_finish = iterator();
      this->_M_impl._M_end_of_storage = 0;
      for ( ; __first != __last; ++__first)
        push_back(*__first);
    }

    template<class _ForwardIterator>
    void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
                             forward_iterator_tag)
    {
      const size_type __n = std::distance(__first, __last);
      _M_initialize(__n);
      std::copy(__first, __last, this->_M_impl._M_start);
    }

    template<class _InputIterator>
    void _M_insert_range(iterator __pos, _InputIterator __first,
    _InputIterator __last, input_iterator_tag)
    {
      for ( ; __first != __last; ++__first)
 {
   __pos = insert(__pos, *__first);
   ++__pos;
 }
    }

    template<class _ForwardIterator>
    void _M_insert_range(iterator __position, _ForwardIterator __first,
    _ForwardIterator __last, forward_iterator_tag)
    {
      if (__first != __last)
 {
   size_type __n = std::distance(__first, __last);
   if (capacity() - size() >= __n)
     {
       std::copy_backward(__position, end(),
          this->_M_impl._M_finish + difference_type(__n));
       std::copy(__first, __last, __position);
       this->_M_impl._M_finish += difference_type(__n);
     }
   else
     {
       const size_type __len = size() + std::max(size(), __n);
       _Bit_type * __q = this->_M_allocate(__len);
       iterator __i = std::copy(begin(), __position, iterator(__q, 0));
       __i = std::copy(__first, __last, __i);
       this->_M_impl._M_finish = std::copy(__position, end(), __i);
       this->_M_deallocate();
       this->_M_impl._M_end_of_storage = __q + (__len + _S_word_bit - 1)
                                  / _S_word_bit;
       this->_M_impl._M_start = iterator(__q, 0);
     }
 }
    }

  public:
    iterator begin()
    { return this->_M_impl._M_start; }

    const_iterator begin() const
    { return this->_M_impl._M_start; }

    iterator end()
    { return this->_M_impl._M_finish; }

    const_iterator end() const
    { return this->_M_impl._M_finish; }

    reverse_iterator rbegin()
    { return reverse_iterator(end()); }

    const_reverse_iterator rbegin() const
    { return const_reverse_iterator(end()); }

    reverse_iterator rend()
    { return reverse_iterator(begin()); }

    const_reverse_iterator rend() const
    { return const_reverse_iterator(begin()); }

    size_type size() const
    { return size_type(end() - begin()); }

    size_type max_size() const
    { return size_type(-1); }

    size_type capacity() const
    { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
         - begin()); }
    bool empty() const
    { return begin() == end(); }

    reference operator[](size_type __n)
    { return *(begin() + difference_type(__n)); }

    const_reference operator[](size_type __n) const
    { return *(begin() + difference_type(__n)); }

    void _M_range_check(size_type __n) const
    {
      if (__n >= this->size())
        __throw_out_of_range(("vector<bool>::_M_range_check"));
    }

    reference at(size_type __n)
    { _M_range_check(__n); return (*this)[__n]; }

    const_reference at(size_type __n) const
    { _M_range_check(__n); return (*this)[__n]; }

    explicit vector(const allocator_type& __a = allocator_type())
      : _Bvector_base<_Alloc>(__a) { }

    vector(size_type __n, bool __value,
    const allocator_type& __a = allocator_type())
    : _Bvector_base<_Alloc>(__a)
    {
      _M_initialize(__n);
      std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
  __value ? ~0 : 0);
    }

    explicit vector(size_type __n)
    : _Bvector_base<_Alloc>(allocator_type())
    {
      _M_initialize(__n);
      std::fill(this->_M_impl._M_start._M_p,
  this->_M_impl._M_end_of_storage, 0);
    }

    vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator())
    {
      _M_initialize(__x.size());
      std::copy(__x.begin(), __x.end(), this->_M_impl._M_start);
    }


    template<class _Integer>
    void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
    {
      _M_initialize(__n);
      std::fill(this->_M_impl._M_start._M_p,
  this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
    }

    template<class _InputIterator>
      void
      _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
        __false_type)
      { _M_initialize_range(__first, __last,
       std::__iterator_category(__first)); }

    template<class _InputIterator>
      vector(_InputIterator __first, _InputIterator __last,
      const allocator_type& __a = allocator_type())
    : _Bvector_base<_Alloc>(__a)
    {
      typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
      _M_initialize_dispatch(__first, __last, _Integral());
    }

    ~vector() { }

    vector& operator=(const vector& __x)
    {
      if (&__x == this)
 return *this;
      if (__x.size() > capacity())
 {
   this->_M_deallocate();
   _M_initialize(__x.size());
 }
      std::copy(__x.begin(), __x.end(), begin());
      this->_M_impl._M_finish = begin() + difference_type(__x.size());
      return *this;
    }






    void _M_fill_assign(size_t __n, bool __x)
    {
      if (__n > size())
 {
   std::fill(this->_M_impl._M_start._M_p,
      this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
   insert(end(), __n - size(), __x);
 }
      else
 {
   erase(begin() + __n, end());
   std::fill(this->_M_impl._M_start._M_p,
      this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
 }
    }

    void assign(size_t __n, bool __x)
    { _M_fill_assign(__n, __x); }

    template<class _InputIterator>
    void assign(_InputIterator __first, _InputIterator __last)
    {
      typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
      _M_assign_dispatch(__first, __last, _Integral());
    }

    template<class _Integer>
    void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
    { _M_fill_assign((size_t) __n, (bool) __val); }

    template<class _InputIterator>
    void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
       __false_type)
    { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }

    template<class _InputIterator>
    void _M_assign_aux(_InputIterator __first, _InputIterator __last,
                       input_iterator_tag)
    {
      iterator __cur = begin();
      for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
        *__cur = *__first;
      if (__first == __last)
        erase(__cur, end());
      else
        insert(end(), __first, __last);
    }

    template<class _ForwardIterator>
    void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
                       forward_iterator_tag)
    {
      const size_type __len = std::distance(__first, __last);
      if (__len < size())
        erase(std::copy(__first, __last, begin()), end());
      else
 {
   _ForwardIterator __mid = __first;
   std::advance(__mid, size());
   std::copy(__first, __mid, begin());
   insert(end(), __mid, __last);
 }
    }

    void reserve(size_type __n)
    {
      if (__n > this->max_size())
 __throw_length_error(("vector::reserve"));
      if (this->capacity() < __n)
 {
   _Bit_type* __q = this->_M_allocate(__n);
   this->_M_impl._M_finish = std::copy(begin(), end(),
           iterator(__q, 0));
   this->_M_deallocate();
   this->_M_impl._M_start = iterator(__q, 0);
   this->_M_impl._M_end_of_storage = __q + (__n + _S_word_bit - 1) / _S_word_bit;
 }
    }

    reference front()
    { return *begin(); }

    const_reference front() const
    { return *begin(); }

    reference back()
    { return *(end() - 1); }

    const_reference back() const
    { return *(end() - 1); }

    void push_back(bool __x)
    {
      if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
        *this->_M_impl._M_finish++ = __x;
      else
        _M_insert_aux(end(), __x);
    }

    void swap(vector<bool, _Alloc>& __x)
    {
      std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
      std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
      std::swap(this->_M_impl._M_end_of_storage,
  __x._M_impl._M_end_of_storage);
    }


    static void swap(reference __x, reference __y)
    {
      bool __tmp = __x;
      __x = __y;
      __y = __tmp;
    }

    iterator insert(iterator __position, bool __x = bool())
    {
      const difference_type __n = __position - begin();
      if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
   && __position == end())
        *this->_M_impl._M_finish++ = __x;
      else
        _M_insert_aux(__position, __x);
      return begin() + __n;
    }



    template<class _Integer>
    void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
                            __true_type)
    { _M_fill_insert(__pos, __n, __x); }

    template<class _InputIterator>
    void _M_insert_dispatch(iterator __pos,
                            _InputIterator __first, _InputIterator __last,
                            __false_type)
    { _M_insert_range(__pos, __first, __last,
        std::__iterator_category(__first)); }

    template<class _InputIterator>
    void insert(iterator __position,
                _InputIterator __first, _InputIterator __last)
    {
      typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
      _M_insert_dispatch(__position, __first, __last, _Integral());
    }

    void _M_fill_insert(iterator __position, size_type __n, bool __x)
    {
      if (__n == 0)
 return;
      if (capacity() - size() >= __n)
 {
   std::copy_backward(__position, end(),
        this->_M_impl._M_finish + difference_type(__n));
   std::fill(__position, __position + difference_type(__n), __x);
   this->_M_impl._M_finish += difference_type(__n);
 }
      else
 {
   const size_type __len = size() + std::max(size(), __n);
   _Bit_type * __q = this->_M_allocate(__len);
   iterator __i = std::copy(begin(), __position, iterator(__q, 0));
   std::fill_n(__i, __n, __x);
   this->_M_impl._M_finish = std::copy(__position, end(),
           __i + difference_type(__n));
   this->_M_deallocate();
   this->_M_impl._M_end_of_storage = __q + (__len + _S_word_bit - 1)
                                     / _S_word_bit;
   this->_M_impl._M_start = iterator(__q, 0);
 }
    }

    void insert(iterator __position, size_type __n, bool __x)
    { _M_fill_insert(__position, __n, __x); }

    void pop_back()
    { --this->_M_impl._M_finish; }

    iterator erase(iterator __position)
    {
      if (__position + 1 != end())
        std::copy(__position + 1, end(), __position);
      --this->_M_impl._M_finish;
      return __position;
    }

    iterator erase(iterator __first, iterator __last)
    {
      this->_M_impl._M_finish = std::copy(__last, end(), __first);
      return __first;
    }

    void resize(size_type __new_size, bool __x = bool())
    {
      if (__new_size < size())
        erase(begin() + difference_type(__new_size), end());
      else
        insert(end(), __new_size - size(), __x);
    }

    void flip()
    {
      for (_Bit_type * __p = this->_M_impl._M_start._M_p;
    __p != this->_M_impl._M_end_of_storage; ++__p)
        *__p = ~*__p;
    }

    void clear()
    { erase(begin(), end()); }
  };
}
# 73 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 2 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc" 3
namespace std
{
  template<typename _Tp, typename _Alloc>
    void
    vector<_Tp,_Alloc>::
    reserve(size_type __n)
    {
      if (__n > this->max_size())
 __throw_length_error(("vector::reserve"));
      if (this->capacity() < __n)
 {
   const size_type __old_size = size();
   pointer __tmp = _M_allocate_and_copy(__n,
            this->_M_impl._M_start,
            this->_M_impl._M_finish);
   std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish);
   _M_deallocate(this->_M_impl._M_start,
   this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
   this->_M_impl._M_start = __tmp;
   this->_M_impl._M_finish = __tmp + __old_size;
   this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
 }
    }

  template<typename _Tp, typename _Alloc>
    typename vector<_Tp,_Alloc>::iterator
    vector<_Tp,_Alloc>::
    insert(iterator __position, const value_type& __x)
    {
      size_type __n = __position - begin();
      if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage && __position == end())
      {
        std::_Construct(this->_M_impl._M_finish, __x);
        ++this->_M_impl._M_finish;
      }
      else
        _M_insert_aux(__position, __x);
      return begin() + __n;
    }

  template<typename _Tp, typename _Alloc>
    typename vector<_Tp,_Alloc>::iterator
    vector<_Tp,_Alloc>::
    erase(iterator __position)
    {
      if (__position + 1 != end())
        std::copy(__position + 1, end(), __position);
      --this->_M_impl._M_finish;
      std::_Destroy(this->_M_impl._M_finish);
      return __position;
    }

  template<typename _Tp, typename _Alloc>
    typename vector<_Tp,_Alloc>::iterator
    vector<_Tp,_Alloc>::
    erase(iterator __first, iterator __last)
    {
      iterator __i(std::copy(__last, end(), __first));
      std::_Destroy(__i, end());
      this->_M_impl._M_finish = this->_M_impl._M_finish - (__last - __first);
      return __first;
    }

  template<typename _Tp, typename _Alloc>
    vector<_Tp,_Alloc>&
    vector<_Tp,_Alloc>::
    operator=(const vector<_Tp,_Alloc>& __x)
    {
      if (&__x != this)
      {
        const size_type __xlen = __x.size();
        if (__xlen > capacity())
        {
          pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end());
          std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish);
          _M_deallocate(this->_M_impl._M_start,
   this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
          this->_M_impl._M_start = __tmp;
          this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
        }
        else if (size() >= __xlen)
        {
          iterator __i(std::copy(__x.begin(), __x.end(), begin()));
          std::_Destroy(__i, end());
        }
        else
        {
          std::copy(__x.begin(), __x.begin() + size(), this->_M_impl._M_start);
          std::uninitialized_copy(__x.begin() + size(), __x.end(), this->_M_impl._M_finish);
        }
        this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
      }
      return *this;
    }

  template<typename _Tp, typename _Alloc>
    void
    vector<_Tp,_Alloc>::
    _M_fill_assign(size_t __n, const value_type& __val)
    {
      if (__n > capacity())
      {
        vector __tmp(__n, __val, get_allocator());
        __tmp.swap(*this);
      }
      else if (__n > size())
      {
        std::fill(begin(), end(), __val);
        this->_M_impl._M_finish
   = std::uninitialized_fill_n(this->_M_impl._M_finish, __n - size(), __val);
      }
      else
        erase(fill_n(begin(), __n, __val), end());
    }

  template<typename _Tp, typename _Alloc> template<typename _InputIterator>
    void
    vector<_Tp,_Alloc>::
    _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag)
    {
      iterator __cur(begin());
      for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
        *__cur = *__first;
      if (__first == __last)
        erase(__cur, end());
      else
        insert(end(), __first, __last);
    }

  template<typename _Tp, typename _Alloc> template<typename _ForwardIterator>
    void
    vector<_Tp,_Alloc>::
    _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
                  forward_iterator_tag)
    {
      size_type __len = std::distance(__first, __last);

      if (__len > capacity())
      {
        pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
        std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish);
        _M_deallocate(this->_M_impl._M_start,
        this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
        this->_M_impl._M_start = __tmp;
        this->_M_impl._M_end_of_storage = this->_M_impl._M_finish = this->_M_impl._M_start + __len;
      }
      else if (size() >= __len)
      {
        iterator __new_finish(std::copy(__first, __last, this->_M_impl._M_start));
        std::_Destroy(__new_finish, end());
        this->_M_impl._M_finish = __new_finish.base();
      }
      else
      {
        _ForwardIterator __mid = __first;
        std::advance(__mid, size());
        std::copy(__first, __mid, this->_M_impl._M_start);
        this->_M_impl._M_finish = std::uninitialized_copy(__mid, __last, this->_M_impl._M_finish);
      }
    }

  template<typename _Tp, typename _Alloc>
    void
    vector<_Tp,_Alloc>::
    _M_insert_aux(iterator __position, const _Tp& __x)
    {
      if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
      {
        std::_Construct(this->_M_impl._M_finish, *(this->_M_impl._M_finish - 1));
        ++this->_M_impl._M_finish;
        _Tp __x_copy = __x;
        std::copy_backward(__position,
      iterator(this->_M_impl._M_finish-2),
      iterator(this->_M_impl._M_finish-1));
        *__position = __x_copy;
      }
      else
      {
        const size_type __old_size = size();
        const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
        iterator __new_start(this->_M_allocate(__len));
        iterator __new_finish(__new_start);
        try
          {
            __new_finish = std::uninitialized_copy(iterator(this->_M_impl._M_start),
         __position,
         __new_start);
            std::_Construct(__new_finish.base(), __x);
            ++__new_finish;
            __new_finish = std::uninitialized_copy(__position,
         iterator(this->_M_impl._M_finish),
         __new_finish);
          }
        catch(...)
          {
            std::_Destroy(__new_start,__new_finish);
            _M_deallocate(__new_start.base(),__len);
            throw;
          }
        std::_Destroy(begin(), end());
        _M_deallocate(this->_M_impl._M_start,
        this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
        this->_M_impl._M_start = __new_start.base();
        this->_M_impl._M_finish = __new_finish.base();
        this->_M_impl._M_end_of_storage = __new_start.base() + __len;
      }
    }

  template<typename _Tp, typename _Alloc>
    void
    vector<_Tp,_Alloc>::
    _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
    {
      if (__n != 0)
      {
        if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n)
   {
           value_type __x_copy = __x;
    const size_type __elems_after = end() - __position;
    iterator __old_finish(this->_M_impl._M_finish);
    if (__elems_after > __n)
      {
        std::uninitialized_copy(this->_M_impl._M_finish - __n,
           this->_M_impl._M_finish,
           this->_M_impl._M_finish);
        this->_M_impl._M_finish += __n;
        std::copy_backward(__position, __old_finish - __n, __old_finish);
        std::fill(__position, __position + __n, __x_copy);
      }
    else
      {
        std::uninitialized_fill_n(this->_M_impl._M_finish,
      __n - __elems_after,
      __x_copy);
        this->_M_impl._M_finish += __n - __elems_after;
        std::uninitialized_copy(__position, __old_finish, this->_M_impl._M_finish);
        this->_M_impl._M_finish += __elems_after;
        std::fill(__position, __old_finish, __x_copy);
      }
   }
        else
   {
     const size_type __old_size = size();
     const size_type __len = __old_size + std::max(__old_size, __n);
     iterator __new_start(this->_M_allocate(__len));
     iterator __new_finish(__new_start);
     try
       {
  __new_finish = std::uninitialized_copy(begin(), __position,
             __new_start);
  __new_finish = std::uninitialized_fill_n(__new_finish, __n, __x);
  __new_finish = std::uninitialized_copy(__position, end(),
             __new_finish);
       }
     catch(...)
       {
  std::_Destroy(__new_start,__new_finish);
  _M_deallocate(__new_start.base(),__len);
  throw;
       }
     std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish);
     _M_deallocate(this->_M_impl._M_start,
     this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
     this->_M_impl._M_start = __new_start.base();
     this->_M_impl._M_finish = __new_finish.base();
     this->_M_impl._M_end_of_storage = __new_start.base() + __len;
   }
      }
    }

  template<typename _Tp, typename _Alloc> template<typename _InputIterator>
    void
    vector<_Tp,_Alloc>::
    _M_range_insert(iterator __pos,
                    _InputIterator __first, _InputIterator __last,
                    input_iterator_tag)
    {
      for ( ; __first != __last; ++__first)
      {
        __pos = insert(__pos, *__first);
        ++__pos;
      }
    }

  template<typename _Tp, typename _Alloc> template<typename _ForwardIterator>
    void
    vector<_Tp,_Alloc>::
    _M_range_insert(iterator __position,_ForwardIterator __first,
      _ForwardIterator __last, forward_iterator_tag)
    {
      if (__first != __last)
      {
        size_type __n = std::distance(__first, __last);
        if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n)
        {
          const size_type __elems_after = end() - __position;
          iterator __old_finish(this->_M_impl._M_finish);
          if (__elems_after > __n)
          {
            std::uninitialized_copy(this->_M_impl._M_finish - __n,
        this->_M_impl._M_finish,
        this->_M_impl._M_finish);
            this->_M_impl._M_finish += __n;
            std::copy_backward(__position, __old_finish - __n, __old_finish);
            std::copy(__first, __last, __position);
          }
          else
          {
            _ForwardIterator __mid = __first;
            std::advance(__mid, __elems_after);
            std::uninitialized_copy(__mid, __last, this->_M_impl._M_finish);
            this->_M_impl._M_finish += __n - __elems_after;
            std::uninitialized_copy(__position, __old_finish, this->_M_impl._M_finish);
            this->_M_impl._M_finish += __elems_after;
            std::copy(__first, __mid, __position);
          }
        }
        else
        {
          const size_type __old_size = size();
          const size_type __len = __old_size + std::max(__old_size, __n);
          iterator __new_start(this->_M_allocate(__len));
          iterator __new_finish(__new_start);
          try
            {
              __new_finish = std::uninitialized_copy(iterator(this->_M_impl._M_start),
           __position, __new_start);
              __new_finish = std::uninitialized_copy(__first, __last,
           __new_finish);
              __new_finish = std::uninitialized_copy(__position,
           iterator(this->_M_impl._M_finish),
           __new_finish);
            }
          catch(...)
            {
              std::_Destroy(__new_start,__new_finish);
              _M_deallocate(__new_start.base(), __len);
              throw;
            }
          std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish);
          _M_deallocate(this->_M_impl._M_start,
   this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
          this->_M_impl._M_start = __new_start.base();
          this->_M_impl._M_finish = __new_finish.base();
          this->_M_impl._M_end_of_storage = __new_start.base() + __len;
        }
      }
    }
}
# 76 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/vector" 2 3
# 33 "Linear_Form_defs.hh" 2

namespace Parma_Polyhedra_Library {



template <typename C>
void swap(Linear_Form<C>& x, Linear_Form<C>& y);





template <typename C>
Linear_Form<C>
operator+(const Linear_Form<C>& f1, const Linear_Form<C>& f2);



template <typename C>
Linear_Form<C>
operator+(Variable v, const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator+(const Linear_Form<C>& f, Variable v);



template <typename C>
Linear_Form<C>
operator+(const C& n, const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator+(const Linear_Form<C>& f, const C& n);



template <typename C>
Linear_Form<C>
operator+(const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator-(const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator-(const Linear_Form<C>& f1, const Linear_Form<C>& f2);



template <typename C>
Linear_Form<C>
operator-(Variable v, const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator-(const Linear_Form<C>& f, Variable v);



template <typename C>
Linear_Form<C>
operator-(const C& n, const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator-(const Linear_Form<C>& f, const C& n);



template <typename C>
Linear_Form<C>
operator*(const C& n, const Linear_Form<C>& f);



template <typename C>
Linear_Form<C>
operator*(const Linear_Form<C>& f, const C& n);



template <typename C>
Linear_Form<C>&
operator+=(Linear_Form<C>& f1, const Linear_Form<C>& f2);







template <typename C>
Linear_Form<C>&
operator+=(Linear_Form<C>& f, Variable v);



template <typename C>
Linear_Form<C>&
operator+=(Linear_Form<C>& f, const C& n);



template <typename C>
Linear_Form<C>&
operator-=(Linear_Form<C>& f1, const Linear_Form<C>& f2);







template <typename C>
Linear_Form<C>&
operator-=(Linear_Form<C>& f, Variable v);



template <typename C>
Linear_Form<C>&
operator-=(Linear_Form<C>& f, const C& n);



template <typename C>
Linear_Form<C>&
operator*=(Linear_Form<C>& f, const C& n);







template <typename C>
Linear_Form<C>&
operator/=(Linear_Form<C>& f, const C& n);



template <typename C>
bool
operator==(const Linear_Form<C>& x, const Linear_Form<C>& y);



template <typename C>
bool
operator!=(const Linear_Form<C>& x, const Linear_Form<C>& y);

namespace IO_Operators {



template <typename C>
std::ostream& operator<<(std::ostream& s, const Linear_Form<C>& f);

}

}
# 260 "Linear_Form_defs.hh"
template <typename C>
class Parma_Polyhedra_Library::Linear_Form {
public:

  Linear_Form();


  Linear_Form(const Linear_Form& f);


  ~Linear_Form();


  explicit Linear_Form(const C& n);







  Linear_Form(Variable v);


  Linear_Form(const Linear_Expression& e);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;


  const C& coefficient(Variable v) const;


  const C& inhomogeneous_term() const;


  void negate();





  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  bool OK() const;


  void m_swap(Linear_Form& y);
# 336 "Linear_Form_defs.hh"
  bool overflows() const;
# 365 "Linear_Form_defs.hh"
  void relative_error(Floating_Point_Format analyzed_format,
                      Linear_Form& result) const;
# 398 "Linear_Form_defs.hh"
  template <typename Target>
  bool intervalize(const FP_Oracle<Target,C>& oracle, C& result) const;

private:

  static C zero;


  typedef std::vector<C> vec_type;


  vec_type vec;






  Linear_Form(dimension_type sz, bool);
# 426 "Linear_Form_defs.hh"
  Linear_Form(Variable v, Variable w);


  dimension_type size() const;


  void extend(dimension_type sz);


  C& operator[](dimension_type i);


  const C& operator[](dimension_type i) const;

  friend Linear_Form<C>
  operator+<C>(const Linear_Form<C>& f1, const Linear_Form<C>& f2);
  friend Linear_Form<C>
  operator+<C>(const C& n, const Linear_Form<C>& f);
  friend Linear_Form<C>
  operator+<C>(const Linear_Form<C>& f, const C& n);
  friend Linear_Form<C>
  operator+<C>(Variable v, const Linear_Form<C>& f);

  friend Linear_Form<C>
  operator-<C>(const Linear_Form<C>& f);

  friend Linear_Form<C>
  operator-<C>(const Linear_Form<C>& f1, const Linear_Form<C>& f2);
  friend Linear_Form<C>
  operator-<C>(const C& n, const Linear_Form<C>& f);
  friend Linear_Form<C>
  operator-<C>(const Linear_Form<C>& f, const C& n);
  friend Linear_Form<C>
  operator-<C>(Variable v, const Linear_Form<C>& f);
  friend Linear_Form<C>
  operator-<C>(const Linear_Form<C>& f, Variable v);

  friend Linear_Form<C>
  operator*<C>(const C& n, const Linear_Form<C>& f);
  friend Linear_Form<C>
  operator*<C>(const Linear_Form<C>& f, const C& n);

  friend Linear_Form<C>&
  operator+=<C>(Linear_Form<C>& f1, const Linear_Form<C>& f2);
  friend Linear_Form<C>&
  operator+=<C>(Linear_Form<C>& f, Variable v);
  friend Linear_Form<C>&
  operator+=<C>(Linear_Form<C>& f, const C& n);

  friend Linear_Form<C>&
  operator-=<C>(Linear_Form<C>& f1, const Linear_Form<C>& f2);
  friend Linear_Form<C>&
  operator-=<C>(Linear_Form<C>& f, Variable v);
  friend Linear_Form<C>&
  operator-=<C>(Linear_Form<C>& f, const C& n);

  friend Linear_Form<C>&
  operator*=<C>(Linear_Form<C>& f, const C& n);

  friend Linear_Form<C>&
  operator/=<C>(Linear_Form<C>& f, const C& n);

  friend bool
  operator==<C>(const Linear_Form<C>& x, const Linear_Form<C>& y);

  friend std::ostream&
  Parma_Polyhedra_Library::IO_Operators
  ::operator<<<C>(std::ostream& s, const Linear_Form<C>& f);
};

# 1 "Linear_Form_inlines.hh" 1
# 31 "Linear_Form_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename C>
inline dimension_type
Linear_Form<C>::max_space_dimension() {
  return vec_type().max_size() - 1;
}

template <typename C>
inline
Linear_Form<C>::Linear_Form()
  : vec(1, zero) {
  vec.reserve(compute_capacity(1, vec_type().max_size()));
}

template <typename C>
inline
Linear_Form<C>::Linear_Form(dimension_type sz, bool)
  : vec(sz, zero) {
  vec.reserve(compute_capacity(sz, vec_type().max_size()));
}

template <typename C>
inline
Linear_Form<C>::Linear_Form(const Linear_Form& f)
  : vec(f.vec) {
}

template <typename C>
inline
Linear_Form<C>::~Linear_Form() {
}

template <typename C>
inline dimension_type
Linear_Form<C>::size() const {
  return vec.size();
}

template <typename C>
inline void
Linear_Form<C>::extend(dimension_type sz) {
  (static_cast<void> (0));
  vec.reserve(compute_capacity(sz, vec_type().max_size()));
  vec.resize(sz, zero);
}

template <typename C>
inline
Linear_Form<C>::Linear_Form(const C& n)
  : vec(1, n) {
  vec.reserve(compute_capacity(1, vec_type().max_size()));
}

template <typename C>
inline dimension_type
Linear_Form<C>::space_dimension() const {
  return size() - 1;
}

template <typename C>
inline const C&
Linear_Form<C>::coefficient(Variable v) const {
  if (v.space_dimension() > space_dimension())
    return zero;
  return vec[v.id()+1];
}

template <typename C>
inline C&
Linear_Form<C>::operator[](dimension_type i) {
  (static_cast<void> (0));
  return vec[i];
}

template <typename C>
inline const C&
Linear_Form<C>::operator[](dimension_type i) const {
  (static_cast<void> (0));
  return vec[i];
}

template <typename C>
inline const C&
Linear_Form<C>::inhomogeneous_term() const {
  return vec[0];
}

template <typename C>
inline memory_size_type
Linear_Form<C>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}


template <typename C>
inline Linear_Form<C>
operator+(const Linear_Form<C>& f) {
  return f;
}


template <typename C>
inline Linear_Form<C>
operator+(const Linear_Form<C>& f, const C& n) {
  return n + f;
}


template <typename C>
inline Linear_Form<C>
operator+(const Linear_Form<C>& f, const Variable v) {
  return v + f;
}


template <typename C>
inline Linear_Form<C>
operator-(const Linear_Form<C>& f, const C& n) {
  return -n + f;
}


template <typename C>
inline Linear_Form<C>
operator-(const Variable v, const Variable w) {
  return Linear_Form<C>(v, w);
}


template <typename C>
inline Linear_Form<C>
operator*(const Linear_Form<C>& f, const C& n) {
  return n * f;
}


template <typename C>
inline Linear_Form<C>&
operator+=(Linear_Form<C>& f, const C& n) {
  f[0] += n;
  return f;
}


template <typename C>
inline Linear_Form<C>&
operator-=(Linear_Form<C>& f, const C& n) {
  f[0] -= n;
  return f;
}


template <typename C>
inline bool
operator!=(const Linear_Form<C>& x, const Linear_Form<C>& y) {
  return !(x == y);
}

template <typename C>
inline void
Linear_Form<C>::m_swap(Linear_Form& y) {
  using std::swap;
  swap(vec, y.vec);
}

template <typename C>
inline void
Linear_Form<C>::ascii_dump(std::ostream& s) const {
  using namespace IO_Operators;
  dimension_type space_dim = space_dimension();
  s << space_dim << "\n";
  for (dimension_type i = 0; i <= space_dim; ++i) {
    const char separator = ' ';
    s << vec[i] << separator;
  }
  s << "\n";
}

template <typename C>
inline bool
Linear_Form<C>::ascii_load(std::istream& s) {
  using namespace IO_Operators;
  dimension_type new_dim;
  if (!(s >> new_dim))
    return false;

  vec.resize(new_dim + 1, zero);
  for (dimension_type i = 0; i <= new_dim; ++i) {
    if (!(s >> vec[i]))
      return false;
  }

  ((void) 0);
  return true;
}


template <typename C>
inline bool
Linear_Form<C>::overflows() const {
  if (!inhomogeneous_term().is_bounded())
    return true;

  for (dimension_type i = space_dimension(); i-- > 0; ) {
    if (!coefficient(Variable(i)).is_bounded())
      return true;
  }

  return false;
}


template <typename C>
inline void
swap(Linear_Form<C>& x, Linear_Form<C>& y) {
  x.m_swap(y);
}

}
# 497 "Linear_Form_defs.hh" 2
# 30 "Float_inlines.hh" 2

namespace Parma_Polyhedra_Library {

inline int
float_ieee754_half::inf_sign() const {
  if (word == NEG_INF)
    return -1;
  if (word == POS_INF)
    return 1;
  return 0;
}

inline bool
float_ieee754_half::is_nan() const {
  return (word & ~SGN_MASK) > POS_INF;
}

inline int
float_ieee754_half::zero_sign() const {
  if (word == NEG_ZERO)
    return -1;
  if (word == POS_ZERO)
    return 1;
  return 0;
}

inline void
float_ieee754_half::negate() {
  word ^= SGN_MASK;
}

inline bool
float_ieee754_half::sign_bit() const {
  return (word & SGN_MASK) != 0;
}

inline void
float_ieee754_half::dec() {
  --word;
}

inline void
float_ieee754_half::inc() {
  ++word;
}

inline void
float_ieee754_half::set_max(bool negative) {
  word = WRD_MAX;
  if (negative)
    word |= SGN_MASK;
}

inline void
float_ieee754_half::build(bool negative, mpz_t mantissa, int exponent) {
  word = static_cast<uint16_t>(__gmpz_get_ui(mantissa)
                               & ((1UL << MANTISSA_BITS) - 1));
  if (negative)
    word |= SGN_MASK;
  const int exponent_repr = exponent + EXPONENT_BIAS;
  ((void) 0);
  word |= static_cast<uint16_t>(exponent_repr) << MANTISSA_BITS;
}

inline int
float_ieee754_single::inf_sign() const {
  if (word == NEG_INF)
    return -1;
  if (word == POS_INF)
    return 1;
  return 0;
}

inline bool
float_ieee754_single::is_nan() const {
  return (word & ~SGN_MASK) > POS_INF;
}

inline int
float_ieee754_single::zero_sign() const {
  if (word == NEG_ZERO)
    return -1;
  if (word == POS_ZERO)
    return 1;
  return 0;
}

inline void
float_ieee754_single::negate() {
  word ^= SGN_MASK;
}

inline bool
float_ieee754_single::sign_bit() const {
  return (word & SGN_MASK) != 0;
}

inline void
float_ieee754_single::dec() {
  --word;
}

inline void
float_ieee754_single::inc() {
  ++word;
}

inline void
float_ieee754_single::set_max(bool negative) {
  word = WRD_MAX;
  if (negative)
    word |= SGN_MASK;
}

inline void
float_ieee754_single::build(bool negative, mpz_t mantissa, int exponent) {
  word = static_cast<uint32_t>(__gmpz_get_ui(mantissa)
                               & ((1UL << MANTISSA_BITS) - 1));
  if (negative)
    word |= SGN_MASK;
  const int exponent_repr = exponent + EXPONENT_BIAS;
  ((void) 0);
  word |= static_cast<uint32_t>(exponent_repr) << MANTISSA_BITS;
}

inline int
float_ieee754_double::inf_sign() const {
  if (lsp != LSP_INF)
    return 0;
  if (msp == MSP_NEG_INF)
    return -1;
  if (msp == MSP_POS_INF)
    return 1;
  return 0;
}

inline bool
float_ieee754_double::is_nan() const {
  const uint32_t a = msp & ~MSP_SGN_MASK;
  return a > MSP_POS_INF || (a == MSP_POS_INF && lsp != LSP_INF);
}

inline int
float_ieee754_double::zero_sign() const {
  if (lsp != LSP_ZERO)
    return 0;
  if (msp == MSP_NEG_ZERO)
    return -1;
  if (msp == MSP_POS_ZERO)
    return 1;
  return 0;
}

inline void
float_ieee754_double::negate() {
  msp ^= MSP_SGN_MASK;
}

inline bool
float_ieee754_double::sign_bit() const {
  return (msp & MSP_SGN_MASK) != 0;
}

inline void
float_ieee754_double::dec() {
  if (lsp == 0) {
    --msp;
    lsp = LSP_MAX;
  }
  else
    --lsp;
}

inline void
float_ieee754_double::inc() {
  if (lsp == LSP_MAX) {
    ++msp;
    lsp = 0;
  }
  else
    ++lsp;
}

inline void
float_ieee754_double::set_max(bool negative) {
  msp = MSP_MAX;
  lsp = LSP_MAX;
  if (negative)
    msp |= MSP_SGN_MASK;
}

inline void
float_ieee754_double::build(bool negative, mpz_t mantissa, int exponent) {
  unsigned long m;

  lsp = __gmpz_get_ui(mantissa);
  __gmpz_tdiv_q_2exp(mantissa, mantissa, 32);
  m = __gmpz_get_ui(mantissa);





  msp = static_cast<uint32_t>(m & ((1UL << (MANTISSA_BITS - 32)) - 1));
  if (negative)
    msp |= MSP_SGN_MASK;
  const int exponent_repr = exponent + EXPONENT_BIAS;
  ((void) 0);
  msp |= static_cast<uint32_t>(exponent_repr) << (MANTISSA_BITS - 32);
}

inline int
float_ibm_single::inf_sign() const {
  if (word == NEG_INF)
    return -1;
  if (word == POS_INF)
    return 1;
  return 0;
}

inline bool
float_ibm_single::is_nan() const {
  return (word & ~SGN_MASK) > POS_INF;
}

inline int
float_ibm_single::zero_sign() const {
  if (word == NEG_ZERO)
    return -1;
  if (word == POS_ZERO)
    return 1;
  return 0;
}

inline void
float_ibm_single::negate() {
  word ^= SGN_MASK;
}

inline bool
float_ibm_single::sign_bit() const {
  return (word & SGN_MASK) != 0;
}

inline void
float_ibm_single::dec() {
  --word;
}

inline void
float_ibm_single::inc() {
  ++word;
}

inline void
float_ibm_single::set_max(bool negative) {
  word = WRD_MAX;
  if (negative)
    word |= SGN_MASK;
}

inline void
float_ibm_single::build(bool negative, mpz_t mantissa, int exponent) {
  word = static_cast<uint32_t>(__gmpz_get_ui(mantissa)
                               & ((1UL << MANTISSA_BITS) - 1));
  if (negative)
    word |= SGN_MASK;
  const int exponent_repr = exponent + EXPONENT_BIAS;
  ((void) 0);
  word |= static_cast<uint32_t>(exponent_repr) << MANTISSA_BITS;
}

inline int
float_intel_double_extended::inf_sign() const {
  if (lsp != LSP_INF)
    return 0;
  const uint32_t a = msp & MSP_NEG_INF;
  if (a == MSP_NEG_INF)
    return -1;
  if (a == MSP_POS_INF)
    return 1;
  return 0;
}

inline bool
float_intel_double_extended::is_nan() const {
  return (msp & MSP_POS_INF) == MSP_POS_INF
    && lsp != LSP_INF;
}

inline int
float_intel_double_extended::zero_sign() const {
  if (lsp != LSP_ZERO)
    return 0;
  const uint32_t a = msp & MSP_NEG_INF;
  if (a == MSP_NEG_ZERO)
    return -1;
  if (a == MSP_POS_ZERO)
    return 1;
  return 0;
}

inline void
float_intel_double_extended::negate() {
  msp ^= MSP_SGN_MASK;
}

inline bool
float_intel_double_extended::sign_bit() const {
  return (msp & MSP_SGN_MASK) != 0;
}

inline void
float_intel_double_extended::dec() {
  if ((lsp & LSP_DMAX) == 0) {
    --msp;
    lsp = ((msp & MSP_NEG_INF) == 0) ? LSP_DMAX : LSP_NMAX;
  }
  else
    --lsp;
}

inline void
float_intel_double_extended::inc() {
  if ((lsp & LSP_DMAX) == LSP_DMAX) {
    ++msp;
    lsp = LSP_DMAX + 1;
  }
  else
    ++lsp;
}

inline void
float_intel_double_extended::set_max(bool negative) {
  msp = MSP_MAX;
  lsp = LSP_NMAX;
  if (negative)
    msp |= MSP_SGN_MASK;
}

inline void
float_intel_double_extended::build(bool negative,
                                   mpz_t mantissa, int exponent) {

  __gmpz_export(&lsp, 0, -1, sizeof(lsp), 0, 0, mantissa);



  msp = (negative ? MSP_SGN_MASK : 0);
  const int exponent_repr = exponent + EXPONENT_BIAS;
  ((void) 0);
  msp |= static_cast<uint32_t>(exponent_repr);
}

inline int
float_ieee754_quad::inf_sign() const {
  if (lsp != LSP_INF)
    return 0;
  if (msp == MSP_NEG_INF)
    return -1;
  if (msp == MSP_POS_INF)
    return 1;
  return 0;
}

inline bool
float_ieee754_quad::is_nan() const {
  return (msp & ~MSP_SGN_MASK) == MSP_POS_INF
    && lsp != LSP_INF;
}

inline int
float_ieee754_quad::zero_sign() const {
  if (lsp != LSP_ZERO)
    return 0;
  if (msp == MSP_NEG_ZERO)
    return -1;
  if (msp == MSP_POS_ZERO)
    return 1;
  return 0;
}

inline void
float_ieee754_quad::negate() {
  msp ^= MSP_SGN_MASK;
}

inline bool
float_ieee754_quad::sign_bit() const {
  return (msp & MSP_SGN_MASK) != 0;
}

inline void
float_ieee754_quad::dec() {
  if (lsp == 0) {
    --msp;
    lsp = LSP_MAX;
  }
  else
    --lsp;
}

inline void
float_ieee754_quad::inc() {
  if (lsp == LSP_MAX) {
    ++msp;
    lsp = 0;
  }
  else
    ++lsp;
}

inline void
float_ieee754_quad::set_max(bool negative) {
  msp = MSP_MAX;
  lsp = LSP_MAX;
  if (negative)
    msp |= MSP_SGN_MASK;
}

inline void
float_ieee754_quad::build(bool negative, mpz_t mantissa, int exponent) {
  uint64_t parts[2];
  __gmpz_export(parts, 0, -1, sizeof(parts[0]), 0, 0, mantissa);
  lsp = parts[0];
  msp = parts[1];
  msp &= ((static_cast<uint64_t>(1) << (MANTISSA_BITS - 64)) - 1);
  if (negative)
    msp |= MSP_SGN_MASK;
  const int exponent_repr = exponent + EXPONENT_BIAS;
  ((void) 0);
  msp |= static_cast<uint64_t>(exponent_repr) << (MANTISSA_BITS - 64);
}

inline bool
is_less_precise_than(Floating_Point_Format f1, Floating_Point_Format f2) {
  return f1 < f2;
}

inline unsigned int
msb_position(unsigned long long v) {
  return static_cast<unsigned int>(((sizeof(v)) * static_cast<std::size_t>(8))) - 1U - clz(v);
}

template <typename FP_Interval_Type>
inline void
affine_form_image(std::map<dimension_type,
                           Linear_Form<FP_Interval_Type> >& lf_store,
                  const Variable var,
                  const Linear_Form<FP_Interval_Type>& lf) {

  lf_store[var.id()] = lf;

  discard_occurrences(lf_store, var);
}


inline
Float<float>::Float() {
}

inline
Float<float>::Float(float v) {
  u.number = v;
}

inline float
Float<float>::value() {
  return u.number;
}



inline
Float<double>::Float() {
}

inline
Float<double>::Float(double v) {
  u.number = v;
}

inline double
Float<double>::value() {
  return u.number;
}



inline
Float<long double>::Float() {
}

inline
Float<long double>::Float(long double v) {
  u.number = v;
}

inline long double
Float<long double>::value() {
  return u.number;
}


}
# 521 "Float_defs.hh" 2
# 1 "Float_templates.hh" 1
# 32 "Float_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename FP_Interval_Type>
const FP_Interval_Type& compute_absolute_error(
                        const Floating_Point_Format analyzed_format) {
  typedef typename FP_Interval_Type::boundary_type analyzer_format;


  static const FP_Interval_Type ZERO_INTERVAL = FP_Interval_Type(0);

  static FP_Interval_Type ieee754_half_result = ZERO_INTERVAL;
  static FP_Interval_Type ieee754_single_result = ZERO_INTERVAL;
  static FP_Interval_Type ieee754_double_result = ZERO_INTERVAL;
  static FP_Interval_Type ibm_single_result = ZERO_INTERVAL;
  static FP_Interval_Type ieee754_quad_result = ZERO_INTERVAL;
  static FP_Interval_Type intel_double_extended_result = ZERO_INTERVAL;

  FP_Interval_Type* to_compute = __null;

  unsigned int f_base;
  int f_exponent_bias;
  unsigned int f_mantissa_bits;
  switch (analyzed_format) {
    case IEEE754_HALF:
      if (ieee754_half_result != ZERO_INTERVAL)
        return ieee754_half_result;

      to_compute = &ieee754_half_result;
      f_base = float_ieee754_half::BASE;
      f_exponent_bias = float_ieee754_half::EXPONENT_BIAS;
      f_mantissa_bits = float_ieee754_half::MANTISSA_BITS;
      break;
    case IEEE754_SINGLE:
      if (ieee754_single_result != ZERO_INTERVAL)
        return ieee754_single_result;

      to_compute = &ieee754_single_result;
      f_base = float_ieee754_single::BASE;
      f_exponent_bias = float_ieee754_single::EXPONENT_BIAS;
      f_mantissa_bits = float_ieee754_single::MANTISSA_BITS;
      break;
    case IEEE754_DOUBLE:
      if (ieee754_double_result != ZERO_INTERVAL)
        return ieee754_double_result;

      to_compute = &ieee754_double_result;
      f_base = float_ieee754_double::BASE;
      f_exponent_bias = float_ieee754_double::EXPONENT_BIAS;
      f_mantissa_bits = float_ieee754_double::MANTISSA_BITS;
      break;
    case IBM_SINGLE:
      if (ibm_single_result != ZERO_INTERVAL)
        return ibm_single_result;

      to_compute = &ibm_single_result;
      f_base = float_ibm_single::BASE;
      f_exponent_bias = float_ibm_single::EXPONENT_BIAS;
      f_mantissa_bits = float_ibm_single::MANTISSA_BITS;
      break;
    case IEEE754_QUAD:
      if (ieee754_quad_result != ZERO_INTERVAL)
        return ieee754_quad_result;

      to_compute = &ieee754_quad_result;
      f_base = float_ieee754_quad::BASE;
      f_exponent_bias = float_ieee754_quad::EXPONENT_BIAS;
      f_mantissa_bits = float_ieee754_quad::MANTISSA_BITS;
      break;
    case INTEL_DOUBLE_EXTENDED:
      if (intel_double_extended_result != ZERO_INTERVAL)
        return intel_double_extended_result;

      to_compute = &intel_double_extended_result;
      f_base = float_intel_double_extended::BASE;
      f_exponent_bias = float_intel_double_extended::EXPONENT_BIAS;
      f_mantissa_bits = float_intel_double_extended::MANTISSA_BITS;
      break;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      break;
  }

  ((void) 0);


  analyzer_format omega;
  int power = static_cast<int>(msb_position(f_base))
    * ((1 - f_exponent_bias) - static_cast<int>(f_mantissa_bits));
  omega = std::max(static_cast<analyzer_format>(ldexp(1.0, power)),
                   std::numeric_limits<analyzer_format>::denorm_min());

  to_compute->build(i_constraint(GREATER_OR_EQUAL, -omega),
                    i_constraint(LESS_OR_EQUAL, omega));
  return *to_compute;
}

template <typename FP_Interval_Type>
void
discard_occurrences(std::map<dimension_type,
                             Linear_Form<FP_Interval_Type> >& lf_store,
                    Variable var) {
  typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;
  typedef typename std::map<dimension_type, FP_Linear_Form>::iterator Iter;
  for (Iter i = lf_store.begin(); i != lf_store.end(); ) {
    if((i->second).coefficient(var) != 0)
      i = lf_store.erase(i);
    else
      ++i;
  }
}



template <typename FP_Interval_Type>
void upper_bound_assign(std::map<dimension_type,
                                 Linear_Form<FP_Interval_Type> >& ls1,
                        const std::map<dimension_type,
                                       Linear_Form<FP_Interval_Type> >& ls2) {
  typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;
  typedef typename std::map<dimension_type, FP_Linear_Form>::iterator Iter;
  typedef typename std::map<dimension_type,
                            FP_Linear_Form>::const_iterator Const_Iter;

  Const_Iter i2_end = ls2.end();
  for (Iter i1 = ls1.begin(), i1_end = ls1.end(); i1 != i1_end; ) {
    Const_Iter i2 = ls2.find(i1->first);
    if ((i2 == i2_end) || (i1->second != i2->second))
      i1 = ls1.erase(i1);
    else
      ++i1;
  }
}

}
# 522 "Float_defs.hh" 2
# 35 "checked_defs.hh" 2

namespace Parma_Polyhedra_Library {

namespace Checked {
# 471 "checked_defs.hh"
template <typename Policy1, typename Policy2, typename Type1, typename Type2> struct copy_function_struct; template <typename Policy1, typename Policy2, typename Type1, typename Type2> inline void copy( Type1& arg1, const Type2& arg2) { return copy_function_struct<Policy1, Policy2, Type1, Type2>::function(arg1, arg2); }

template <typename Policy, typename From> struct sgn_function_struct; template <typename Policy, typename From> inline Result_Relation sgn(const From& arg) { return sgn_function_struct<Policy, From>::function(arg); }

template <typename Policy1, typename Policy2, typename Type1, typename Type2> struct cmp_function_struct; template <typename Policy1, typename Policy2, typename Type1, typename Type2> inline Result_Relation cmp(const Type1& arg1, const Type2& arg2) { return cmp_function_struct<Policy1, Policy2, Type1, Type2>::function(arg1, arg2); }

template <typename Policy, typename Type> struct classify_function_struct; template <typename Policy, typename Type> inline Result classify(const Type& arg, bool a1, bool a2, bool a3) { return classify_function_struct<Policy, Type>::function(arg, a1, a2, a3); }

template <typename Policy, typename Type> struct is_nan_function_struct; template <typename Policy, typename Type> inline bool is_nan(const Type& arg) { return is_nan_function_struct<Policy, Type>::function(arg); }

template <typename Policy, typename Type> struct is_minf_function_struct; template <typename Policy, typename Type> inline bool is_minf(const Type& arg) { return is_minf_function_struct<Policy, Type>::function(arg); }

template <typename Policy, typename Type> struct is_pinf_function_struct; template <typename Policy, typename Type> inline bool is_pinf(const Type& arg) { return is_pinf_function_struct<Policy, Type>::function(arg); }

template <typename Policy, typename Type> struct is_int_function_struct; template <typename Policy, typename Type> inline bool is_int(const Type& arg) { return is_int_function_struct<Policy, Type>::function(arg); }

template <typename Policy, typename Type> struct assign_special_function_struct; template <typename Policy, typename Type> inline Result assign_special( Type& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_function_struct<Policy, Type>::function(arg, a1, a2); }

template <typename Policy, typename Type> struct construct_special_function_struct; template <typename Policy, typename Type> inline Result construct_special( Type& arg, Result_Class a1, Rounding_Dir a2) { return construct_special_function_struct<Policy, Type>::function(arg, a1, a2); }

template <typename Policy1, typename Policy2, typename To, typename From> struct construct_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result construct( To& arg1, const From& arg2, Rounding_Dir a1) { return construct_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct assign_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result assign( To& arg1, const From& arg2, Rounding_Dir a1) { return assign_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct floor_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result floor( To& arg1, const From& arg2, Rounding_Dir a1) { return floor_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct ceil_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result ceil( To& arg1, const From& arg2, Rounding_Dir a1) { return ceil_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct trunc_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result trunc( To& arg1, const From& arg2, Rounding_Dir a1) { return trunc_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct neg_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result neg( To& arg1, const From& arg2, Rounding_Dir a1) { return neg_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct abs_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result abs( To& arg1, const From& arg2, Rounding_Dir a1) { return abs_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename To, typename From> struct sqrt_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result sqrt( To& arg1, const From& arg2, Rounding_Dir a1) { return sqrt_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1); }

template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct add_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result add( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return add_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct sub_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result sub( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return sub_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct mul_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result mul( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return mul_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct div_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result div( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return div_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct rem_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result rem( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return rem_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct idiv_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result idiv( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return idiv_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename To, typename From> struct add_2exp_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result add_2exp( To& arg1, const From& arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1, a2); }


template <typename Policy1, typename Policy2, typename To, typename From> struct sub_2exp_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result sub_2exp( To& arg1, const From& arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1, a2); }


template <typename Policy1, typename Policy2, typename To, typename From> struct mul_2exp_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result mul_2exp( To& arg1, const From& arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1, a2); }


template <typename Policy1, typename Policy2, typename To, typename From> struct div_2exp_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result div_2exp( To& arg1, const From& arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1, a2); }


template <typename Policy1, typename Policy2, typename To, typename From> struct smod_2exp_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result smod_2exp( To& arg1, const From& arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1, a2); }


template <typename Policy1, typename Policy2, typename To, typename From> struct umod_2exp_function_struct; template <typename Policy1, typename Policy2, typename To, typename From> inline Result umod_2exp( To& arg1, const From& arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_function_struct<Policy1, Policy2, To, From>::function(arg1, arg2, a1, a2); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct add_mul_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result add_mul( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return add_mul_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct sub_mul_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result sub_mul( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return sub_mul_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct gcd_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result gcd( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return gcd_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename Policy4,typename Policy5, typename To1, typename To2, typename To3, typename From1, typename From2> struct gcdext_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename Policy4,typename Policy5, typename To1, typename To2, typename To3, typename From1, typename From2> inline Result gcdext( To1& arg1, To2& arg2, To3& arg3, const From1& arg4, const From2& arg5, Rounding_Dir a1) { return gcdext_function_struct<Policy1, Policy2, Policy3, Policy4, Policy5, To1, To2, To3, From1, From2> ::function(arg1, arg2, arg3, arg4, arg5, a1); }


template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> struct lcm_function_struct; template <typename Policy1, typename Policy2, typename Policy3, typename To, typename From1, typename From2> inline Result lcm( To& arg1, const From1& arg2, const From2& arg3, Rounding_Dir a1) { return lcm_function_struct<Policy1, Policy2, Policy3, To, From1, From2> ::function(arg1, arg2, arg3, a1); }


template <typename Policy, typename Type> struct input_function_struct; template <typename Policy, typename Type> inline Result input( Type& arg, std::istream& a1, Rounding_Dir a2) { return input_function_struct<Policy, Type>::function(arg, a1, a2); }

template <typename Policy, typename Type> struct output_function_struct; template <typename Policy, typename Type> inline Result output(std::ostream& b1, const Type& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_function_struct<Policy, Type>::function(b1, arg, a1, a2); }
# 577 "checked_defs.hh"
template <typename Policy, typename To>
Result round(To& to, Result r, Rounding_Dir dir);

Result input_mpq(mpq_class& to, std::istream& is);

std::string float_mpq_to_string(mpq_class& q);

}

struct Minus_Infinity {
  static const Result_Class vclass = VC_MINUS_INFINITY;
};
struct Plus_Infinity {
  static const Result_Class vclass = VC_PLUS_INFINITY;
};
struct Not_A_Number {
  static const Result_Class vclass = VC_NAN;
};

template <typename T>
struct Is_Special : public False { };

template <>
struct Is_Special<Minus_Infinity> : public True {};

template <>
struct Is_Special<Plus_Infinity> : public True {};

template <>
struct Is_Special<Not_A_Number> : public True {};

extern Minus_Infinity MINUS_INFINITY;
extern Plus_Infinity PLUS_INFINITY;
extern Not_A_Number NOT_A_NUMBER;




template <typename T>
struct Checked_Number_Transparent_Policy {

  enum const_bool_value_check_overflow { check_overflow = (false) };


  enum const_bool_value_check_inf_add_inf { check_inf_add_inf = (false) };


  enum const_bool_value_check_inf_sub_inf { check_inf_sub_inf = (false) };


  enum const_bool_value_check_inf_mul_zero { check_inf_mul_zero = (false) };


  enum const_bool_value_check_div_zero { check_div_zero = (false) };


  enum const_bool_value_check_inf_div_inf { check_inf_div_inf = (false) };


  enum const_bool_value_check_inf_mod { check_inf_mod = (false) };


  enum const_bool_value_check_sqrt_neg { check_sqrt_neg = (false) };


  enum const_bool_value_has_nan { has_nan = (std::numeric_limits<T>::has_quiet_NaN) };


  enum const_bool_value_has_infinity { has_infinity = (std::numeric_limits<T>::has_infinity) };





  enum const_bool_value_convertible { convertible = (true) };


  enum const_bool_value_fpu_check_inexact { fpu_check_inexact = (false) };


  enum const_bool_value_fpu_check_nan_result { fpu_check_nan_result = (false) };





  static const Rounding_Dir ROUND_DEFAULT_CONSTRUCTOR = ROUND_NATIVE;





  static const Rounding_Dir ROUND_DEFAULT_OPERATOR = ROUND_NATIVE;





  static const Rounding_Dir ROUND_DEFAULT_INPUT = ROUND_NATIVE;





  static const Rounding_Dir ROUND_DEFAULT_OUTPUT = ROUND_NATIVE;





  static const Rounding_Dir ROUND_DEFAULT_FUNCTION = ROUND_NATIVE;





  static void handle_result(Result r);
};

}



# 1 "checked_inlines.hh" 1
# 41 "checked_inlines.hh"
namespace Parma_Polyhedra_Library {

namespace Checked {

template <typename T1, typename T2>
struct Safe_Conversion : public False {
};
template <typename T>
struct Safe_Conversion<T, T> : public True {
};






template <> struct Safe_Conversion<signed short, char> : public True { };

template <> struct Safe_Conversion<signed short, signed char> : public True { };




template <> struct Safe_Conversion<signed short, unsigned char> : public True { };



template <> struct Safe_Conversion<signed int, char> : public True { };

template <> struct Safe_Conversion<signed int, signed char> : public True { };
template <> struct Safe_Conversion<signed int, signed short> : public True { };




template <> struct Safe_Conversion<signed int, unsigned char> : public True { };


template <> struct Safe_Conversion<signed int, unsigned short> : public True { };



template <> struct Safe_Conversion<signed long, char> : public True { };

template <> struct Safe_Conversion<signed long, signed char> : public True { };
template <> struct Safe_Conversion<signed long, signed short> : public True { };
template <> struct Safe_Conversion<signed long, signed int> : public True { };




template <> struct Safe_Conversion<signed long, unsigned char> : public True { };


template <> struct Safe_Conversion<signed long, unsigned short> : public True { };






template <> struct Safe_Conversion<signed long long, char> : public True { };

template <> struct Safe_Conversion<signed long long, signed char> : public True { };
template <> struct Safe_Conversion<signed long long, signed short> : public True { };
template <> struct Safe_Conversion<signed long long, signed int> : public True { };
template <> struct Safe_Conversion<signed long long, signed long> : public True { };




template <> struct Safe_Conversion<signed long long, unsigned char> : public True { };


template <> struct Safe_Conversion<signed long long, unsigned short> : public True { };


template <> struct Safe_Conversion<signed long long, unsigned int> : public True { };


template <> struct Safe_Conversion<signed long long, unsigned long> : public True { };





template <> struct Safe_Conversion<unsigned short, unsigned char> : public True { };




template <> struct Safe_Conversion<unsigned int, unsigned char> : public True { };
template <> struct Safe_Conversion<unsigned int, unsigned short> : public True { };




template <> struct Safe_Conversion<unsigned long, unsigned char> : public True { };
template <> struct Safe_Conversion<unsigned long, unsigned short> : public True { };
template <> struct Safe_Conversion<unsigned long, unsigned int> : public True { };




template <> struct Safe_Conversion<unsigned long long, unsigned char> : public True { };
template <> struct Safe_Conversion<unsigned long long, unsigned short> : public True { };
template <> struct Safe_Conversion<unsigned long long, unsigned int> : public True { };
template <> struct Safe_Conversion<unsigned long long, unsigned long> : public True { };



template <> struct Safe_Conversion<float, char> : public True { };
template <> struct Safe_Conversion<float, signed char> : public True { };
template <> struct Safe_Conversion<float, unsigned char> : public True { };


template <> struct Safe_Conversion<float, signed short> : public True { };
template <> struct Safe_Conversion<float, unsigned short> : public True { };
# 174 "checked_inlines.hh"
template <> struct Safe_Conversion<double, char> : public True { };
template <> struct Safe_Conversion<double, signed char> : public True { };
template <> struct Safe_Conversion<double, unsigned char> : public True { };


template <> struct Safe_Conversion<double, signed short> : public True { };
template <> struct Safe_Conversion<double, unsigned short> : public True { };


template <> struct Safe_Conversion<double, signed int> : public True { };
template <> struct Safe_Conversion<double, unsigned int> : public True { };


template <> struct Safe_Conversion<double, signed long> : public True { };
template <> struct Safe_Conversion<double, unsigned long> : public True { };





template <> struct Safe_Conversion<double, float> : public True { };


template <> struct Safe_Conversion<long double, char> : public True { };
template <> struct Safe_Conversion<long double, signed char> : public True { };
template <> struct Safe_Conversion<long double, unsigned char> : public True { };


template <> struct Safe_Conversion<long double, signed short> : public True { };
template <> struct Safe_Conversion<long double, unsigned short> : public True { };


template <> struct Safe_Conversion<long double, signed int> : public True { };
template <> struct Safe_Conversion<long double, unsigned int> : public True { };


template <> struct Safe_Conversion<long double, signed long> : public True { };
template <> struct Safe_Conversion<long double, unsigned long> : public True { };


template <> struct Safe_Conversion<long double, signed long long> : public True { };
template <> struct Safe_Conversion<long double, unsigned long long> : public True { };

template <> struct Safe_Conversion<long double, float> : public True { };
template <> struct Safe_Conversion<long double, double> : public True { };

template <> struct Safe_Conversion<mpz_class, char> : public True { };
template <> struct Safe_Conversion<mpz_class, signed char> : public True { };
template <> struct Safe_Conversion<mpz_class, signed short> : public True { };
template <> struct Safe_Conversion<mpz_class, signed int> : public True { };
template <> struct Safe_Conversion<mpz_class, signed long> : public True { };

template <> struct Safe_Conversion<mpz_class, unsigned char> : public True { };
template <> struct Safe_Conversion<mpz_class, unsigned short> : public True { };
template <> struct Safe_Conversion<mpz_class, unsigned int> : public True { };
template <> struct Safe_Conversion<mpz_class, unsigned long> : public True { };


template <> struct Safe_Conversion<mpq_class, char> : public True { };
template <> struct Safe_Conversion<mpq_class, signed char> : public True { };
template <> struct Safe_Conversion<mpq_class, signed short> : public True { };
template <> struct Safe_Conversion<mpq_class, signed int> : public True { };
template <> struct Safe_Conversion<mpq_class, signed long> : public True { };

template <> struct Safe_Conversion<mpq_class, unsigned char> : public True { };
template <> struct Safe_Conversion<mpq_class, unsigned short> : public True { };
template <> struct Safe_Conversion<mpq_class, unsigned int> : public True { };
template <> struct Safe_Conversion<mpq_class, unsigned long> : public True { };

template <> struct Safe_Conversion<mpq_class, float> : public True { };
template <> struct Safe_Conversion<mpq_class, double> : public True { };




template <typename Policy, typename Type>
struct construct_function_struct<Policy, Policy, Type, Type> {
  static inline Result function(Type& to, const Type& from, Rounding_Dir) {
    new (&to) Type(from);
    return V_EQ;
  }
};

template <typename To_Policy, typename From_Policy, typename To, typename From>
struct construct_function_struct {
  static inline Result function(To& to, const From& from, Rounding_Dir dir) {
    new (&to) To();
    return assign<To_Policy, From_Policy>(to, from, dir);
  }
};

template <typename To_Policy, typename To>
struct construct_special_function_struct {
  static inline Result function(To& to, Result_Class r, Rounding_Dir dir) {
    new (&to) To();
    return assign_special<To_Policy>(to, r, dir);
  }
};

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_exact(To& to, const From& from, Rounding_Dir) {
  to = from;
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline typename Enable_If<Is_Same<To_Policy, From_Policy>::value, void>::type
copy_generic(Type& to, const Type& from) {
  to = from;
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
abs_generic(To& to, const From& from, Rounding_Dir dir) {
  if (from < 0)
    return neg<To_Policy, From_Policy>(to, from, dir);
  else
    return assign<To_Policy, From_Policy>(to, from, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From>
inline void
gcd_exact_no_abs(To& to, const From& x, const From& y) {
  To w_x = x;
  To w_y = y;
  To remainder;
  while (w_y != 0) {



    rem<To_Policy, From1_Policy, From2_Policy>(remainder, w_x, w_y,
                                               ROUND_NOT_NEEDED);
    w_x = w_y;
    w_y = remainder;
  }
  to = w_x;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
gcd_exact(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  gcd_exact_no_abs<To_Policy, From1_Policy, From2_Policy>(to, x, y);
  return abs<To_Policy, To_Policy>(to, to, dir);
}

template <typename To1_Policy, typename To2_Policy, typename To3_Policy,
          typename From1_Policy, typename From2_Policy,
          typename To1, typename To2, typename To3,
          typename From1, typename From2>
inline Result
gcdext_exact(To1& to, To2& s, To3& t, const From1& x, const From2& y,
             Rounding_Dir dir) {




  if (y == 0) {
    if (x == 0) {
      s = 0;
      t = 1;
      return V_EQ;
    }
    else {
      if (x < 0)
        s = -1;
      else
        s = 1;
      t = 0;
      return abs<To1_Policy, From1_Policy>(to, x, dir);
    }
  }

  s = 1;
  t = 0;
  bool negative_x = x < 0;
  bool negative_y = y < 0;

  Result r;
  r = abs<To1_Policy, From1_Policy>(to, x, dir);
  if (r != V_EQ)
    return r;

  From2 a_y;
  r = abs<To1_Policy, From2_Policy>(a_y, y, dir);
  if (r != V_EQ)
    return r;







  if (to == a_y)
    goto sign_check;


  {
    To2 v1 = 0;
    To3 v2 = 1;
    To1 v3 = static_cast<To1>(a_y);
    while (true) {
      To1 q = to / v3;

      To1 t3 = to - q*v3;
      To2 t1 = s - static_cast<To2>(q)*v1;
      To3 t2 = t - static_cast<To3>(q)*v2;
      s = v1;
      t = v2;
      to = v3;
      if (t3 == 0)
        break;
      v1 = t1;
      v2 = t2;
      v3 = t3;
    }
  }


 sign_check:

  if (negative_x) {
    r = neg<To2_Policy, To2_Policy>(s, s, dir);
    if (r != V_EQ)
      return r;
  }
  if (negative_y)
    return neg<To3_Policy, To3_Policy>(t, t, dir);
  return V_EQ;

}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
lcm_gcd_exact(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (x == 0 || y == 0) {
    to = 0;
    return V_EQ;
  }
  To a_x;
  To a_y;
  Result r;
  r = abs<From1_Policy, From1_Policy>(a_x, x, dir);
  if (r != V_EQ)
    return r;
  r = abs<From2_Policy, From2_Policy>(a_y, y, dir);
  if (r != V_EQ)
    return r;
  To gcd;
  gcd_exact_no_abs<To_Policy, From1_Policy, From2_Policy>(gcd, a_x, a_y);



  div<To_Policy, From1_Policy, To_Policy>(to, a_x, gcd, ROUND_NOT_NEEDED);
  return mul<To_Policy, To_Policy, From2_Policy>(to, to, a_y, dir);
}

template <typename Policy, typename Type>
inline Result_Relation
sgn_generic(const Type& x) {
  if (x > 0)
    return VR_GT;
  if (x == 0)
    return VR_EQ;
  return VR_LT;
}

template <typename T1, typename T2, typename Enable = void>
struct Safe_Int_Comparison : public False {
};

template <typename T1, typename T2>
struct Safe_Int_Comparison<T1, T2, typename Enable_If<(C_Integer<T1>::value && C_Integer<T2>::value)>::type>
  : public Bool<(C_Integer<T1>::is_signed
                 ? (C_Integer<T2>::is_signed
                    || sizeof(T2) < sizeof(T1)
                    || sizeof(T2) < sizeof(int))
                 : (!C_Integer<T2>::is_signed
                    || sizeof(T1) < sizeof(T2)
                    || sizeof(T1) < sizeof(int)))> {
};


template <typename T1, typename T2>
inline typename Enable_If<(Safe_Int_Comparison<T1, T2>::value
                           || Safe_Conversion<T1, T2>::value
                           || Safe_Conversion<T2, T1>::value), bool>::type
lt(const T1& x, const T2& y) {
  return x < y;
}
template <typename T1, typename T2>
inline typename Enable_If<(Safe_Int_Comparison<T1, T2>::value
                           || Safe_Conversion<T1, T2>::value
                           || Safe_Conversion<T2, T1>::value), bool>::type
le(const T1& x, const T2& y) {
  return x <= y;
}
template <typename T1, typename T2>
inline typename Enable_If<(Safe_Int_Comparison<T1, T2>::value
                           || Safe_Conversion<T1, T2>::value
                           || Safe_Conversion<T2, T1>::value), bool>::type
eq(const T1& x, const T2& y) {
  return x == y;
}

template <typename S, typename U>
inline typename Enable_If<(!Safe_Int_Comparison<S, U>::value
                           && C_Integer<U>::value
                           && C_Integer<S>::is_signed), bool>::type
lt(const S& x, const U& y) {
  return x < 0 || static_cast<typename C_Integer<S>::other_type>(x) < y;
}

template <typename U, typename S>
inline typename Enable_If<(!Safe_Int_Comparison<S, U>::value
                           && C_Integer<U>::value
                           && C_Integer<S>::is_signed), bool>::type
lt(const U& x, const S& y) {
  return y >= 0 && x < static_cast<typename C_Integer<S>::other_type>(y);
}

template <typename S, typename U>
inline typename Enable_If<(!Safe_Int_Comparison<S, U>::value
                           && C_Integer<U>::value
                           && C_Integer<S>::is_signed), bool>::type
le(const S& x, const U& y) {
  return x < 0 || static_cast<typename C_Integer<S>::other_type>(x) <= y;
}

template <typename U, typename S>
inline typename Enable_If<(!Safe_Int_Comparison<S, U>::value
                           && C_Integer<U>::value
                           && C_Integer<S>::is_signed), bool>::type
le(const U& x, const S& y) {
  return y >= 0 && x <= static_cast<typename C_Integer<S>::other_type>(y);
}

template <typename S, typename U>
inline typename Enable_If<(!Safe_Int_Comparison<S, U>::value
                           && C_Integer<U>::value
                           && C_Integer<S>::is_signed), bool>::type
eq(const S& x, const U& y) {
  return x >= 0 && static_cast<typename C_Integer<S>::other_type>(x) == y;
}

template <typename U, typename S>
inline typename Enable_If<(!Safe_Int_Comparison<S, U>::value
                           && C_Integer<U>::value
                           && C_Integer<S>::is_signed), bool>::type
eq(const U& x, const S& y) {
  return y >= 0 && x == static_cast<typename C_Integer<S>::other_type>(y);
}

template <typename T1, typename T2>
inline typename Enable_If<(!Safe_Conversion<T1, T2>::value
                           && !Safe_Conversion<T2, T1>::value
                           && (!C_Integer<T1>::value || !C_Integer<T2>::value)), bool>::type
eq(const T1& x, const T2& y) {
  Parma_Polyhedra_Library::Dirty_Temp<T1> holder_tmp; T1& tmp = holder_tmp.item();
  Result r = assign_r(tmp, y, ROUND_CHECK);




  ((void) 0);
  return r == V_EQ && x == tmp;
}

template <typename T1, typename T2>
inline typename Enable_If<(!Safe_Conversion<T1, T2>::value
                           && !Safe_Conversion<T2, T1>::value
                           && (!C_Integer<T1>::value || !C_Integer<T2>::value)), bool>::type
lt(const T1& x, const T2& y) {
  Parma_Polyhedra_Library::Dirty_Temp<T1> holder_tmp; T1& tmp = holder_tmp.item();
  Result r = assign_r(tmp, y, ROUND_UP);
  if (!result_representable(r))
    return true;
  switch (result_relation(r)) {
  case VR_EQ:
  case VR_LT:
  case VR_LE:
    return x < tmp;
  default:
    return false;
  }
}

template <typename T1, typename T2>
inline typename
Enable_If<(!Safe_Conversion<T1, T2>::value
           && !Safe_Conversion<T2, T1>::value
           && (!C_Integer<T1>::value || !C_Integer<T2>::value)), bool>::type
le(const T1& x, const T2& y) {
  Parma_Polyhedra_Library::Dirty_Temp<T1> holder_tmp; T1& tmp = holder_tmp.item();
  Result r = assign_r(tmp, y, (ROUND_UP | ROUND_STRICT_RELATION));




  ((void) 0);
  if (!result_representable(r))
    return true;
  switch (result_relation(r)) {
  case VR_EQ:
    return x <= tmp;
  case VR_LT:
    return x < tmp;
  case VR_LE:
  case VR_GE:
  case VR_LGE:

    Parma_Polyhedra_Library::ppl_unreachable();
    return false;
  default:
    return false;
  }
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
lt_p(const Type1& x, const Type2& y) {
  return lt(x, y);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
le_p(const Type1& x, const Type2& y) {
  return le(x, y);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
eq_p(const Type1& x, const Type2& y) {
  return eq(x, y);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline Result_Relation
cmp_generic(const Type1& x, const Type2& y) {
  if (lt(y, x))
    return VR_GT;
  if (lt(x, y))
    return VR_LT;
  return VR_EQ;
}

template <typename Policy, typename Type>
inline Result
assign_nan(Type& to, Result r) {
  assign_special<Policy>(to, VC_NAN, ROUND_IGNORE);
  return r;
}

template <typename Policy, typename Type>
inline Result
input_generic(Type& to, std::istream& is, Rounding_Dir dir) {
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  Result r = input_mpq(q, is);
  Result_Class c = result_class(r);
  switch (c) {
  case VC_MINUS_INFINITY:
  case VC_PLUS_INFINITY:
    return assign_special<Policy>(to, c, dir);
  case VC_NAN:
    return assign_nan<Policy>(to, r);
  default:
    break;
  }
  ((void) 0);
  return assign<Policy, void>(to, q, dir);
}

}

}
# 701 "checked_defs.hh" 2
# 1 "checked_int_inlines.hh" 1
# 28 "checked_int_inlines.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cerrno" 1 3
# 46 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cerrno" 3
       
# 47 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cerrno" 3

# 1 "/usr/include/errno.h" 1 3 4
# 32 "/usr/include/errno.h" 3 4
extern "C" {



# 1 "/usr/include/bits/errno.h" 1 3 4
# 25 "/usr/include/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4



# 1 "/usr/include/asm/errno.h" 1 3 4
# 5 "/usr/include/linux/errno.h" 2 3 4
# 26 "/usr/include/bits/errno.h" 2 3 4
# 38 "/usr/include/bits/errno.h" 3 4
extern int *__errno_location (void) throw () __attribute__ ((__const__));
# 37 "/usr/include/errno.h" 2 3 4
# 55 "/usr/include/errno.h" 3 4
extern char *program_invocation_name, *program_invocation_short_name;



}
# 69 "/usr/include/errno.h" 3 4
typedef int error_t;
# 49 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/cerrno" 2 3
# 29 "checked_int_inlines.hh" 2
# 43 "checked_int_inlines.hh"
namespace Parma_Polyhedra_Library {

namespace Checked {
# 71 "checked_int_inlines.hh"
template <typename Policy, typename Type>
struct Extended_Int {
  static const Type plus_infinity = C_Integer<Type>::max;
  static const Type minus_infinity = ((C_Integer<Type>::min >= 0)
                                      ? (C_Integer<Type>::max - 1)
                                      : C_Integer<Type>::min);
  static const Type not_a_number
  = ((C_Integer<Type>::min >= 0)
     ? (C_Integer<Type>::max - 2 * (Policy::has_infinity ? 1 : 0))
     : (C_Integer<Type>::min + (Policy::has_infinity ? 1 : 0)));
  static const Type min
  = (C_Integer<Type>::min
     + ((C_Integer<Type>::min >= 0)
        ? 0
        : ((Policy::has_infinity ? 1 : 0) + (Policy::has_nan ? 1 : 0))));
  static const Type max
  = (C_Integer<Type>::max
     - ((C_Integer<Type>::min >= 0)
        ? (2 * (Policy::has_infinity ? 1 : 0) + (Policy::has_nan ? 1 : 0))
        : (Policy::has_infinity ? 1 : 0)));
};

template <typename Policy, typename To>
inline Result
set_neg_overflow_int(To& to, Rounding_Dir dir) {
  if (round_up(dir)) {
    to = Extended_Int<Policy, To>::min;
    return V_LT_INF;
  }
  else {
    if (Policy::has_infinity) {
      to = Extended_Int<Policy, To>::minus_infinity;
      return V_GT_MINUS_INFINITY;
    }
    return V_GT_MINUS_INFINITY | V_UNREPRESENTABLE;
  }
}

template <typename Policy, typename To>
inline Result
set_pos_overflow_int(To& to, Rounding_Dir dir) {
  if (round_down(dir)) {
    to = Extended_Int<Policy, To>::max;
    return V_GT_SUP;
  }
  else {
    if (Policy::has_infinity) {
      to = Extended_Int<Policy, To>::plus_infinity;
      return V_LT_PLUS_INFINITY;
    }
    return V_LT_PLUS_INFINITY | V_UNREPRESENTABLE;
  }
}

template <typename Policy, typename To>
inline Result
round_lt_int_no_overflow(To& to, Rounding_Dir dir) {
  if (round_down(dir)) {
    --to;
    return V_GT;
  }
  return V_LT;
}

template <typename Policy, typename To>
inline Result
round_gt_int_no_overflow(To& to, Rounding_Dir dir) {
  if (round_up(dir)) {
    ++to;
    return V_LT;
  }
  return V_GT;
}

template <typename Policy, typename To>
inline Result
round_lt_int(To& to, Rounding_Dir dir) {
  if (round_down(dir)) {
    if (to == Extended_Int<Policy, To>::min) {
      if (Policy::has_infinity) {
        to = Extended_Int<Policy, To>::minus_infinity;
        return V_GT_MINUS_INFINITY;
      }
      return V_GT_MINUS_INFINITY | V_UNREPRESENTABLE;
    }
    else {
      --to;
      return V_GT;
    }
  }
  return V_LT;
}

template <typename Policy, typename To>
inline Result
round_gt_int(To& to, Rounding_Dir dir) {
  if (round_up(dir)) {
    if (to == Extended_Int<Policy, To>::max) {
      if (Policy::has_infinity) {
        to = Extended_Int<Policy, To>::plus_infinity;
        return V_LT_PLUS_INFINITY;
      }
      return V_LT_PLUS_INFINITY | V_UNREPRESENTABLE;
    }
    else {
      ++to;
      return V_LT;
    }
  }
  return V_GT;
}

template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, char, char> { static inline void function( char& arg1, const char &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, signed char, signed char> { static inline void function( signed char& arg1, const signed char &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, signed short, signed short> { static inline void function( signed short& arg1, const signed short &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, signed int, signed int> { static inline void function( signed int& arg1, const signed int &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, signed long, signed long> { static inline void function( signed long& arg1, const signed long &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline void function( signed long long& arg1, const signed long long &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline void function( unsigned char& arg1, const unsigned char &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline void function( unsigned short& arg1, const unsigned short &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline void function( unsigned int& arg1, const unsigned int &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline void function( unsigned long& arg1, const unsigned long &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline void function( unsigned long long& arg1, const unsigned long long &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };

template <typename Policy, typename Type>
inline Result
classify_int(const Type v, bool nan, bool inf, bool sign) {
  if (Policy::has_nan
      && (nan || sign)
      && v == Extended_Int<Policy, Type>::not_a_number)
    return V_NAN;
  if (!inf && !sign)
    return V_LGE;
  if (Policy::has_infinity) {
    if (v == Extended_Int<Policy, Type>::minus_infinity)
      return inf ? V_EQ_MINUS_INFINITY : V_LT;
    if (v == Extended_Int<Policy, Type>::plus_infinity)
      return inf ? V_EQ_PLUS_INFINITY : V_GT;
  }
  if (sign) {
    if (v < 0)
      return V_LT;
    if (v > 0)
      return V_GT;
    return V_EQ;
  }
  return V_LGE;
}

template <typename Policy> struct classify_function_struct<Policy, char> { static inline Result function(const char& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, signed char> { static inline Result function(const signed char& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, signed short> { static inline Result function(const signed short& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, signed int> { static inline Result function(const signed int& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, signed long> { static inline Result function(const signed long& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, signed long long> { static inline Result function(const signed long long& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, unsigned char> { static inline Result function(const unsigned char& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, unsigned short> { static inline Result function(const unsigned short& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, unsigned int> { static inline Result function(const unsigned int& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, unsigned long> { static inline Result function(const unsigned long& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct classify_function_struct<Policy, unsigned long long> { static inline Result function(const unsigned long long& arg, bool a1, bool a2, bool a3) { return classify_int<Policy>(arg, a1, a2, a3); } };

template <typename Policy, typename Type>
inline bool
is_nan_int(const Type v) {
  return Policy::has_nan && v == Extended_Int<Policy, Type>::not_a_number;
}

template <typename Policy> struct is_nan_function_struct<Policy, char> { static inline bool function(const char& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, signed char> { static inline bool function(const signed char& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, signed short> { static inline bool function(const signed short& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, signed int> { static inline bool function(const signed int& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, signed long> { static inline bool function(const signed long& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, signed long long> { static inline bool function(const signed long long& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, unsigned char> { static inline bool function(const unsigned char& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, unsigned short> { static inline bool function(const unsigned short& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, unsigned int> { static inline bool function(const unsigned int& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, unsigned long> { static inline bool function(const unsigned long& arg) { return is_nan_int<Policy>(arg); } };
template <typename Policy> struct is_nan_function_struct<Policy, unsigned long long> { static inline bool function(const unsigned long long& arg) { return is_nan_int<Policy>(arg); } };

template <typename Policy, typename Type>
inline bool
is_minf_int(const Type v) {
  return Policy::has_infinity
    && v == Extended_Int<Policy, Type>::minus_infinity;
}

template <typename Policy> struct is_minf_function_struct<Policy, char> { static inline bool function(const char& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, signed char> { static inline bool function(const signed char& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, signed short> { static inline bool function(const signed short& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, signed int> { static inline bool function(const signed int& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, signed long> { static inline bool function(const signed long& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, signed long long> { static inline bool function(const signed long long& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, unsigned char> { static inline bool function(const unsigned char& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, unsigned short> { static inline bool function(const unsigned short& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, unsigned int> { static inline bool function(const unsigned int& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, unsigned long> { static inline bool function(const unsigned long& arg) { return is_minf_int<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, unsigned long long> { static inline bool function(const unsigned long long& arg) { return is_minf_int<Policy>(arg); } };

template <typename Policy, typename Type>
inline bool
is_pinf_int(const Type v) {
  return Policy::has_infinity
    && v == Extended_Int<Policy, Type>::plus_infinity;
}

template <typename Policy> struct is_pinf_function_struct<Policy, char> { static inline bool function(const char& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, signed char> { static inline bool function(const signed char& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, signed short> { static inline bool function(const signed short& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, signed int> { static inline bool function(const signed int& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, signed long> { static inline bool function(const signed long& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, signed long long> { static inline bool function(const signed long long& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, unsigned char> { static inline bool function(const unsigned char& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, unsigned short> { static inline bool function(const unsigned short& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, unsigned int> { static inline bool function(const unsigned int& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, unsigned long> { static inline bool function(const unsigned long& arg) { return is_pinf_int<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, unsigned long long> { static inline bool function(const unsigned long long& arg) { return is_pinf_int<Policy>(arg); } };

template <typename Policy, typename Type>
inline bool
is_int_int(const Type v) {
  return !is_nan<Policy>(v);
}

template <typename Policy> struct is_int_function_struct<Policy, char> { static inline bool function(const char& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, signed char> { static inline bool function(const signed char& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, signed short> { static inline bool function(const signed short& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, signed int> { static inline bool function(const signed int& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, signed long> { static inline bool function(const signed long& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, signed long long> { static inline bool function(const signed long long& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, unsigned char> { static inline bool function(const unsigned char& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, unsigned short> { static inline bool function(const unsigned short& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, unsigned int> { static inline bool function(const unsigned int& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, unsigned long> { static inline bool function(const unsigned long& arg) { return is_int_int<Policy>(arg); } };
template <typename Policy> struct is_int_function_struct<Policy, unsigned long long> { static inline bool function(const unsigned long long& arg) { return is_int_int<Policy>(arg); } };

template <typename Policy, typename Type>
inline Result
assign_special_int(Type& v, Result_Class c, Rounding_Dir dir) {
  ((void) 0);
  switch (c) {
  case VC_NAN:
    if (Policy::has_nan) {
      v = Extended_Int<Policy, Type>::not_a_number;
      return V_NAN;
    }
    return V_NAN | V_UNREPRESENTABLE;
  case VC_MINUS_INFINITY:
    if (Policy::has_infinity) {
      v = Extended_Int<Policy, Type>::minus_infinity;
      return V_EQ_MINUS_INFINITY;
    }
    if (round_up(dir)) {
      v = Extended_Int<Policy, Type>::min;
      return V_LT_INF;
    }
    return V_EQ_MINUS_INFINITY | V_UNREPRESENTABLE;
  case VC_PLUS_INFINITY:
    if (Policy::has_infinity) {
      v = Extended_Int<Policy, Type>::plus_infinity;
      return V_EQ_PLUS_INFINITY;
    }
    if (round_down(dir)) {
      v = Extended_Int<Policy, Type>::max;
      return V_GT_SUP;
    }
    return V_EQ_PLUS_INFINITY | V_UNREPRESENTABLE;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_NAN | V_UNREPRESENTABLE;
  }
}

template <typename Policy> struct assign_special_function_struct<Policy, char> { static inline Result function( char& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, signed char> { static inline Result function( signed char& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, signed short> { static inline Result function( signed short& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, signed int> { static inline Result function( signed int& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, signed long> { static inline Result function( signed long& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, signed long long> { static inline Result function( signed long long& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, unsigned char> { static inline Result function( unsigned char& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, unsigned short> { static inline Result function( unsigned short& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, unsigned int> { static inline Result function( unsigned int& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, unsigned long> { static inline Result function( unsigned long& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };
template <typename Policy> struct assign_special_function_struct<Policy, unsigned long long> { static inline Result function( unsigned long long& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_int<Policy>(arg, a1, a2); } };

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_signed_int_signed_int(To& to, const From from, Rounding_Dir dir) {
  if (sizeof(To) < sizeof(From)
      || (sizeof(To) == sizeof(From)
          && (Extended_Int<To_Policy, To>::min > Extended_Int<From_Policy, From>::min
              || Extended_Int<To_Policy, To>::max < Extended_Int<From_Policy, From>::max))) {
    if (((To_Policy::check_overflow) ? (((from) < (static_cast<From>(Extended_Int<To_Policy, To>::min)))) : ((static_cast<void> (0)), false)))


      return set_neg_overflow_int<To_Policy>(to, dir);
    if (((To_Policy::check_overflow) ? (((from) > (static_cast<From>(Extended_Int<To_Policy, To>::max)))) : ((static_cast<void> (0)), false)))


      return set_pos_overflow_int<To_Policy>(to, dir);
  }
  to = static_cast<To>(from);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_signed_int_unsigned_int(To& to, const From from, Rounding_Dir dir) {
  if (sizeof(To) <= sizeof(From)) {
    if (((To_Policy::check_overflow) ? (from > static_cast<From>(Extended_Int<To_Policy, To>::max)) : ((static_cast<void> (0)), false)))

      return set_pos_overflow_int<To_Policy>(to, dir);
  }
  to = static_cast<To>(from);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_unsigned_int_signed_int(To& to, const From from, Rounding_Dir dir) {
  if (((To_Policy::check_overflow) ? (from < 0) : ((static_cast<void> (0)), false)))
    return set_neg_overflow_int<To_Policy>(to, dir);
  if (sizeof(To) < sizeof(From)) {
    if (((To_Policy::check_overflow) ? (from > static_cast<From>(Extended_Int<To_Policy, To>::max)) : ((static_cast<void> (0)), false)))

      return set_pos_overflow_int<To_Policy>(to, dir);
  }
  to = static_cast<To>(from);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_unsigned_int_unsigned_int(To& to, const From from, Rounding_Dir dir) {
  if (sizeof(To) < sizeof(From)
      || (sizeof(To) == sizeof(From)
          && Extended_Int<To_Policy, To>::max < Extended_Int<From_Policy, From>::max)) {
    if (((To_Policy::check_overflow) ? (((from) > (static_cast<From>(Extended_Int<To_Policy, To>::max)))) : ((static_cast<void> (0)), false)))


      return set_pos_overflow_int<To_Policy>(to, dir);
  }
  to = static_cast<To>(from);
  return V_EQ;
}
# 439 "checked_int_inlines.hh"
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, signed short> { static inline Result function( char& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, char> { static inline Result function( signed short& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, signed int> { static inline Result function( char& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, char> { static inline Result function( signed int& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, signed long> { static inline Result function( char& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, char> { static inline Result function( signed long& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, signed long long> { static inline Result function( char& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, char> { static inline Result function( signed long long& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, signed short> { static inline Result function( signed char& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, signed char> { static inline Result function( signed short& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, signed int> { static inline Result function( signed char& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, signed char> { static inline Result function( signed int& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, signed long> { static inline Result function( signed char& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, signed char> { static inline Result function( signed long& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, signed long long> { static inline Result function( signed char& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, signed char> { static inline Result function( signed long long& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, signed int> { static inline Result function( signed short& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, signed short> { static inline Result function( signed int& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, signed long> { static inline Result function( signed short& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, signed short> { static inline Result function( signed long& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, signed long long> { static inline Result function( signed short& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, signed short> { static inline Result function( signed long long& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, signed long> { static inline Result function( signed int& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, signed int> { static inline Result function( signed long& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, signed long long> { static inline Result function( signed int& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, signed int> { static inline Result function( signed long long& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, signed long long> { static inline Result function( signed long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, signed long> { static inline Result function( signed long long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };






template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, unsigned short> { static inline Result function( unsigned char& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, unsigned char> { static inline Result function( unsigned short& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, unsigned int> { static inline Result function( unsigned char& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, unsigned char> { static inline Result function( unsigned int& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, unsigned long> { static inline Result function( unsigned char& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, unsigned char> { static inline Result function( unsigned long& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, unsigned long long> { static inline Result function( unsigned char& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, unsigned char> { static inline Result function( unsigned long long& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, unsigned int> { static inline Result function( unsigned short& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, unsigned short> { static inline Result function( unsigned int& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, unsigned long> { static inline Result function( unsigned short& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, unsigned short> { static inline Result function( unsigned long& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, unsigned long long> { static inline Result function( unsigned short& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, unsigned short> { static inline Result function( unsigned long long& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, unsigned long> { static inline Result function( unsigned int& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, unsigned int> { static inline Result function( unsigned long& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, unsigned long long> { static inline Result function( unsigned int& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, unsigned int> { static inline Result function( unsigned long long& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, unsigned long long> { static inline Result function( unsigned long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, unsigned long> { static inline Result function( unsigned long long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };






template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, signed short> { static inline Result function( unsigned char& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, unsigned char> { static inline Result function( signed short& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, signed int> { static inline Result function( unsigned char& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, unsigned char> { static inline Result function( signed int& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, signed long> { static inline Result function( unsigned char& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, unsigned char> { static inline Result function( signed long& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, signed long long> { static inline Result function( unsigned char& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, unsigned char> { static inline Result function( signed long long& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, signed int> { static inline Result function( unsigned short& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, unsigned short> { static inline Result function( signed int& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, signed long> { static inline Result function( unsigned short& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, unsigned short> { static inline Result function( signed long& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, signed long long> { static inline Result function( unsigned short& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, unsigned short> { static inline Result function( signed long long& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, signed long> { static inline Result function( unsigned int& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, unsigned int> { static inline Result function( signed long& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, signed long long> { static inline Result function( unsigned int& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, unsigned int> { static inline Result function( signed long long& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, signed long long> { static inline Result function( unsigned long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, unsigned long> { static inline Result function( signed long long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, unsigned char> { static inline Result function( char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, char> { static inline Result function( unsigned char& arg1, const char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, unsigned short> { static inline Result function( char& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, char> { static inline Result function( unsigned short& arg1, const char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, unsigned int> { static inline Result function( char& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, char> { static inline Result function( unsigned int& arg1, const char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, unsigned long> { static inline Result function( char& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, char> { static inline Result function( unsigned long& arg1, const char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, unsigned long long> { static inline Result function( char& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, char> { static inline Result function( unsigned long long& arg1, const char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, unsigned char> { static inline Result function( signed char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, signed char> { static inline Result function( unsigned char& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, unsigned short> { static inline Result function( signed char& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, signed char> { static inline Result function( unsigned short& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, unsigned int> { static inline Result function( signed char& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, signed char> { static inline Result function( unsigned int& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, unsigned long> { static inline Result function( signed char& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, signed char> { static inline Result function( unsigned long& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, unsigned long long> { static inline Result function( signed char& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, signed char> { static inline Result function( unsigned long long& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, unsigned short> { static inline Result function( signed short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, signed short> { static inline Result function( unsigned short& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, unsigned int> { static inline Result function( signed short& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, signed short> { static inline Result function( unsigned int& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, unsigned long> { static inline Result function( signed short& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, signed short> { static inline Result function( unsigned long& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, unsigned long long> { static inline Result function( signed short& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, signed short> { static inline Result function( unsigned long long& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, unsigned int> { static inline Result function( signed int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, signed int> { static inline Result function( unsigned int& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, unsigned long> { static inline Result function( signed int& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, signed int> { static inline Result function( unsigned long& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, unsigned long long> { static inline Result function( signed int& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, signed int> { static inline Result function( unsigned long long& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, unsigned long> { static inline Result function( signed long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, signed long> { static inline Result function( unsigned long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, unsigned long long> { static inline Result function( signed long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, signed long> { static inline Result function( unsigned long long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, unsigned long long> { static inline Result function( signed long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_signed_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } }; template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, signed long long> { static inline Result function( unsigned long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_int_float(To& to, const From from, Rounding_Dir dir) {
  if (is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
# 546 "checked_int_inlines.hh"
  if (((To_Policy::check_overflow) ? ((from < Extended_Int<To_Policy, To>::min)) : ((static_cast<void> (0)), false)))
    return set_neg_overflow_int<To_Policy>(to, dir);
  if (((To_Policy::check_overflow) ? ((from > Extended_Int<To_Policy, To>::max)) : ((static_cast<void> (0)), false)))
    return set_pos_overflow_int<To_Policy>(to, dir);

  if (round_not_requested(dir)) {
    to = from;
    return V_LGE;
  }
  From i_from = rint(from);
  to = i_from;
  if (from == i_from)
    return V_EQ;
  if (round_direct(ROUND_UP))
    return round_lt_int<To_Policy>(to, dir);
  if (round_direct(ROUND_DOWN))
    return round_gt_int<To_Policy>(to, dir);
  if (from < i_from)
    return round_lt_int<To_Policy>(to, dir);
  ((void) 0);
  return round_gt_int<To_Policy>(to, dir);
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, float> { static inline Result function( char& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, float> { static inline Result function( signed char& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, float> { static inline Result function( signed short& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, float> { static inline Result function( signed int& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, float> { static inline Result function( signed long& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, float> { static inline Result function( signed long long& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, float> { static inline Result function( unsigned char& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, float> { static inline Result function( unsigned short& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, float> { static inline Result function( unsigned int& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, float> { static inline Result function( unsigned long& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, float> { static inline Result function( unsigned long long& arg1, const float &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, double> { static inline Result function( char& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, double> { static inline Result function( signed char& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, double> { static inline Result function( signed short& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, double> { static inline Result function( signed int& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, double> { static inline Result function( signed long& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, double> { static inline Result function( signed long long& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, double> { static inline Result function( unsigned char& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, double> { static inline Result function( unsigned short& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, double> { static inline Result function( unsigned int& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, double> { static inline Result function( unsigned long& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, double> { static inline Result function( unsigned long long& arg1, const double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, long double> { static inline Result function( char& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, long double> { static inline Result function( signed char& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, long double> { static inline Result function( signed short& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, long double> { static inline Result function( signed int& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, long double> { static inline Result function( signed long& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, long double> { static inline Result function( signed long long& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, long double> { static inline Result function( unsigned char& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, long double> { static inline Result function( unsigned short& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, long double> { static inline Result function( unsigned int& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, long double> { static inline Result function( unsigned long& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, long double> { static inline Result function( unsigned long long& arg1, const long double &arg2, Rounding_Dir a1) { return assign_int_float<Policy1, Policy2>(arg1, arg2, a1); } };
# 612 "checked_int_inlines.hh"
template <typename To_Policy, typename From_Policy, typename To>
inline Result
assign_signed_int_mpz(To& to, const mpz_class& from, Rounding_Dir dir) {
  if (sizeof(To) <= sizeof(signed long)) {
    if (!To_Policy::check_overflow) {
      to = from.get_si();
      return V_EQ;
    }
    if (from.fits_slong_p()) {
      signed long v = from.get_si();
      if (((v) < ((Extended_Int<To_Policy, To>::min))))
        return set_neg_overflow_int<To_Policy>(to, dir);
      if (((v) > ((Extended_Int<To_Policy, To>::max))))
        return set_pos_overflow_int<To_Policy>(to, dir);
      to = v;
      return V_EQ;
    }
  }
  else {
    mpz_srcptr m = from.get_mpz_t();
    size_t sz = __gmpz_size(m);
    if (sz <= sizeof(To) / sizeof(mp_limb_t)) {
      if (sz == 0) {
        to = 0;
        return V_EQ;
      }
      To v;
      __gmpz_export(&v, 0, -1, sizeof(To), 0, 0, m);
      if (v >= 0) {
        if (::sgn(from) < 0)
          return neg<To_Policy, To_Policy>(to, v, dir);
        to = v;
        return V_EQ;
      }
    }
  }
  return (::sgn(from) < 0)
    ? set_neg_overflow_int<To_Policy>(to, dir)
    : set_pos_overflow_int<To_Policy>(to, dir);
}


template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, mpz_class> { static inline Result function( char& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_signed_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, mpz_class> { static inline Result function( signed char& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_signed_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, mpz_class> { static inline Result function( signed short& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_signed_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, mpz_class> { static inline Result function( signed int& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_signed_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, mpz_class> { static inline Result function( signed long& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_signed_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, mpz_class> { static inline Result function( signed long long& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_signed_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename To>
inline Result
assign_unsigned_int_mpz(To& to, const mpz_class& from, Rounding_Dir dir) {
  if (((To_Policy::check_overflow) ? (::sgn(from) < 0) : ((static_cast<void> (0)), false)))
    return set_neg_overflow_int<To_Policy>(to, dir);
  if (sizeof(To) <= sizeof(unsigned long)) {
    if (!To_Policy::check_overflow) {
      to = static_cast<To>(from.get_ui());
      return V_EQ;
    }
    if (from.fits_ulong_p()) {
      const unsigned long v = from.get_ui();
      if (((v) > ((Extended_Int<To_Policy, To>::max))))
        return set_pos_overflow_int<To_Policy>(to, dir);
      to = static_cast<To>(v);
      return V_EQ;
    }
  }
  else {
    const mpz_srcptr m = from.get_mpz_t();
    const size_t sz = __gmpz_size(m);
    if (sz <= sizeof(To) / sizeof(mp_limb_t)) {
      if (sz == 0)
        to = 0;
      else
        __gmpz_export(&to, 0, -1, sizeof(To), 0, 0, m);
      return V_EQ;
    }
  }
  return set_pos_overflow_int<To_Policy>(to, dir);
}




template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, mpz_class> { static inline Result function( unsigned char& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_unsigned_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, mpz_class> { static inline Result function( unsigned short& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_unsigned_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, mpz_class> { static inline Result function( unsigned int& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_unsigned_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, mpz_class> { static inline Result function( unsigned long& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_unsigned_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, mpz_class> { static inline Result function( unsigned long long& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_unsigned_int_mpz<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename To>
inline Result
assign_int_mpq(To& to, const mpq_class& from, Rounding_Dir dir) {
  mpz_srcptr n = from.get_num().get_mpz_t();
  mpz_srcptr d = from.get_den().get_mpz_t();
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_q; mpz_class& q = holder_q.item();
  mpz_ptr q_z = q.get_mpz_t();
  if (round_not_requested(dir)) {
    __gmpz_tdiv_q(q_z, n, d);
    Result r = assign<To_Policy, void>(to, q, dir);
    if (r != V_EQ)
      return r;
    return V_LGE;
  }
  mpz_t rem;
  int sign;
  __gmpz_init(rem);
  __gmpz_tdiv_qr(q_z, rem, n, d);
  sign = ((rem)->_mp_size < 0 ? -1 : (rem)->_mp_size > 0);
  __gmpz_clear(rem);
  Result r = assign<To_Policy, void>(to, q, dir);
  if (r != V_EQ)
    return r;
  switch (sign) {
  case -1:
    return round_lt_int<To_Policy>(to, dir);
  case 1:
    return round_gt_int<To_Policy>(to, dir);
  default:
    return V_EQ;
  }
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, char, mpq_class> { static inline Result function( char& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed char, mpq_class> { static inline Result function( signed char& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed short, mpq_class> { static inline Result function( signed short& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed int, mpq_class> { static inline Result function( signed int& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long, mpq_class> { static inline Result function( signed long& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, signed long long, mpq_class> { static inline Result function( signed long long& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned char, mpq_class> { static inline Result function( unsigned char& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned short, mpq_class> { static inline Result function( unsigned short& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned int, mpq_class> { static inline Result function( unsigned int& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long, mpq_class> { static inline Result function( unsigned long& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, unsigned long long, mpq_class> { static inline Result function( unsigned long long& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_int_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
# 785 "checked_int_inlines.hh"
template <typename T>
struct Larger;







template <>
struct Larger<char> {
  enum const_bool_value_use_for_neg { use_for_neg = (true) };
  enum const_bool_value_use_for_add { use_for_add = (true) };
  enum const_bool_value_use_for_sub { use_for_sub = (true) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast16_t type_for_neg;
  typedef int_fast16_t type_for_add;
  typedef int_fast16_t type_for_sub;
  typedef int_fast16_t type_for_mul;
};

template <>
struct Larger<signed char> {
  enum const_bool_value_use_for_neg { use_for_neg = (true) };
  enum const_bool_value_use_for_add { use_for_add = (true) };
  enum const_bool_value_use_for_sub { use_for_sub = (true) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast16_t type_for_neg;
  typedef int_fast16_t type_for_add;
  typedef int_fast16_t type_for_sub;
  typedef int_fast16_t type_for_mul;
};

template <>
struct Larger<unsigned char> {
  enum const_bool_value_use_for_neg { use_for_neg = (true) };
  enum const_bool_value_use_for_add { use_for_add = (true) };
  enum const_bool_value_use_for_sub { use_for_sub = (true) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast16_t type_for_neg;
  typedef uint_fast16_t type_for_add;
  typedef int_fast16_t type_for_sub;
  typedef uint_fast16_t type_for_mul;
};

template <>
struct Larger<signed short> {
  enum const_bool_value_use_for_neg { use_for_neg = (true) };
  enum const_bool_value_use_for_add { use_for_add = (true) };
  enum const_bool_value_use_for_sub { use_for_sub = (true) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast32_t type_for_neg;
  typedef int_fast32_t type_for_add;
  typedef int_fast32_t type_for_sub;
  typedef int_fast32_t type_for_mul;
};

template <>
struct Larger<unsigned short> {
  enum const_bool_value_use_for_neg { use_for_neg = (true) };
  enum const_bool_value_use_for_add { use_for_add = (true) };
  enum const_bool_value_use_for_sub { use_for_sub = (true) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast32_t type_for_neg;
  typedef uint_fast32_t type_for_add;
  typedef int_fast32_t type_for_sub;
  typedef uint_fast32_t type_for_mul;
};

template <>
struct Larger<signed int> {
  enum const_bool_value_use_for_neg { use_for_neg = ((32 == 64)) };
  enum const_bool_value_use_for_add { use_for_add = ((32 == 64)) };
  enum const_bool_value_use_for_sub { use_for_sub = ((32 == 64)) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast64_t type_for_neg;
  typedef int_fast64_t type_for_add;
  typedef int_fast64_t type_for_sub;
  typedef int_fast64_t type_for_mul;
};

template <>
struct Larger<unsigned int> {
  enum const_bool_value_use_for_neg { use_for_neg = ((32 == 64)) };
  enum const_bool_value_use_for_add { use_for_add = ((32 == 64)) };
  enum const_bool_value_use_for_sub { use_for_sub = ((32 == 64)) };
  enum const_bool_value_use_for_mul { use_for_mul = (true) };
  typedef int_fast64_t type_for_neg;
  typedef uint_fast64_t type_for_add;
  typedef int_fast64_t type_for_sub;
  typedef uint_fast64_t type_for_mul;
};

template <>
struct Larger<signed long> {
  enum const_bool_value_use_for_neg { use_for_neg = (false) };
  enum const_bool_value_use_for_add { use_for_add = (false) };
  enum const_bool_value_use_for_sub { use_for_sub = (false) };
  enum const_bool_value_use_for_mul { use_for_mul = ((32 == 32)) };
  typedef int_fast64_t type_for_neg;
  typedef int_fast64_t type_for_add;
  typedef int_fast64_t type_for_sub;
  typedef int_fast64_t type_for_mul;
};

template <>
struct Larger<unsigned long> {
  enum const_bool_value_use_for_neg { use_for_neg = (false) };
  enum const_bool_value_use_for_add { use_for_add = (false) };
  enum const_bool_value_use_for_sub { use_for_sub = (false) };
  enum const_bool_value_use_for_mul { use_for_mul = ((32 == 32)) };
  typedef int_fast64_t type_for_neg;
  typedef uint_fast64_t type_for_add;
  typedef int_fast64_t type_for_sub;
  typedef uint_fast64_t type_for_mul;
};

template <>
struct Larger<signed long long> {
  enum const_bool_value_use_for_neg { use_for_neg = (false) };
  enum const_bool_value_use_for_add { use_for_add = (false) };
  enum const_bool_value_use_for_sub { use_for_sub = (false) };
  enum const_bool_value_use_for_mul { use_for_mul = (false) };
  typedef int_fast64_t type_for_neg;
  typedef int_fast64_t type_for_add;
  typedef int_fast64_t type_for_sub;
  typedef int_fast64_t type_for_mul;
};

template <>
struct Larger<unsigned long long> {
  enum const_bool_value_use_for_neg { use_for_neg = (false) };
  enum const_bool_value_use_for_add { use_for_add = (false) };
  enum const_bool_value_use_for_sub { use_for_sub = (false) };
  enum const_bool_value_use_for_mul { use_for_mul = (false) };
  typedef int_fast64_t type_for_neg;
  typedef uint_fast64_t type_for_add;
  typedef int_fast64_t type_for_sub;
  typedef uint_fast64_t type_for_mul;
};

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
neg_int_larger(Type& to, const Type x, Rounding_Dir dir) {
  typename Larger<Type>::type_for_neg l = x;
  l = -l;
  return assign<To_Policy, To_Policy>(to, l, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
add_int_larger(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  typename Larger<Type>::type_for_add l = x;
  l += y;
  return assign<To_Policy, To_Policy>(to, l, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
sub_int_larger(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  typename Larger<Type>::type_for_sub l = x;
  l -= y;
  return assign<To_Policy, To_Policy>(to, l, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
mul_int_larger(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  typename Larger<Type>::type_for_mul l = x;
  l *= y;
  return assign<To_Policy, To_Policy>(to, l, dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
neg_signed_int(Type& to, const Type from, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_neg)
    return neg_int_larger<To_Policy, From_Policy>(to, from, dir);
  if (((To_Policy::check_overflow) ? ((from < -Extended_Int<To_Policy, Type>::max)) : ((static_cast<void> (0)), false)))

    return set_pos_overflow_int<To_Policy>(to, dir);
  to = -from;
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
neg_unsigned_int(Type& to, const Type from, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_neg)
    return neg_int_larger<To_Policy, From_Policy>(to, from, dir);
  if (((To_Policy::check_overflow) ? (from != 0) : ((static_cast<void> (0)), false)))
    return set_neg_overflow_int<To_Policy>(to, dir);
  to = from;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
add_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_add)
    return add_int_larger<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
  if (To_Policy::check_overflow) {
    if (y >= 0) {
      if (x > Extended_Int<To_Policy, Type>::max - y)
        return set_pos_overflow_int<To_Policy>(to, dir);
    }
    else if (x < Extended_Int<To_Policy, Type>::min - y)
      return set_neg_overflow_int<To_Policy>(to, dir);
  }
  to = x + y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
add_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_add)
    return add_int_larger<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
  if (((To_Policy::check_overflow) ? ((x > Extended_Int<To_Policy, Type>::max - y)) : ((static_cast<void> (0)), false)))

    return set_pos_overflow_int<To_Policy>(to, dir);
  to = x + y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
sub_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_sub)
    return sub_int_larger<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
  if (To_Policy::check_overflow) {
    if (y >= 0) {
      if (x < Extended_Int<To_Policy, Type>::min + y)
        return set_neg_overflow_int<To_Policy>(to, dir);
    }
    else if (x > Extended_Int<To_Policy, Type>::max + y)
      return set_pos_overflow_int<To_Policy>(to, dir);
  }
  to = x - y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
sub_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_sub)
    return sub_int_larger<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
  if (((To_Policy::check_overflow) ? ((x < Extended_Int<To_Policy, Type>::min + y)) : ((static_cast<void> (0)), false)))

    return set_neg_overflow_int<To_Policy>(to, dir);
  to = x - y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
mul_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_mul)
    return mul_int_larger<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
  if (!To_Policy::check_overflow) {
    to = x * y;
    return V_EQ;
  }
  if (y == 0) {
    to = 0;
    return V_EQ;
  }
  if (y == -1)
    return neg_signed_int<To_Policy, From1_Policy>(to, x, dir);
  if (x >= 0) {
    if (y > 0) {
      if (x > Extended_Int<To_Policy, Type>::max / y)
        return set_pos_overflow_int<To_Policy>(to, dir);
    }
    else {
      if (x > Extended_Int<To_Policy, Type>::min / y)
        return set_neg_overflow_int<To_Policy>(to, dir);
    }
  }
  else {
    if (y < 0) {
      if (x < Extended_Int<To_Policy, Type>::max / y)
        return set_pos_overflow_int<To_Policy>(to, dir);
    }
    else {
      if (x < Extended_Int<To_Policy, Type>::min / y)
        return set_neg_overflow_int<To_Policy>(to, dir);
    }
  }
  to = x * y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
mul_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_overflow && Larger<Type>::use_for_mul)
    return mul_int_larger<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
  if (!To_Policy::check_overflow) {
    to = x * y;
    return V_EQ;
  }
  if (y == 0) {
    to = 0;
    return V_EQ;
  }
  if (x > Extended_Int<To_Policy, Type>::max / y)
    return set_pos_overflow_int<To_Policy>(to, dir);
  to = x * y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
div_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (((To_Policy::check_div_zero) ? (y == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  if (To_Policy::check_overflow && y == -1)
    return neg_signed_int<To_Policy, From1_Policy>(to, x, dir);
  to = x / y;
  if (round_not_requested(dir))
    return V_LGE;
  if (y == -1)
    return V_EQ;
  Type m = x % y;
  if (m < 0)
    return round_lt_int_no_overflow<To_Policy>(to, dir);
  else if (m > 0)
    return round_gt_int_no_overflow<To_Policy>(to, dir);
  else
    return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
div_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (((To_Policy::check_div_zero) ? (y == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  to = x / y;
  if (round_not_requested(dir))
    return V_GE;
  Type m = x % y;
  if (m == 0)
    return V_EQ;
  return round_gt_int<To_Policy>(to, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
idiv_signed_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (((To_Policy::check_div_zero) ? (y == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  if (To_Policy::check_overflow && y == -1)
    return neg_signed_int<To_Policy, From1_Policy>(to, x, dir);
  to = x / y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
idiv_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (y == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  to = x / y;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
rem_signed_int(Type& to, const Type x, const Type y, Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (y == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_MOD_ZERO);
  }
  to = (y == -1) ? 0 : (x % y);
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
rem_unsigned_int(Type& to, const Type x, const Type y, Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (y == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_MOD_ZERO);
  }
  to = x % y;
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
div_2exp_unsigned_int(Type& to, const Type x, unsigned int exp,
                      Rounding_Dir dir) {
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8))) {
    to = 0;
    if (round_not_requested(dir))
      return V_GE;
    if (x == 0)
      return V_EQ;
    return round_gt_int_no_overflow<To_Policy>(to, dir);
  }
  to = x >> exp;
  if (round_not_requested(dir))
    return V_GE;
  if (x & ((Type(1) << exp) - 1))
    return round_gt_int_no_overflow<To_Policy>(to, dir);
  else
    return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
div_2exp_signed_int(Type& to, const Type x, unsigned int exp,
                    Rounding_Dir dir) {
  if (x < 0) {
    if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8))) {
      to = 0;
      if (round_not_requested(dir))
        return V_LE;
      return round_lt_int_no_overflow<To_Policy>(to, dir);
    }
    typedef typename C_Integer<Type>::other_type UType;
    UType ux = x;
    ux = -ux;
    to = ~Type(~-(ux >> exp));
    if (round_not_requested(dir))
      return V_LE;
    if (ux & ((UType(1) << exp) -1))
      return round_lt_int_no_overflow<To_Policy>(to, dir);
    return V_EQ;
  }
  else {
    if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)) - 1) {
      to = 0;
      if (round_not_requested(dir))
        return V_GE;
      if (x == 0)
        return V_EQ;
      return round_gt_int_no_overflow<To_Policy>(to, dir);
    }
    to = x >> exp;
    if (round_not_requested(dir))
      return V_GE;
    if (x & ((Type(1) << exp) - 1))
      return round_gt_int_no_overflow<To_Policy>(to, dir);
    else
      return V_EQ;
  }
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
add_2exp_unsigned_int(Type& to, const Type x, unsigned int exp,
                      Rounding_Dir dir) {
  if (!To_Policy::check_overflow) {
    to = x + (Type(1) << exp);
    return V_EQ;
  }
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
    return set_pos_overflow_int<To_Policy>(to, dir);
  Type n = Type(1) << exp;
  return add_unsigned_int<To_Policy, From_Policy, void>(to, x, n, dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
add_2exp_signed_int(Type& to, const Type x, unsigned int exp,
                    Rounding_Dir dir) {
  if (!To_Policy::check_overflow) {
    to = x + (Type(1) << exp);
    return V_EQ;
  }
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
    return set_pos_overflow_int<To_Policy>(to, dir);
  if (exp == ((sizeof(Type)) * static_cast<std::size_t>(8)) - 1) {
    Type n = -2 * (Type(1) << (exp - 1));
    return sub_signed_int<To_Policy, From_Policy, void>(to, x, n, dir);
  }
  else {
    Type n = Type(1) << exp;
    return add_signed_int<To_Policy, From_Policy, void>(to, x, n, dir);
  }
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
sub_2exp_unsigned_int(Type& to, const Type x, unsigned int exp,
                      Rounding_Dir dir) {
  if (!To_Policy::check_overflow) {
    to = x - (Type(1) << exp);
    return V_EQ;
  }
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
    return set_neg_overflow_int<To_Policy>(to, dir);
  Type n = Type(1) << exp;
  return sub_unsigned_int<To_Policy, From_Policy, void>(to, x, n, dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
sub_2exp_signed_int(Type& to, const Type x, unsigned int exp,
                    Rounding_Dir dir) {
  if (!To_Policy::check_overflow) {
    to = x - (Type(1) << exp);
    return V_EQ;
  }
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
    return set_neg_overflow_int<To_Policy>(to, dir);
  if (exp == ((sizeof(Type)) * static_cast<std::size_t>(8)) - 1) {
    Type n = -2 * (Type(1) << (exp - 1));
    return add_signed_int<To_Policy, From_Policy, void>(to, x, n, dir);
  }
  else {
    Type n = Type(1) << exp;
    return sub_signed_int<To_Policy, From_Policy, void>(to, x, n, dir);
  }
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
mul_2exp_unsigned_int(Type& to, const Type x, unsigned int exp,
                      Rounding_Dir dir) {
  if (!To_Policy::check_overflow) {
    to = x << exp;
    return V_EQ;
  }
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8))) {
    if (x == 0) {
      to = 0;
      return V_EQ;
    }
    return set_pos_overflow_int<To_Policy>(to, dir);
  }
  if (x > Extended_Int<To_Policy, Type>::max >> exp)
    return set_pos_overflow_int<To_Policy>(to, dir);
  to = x << exp;
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
mul_2exp_signed_int(Type& to, const Type x, unsigned int exp,
                    Rounding_Dir dir) {
  if (x < 0) {
    if (!To_Policy::check_overflow) {
      to = x * (Type(1) << exp);
      return V_EQ;
    }
    if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
      return set_neg_overflow_int<To_Policy>(to, dir);
    typedef typename C_Integer<Type>::other_type UType;
    UType mask = UType(-1) << (((sizeof(Type)) * static_cast<std::size_t>(8)) - exp - 1);
    UType ux = x;
    if ((ux & mask) != mask)
      return set_neg_overflow_int<To_Policy>(to, dir);
    ux <<= exp;
    Type n = ~(Type(~ux));
    if (((n) < ((Extended_Int<To_Policy, Type>::min))))
      return set_neg_overflow_int<To_Policy>(to, dir);
    to = n;
  }
  else {
    if (!To_Policy::check_overflow) {
      to = x << exp;
      return V_EQ;
    }
    if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)) - 1) {
      if (x == 0) {
        to = 0;
        return V_EQ;
      }
      return set_pos_overflow_int<To_Policy>(to, dir);
    }
    if (x > Extended_Int<To_Policy, Type>::max >> exp)
      return set_pos_overflow_int<To_Policy>(to, dir);
    to = x << exp;
  }
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
smod_2exp_unsigned_int(Type& to, const Type x, unsigned int exp,
                       Rounding_Dir dir) {
  if (exp > ((sizeof(Type)) * static_cast<std::size_t>(8)))
    to = x;
  else {
    Type v = (exp == ((sizeof(Type)) * static_cast<std::size_t>(8)) ? x : (x & ((Type(1) << exp) - 1)));
    if (v >= (Type(1) << (exp - 1)))
      return set_neg_overflow_int<To_Policy>(to, dir);
    else
      to = v;
  }
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
smod_2exp_signed_int(Type& to, const Type x, unsigned int exp,
                     Rounding_Dir) {
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
    to = x;
  else {
    Type m = Type(1) << (exp - 1);
    to = (x & (m - 1)) - (x & m);
  }
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
umod_2exp_unsigned_int(Type& to, const Type x, unsigned int exp,
                       Rounding_Dir) {
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8)))
    to = x;
  else
    to = x & ((Type(1) << exp) - 1);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
umod_2exp_signed_int(Type& to, const Type x, unsigned int exp,
                     Rounding_Dir dir) {
  if (exp >= ((sizeof(Type)) * static_cast<std::size_t>(8))) {
    if (x < 0)
      return set_pos_overflow_int<To_Policy>(to, dir);
    to = x;
  }
  else
    to = x & ((Type(1) << exp) - 1);
  return V_EQ;
}

template <typename Type>
inline void
isqrt_rem(Type& q, Type& r, const Type from) {
  q = 0;
  r = from;
  Type t(1);
  for (t <<= ((sizeof(Type)) * static_cast<std::size_t>(8)) - 2; t != 0; t >>= 2) {
    Type s = q + t;
    if (s <= r) {
      r -= s;
      q = s + t;
    }
    q >>= 1;
  }
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
sqrt_unsigned_int(Type& to, const Type from, Rounding_Dir dir) {
  Type rem;
  isqrt_rem(to, rem, from);
  if (round_not_requested(dir))
    return V_GE;
  if (rem == 0)
    return V_EQ;
  return round_gt_int<To_Policy>(to, dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
sqrt_signed_int(Type& to, const Type from, Rounding_Dir dir) {
  if (((To_Policy::check_sqrt_neg) ? (from < 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_SQRT_NEG);
  }
  return sqrt_unsigned_int<To_Policy, From_Policy>(to, from, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
add_mul_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  Type z;
  Result r = mul<To_Policy, From1_Policy, From2_Policy>(z, x, y, dir);
  switch (result_overflow(r)) {
  case 0:
    return add<To_Policy, To_Policy, To_Policy>(to, to, z, dir);
  case -1:
    if (to <= 0)
      return set_neg_overflow_int<To_Policy>(to, dir);
    return assign_nan<To_Policy>(to, V_UNKNOWN_NEG_OVERFLOW);
  case 1:
    if (to >= 0)
      return set_pos_overflow_int<To_Policy>(to, dir);
    return assign_nan<To_Policy>(to, V_UNKNOWN_POS_OVERFLOW);
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_NAN;
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
sub_mul_int(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  Type z;
  Result r = mul<To_Policy, From1_Policy, From2_Policy>(z, x, y, dir);
  switch (result_overflow(r)) {
  case 0:
    return sub<To_Policy, To_Policy, To_Policy>(to, to, z, dir);
  case -1:
    if (to >= 0)
      return set_pos_overflow_int<To_Policy>(to, dir);
    return assign_nan<To_Policy>(to, V_UNKNOWN_NEG_OVERFLOW);
  case 1:
    if (to <= 0)
      return set_neg_overflow_int<To_Policy>(to, dir);
    return assign_nan<To_Policy>(to, V_UNKNOWN_POS_OVERFLOW);
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_NAN;
  }
}

template <typename Policy, typename Type>
inline Result
output_char(std::ostream& os, Type& from,
            const Numeric_Format&, Rounding_Dir) {
  os << int(from);
  return V_EQ;
}

template <typename Policy, typename Type>
inline Result
output_int(std::ostream& os, Type& from, const Numeric_Format&, Rounding_Dir) {
  os << from;
  return V_EQ;
}


template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_signed_int_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return neg_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return neg_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return neg_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return neg_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return neg_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return neg_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return neg_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return neg_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return neg_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return neg_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return neg_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return add_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return add_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return add_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return add_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return add_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return add_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };



template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return add_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return add_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return add_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return add_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return add_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };


template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return sub_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return sub_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return sub_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return sub_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return sub_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return sub_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };



template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return sub_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return sub_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return sub_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return sub_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return sub_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };


template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return mul_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return mul_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return mul_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return mul_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return mul_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return mul_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };



template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return mul_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return mul_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return mul_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return mul_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return mul_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };


template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return div_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return div_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return div_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return div_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return div_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return div_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };



template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return div_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return div_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return div_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return div_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return div_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };


template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return idiv_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return idiv_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return idiv_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return idiv_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return idiv_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return idiv_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };



template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return idiv_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return idiv_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return idiv_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return idiv_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return idiv_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };


template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return rem_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return rem_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return rem_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return rem_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return rem_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return rem_signed_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };



template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return rem_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return rem_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return rem_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return rem_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return rem_unsigned_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };


template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };



template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };


template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };



template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };


template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };



template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };


template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };



template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };


template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };



template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };


template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_signed_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };



template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_unsigned_int<Policy1, Policy2>(arg1, arg2, a1, a2); } };


template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return sqrt_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return sqrt_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return sqrt_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return sqrt_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return sqrt_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return sqrt_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return sqrt_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return sqrt_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return sqrt_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return sqrt_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return sqrt_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, char, char> { static inline Result function( char& arg1, const char &arg2, Rounding_Dir a1) { return abs_generic<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, Rounding_Dir a1) { return abs_generic<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, Rounding_Dir a1) { return abs_generic<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, Rounding_Dir a1) { return abs_generic<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, Rounding_Dir a1) { return abs_generic<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, Rounding_Dir a1) { return abs_generic<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_unsigned_int_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, char, char, char, char, char> { static inline Result function( char& arg1, char &arg2, char &arg3, const char &arg4, const char &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, signed char, signed char, signed char, signed char, signed char> { static inline Result function( signed char& arg1, signed char &arg2, signed char &arg3, const signed char &arg4, const signed char &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, signed short, signed short, signed short, signed short, signed short> { static inline Result function( signed short& arg1, signed short &arg2, signed short &arg3, const signed short &arg4, const signed short &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, signed int, signed int, signed int, signed int, signed int> { static inline Result function( signed int& arg1, signed int &arg2, signed int &arg3, const signed int &arg4, const signed int &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, signed long, signed long, signed long, signed long, signed long> { static inline Result function( signed long& arg1, signed long &arg2, signed long &arg3, const signed long &arg4, const signed long &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, signed long long, signed long long, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, signed long long &arg2, signed long long &arg3, const signed long long &arg4, const signed long long &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, unsigned char &arg2, unsigned char &arg3, const unsigned char &arg4, const unsigned char &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, unsigned short &arg2, unsigned short &arg3, const unsigned short &arg4, const unsigned short &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, unsigned int &arg2, unsigned int &arg3, const unsigned int &arg4, const unsigned int &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, unsigned long &arg2, unsigned long &arg3, const unsigned long &arg4, const unsigned long &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, unsigned long long &arg2, unsigned long long &arg3, const unsigned long long &arg4, const unsigned long long &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy> struct sgn_function_struct<Policy, char> { static inline Result_Relation function(const char& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, signed char> { static inline Result_Relation function(const signed char& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, signed short> { static inline Result_Relation function(const signed short& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, signed int> { static inline Result_Relation function(const signed int& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, signed long> { static inline Result_Relation function(const signed long& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, signed long long> { static inline Result_Relation function(const signed long long& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, unsigned char> { static inline Result_Relation function(const unsigned char& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, unsigned short> { static inline Result_Relation function(const unsigned short& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, unsigned int> { static inline Result_Relation function(const unsigned int& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, unsigned long> { static inline Result_Relation function(const unsigned long& arg) { return sgn_generic<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, unsigned long long> { static inline Result_Relation function(const unsigned long long& arg) { return sgn_generic<Policy>(arg); } };

template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, char, char> { static inline Result_Relation function(const char& arg1, const char &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, signed char, signed char> { static inline Result_Relation function(const signed char& arg1, const signed char &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, signed short, signed short> { static inline Result_Relation function(const signed short& arg1, const signed short &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, signed int, signed int> { static inline Result_Relation function(const signed int& arg1, const signed int &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, signed long, signed long> { static inline Result_Relation function(const signed long& arg1, const signed long &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, signed long long, signed long long> { static inline Result_Relation function(const signed long long& arg1, const signed long long &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, unsigned char, unsigned char> { static inline Result_Relation function(const unsigned char& arg1, const unsigned char &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, unsigned short, unsigned short> { static inline Result_Relation function(const unsigned short& arg1, const unsigned short &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, unsigned int, unsigned int> { static inline Result_Relation function(const unsigned int& arg1, const unsigned int &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, unsigned long, unsigned long> { static inline Result_Relation function(const unsigned long& arg1, const unsigned long &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, unsigned long long, unsigned long long> { static inline Result_Relation function(const unsigned long long& arg1, const unsigned long long &arg2) { return cmp_generic<Policy1, Policy2>(arg1, arg2); } };

template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return add_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, char, char, char> { static inline Result function( char& arg1, const char &arg2, const char &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, signed char, signed char, signed char> { static inline Result function( signed char& arg1, const signed char &arg2, const signed char &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, signed short, signed short, signed short> { static inline Result function( signed short& arg1, const signed short &arg2, const signed short &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, signed int, signed int, signed int> { static inline Result function( signed int& arg1, const signed int &arg2, const signed int &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, signed long, signed long, signed long> { static inline Result function( signed long& arg1, const signed long &arg2, const signed long &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, signed long long, signed long long, signed long long> { static inline Result function( signed long long& arg1, const signed long long &arg2, const signed long long &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, unsigned char, unsigned char, unsigned char> { static inline Result function( unsigned char& arg1, const unsigned char &arg2, const unsigned char &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, unsigned short, unsigned short, unsigned short> { static inline Result function( unsigned short& arg1, const unsigned short &arg2, const unsigned short &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, unsigned int, unsigned int, unsigned int> { static inline Result function( unsigned int& arg1, const unsigned int &arg2, const unsigned int &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, unsigned long, unsigned long, unsigned long> { static inline Result function( unsigned long& arg1, const unsigned long &arg2, const unsigned long &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, unsigned long long, unsigned long long, unsigned long long> { static inline Result function( unsigned long long& arg1, const unsigned long long &arg2, const unsigned long long &arg3, Rounding_Dir a1) { return sub_mul_int<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename Policy> struct input_function_struct<Policy, char> { static inline Result function( char& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, signed char> { static inline Result function( signed char& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, signed short> { static inline Result function( signed short& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, signed int> { static inline Result function( signed int& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, signed long> { static inline Result function( signed long& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, signed long long> { static inline Result function( signed long long& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, unsigned char> { static inline Result function( unsigned char& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, unsigned short> { static inline Result function( unsigned short& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, unsigned int> { static inline Result function( unsigned int& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, unsigned long> { static inline Result function( unsigned long& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct input_function_struct<Policy, unsigned long long> { static inline Result function( unsigned long long& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };

template <typename Policy> struct output_function_struct<Policy, char> { static inline Result function(std::ostream& b1, const char& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_char<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, signed char> { static inline Result function(std::ostream& b1, const signed char& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_char<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, signed short> { static inline Result function(std::ostream& b1, const signed short& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, signed int> { static inline Result function(std::ostream& b1, const signed int& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, signed long> { static inline Result function(std::ostream& b1, const signed long& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, signed long long> { static inline Result function(std::ostream& b1, const signed long long& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, unsigned char> { static inline Result function(std::ostream& b1, const unsigned char& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_char<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, unsigned short> { static inline Result function(std::ostream& b1, const unsigned short& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, unsigned int> { static inline Result function(std::ostream& b1, const unsigned int& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, unsigned long> { static inline Result function(std::ostream& b1, const unsigned long& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, unsigned long long> { static inline Result function(std::ostream& b1, const unsigned long long& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_int<Policy>(b1, arg, a1, a2); } };

}

}
# 702 "checked_defs.hh" 2
# 1 "checked_float_inlines.hh" 1
# 30 "checked_float_inlines.hh"
namespace Parma_Polyhedra_Library {

namespace Checked {

inline float
multiply_add(float x, float y, float z) {




  return x*y + z;

}

inline double
multiply_add(double x, double y, double z) {




  return x*y + z;

}

inline long double
multiply_add(long double x, long double y, long double z) {




  return x*y + z;

}


inline float
round_to_integer(float x) {
  return rintf(x);
}


inline double
round_to_integer(double x) {
  return rint(x);
}


inline long double
round_to_integer(long double x) {
  return rintl(x);
}
# 99 "checked_float_inlines.hh"
inline bool
fpu_direct_rounding(Rounding_Dir dir) {
  return round_direct(dir) || round_not_requested(dir);
}

inline bool
fpu_inverse_rounding(Rounding_Dir dir) {
  return round_inverse(dir);
}
# 133 "checked_float_inlines.hh"
inline void
limit_precision(const float& v) {
  PPL_CC_FLUSH(v);
}

inline void
limit_precision(const double& v) {
  PPL_CC_FLUSH(v);
}

inline void
limit_precision(const long double&) {
}

template <typename Policy, typename T>
inline Result
classify_float(const T v, bool nan, bool inf, bool sign) {
  Float<T> f(v);
  if ((nan || sign) && ((Policy::has_nan) ? (f.u.binary.is_nan()) : ((static_cast<void> (0)), false)))
    return V_NAN;
  if (inf) {
    if (Policy::has_infinity) {
      int sign_inf = f.u.binary.inf_sign();
      if (sign_inf < 0)
        return V_EQ_MINUS_INFINITY;
      if (sign_inf > 0)
        return V_EQ_PLUS_INFINITY;
    }
    else
      ((void) 0);
  }
  if (sign) {
    if (v < 0)
      return V_LT;
    if (v > 0)
      return V_GT;
    return V_EQ;
  }
  return V_LGE;
}

template <typename Policy, typename T>
inline bool
is_nan_float(const T v) {
  Float<T> f(v);
  return ((Policy::has_nan) ? (f.u.binary.is_nan()) : ((static_cast<void> (0)), false));
}

template <typename Policy, typename T>
inline bool
is_inf_float(const T v) {
  Float<T> f(v);
  return ((Policy::has_infinity) ? ((f.u.binary.inf_sign() != 0)) : ((static_cast<void> (0)), false));
}
template <typename Policy, typename T>
inline bool
is_minf_float(const T v) {
  Float<T> f(v);
  return ((Policy::has_infinity) ? ((f.u.binary.inf_sign() < 0)) : ((static_cast<void> (0)), false));
}

template <typename Policy, typename T>
inline bool
is_pinf_float(const T v) {
  Float<T> f(v);
  return ((Policy::has_infinity) ? ((f.u.binary.inf_sign() > 0)) : ((static_cast<void> (0)), false));
}


template <typename Policy, typename T>
inline bool
is_int_float(const T v) {
  return round_to_integer(v) == v;
}

template <typename Policy, typename T>
inline Result
assign_special_float(T& v, Result_Class c, Rounding_Dir) {
  ((void) 0);
  switch (c) {
  case VC_MINUS_INFINITY:
    v = -(__builtin_huge_val());
    return V_EQ_MINUS_INFINITY;
  case VC_PLUS_INFINITY:
    v = (__builtin_huge_val());
    return V_EQ_PLUS_INFINITY;
  case VC_NAN:
    v = (__builtin_nanf (""));
    return V_NAN;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_NAN | V_UNREPRESENTABLE;
  }
}

template <typename T>
inline void
pred_float(T& v) {
  Float<T> f(v);
  ((void) 0);
  ((void) 0);
  if (f.u.binary.zero_sign() > 0) {
    f.u.binary.negate();
    f.u.binary.inc();
  }
  else if (f.u.binary.sign_bit()) {
    f.u.binary.inc();
  }
  else {
    f.u.binary.dec();
  }
  v = f.value();
}

template <typename T>
inline void
succ_float(T& v) {
  Float<T> f(v);
  ((void) 0);
  ((void) 0);
  if (f.u.binary.zero_sign() < 0) {
    f.u.binary.negate();
    f.u.binary.inc();
  }
  else if (!f.u.binary.sign_bit()) {
    f.u.binary.inc();
  }
  else {
    f.u.binary.dec();
  }
  v = f.value();
}

template <typename Policy, typename To>
inline Result
round_lt_float(To& to, Rounding_Dir dir) {
  if (round_down(dir)) {
    pred_float(to);
    return V_GT;
  }
  return V_LT;
}

template <typename Policy, typename To>
inline Result
round_gt_float(To& to, Rounding_Dir dir) {
  if (round_up(dir)) {
    succ_float(to);
    return V_LT;
  }
  return V_GT;
}


template <typename Policy>
inline void
prepare_inexact(Rounding_Dir dir) {
  if (Policy::fpu_check_inexact
      && !round_not_needed(dir) && round_strict_relation(dir))
    fpu_reset_inexact();
}

template <typename Policy>
inline Result
result_relation(Rounding_Dir dir) {
  if (Policy::fpu_check_inexact
      && !round_not_needed(dir) && round_strict_relation(dir)) {
    switch (fpu_check_inexact()) {
    case 0:
      return V_EQ;
    case -1:
      goto unknown;
    case 1:
      break;
    }
    switch (round_dir(dir)) {
    case ROUND_DOWN:
      return V_GT;
    case ROUND_UP:
      return V_LT;
    default:
      return V_NE;
    }
  }
  else {
  unknown:
    switch (round_dir(dir)) {
    case ROUND_DOWN:
      return V_GE;
    case ROUND_UP:
      return V_LE;
    default:
      return V_LGE;
    }
  }
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_float_float_exact(To& to, const From from, Rounding_Dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  to = from;
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_float_float_inexact(To& to, const From from, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = from;
  else if (fpu_inverse_rounding(dir)) {
    From tmp = -from;
    to = tmp;
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(from);
    to = from;
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_float_float(To& to, const From from, Rounding_Dir dir) {
  if (sizeof(From) > sizeof(To))
    return assign_float_float_inexact<To_Policy, From_Policy>(to, from, dir);
  else
    return assign_float_float_exact<To_Policy, From_Policy>(to, from, dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
floor_float(Type& to, const Type from, Rounding_Dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (fpu_direct_rounding(ROUND_DOWN))
    to = round_to_integer(from);
  else if (fpu_inverse_rounding(ROUND_DOWN)) {
    to = round_to_integer(-from);
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(ROUND_DOWN));
    limit_precision(from);
    to = round_to_integer(from);
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
ceil_float(Type& to, const Type from, Rounding_Dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (fpu_direct_rounding(ROUND_UP))
    to = round_to_integer(from);
  else if (fpu_inverse_rounding(ROUND_UP)) {
    to = round_to_integer(-from);
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(ROUND_UP));
    limit_precision(from);
    to = round_to_integer(from);
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
trunc_float(Type& to, const Type from, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (from >= 0)
    return floor<To_Policy, From_Policy>(to, from, dir);
  else
    return ceil<To_Policy, From_Policy>(to, from, dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
neg_float(Type& to, const Type from, Rounding_Dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  to = -from;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
add_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_inf_add_inf
      && is_inf_float<From1_Policy>(x) && x == -y) {
    return assign_nan<To_Policy>(to, V_INF_ADD_INF);
  }
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = x + y;
  else if (fpu_inverse_rounding(dir)) {
    to = -x - y;
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(x);
    limit_precision(y);
    to = x + y;
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
sub_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_inf_sub_inf
      && is_inf_float<From1_Policy>(x) && x == y) {
    return assign_nan<To_Policy>(to, V_INF_SUB_INF);
  }
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = x - y;
  else if (fpu_inverse_rounding(dir)) {
    to = y - x;
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(x);
    limit_precision(y);
    to = x - y;
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
mul_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_inf_mul_zero
      && ((x == 0 && is_inf_float<From2_Policy>(y))
          ||
          (y == 0 && is_inf_float<From1_Policy>(x)))) {
    return assign_nan<To_Policy>(to, V_INF_MUL_ZERO);
  }
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = x * y;
  else if (fpu_inverse_rounding(dir)) {
    to = x * -y;
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(x);
    limit_precision(y);
    to = x * y;
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
div_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_inf_div_inf
      && is_inf_float<From1_Policy>(x) && is_inf_float<From2_Policy>(y)) {
    return assign_nan<To_Policy>(to, V_INF_DIV_INF);
  }
  if (To_Policy::check_div_zero && y == 0) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = x / y;
  else if (fpu_inverse_rounding(dir)) {
    to = x / -y;
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(x);
    limit_precision(y);
    to = x / y;
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
idiv_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  Type temp;

  dir = round_dir(dir);
  Result r = div<To_Policy, From1_Policy, From2_Policy>(temp, x, y, dir);
  if (result_class(r) != VC_NORMAL) {
    to = temp;
    return r;
  }
  Result r1 = trunc<To_Policy, To_Policy>(to, temp, ROUND_NOT_NEEDED);
  ((void) 0);
  if (r == V_EQ || to != temp)
    return r1;

  return (dir == ROUND_UP) ? V_LE : V_GE;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
rem_float(Type& to, const Type x, const Type y, Rounding_Dir) {
  if (To_Policy::check_inf_mod && is_inf_float<From1_Policy>(x)) {
    return assign_nan<To_Policy>(to, V_INF_MOD);
  }
  if (To_Policy::check_div_zero && y == 0) {
    return assign_nan<To_Policy>(to, V_MOD_ZERO);
  }
  to = std::fmod(x, y);
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return V_EQ;
}

struct Float_2exp {
  enum const_bool_value_has_nan { has_nan = (false) };
  enum const_bool_value_has_infinity { has_infinity = (false) };
};

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
add_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  ((void) 0);
  return
    add<To_Policy, From_Policy, Float_2exp>(to,
                                            x,
                                            Type(1ULL << exp),
                                            dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
sub_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  ((void) 0);
  return
    sub<To_Policy, From_Policy, Float_2exp>(to,
                                            x,
                                            Type(1ULL << exp),
                                            dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
mul_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  ((void) 0);
  return
    mul<To_Policy, From_Policy, Float_2exp>(to,
                                            x,
                                            Type(1ULL << exp),
                                            dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
div_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  ((void) 0);
  return
    div<To_Policy, From_Policy, Float_2exp>(to,
                                            x,
                                            Type(1ULL << exp),
                                            dir);
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
smod_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (To_Policy::check_inf_mod && is_inf_float<From_Policy>(x)) {
    return assign_nan<To_Policy>(to, V_INF_MOD);
  }
  ((void) 0);
  Type m = 1ULL << exp;
  rem_float<To_Policy, From_Policy, Float_2exp>(to, x, m, ROUND_IGNORE);
  Type m2 = m / 2;
  if (to < -m2)
    return add_float<To_Policy, From_Policy, Float_2exp>(to, to, m, dir);
  else if (to >= m2)
    return sub_float<To_Policy, From_Policy, Float_2exp>(to, to, m, dir);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
umod_2exp_float(Type& to, const Type x, unsigned int exp, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (To_Policy::check_inf_mod && is_inf_float<From_Policy>(x)) {
    return assign_nan<To_Policy>(to, V_INF_MOD);
  }
  ((void) 0);
  Type m = 1ULL << exp;
  rem_float<To_Policy, From_Policy, Float_2exp>(to, x, m, ROUND_IGNORE);
  if (to < 0)
    return add_float<To_Policy, From_Policy, Float_2exp>(to, to, m, dir);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
abs_float(Type& to, const Type from, Rounding_Dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  to = std::abs(from);
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename Type>
inline Result
sqrt_float(Type& to, const Type from, Rounding_Dir dir) {
  if (To_Policy::fpu_check_nan_result && is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (To_Policy::check_sqrt_neg && from < 0) {
    return assign_nan<To_Policy>(to, V_SQRT_NEG);
  }
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = std::sqrt(from);
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(from);
    to = std::sqrt(from);
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  return result_relation<To_Policy>(dir);
}

template <typename Policy, typename Type>
inline Result_Relation
sgn_float(const Type x) {
  if (x > 0)
    return VR_GT;
  if (x < 0)
    return VR_LT;
  if (x == 0)
    return VR_EQ;
  return VR_EMPTY;
}

template <typename Policy1, typename Policy2, typename Type>
inline Result_Relation
cmp_float(const Type x, const Type y) {
  if (x > y)
    return VR_GT;
  if (x < y)
    return VR_LT;
  if (x == y)
    return VR_EQ;
  return VR_EMPTY;
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_float_int_inexact(To& to, const From from, Rounding_Dir dir) {
  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = from;
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    to = from;
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From_Policy, typename To, typename From>
inline Result
assign_float_int(To& to, const From from, Rounding_Dir dir) {
  if (((sizeof(From)) * static_cast<std::size_t>(8)) > Float<To>::Binary::MANTISSA_BITS)
    return assign_float_int_inexact<To_Policy, From_Policy>(to, from, dir);
  else
    return assign_exact<To_Policy, From_Policy>(to, from, dir);
}

template <typename Policy, typename T>
inline Result
set_neg_overflow_float(T& to, Rounding_Dir dir) {
  switch (round_dir(dir)) {
  case ROUND_UP:
    {
      Float<T> f;
      f.u.binary.set_max(true);
      to = f.value();
      return V_LT_INF;
    }
  case ROUND_DOWN:
  case ROUND_IGNORE:
    to = -(__builtin_huge_val());
    return V_GT_MINUS_INFINITY;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_GT_MINUS_INFINITY;
  }
}

template <typename Policy, typename T>
inline Result
set_pos_overflow_float(T& to, Rounding_Dir dir) {
  switch (round_dir(dir)) {
  case ROUND_DOWN:
    {
      Float<T> f;
      f.u.binary.set_max(false);
      to = f.value();
      return V_GT_SUP;
    }
  case ROUND_UP:
  case ROUND_IGNORE:
    to = (__builtin_huge_val());
    return V_LT_PLUS_INFINITY;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_LT_PLUS_INFINITY;
  }
}

template <typename To_Policy, typename From_Policy, typename T>
inline Result
assign_float_mpz(T& to, const mpz_class& from, Rounding_Dir dir) {
  int sign = sgn(from);
  if (sign == 0) {
    to = 0;
    return V_EQ;
  }
  mpz_srcptr from_z = from.get_mpz_t();
  size_t exponent = __gmpz_sizeinbase(from_z, 2) - 1;
  if (exponent > size_t(Float<T>::Binary::EXPONENT_MAX)) {
    if (sign < 0)
      return set_neg_overflow_float<To_Policy>(to, dir);
    else
      return set_pos_overflow_float<To_Policy>(to, dir);
  }
  unsigned long zeroes = __gmpn_scan1(from_z->_mp_d, 0);
  size_t meaningful_bits = exponent - zeroes;
  mpz_t mantissa;
  __gmpz_init(mantissa);
  if (exponent > Float<T>::Binary::MANTISSA_BITS)
    __gmpz_tdiv_q_2exp(mantissa,
                    from_z,
                    exponent - Float<T>::Binary::MANTISSA_BITS);
  else
    __gmpz_mul_2exp(mantissa, from_z, Float<T>::Binary::MANTISSA_BITS - exponent);
  Float<T> f;
  f.u.binary.build(sign < 0, mantissa, static_cast<long>(exponent));
  __gmpz_clear(mantissa);
  to = f.value();
  if (meaningful_bits > Float<T>::Binary::MANTISSA_BITS) {
    if (sign < 0)
      return round_lt_float<To_Policy>(to, dir);
    else
      return round_gt_float<To_Policy>(to, dir);
  }
  return V_EQ;
}

template <typename To_Policy, typename From_Policy, typename T>
inline Result
assign_float_mpq(T& to, const mpq_class& from, Rounding_Dir dir) {
  const mpz_class& numer = from.get_num();
  const mpz_class& denom = from.get_den();
  if (denom == 1)
    return assign_float_mpz<To_Policy, From_Policy>(to, numer, dir);
  mpz_srcptr numer_z = numer.get_mpz_t();
  mpz_srcptr denom_z = denom.get_mpz_t();
  int sign = sgn(numer);
  long exponent = static_cast<long>(__gmpz_sizeinbase(numer_z, 2))
    - static_cast<long>(__gmpz_sizeinbase(denom_z, 2));
  if (exponent < Float<T>::Binary::EXPONENT_MIN_DENORM) {
    to = 0;
  inexact:
    if (sign < 0)
      return round_lt_float<To_Policy>(to, dir);
    else
      return round_gt_float<To_Policy>(to, dir);
  }
  if (exponent > Float<T>::Binary::EXPONENT_MAX + 1) {
  overflow:
    if (sign < 0)
      return set_neg_overflow_float<To_Policy>(to, dir);
    else
      return set_pos_overflow_float<To_Policy>(to, dir);
  }
  unsigned int needed_bits = Float<T>::Binary::MANTISSA_BITS + 1;
  if (exponent < Float<T>::Binary::EXPONENT_MIN) {
    long diff = Float<T>::Binary::EXPONENT_MIN - exponent;
    needed_bits -= static_cast<unsigned int>(diff);
  }
  mpz_t mantissa;
  __gmpz_init(mantissa);
  {
    long shift = static_cast<long>(needed_bits) - exponent;
    if (shift > 0) {
      __gmpz_mul_2exp(mantissa, numer_z, static_cast<unsigned long>(shift));
      numer_z = mantissa;
    }
    else if (shift < 0) {
      shift = -shift;
      __gmpz_mul_2exp(mantissa, denom_z, static_cast<unsigned long>(shift));
      denom_z = mantissa;
    }
  }
  mpz_t r;
  __gmpz_init(r);
  __gmpz_tdiv_qr(mantissa, r, numer_z, denom_z);
  size_t bits = __gmpz_sizeinbase(mantissa, 2);
  bool inexact = (((r)->_mp_size < 0 ? -1 : (r)->_mp_size > 0) != 0);
  __gmpz_clear(r);
  if (bits == needed_bits + 1) {
    inexact = (inexact || (((mantissa)->_mp_size != 0) & (static_cast<int> ((mantissa)->_mp_d[0]))));
    __gmpz_tdiv_q_2exp(mantissa, mantissa, 1);
  }
  else
    --exponent;
  if (exponent > Float<T>::Binary::EXPONENT_MAX) {
    __gmpz_clear(mantissa);
    goto overflow;
  }
  else if (exponent < Float<T>::Binary::EXPONENT_MIN - 1) {

    exponent = Float<T>::Binary::EXPONENT_MIN - 1;
  }
  Float<T> f;
  f.u.binary.build(sign < 0, mantissa, exponent);
  __gmpz_clear(mantissa);
  to = f.value();
  if (inexact)
    goto inexact;
  return V_EQ;
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename Type>
inline Result
add_mul_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_inf_mul_zero
      && ((x == 0 && is_inf_float<From2_Policy>(y))
          ||
          (y == 0 && is_inf_float<From1_Policy>(x)))) {
    return assign_nan<To_Policy>(to, V_INF_MUL_ZERO);
  }

  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = multiply_add(x, y, to);
  else if (fpu_inverse_rounding(dir)) {
    to = multiply_add(-x, y, -to);
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(x);
    limit_precision(y);
    limit_precision(to);
    to = multiply_add(x, y, to);
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return result_relation<To_Policy>(dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy, typename Type>
inline Result
sub_mul_float(Type& to, const Type x, const Type y, Rounding_Dir dir) {
  if (To_Policy::check_inf_mul_zero
      && ((x == 0 && is_inf_float<From2_Policy>(y))
          ||
          (y == 0 && is_inf_float<From1_Policy>(x)))) {
    return assign_nan<To_Policy>(to, V_INF_MUL_ZERO);
  }

  prepare_inexact<To_Policy>(dir);
  if (fpu_direct_rounding(dir))
    to = multiply_add(x, -y, to);
  else if (fpu_inverse_rounding(dir)) {
    to = multiply_add(x, y, -to);
    limit_precision(to);
    to = -to;
  }
  else {
    fpu_rounding_control_word_type old
      = fpu_save_rounding_direction(round_fpu_dir(dir));
    limit_precision(x);
    limit_precision(y);
    limit_precision(to);
    to = multiply_add(x, -y, to);
    limit_precision(to);
    fpu_restore_rounding_direction(old);
  }
  if (To_Policy::fpu_check_nan_result && is_nan<To_Policy>(to))
    return V_NAN;
  return result_relation<To_Policy>(dir);
}

template <typename From>
inline void
assign_mpq_numeric_float(mpq_class& to, const From from) {
  to = from;
}

template <>
inline void
assign_mpq_numeric_float(mpq_class& to, const long double from) {
  to = 0;
  if (from == 0.0L)
    return;
  mpz_class& num = to.get_num();
  mpz_class& den = to.get_den();
  int exp;
  long double n = std::frexp(from, &exp);
  bool neg = false;
  if (n < 0.0L) {
    neg = true;
    n = -n;
  }
  const long double mult = static_cast<long double>((2147483647L * 2UL + 1UL)) + 1.0L;
  const unsigned int bits = sizeof(unsigned long) * 8;
  while (true) {
    n *= mult;
    exp -= bits;
    const long double intpart = std::floor(n);
    num += static_cast<unsigned long>(intpart);
    n -= intpart;
    if (n == 0.0L)
      break;
    num <<= bits;
  }
  if (exp < 0)
    den <<= -exp;
  else
    num <<= exp;
  if (neg)
    to = -to;
  to.canonicalize();
}

template <typename Policy, typename Type>
inline Result
output_float(std::ostream& os, const Type from, const Numeric_Format&,
             Rounding_Dir) {
  if (from == 0)
    os << "0";
  else if (is_minf<Policy>(from))
    os << "-inf";
  else if (is_pinf<Policy>(from))
    os << "+inf";
  else if (is_nan<Policy>(from))
    os << "nan";
  else {
    mpq_class q;
    assign_mpq_numeric_float(q, from);
    std::string s = float_mpq_to_string(q);
    os << s;
  }
  return V_EQ;
}


template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return assign_float_float_exact<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, double> { static inline Result function( float& arg1, const double &arg2, Rounding_Dir a1) { return assign_float_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, float> { static inline Result function( double& arg1, const float &arg2, Rounding_Dir a1) { return assign_float_float_exact<Policy1, Policy2>(arg1, arg2, a1); } };


template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, long double> { static inline Result function( float& arg1, const long double &arg2, Rounding_Dir a1) { return assign_float_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, float> { static inline Result function( long double& arg1, const float &arg2, Rounding_Dir a1) { return assign_float_float_exact<Policy1, Policy2>(arg1, arg2, a1); } };




template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return assign_float_float_exact<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, long double> { static inline Result function( double& arg1, const long double &arg2, Rounding_Dir a1) { return assign_float_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, double> { static inline Result function( long double& arg1, const double &arg2, Rounding_Dir a1) { return assign_float_float_exact<Policy1, Policy2>(arg1, arg2, a1); } };




template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return assign_float_float_exact<Policy1, Policy2>(arg1, arg2, a1); } };



template <typename Policy> struct classify_function_struct<Policy, float> { static inline Result function(const float& arg, bool a1, bool a2, bool a3) { return classify_float<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct is_nan_function_struct<Policy, float> { static inline bool function(const float& arg) { return is_nan_float<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, float> { static inline bool function(const float& arg) { return is_minf_float<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, float> { static inline bool function(const float& arg) { return is_pinf_float<Policy>(arg); } };
template <typename Policy> struct assign_special_function_struct<Policy, float> { static inline Result function( float& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_float<Policy>(arg, a1, a2); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, char> { static inline Result function( float& arg1, const char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, signed char> { static inline Result function( float& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, signed short> { static inline Result function( float& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, signed int> { static inline Result function( float& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, signed long> { static inline Result function( float& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, signed long long> { static inline Result function( float& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, unsigned char> { static inline Result function( float& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, unsigned short> { static inline Result function( float& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, unsigned int> { static inline Result function( float& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, unsigned long> { static inline Result function( float& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, unsigned long long> { static inline Result function( float& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, mpz_class> { static inline Result function( float& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_float_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, float, mpq_class> { static inline Result function( float& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_float_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, float, float> { static inline void function( float& arg1, const float &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy> struct is_int_function_struct<Policy, float> { static inline bool function(const float& arg) { return is_int_float<Policy>(arg); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return floor_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return ceil_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return trunc_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return neg_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return abs_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return add_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return sub_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return div_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return rem_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, float, float> { static inline Result function( float& arg1, const float &arg2, Rounding_Dir a1) { return sqrt_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, float, float, float, float, float> { static inline Result function( float& arg1, float &arg2, float &arg3, const float &arg4, const float &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy> struct sgn_function_struct<Policy, float> { static inline Result_Relation function(const float& arg) { return sgn_float<Policy>(arg); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, float, float> { static inline Result_Relation function(const float& arg1, const float &arg2) { return cmp_float<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return add_mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, float, float, float> { static inline Result function( float& arg1, const float &arg2, const float &arg3, Rounding_Dir a1) { return sub_mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy> struct input_function_struct<Policy, float> { static inline Result function( float& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, float> { static inline Result function(std::ostream& b1, const float& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_float<Policy>(b1, arg, a1, a2); } };



template <typename Policy> struct classify_function_struct<Policy, double> { static inline Result function(const double& arg, bool a1, bool a2, bool a3) { return classify_float<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct is_nan_function_struct<Policy, double> { static inline bool function(const double& arg) { return is_nan_float<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, double> { static inline bool function(const double& arg) { return is_minf_float<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, double> { static inline bool function(const double& arg) { return is_pinf_float<Policy>(arg); } };
template <typename Policy> struct assign_special_function_struct<Policy, double> { static inline Result function( double& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_float<Policy>(arg, a1, a2); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, char> { static inline Result function( double& arg1, const char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, signed char> { static inline Result function( double& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, signed short> { static inline Result function( double& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, signed int> { static inline Result function( double& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, signed long> { static inline Result function( double& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, signed long long> { static inline Result function( double& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, unsigned char> { static inline Result function( double& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, unsigned short> { static inline Result function( double& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, unsigned int> { static inline Result function( double& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, unsigned long> { static inline Result function( double& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, unsigned long long> { static inline Result function( double& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, mpz_class> { static inline Result function( double& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_float_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, double, mpq_class> { static inline Result function( double& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_float_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, double, double> { static inline void function( double& arg1, const double &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy> struct is_int_function_struct<Policy, double> { static inline bool function(const double& arg) { return is_int_float<Policy>(arg); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return floor_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return ceil_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return trunc_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return neg_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return abs_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return add_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return sub_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return div_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return rem_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, double, double> { static inline Result function( double& arg1, const double &arg2, Rounding_Dir a1) { return sqrt_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, double, double, double, double, double> { static inline Result function( double& arg1, double &arg2, double &arg3, const double &arg4, const double &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy> struct sgn_function_struct<Policy, double> { static inline Result_Relation function(const double& arg) { return sgn_float<Policy>(arg); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, double, double> { static inline Result_Relation function(const double& arg1, const double &arg2) { return cmp_float<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return add_mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, double, double, double> { static inline Result function( double& arg1, const double &arg2, const double &arg3, Rounding_Dir a1) { return sub_mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy> struct input_function_struct<Policy, double> { static inline Result function( double& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, double> { static inline Result function(std::ostream& b1, const double& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_float<Policy>(b1, arg, a1, a2); } };



template <typename Policy> struct classify_function_struct<Policy, long double> { static inline Result function(const long double& arg, bool a1, bool a2, bool a3) { return classify_float<Policy>(arg, a1, a2, a3); } };
template <typename Policy> struct is_nan_function_struct<Policy, long double> { static inline bool function(const long double& arg) { return is_nan_float<Policy>(arg); } };
template <typename Policy> struct is_minf_function_struct<Policy, long double> { static inline bool function(const long double& arg) { return is_minf_float<Policy>(arg); } };
template <typename Policy> struct is_pinf_function_struct<Policy, long double> { static inline bool function(const long double& arg) { return is_pinf_float<Policy>(arg); } };
template <typename Policy> struct assign_special_function_struct<Policy, long double> { static inline Result function( long double& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_float<Policy>(arg, a1, a2); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, char> { static inline Result function( long double& arg1, const char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, signed char> { static inline Result function( long double& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, signed short> { static inline Result function( long double& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, signed int> { static inline Result function( long double& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, signed long> { static inline Result function( long double& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, signed long long> { static inline Result function( long double& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, unsigned char> { static inline Result function( long double& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, unsigned short> { static inline Result function( long double& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, unsigned int> { static inline Result function( long double& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, unsigned long> { static inline Result function( long double& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, unsigned long long> { static inline Result function( long double& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_float_int<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, mpz_class> { static inline Result function( long double& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_float_mpz<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, long double, mpq_class> { static inline Result function( long double& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_float_mpq<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, long double, long double> { static inline void function( long double& arg1, const long double &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy> struct is_int_function_struct<Policy, long double> { static inline bool function(const long double& arg) { return is_int_float<Policy>(arg); } };
template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return floor_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return ceil_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return trunc_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return neg_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return abs_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return add_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return sub_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return div_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return rem_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_float<Policy1, Policy2>(arg1, arg2, a1, a2); } };
template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, Rounding_Dir a1) { return sqrt_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, long double, long double, long double, long double, long double> { static inline Result function( long double& arg1, long double &arg2, long double &arg3, const long double &arg4, const long double &arg5, Rounding_Dir a1) { return gcdext_exact<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };

template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return lcm_gcd_exact<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy> struct sgn_function_struct<Policy, long double> { static inline Result_Relation function(const long double& arg) { return sgn_float<Policy>(arg); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, long double, long double> { static inline Result_Relation function(const long double& arg1, const long double &arg2) { return cmp_float<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return add_mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, long double, long double, long double> { static inline Result function( long double& arg1, const long double &arg2, const long double &arg3, Rounding_Dir a1) { return sub_mul_float<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };
template <typename Policy> struct input_function_struct<Policy, long double> { static inline Result function( long double& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, long double> { static inline Result function(std::ostream& b1, const long double& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_float<Policy>(b1, arg, a1, a2); } };


}

}
# 703 "checked_defs.hh" 2
# 1 "checked_mpz_inlines.hh" 1
# 27 "checked_mpz_inlines.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3




namespace std
{
# 62 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
    {
    public:

      typedef _CharT char_type;
      typedef _Traits traits_type;


      typedef _Alloc allocator_type;
      typedef typename traits_type::int_type int_type;
      typedef typename traits_type::pos_type pos_type;
      typedef typename traits_type::off_type off_type;







      typedef basic_streambuf<char_type, traits_type> __streambuf_type;
      typedef basic_string<char_type, _Traits, _Alloc> __string_type;
      typedef typename __string_type::size_type __size_type;


    protected:





      ios_base::openmode _M_mode;







      __string_type _M_string;

    public:
# 112 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
      : __streambuf_type(), _M_mode(__mode), _M_string()
      { }
# 125 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_stringbuf(const __string_type& __str,
        ios_base::openmode __mode = ios_base::in | ios_base::out)
      : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size())
      { _M_stringbuf_init(__mode); }
# 140 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      __string_type
      str() const
      {
 if (this->pptr())
   {

     if (this->pptr() > this->egptr())
       return __string_type(this->pbase(), this->pptr());
     else
        return __string_type(this->pbase(), this->egptr());
   }
 else
   return _M_string;
      }
# 162 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      void
      str(const __string_type& __s)
      {

 _M_string.assign(__s.data(), __s.size());
 _M_stringbuf_init(this->_M_mode);
      }

    protected:






      void
      _M_stringbuf_init(ios_base::openmode __mode)
      {
 this->_M_mode = __mode;

 __size_type __len = 0;
 if (this->_M_mode & (ios_base::ate | ios_base::app))
   __len = _M_string.size();
 _M_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
      }

      virtual streamsize
      showmanyc()
      {
 streamsize __ret = -1;
 if (_M_mode & ios_base::in)
   {
     _M_update_egptr();
     __ret = this->egptr() - this->gptr();
   }
 return __ret;
      }


      virtual int_type
      underflow();


      virtual int_type
      pbackfail(int_type __c = traits_type::eof());


      virtual int_type
      overflow(int_type __c = traits_type::eof());
# 223 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      virtual __streambuf_type*
      setbuf(char_type* __s, streamsize __n)
      {
 if (__s && __n >= 0)
   {






     _M_string = __string_type(__s, __n);


     _M_sync(__s, 0, 0);
   }
 return this;
      }


      virtual pos_type
      seekoff(off_type __off, ios_base::seekdir __way,
       ios_base::openmode __mode = ios_base::in | ios_base::out);


      virtual pos_type
      seekpos(pos_type __sp,
       ios_base::openmode __mode = ios_base::in | ios_base::out);
# 263 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      void
      _M_sync(char_type* __base, __size_type __i, __size_type __o)
      {
 const bool __testin = this->_M_mode & ios_base::in;
 const bool __testout = this->_M_mode & ios_base::out;
 const __size_type __len = _M_string.size();

 if (__testin)
   this->setg(__base, __base + __i, __base + __len);
 if (__testout)
   {
     this->setp(__base, __base + _M_string.capacity());
     this->pbump(__o);




     if (!__testin)
       this->setg(__base + __len, __base + __len, __base + __len);
   }
      }



      void
      _M_update_egptr()
      {
 const bool __testin = this->_M_mode & ios_base::in;

 if (this->pptr() && this->pptr() > this->egptr())
   if (__testin)
     this->setg(this->eback(), this->gptr(), this->pptr());
   else
     this->setg(this->pptr(), this->pptr(), this->pptr());
      }
    };
# 310 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
  template<typename _CharT, typename _Traits, typename _Alloc>
    class basic_istringstream : public basic_istream<_CharT, _Traits>
    {
    public:

      typedef _CharT char_type;
      typedef _Traits traits_type;


      typedef _Alloc allocator_type;
      typedef typename traits_type::int_type int_type;
      typedef typename traits_type::pos_type pos_type;
      typedef typename traits_type::off_type off_type;


      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
      typedef basic_istream<char_type, traits_type> __istream_type;

    private:





      __stringbuf_type _M_stringbuf;

    public:
# 353 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_istringstream(ios_base::openmode __mode = ios_base::in)
      : __istream_type(), _M_stringbuf(__mode | ios_base::in)
      { this->init(&_M_stringbuf); }
# 373 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_istringstream(const __string_type& __str,
     ios_base::openmode __mode = ios_base::in)
      : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in)
      { this->init(&_M_stringbuf); }







      ~basic_istringstream()
      { }
# 395 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      __stringbuf_type*
      rdbuf() const
      { return const_cast<__stringbuf_type*>(&_M_stringbuf); }





      __string_type
      str() const
      { return _M_stringbuf.str(); }







      void
      str(const __string_type& __s)
      { _M_stringbuf.str(__s); }
    };
# 428 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
  template <typename _CharT, typename _Traits, typename _Alloc>
    class basic_ostringstream : public basic_ostream<_CharT, _Traits>
    {
    public:

      typedef _CharT char_type;
      typedef _Traits traits_type;


      typedef _Alloc allocator_type;
      typedef typename traits_type::int_type int_type;
      typedef typename traits_type::pos_type pos_type;
      typedef typename traits_type::off_type off_type;


      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
      typedef basic_ostream<char_type, traits_type> __ostream_type;

    private:





      __stringbuf_type _M_stringbuf;

    public:
# 471 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_ostringstream(ios_base::openmode __mode = ios_base::out)
      : __ostream_type(), _M_stringbuf(__mode | ios_base::out)
      { this->init(&_M_stringbuf); }
# 491 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_ostringstream(const __string_type& __str,
     ios_base::openmode __mode = ios_base::out)
      : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out)
      { this->init(&_M_stringbuf); }







      ~basic_ostringstream()
      { }
# 513 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      __stringbuf_type*
      rdbuf() const
      { return const_cast<__stringbuf_type*>(&_M_stringbuf); }





      __string_type
      str() const
      { return _M_stringbuf.str(); }







      void
      str(const __string_type& __s)
      { _M_stringbuf.str(__s); }
    };
# 546 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
  template <typename _CharT, typename _Traits, typename _Alloc>
    class basic_stringstream : public basic_iostream<_CharT, _Traits>
    {
    public:

      typedef _CharT char_type;
      typedef _Traits traits_type;


      typedef _Alloc allocator_type;
      typedef typename traits_type::int_type int_type;
      typedef typename traits_type::pos_type pos_type;
      typedef typename traits_type::off_type off_type;


      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
      typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
      typedef basic_iostream<char_type, traits_type> __iostream_type;

    private:





      __stringbuf_type _M_stringbuf;

    public:
# 587 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
      : __iostream_type(), _M_stringbuf(__m)
      { this->init(&_M_stringbuf); }
# 605 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      explicit
      basic_stringstream(const __string_type& __str,
    ios_base::openmode __m = ios_base::out | ios_base::in)
      : __iostream_type(), _M_stringbuf(__str, __m)
      { this->init(&_M_stringbuf); }







      ~basic_stringstream()
      { }
# 627 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 3
      __stringbuf_type*
      rdbuf() const
      { return const_cast<__stringbuf_type*>(&_M_stringbuf); }





      __string_type
      str() const
      { return _M_stringbuf.str(); }







      void
      str(const __string_type& __s)
      { _M_stringbuf.str(__s); }
    };
}


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/sstream.tcc" 1 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/sstream.tcc" 3
       
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/sstream.tcc" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 1 3
# 41 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/sstream.tcc" 2 3

namespace std
{
  template <class _CharT, class _Traits, class _Alloc>
    typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
    basic_stringbuf<_CharT, _Traits, _Alloc>::
    pbackfail(int_type __c)
    {
      int_type __ret = traits_type::eof();
      const bool __testeof = traits_type::eq_int_type(__c, __ret);

      if (this->eback() < this->gptr())
 {
   const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
      this->gptr()[-1]);
   this->gbump(-1);



   if (!__testeof && __testeq)
     __ret = __c;
   else if (__testeof)
     __ret = traits_type::not_eof(__c);
   else
     {
       *this->gptr() = traits_type::to_char_type(__c);
       __ret = __c;
     }
 }
      return __ret;
    }

  template <class _CharT, class _Traits, class _Alloc>
    typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
    basic_stringbuf<_CharT, _Traits, _Alloc>::
    overflow(int_type __c)
    {
      const bool __testout = this->_M_mode & ios_base::out;
      if (__builtin_expect(!__testout, false))
 return traits_type::eof();

      const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
      if (__builtin_expect(__testeof, false))
 return traits_type::not_eof(__c);

      const __size_type __capacity = _M_string.capacity();
      const __size_type __max_size = _M_string.max_size();
      const bool __testput = this->pptr() < this->epptr();
      if (__builtin_expect(!__testput && __capacity == __max_size, false))
 return traits_type::eof();



      if (!__testput)
 {






   const __size_type __opt_len = std::max(__size_type(2 * __capacity),
       __size_type(512));
   const __size_type __len = std::min(__opt_len, __max_size);
   __string_type __tmp;
   __tmp.reserve(__len);
   __tmp.assign(_M_string.data(), this->epptr() - this->pbase());
   _M_string.swap(__tmp);
   _M_sync(const_cast<char_type*>(_M_string.data()),
    this->gptr() - this->eback(), this->pptr() - this->pbase());
 }
      return this->sputc(traits_type::to_char_type(__c));
    }

  template <class _CharT, class _Traits, class _Alloc>
    typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
    basic_stringbuf<_CharT, _Traits, _Alloc>::
    underflow()
    {
      int_type __ret = traits_type::eof();
      const bool __testin = this->_M_mode & ios_base::in;
      if (__testin)
 {

   _M_update_egptr();

   if (this->gptr() < this->egptr())
     __ret = traits_type::to_int_type(*this->gptr());
 }
      return __ret;
    }

  template <class _CharT, class _Traits, class _Alloc>
    typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
    basic_stringbuf<_CharT, _Traits, _Alloc>::
    seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
    {
      pos_type __ret = pos_type(off_type(-1));
      bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
      bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
      const bool __testboth = __testin && __testout && __way != ios_base::cur;
      __testin &= !(__mode & ios_base::out);
      __testout &= !(__mode & ios_base::in);



      const char_type* __beg = __testin ? this->eback() : this->pbase();
      if ((__beg || !__off) && (__testin || __testout || __testboth))
 {
   _M_update_egptr();

   off_type __newoffi = 0;
   off_type __newoffo = 0;
   if (__way == ios_base::cur)
     {
       __newoffi = this->gptr() - __beg;
       __newoffo = this->pptr() - __beg;
     }
   else if (__way == ios_base::end)
     __newoffo = __newoffi = this->egptr() - __beg;

   if ((__testin || __testboth)
       && __newoffi + __off >= 0
       && this->egptr() - __beg >= __newoffi + __off)
     {
       this->gbump((__beg + __newoffi + __off) - this->gptr());
       __ret = pos_type(__newoffi);
     }
   if ((__testout || __testboth)
       && __newoffo + __off >= 0
       && this->egptr() - __beg >= __newoffo + __off)
     {
       this->pbump((__beg + __newoffo + __off) - this->pptr());
       __ret = pos_type(__newoffo);
     }
 }
      return __ret;
    }

  template <class _CharT, class _Traits, class _Alloc>
    typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
    basic_stringbuf<_CharT, _Traits, _Alloc>::
    seekpos(pos_type __sp, ios_base::openmode __mode)
    {
      pos_type __ret = pos_type(off_type(-1));
      const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
      const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;

      const char_type* __beg = __testin ? this->eback() : this->pbase();
      if (__beg)
 {
   _M_update_egptr();

   off_type __pos(__sp);
   const bool __testpos = 0 <= __pos
                          && __pos <= this->egptr() - __beg;
   if ((__testin || __testout) && __testpos)
     {
       if (__testin)
  this->gbump((__beg + __pos) - this->gptr());
       if (__testout)
                this->pbump((__beg + __pos) - this->pptr());
       __ret = __sp;
     }
 }
      return __ret;
    }





  extern template class basic_stringbuf<char>;
  extern template class basic_istringstream<char>;
  extern template class basic_ostringstream<char>;
  extern template class basic_stringstream<char>;


  extern template class basic_stringbuf<wchar_t>;
  extern template class basic_istringstream<wchar_t>;
  extern template class basic_ostringstream<wchar_t>;
  extern template class basic_stringstream<wchar_t>;


}
# 653 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/sstream" 2 3
# 28 "checked_mpz_inlines.hh" 2

namespace Parma_Polyhedra_Library {

namespace Checked {

template <typename Policy>
inline Result
round_lt_mpz(mpz_class& to, Rounding_Dir dir) {
  if (round_down(dir)) {
    --to;
    return V_GT;
  }
  return V_LT;
}

template <typename Policy>
inline Result
round_gt_mpz(mpz_class& to, Rounding_Dir dir) {
  if (round_up(dir)) {
    ++to;
    return V_LT;
  }
  return V_GT;
}



typedef typeof(__mpz_struct()._mp_size) mp_size_field_t;





inline mp_size_field_t
get_mp_size(const mpz_class &v) {
  return v.get_mpz_t()->_mp_size;
}

inline void
set_mp_size(mpz_class &v, mp_size_field_t size) {
  v.get_mpz_t()->_mp_size = size;
}

template <typename Policy>
inline Result
classify_mpz(const mpz_class& v, bool nan, bool inf, bool sign) {
  if (Policy::has_nan || Policy::has_infinity) {
    mp_size_field_t s = get_mp_size(v);
    if (Policy::has_nan
        && (nan || sign)
        && s == C_Integer<mp_size_field_t>::min + 1)
      return V_NAN;
    if (!inf && !sign)
      return V_LGE;
    if (Policy::has_infinity) {
      if (s == C_Integer<mp_size_field_t>::min)
        return inf ? V_EQ_MINUS_INFINITY : V_LT;
      if (s == C_Integer<mp_size_field_t>::max)
        return inf ? V_EQ_PLUS_INFINITY : V_GT;
    }
  }
  if (sign)
    return static_cast<Result>(sgn<Policy>(v));
  return V_LGE;
}

template <typename Policy> struct classify_function_struct<Policy, mpz_class> { static inline Result function(const mpz_class& arg, bool a1, bool a2, bool a3) { return classify_mpz<Policy>(arg, a1, a2, a3); } };

template <typename Policy>
inline bool
is_nan_mpz(const mpz_class& v) {
  return Policy::has_nan
    && get_mp_size(v) == C_Integer<mp_size_field_t>::min + 1;
}

template <typename Policy> struct is_nan_function_struct<Policy, mpz_class> { static inline bool function(const mpz_class& arg) { return is_nan_mpz<Policy>(arg); } };

template <typename Policy>
inline bool
is_minf_mpz(const mpz_class& v) {
  return Policy::has_infinity
    && get_mp_size(v) == C_Integer<mp_size_field_t>::min;
}

template <typename Policy> struct is_minf_function_struct<Policy, mpz_class> { static inline bool function(const mpz_class& arg) { return is_minf_mpz<Policy>(arg); } };

template <typename Policy>
inline bool
is_pinf_mpz(const mpz_class& v) {
  return Policy::has_infinity
    && get_mp_size(v) == C_Integer<mp_size_field_t>::max;
}

template <typename Policy> struct is_pinf_function_struct<Policy, mpz_class> { static inline bool function(const mpz_class& arg) { return is_pinf_mpz<Policy>(arg); } };

template <typename Policy>
inline bool
is_int_mpz(const mpz_class& v) {
  return !is_nan<Policy>(v);
}

template <typename Policy> struct is_int_function_struct<Policy, mpz_class> { static inline bool function(const mpz_class& arg) { return is_int_mpz<Policy>(arg); } };

template <typename Policy>
inline Result
assign_special_mpz(mpz_class& v, Result_Class c, Rounding_Dir) {
  switch (c) {
  case VC_NAN:
    if (Policy::has_nan)
      set_mp_size(v, C_Integer<mp_size_field_t>::min + 1);
    return V_NAN;
  case VC_MINUS_INFINITY:
    if (Policy::has_infinity) {
      set_mp_size(v, C_Integer<mp_size_field_t>::min);
      return V_EQ_MINUS_INFINITY;
    }
    return V_EQ_MINUS_INFINITY | V_UNREPRESENTABLE;
  case VC_PLUS_INFINITY:
    if (Policy::has_infinity) {
      set_mp_size(v, C_Integer<mp_size_field_t>::max);
      return V_EQ_PLUS_INFINITY;
    }
    return V_EQ_PLUS_INFINITY | V_UNREPRESENTABLE;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_NAN;
  }
}

template <typename Policy> struct assign_special_function_struct<Policy, mpz_class> { static inline Result function( mpz_class& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_mpz<Policy>(arg, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline void
copy_mpz(mpz_class& to, const mpz_class& from) {
  if (is_nan_mpz<From_Policy>(from))
    ((void) 0);
  else if (is_minf_mpz<From_Policy>(from) || is_pinf_mpz<From_Policy>(from))
    ((void) 0);
  else {
    to = from;
    return;
  }
  set_mp_size(to, get_mp_size(from));
}

template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline void function( mpz_class& arg1, const mpz_class &arg2) { return copy_mpz<Policy1, Policy2>(arg1, arg2); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
construct_mpz_base(mpz_class& to, const From from, Rounding_Dir) {
    new (&to) mpz_class(from);
    return V_EQ;
}

template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, char> { static inline Result function( mpz_class& arg1, const char &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, signed char> { static inline Result function( mpz_class& arg1, const signed char &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, signed short> { static inline Result function( mpz_class& arg1, const signed short &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, signed int> { static inline Result function( mpz_class& arg1, const signed int &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, signed long> { static inline Result function( mpz_class& arg1, const signed long &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, unsigned char> { static inline Result function( mpz_class& arg1, const unsigned char &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, unsigned short> { static inline Result function( mpz_class& arg1, const unsigned short &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, unsigned int> { static inline Result function( mpz_class& arg1, const unsigned int &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, unsigned long> { static inline Result function( mpz_class& arg1, const unsigned long &arg2, Rounding_Dir a1) { return construct_mpz_base<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
construct_mpz_float(mpz_class& to, const From& from, Rounding_Dir dir) {
  if (is_nan<From_Policy>(from))
    return construct_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(from))
    return construct_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(from))
    return construct_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  if (round_not_requested(dir)) {
    new (&to) mpz_class(from);
    return V_LGE;
  }
  From n = rint(from);
  new (&to) mpz_class(n);
  if (from == n)
    return V_EQ;
  if (from < 0)
    return round_lt_mpz<To_Policy>(to, dir);
  else
    return round_gt_mpz<To_Policy>(to, dir);
}

template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, float> { static inline Result function( mpz_class& arg1, const float &arg2, Rounding_Dir a1) { return construct_mpz_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpz_class, double> { static inline Result function( mpz_class& arg1, const double &arg2, Rounding_Dir a1) { return construct_mpz_float<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, char> { static inline Result function( mpz_class& arg1, const char &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, signed char> { static inline Result function( mpz_class& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, signed short> { static inline Result function( mpz_class& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, signed int> { static inline Result function( mpz_class& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, signed long> { static inline Result function( mpz_class& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, unsigned char> { static inline Result function( mpz_class& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, unsigned short> { static inline Result function( mpz_class& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, unsigned int> { static inline Result function( mpz_class& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, unsigned long> { static inline Result function( mpz_class& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpz_signed_int(mpz_class& to, const From from, Rounding_Dir) {
  if (sizeof(From) <= sizeof(signed long))
    to = static_cast<signed long>(from);
  else {
    mpz_ptr m = to.get_mpz_t();
    if (from >= 0)
      __gmpz_import(m, 1, 1, sizeof(From), 0, 0, &from);
    else {
      From n = -from;
      __gmpz_import(m, 1, 1, sizeof(From), 0, 0, &n);
      __gmpz_neg(m, m);
    }
  }
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, signed long long> { static inline Result function( mpz_class& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_mpz_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpz_unsigned_int(mpz_class& to, const From from, Rounding_Dir) {
  if (sizeof(From) <= sizeof(unsigned long))
    to = static_cast<unsigned long>(from);
  else
    __gmpz_import(to.get_mpz_t(), 1, 1, sizeof(From), 0, 0, &from);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, unsigned long long> { static inline Result function( mpz_class& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_mpz_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpz_float(mpz_class& to, const From from, Rounding_Dir dir) {
  if (is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  if (round_not_requested(dir)) {
    to = from;
    return V_LGE;
  }
  From i_from = rint(from);
  to = i_from;
  if (from == i_from)
    return V_EQ;
  if (round_direct(ROUND_UP))
    return round_lt_mpz<To_Policy>(to, dir);
  if (round_direct(ROUND_DOWN))
    return round_gt_mpz<To_Policy>(to, dir);
  if (from < i_from)
    return round_lt_mpz<To_Policy>(to, dir);
  if (from > i_from)
    return round_gt_mpz<To_Policy>(to, dir);
  Parma_Polyhedra_Library::ppl_unreachable();
  return V_NAN;
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, float> { static inline Result function( mpz_class& arg1, const float &arg2, Rounding_Dir a1) { return assign_mpz_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, double> { static inline Result function( mpz_class& arg1, const double &arg2, Rounding_Dir a1) { return assign_mpz_float<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpz_long_double(mpz_class& to, const From& from, Rounding_Dir dir) {
  if (is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);

  std::stringstream ss;
  output<From_Policy>(ss, from, Numeric_Format(), dir);
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_tmp; mpq_class& tmp = holder_tmp.item();



    input_mpq(tmp, ss);
  ((void) 0);
  return assign<To_Policy, From_Policy>(to, tmp, dir);
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, long double> { static inline Result function( mpz_class& arg1, const long double &arg2, Rounding_Dir a1) { return assign_mpz_long_double<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
assign_mpz_mpq(mpz_class& to, const mpq_class& from, Rounding_Dir dir) {
  if (round_not_needed(dir)) {
    to = from.get_num();
    return V_LGE;
  }
  if (round_ignore(dir)) {
    to = from;
    return V_LGE;
  }
  const mpz_srcptr n = from.get_num().get_mpz_t();
  const mpz_srcptr d = from.get_den().get_mpz_t();
  if (round_down(dir)) {
    __gmpz_fdiv_q(to.get_mpz_t(), n, d);
    if (round_strict_relation(dir))
      return (__gmpz_divisible_p(n, d) != 0) ? V_EQ : V_GT;
    return V_GE;
  }
  else {
    ((void) 0);
    __gmpz_cdiv_q(to.get_mpz_t(), n, d);
    if (round_strict_relation(dir))
      return (__gmpz_divisible_p(n, d) != 0) ? V_EQ : V_LT;
    return V_LE;
  }
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpz_class, mpq_class> { static inline Result function( mpz_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_mpz_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
neg_mpz(mpz_class& to, const mpz_class& from, Rounding_Dir) {
  __gmpz_neg(to.get_mpz_t(), from.get_mpz_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return neg_mpz<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
add_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y, Rounding_Dir) {
  to = x + y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return add_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
sub_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y, Rounding_Dir) {
  to = x - y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return sub_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
mul_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y, Rounding_Dir) {
  to = x * y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return mul_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
div_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y,
        Rounding_Dir dir) {
  if (((To_Policy::check_div_zero) ? (::sgn(y) == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  const mpz_srcptr n = x.get_mpz_t();
  const mpz_srcptr d = y.get_mpz_t();
  if (round_not_needed(dir)) {
    __gmpz_divexact(to.get_mpz_t(), n, d);
    return V_LGE;
  }
  if (round_ignore(dir)) {
    __gmpz_cdiv_q(to.get_mpz_t(), n, d);
    return V_LE;
  }
  if (round_down(dir)) {
    __gmpz_fdiv_q(to.get_mpz_t(), n, d);
    if (round_strict_relation(dir))
      return (__gmpz_divisible_p(n, d) != 0) ? V_EQ : V_GT;
    return V_GE;
  }
  else {
    ((void) 0);
    __gmpz_cdiv_q(to.get_mpz_t(), n, d);
    if (round_strict_relation(dir))
      return (__gmpz_divisible_p(n, d) != 0) ? V_EQ : V_LT;
    return V_LE;
  }
}

template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return div_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
idiv_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y,
        Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (::sgn(y) == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  mpz_srcptr n = x.get_mpz_t();
  mpz_srcptr d = y.get_mpz_t();
  __gmpz_tdiv_q(to.get_mpz_t(), n, d);
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return idiv_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
rem_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y, Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (::sgn(y) == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_MOD_ZERO);
  }
  to = x % y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return rem_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
add_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
             Rounding_Dir) {
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_v; mpz_class& v = holder_v.item();
  v = 1;
  __gmpz_mul_2exp(v.get_mpz_t(), v.get_mpz_t(), exp);
  to = x + v;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_mpz<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
sub_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
             Rounding_Dir) {
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_v; mpz_class& v = holder_v.item();
  v = 1;
  __gmpz_mul_2exp(v.get_mpz_t(), v.get_mpz_t(), exp);
  to = x - v;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_mpz<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
mul_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
             Rounding_Dir) {
  __gmpz_mul_2exp(to.get_mpz_t(), x.get_mpz_t(), exp);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_mpz<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
div_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
             Rounding_Dir dir) {
  const mpz_srcptr n = x.get_mpz_t();
  if (round_not_requested(dir)) {
    __gmpz_tdiv_q_2exp(to.get_mpz_t(), x.get_mpz_t(), exp);
    return V_LGE;
  }
  if (round_down(dir)) {
    __gmpz_fdiv_q_2exp(to.get_mpz_t(), n, exp);
    if (round_strict_relation(dir))
      return (__gmpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_GT;
    return V_GE;
  }
  else {
    ((void) 0);
    __gmpz_cdiv_q_2exp(to.get_mpz_t(), n, exp);
    if (round_strict_relation(dir))
      return (__gmpz_divisible_2exp_p(n, exp) != 0) ? V_EQ : V_LT;
    return V_LE;
  }
}

template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_mpz<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
smod_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
              Rounding_Dir) {
  if (__gmpz_tstbit(x.get_mpz_t(), exp - 1) != 0)
    __gmpz_cdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp);
  else
    __gmpz_fdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_mpz<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
umod_2exp_mpz(mpz_class& to, const mpz_class& x, unsigned int exp,
              Rounding_Dir) {
  __gmpz_fdiv_r_2exp(to.get_mpz_t(), x.get_mpz_t(), exp);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_mpz<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
abs_mpz(mpz_class& to, const mpz_class& from, Rounding_Dir) {
  to = abs(from);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return abs_mpz<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
add_mul_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y,
            Rounding_Dir) {
  __gmpz_addmul(to.get_mpz_t(), x.get_mpz_t(), y.get_mpz_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return add_mul_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
sub_mul_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y,
            Rounding_Dir) {
  __gmpz_submul(to.get_mpz_t(), x.get_mpz_t(), y.get_mpz_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return sub_mul_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
gcd_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y, Rounding_Dir) {
  __gmpz_gcd(to.get_mpz_t(), x.get_mpz_t(), y.get_mpz_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct gcd_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return gcd_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
gcdext_mpz(mpz_class& to, mpz_class& s, mpz_class& t,
           const mpz_class& x, const mpz_class& y,
           Rounding_Dir) {
  __gmpz_gcdext(to.get_mpz_t(), s.get_mpz_t(), t.get_mpz_t(),
             x.get_mpz_t(), y.get_mpz_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3, typename Policy4, typename Policy5> struct gcdext_function_struct <Policy1, Policy2, Policy3, Policy4, Policy5, mpz_class, mpz_class, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, mpz_class &arg2, mpz_class &arg3, const mpz_class &arg4, const mpz_class &arg5, Rounding_Dir a1) { return gcdext_mpz<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
lcm_mpz(mpz_class& to, const mpz_class& x, const mpz_class& y, Rounding_Dir) {
  __gmpz_lcm(to.get_mpz_t(), x.get_mpz_t(), y.get_mpz_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct lcm_function_struct <Policy1, Policy2, Policy3, mpz_class, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, const mpz_class &arg3, Rounding_Dir a1) { return lcm_mpz<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
sqrt_mpz(mpz_class& to, const mpz_class& from, Rounding_Dir dir) {
  if (((To_Policy::check_sqrt_neg) ? (from < 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_SQRT_NEG);
  }
  if (round_not_requested(dir)) {
    to = sqrt(from);
    return V_GE;
  }
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_r; mpz_class& r = holder_r.item();
  __gmpz_sqrtrem(to.get_mpz_t(), r.get_mpz_t(), from.get_mpz_t());
  if (r == 0)
    return V_EQ;
  return round_gt_mpz<To_Policy>(to, dir);
}

template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result function( mpz_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return sqrt_mpz<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy, typename Type>
inline Result_Relation
sgn_mp(const Type& x) {
  const int sign = ::sgn(x);
  return (sign > 0) ? VR_GT : ((sign < 0) ? VR_LT : VR_EQ);
}

template <typename Policy> struct sgn_function_struct<Policy, mpz_class> { static inline Result_Relation function(const mpz_class& arg) { return sgn_mp<Policy>(arg); } };
template <typename Policy> struct sgn_function_struct<Policy, mpq_class> { static inline Result_Relation function(const mpq_class& arg) { return sgn_mp<Policy>(arg); } };

template <typename Policy1, typename Policy2, typename Type>
inline Result_Relation
cmp_mp(const Type& x, const Type& y) {
  int i = ::cmp(x, y);
  return (i > 0) ? VR_GT : ((i < 0) ? VR_LT : VR_EQ);
}

template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, mpz_class, mpz_class> { static inline Result_Relation function(const mpz_class& arg1, const mpz_class &arg2) { return cmp_mp<Policy1, Policy2>(arg1, arg2); } };
template <typename Policy1, typename Policy2> struct cmp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result_Relation function(const mpq_class& arg1, const mpq_class &arg2) { return cmp_mp<Policy1, Policy2>(arg1, arg2); } };

template <typename Policy>
inline Result
output_mpz(std::ostream& os, const mpz_class& from, const Numeric_Format&,
           Rounding_Dir) {
  os << from;
  return V_EQ;
}

template <typename Policy> struct input_function_struct<Policy, mpz_class> { static inline Result function( mpz_class& arg, std::istream& a1, Rounding_Dir a2) { return input_generic<Policy>(arg, a1, a2); } };
template <typename Policy> struct output_function_struct<Policy, mpz_class> { static inline Result function(std::ostream& b1, const mpz_class& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_mpz<Policy>(b1, arg, a1, a2); } };

}

}
# 704 "checked_defs.hh" 2
# 1 "checked_mpq_inlines.hh" 1
# 31 "checked_mpq_inlines.hh"
namespace Parma_Polyhedra_Library {

namespace Checked {

template <typename Policy>
inline Result
classify_mpq(const mpq_class& v, bool nan, bool inf, bool sign) {
  if ((Policy::has_nan || Policy::has_infinity)
      && ::sgn(v.get_den()) == 0) {
    int s = ::sgn(v.get_num());
    if (Policy::has_nan && (nan || sign) && s == 0)
      return V_NAN;
    if (!inf && !sign)
      return V_LGE;
    if (Policy::has_infinity) {
      if (s < 0)
        return inf ? V_EQ_MINUS_INFINITY : V_LT;
      if (s > 0)
        return inf ? V_EQ_PLUS_INFINITY : V_GT;
    }
  }
  if (sign)
    return static_cast<Result>(sgn<Policy>(v));
  return V_LGE;
}

template <typename Policy> struct classify_function_struct<Policy, mpq_class> { static inline Result function(const mpq_class& arg, bool a1, bool a2, bool a3) { return classify_mpq<Policy>(arg, a1, a2, a3); } };

template <typename Policy>
inline bool
is_nan_mpq(const mpq_class& v) {
  return Policy::has_nan
    && ::sgn(v.get_den()) == 0
    && ::sgn(v.get_num()) == 0;
}

template <typename Policy> struct is_nan_function_struct<Policy, mpq_class> { static inline bool function(const mpq_class& arg) { return is_nan_mpq<Policy>(arg); } };

template <typename Policy>
inline bool
is_minf_mpq(const mpq_class& v) {
  return Policy::has_infinity
    && ::sgn(v.get_den()) == 0
    && ::sgn(v.get_num()) < 0;
}

template <typename Policy> struct is_minf_function_struct<Policy, mpq_class> { static inline bool function(const mpq_class& arg) { return is_minf_mpq<Policy>(arg); } };

template <typename Policy>
inline bool
is_pinf_mpq(const mpq_class& v) {
  return Policy::has_infinity
    && ::sgn(v.get_den()) == 0
    && ::sgn(v.get_num()) > 0;
}

template <typename Policy> struct is_pinf_function_struct<Policy, mpq_class> { static inline bool function(const mpq_class& arg) { return is_pinf_mpq<Policy>(arg); } };

template <typename Policy>
inline bool
is_int_mpq(const mpq_class& v) {
  if ((Policy::has_infinity || Policy::has_nan)
      && ::sgn(v.get_den()) == 0)
    return !(Policy::has_nan && ::sgn(v.get_num()) == 0);
  else
    return v.get_den() == 1;
}

template <typename Policy> struct is_int_function_struct<Policy, mpq_class> { static inline bool function(const mpq_class& arg) { return is_int_mpq<Policy>(arg); } };

template <typename Policy>
inline Result
assign_special_mpq(mpq_class& v, Result_Class c, Rounding_Dir) {
  switch (c) {
  case VC_NAN:
    if (Policy::has_nan) {
      v.get_num() = 0;
      v.get_den() = 0;
      return V_NAN | V_UNREPRESENTABLE;
    }
    return V_NAN;
  case VC_MINUS_INFINITY:
    if (Policy::has_infinity) {
      v.get_num() = -1;
      v.get_den() = 0;
      return V_EQ_MINUS_INFINITY;
    }
    return V_EQ_MINUS_INFINITY | V_UNREPRESENTABLE;
  case VC_PLUS_INFINITY:
    if (Policy::has_infinity) {
      v.get_num() = 1;
      v.get_den() = 0;
      return V_EQ_PLUS_INFINITY;
    }
    return V_EQ_PLUS_INFINITY | V_UNREPRESENTABLE;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_NAN | V_UNREPRESENTABLE;
  }
}

template <typename Policy> struct assign_special_function_struct<Policy, mpq_class> { static inline Result function( mpq_class& arg, Result_Class a1, Rounding_Dir a2) { return assign_special_mpq<Policy>(arg, a1, a2); } };

template <typename Policy1, typename Policy2> struct copy_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline void function( mpq_class& arg1, const mpq_class &arg2) { return copy_generic<Policy1, Policy2>(arg1, arg2); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
construct_mpq_base(mpq_class& to, const From& from, Rounding_Dir) {
  new (&to) mpq_class(from);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, mpz_class> { static inline Result function( mpq_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, char> { static inline Result function( mpq_class& arg1, const char &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, signed char> { static inline Result function( mpq_class& arg1, const signed char &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, signed short> { static inline Result function( mpq_class& arg1, const signed short &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, signed int> { static inline Result function( mpq_class& arg1, const signed int &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, signed long> { static inline Result function( mpq_class& arg1, const signed long &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, unsigned char> { static inline Result function( mpq_class& arg1, const unsigned char &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, unsigned short> { static inline Result function( mpq_class& arg1, const unsigned short &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, unsigned int> { static inline Result function( mpq_class& arg1, const unsigned int &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, unsigned long> { static inline Result function( mpq_class& arg1, const unsigned long &arg2, Rounding_Dir a1) { return construct_mpq_base<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
construct_mpq_float(mpq_class& to, const From& from, Rounding_Dir dir) {
  if (is_nan<From_Policy>(from))
    return construct_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(from))
    return construct_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(from))
    return construct_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  new (&to) mpq_class(from);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, float> { static inline Result function( mpq_class& arg1, const float &arg2, Rounding_Dir a1) { return construct_mpq_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct construct_function_struct<Policy1, Policy2, mpq_class, double> { static inline Result function( mpq_class& arg1, const double &arg2, Rounding_Dir a1) { return construct_mpq_float<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, mpz_class> { static inline Result function( mpq_class& arg1, const mpz_class &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, char> { static inline Result function( mpq_class& arg1, const char &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, signed char> { static inline Result function( mpq_class& arg1, const signed char &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, signed short> { static inline Result function( mpq_class& arg1, const signed short &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, signed int> { static inline Result function( mpq_class& arg1, const signed int &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, signed long> { static inline Result function( mpq_class& arg1, const signed long &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, unsigned char> { static inline Result function( mpq_class& arg1, const unsigned char &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, unsigned short> { static inline Result function( mpq_class& arg1, const unsigned short &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, unsigned int> { static inline Result function( mpq_class& arg1, const unsigned int &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, unsigned long> { static inline Result function( mpq_class& arg1, const unsigned long &arg2, Rounding_Dir a1) { return assign_exact<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpq_float(mpq_class& to, const From& from, Rounding_Dir dir) {
  if (is_nan<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(from))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  assign_mpq_numeric_float(to, from);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, float> { static inline Result function( mpq_class& arg1, const float &arg2, Rounding_Dir a1) { return assign_mpq_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, double> { static inline Result function( mpq_class& arg1, const double &arg2, Rounding_Dir a1) { return assign_mpq_float<Policy1, Policy2>(arg1, arg2, a1); } };
template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, long double> { static inline Result function( mpq_class& arg1, const long double &arg2, Rounding_Dir a1) { return assign_mpq_float<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpq_signed_int(mpq_class& to, const From from, Rounding_Dir) {
  if (sizeof(From) <= sizeof(signed long))
    to = static_cast<signed long>(from);
  else {
    mpz_ptr m = to.get_num().get_mpz_t();
    if (from >= 0)
      __gmpz_import(m, 1, 1, sizeof(From), 0, 0, &from);
    else {
      From n = -from;
      __gmpz_import(m, 1, 1, sizeof(From), 0, 0, &n);
      __gmpz_neg(m, m);
    }
    to.get_den() = 1;
  }
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, signed long long> { static inline Result function( mpq_class& arg1, const signed long long &arg2, Rounding_Dir a1) { return assign_mpq_signed_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy, typename From>
inline Result
assign_mpq_unsigned_int(mpq_class& to, const From from, Rounding_Dir) {
  if (sizeof(From) <= sizeof(unsigned long))
    to = static_cast<unsigned long>(from);
  else {
    __gmpz_import(to.get_num().get_mpz_t(), 1, 1, sizeof(From), 0, 0, &from);
    to.get_den() = 1;
  }
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct assign_function_struct<Policy1, Policy2, mpq_class, unsigned long long> { static inline Result function( mpq_class& arg1, const unsigned long long &arg2, Rounding_Dir a1) { return assign_mpq_unsigned_int<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
floor_mpq(mpq_class& to, const mpq_class& from, Rounding_Dir) {
  __gmpz_fdiv_q(to.get_num().get_mpz_t(),
             from.get_num().get_mpz_t(), from.get_den().get_mpz_t());
  to.get_den() = 1;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct floor_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return floor_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
ceil_mpq(mpq_class& to, const mpq_class& from, Rounding_Dir) {
  __gmpz_cdiv_q(to.get_num().get_mpz_t(),
             from.get_num().get_mpz_t(), from.get_den().get_mpz_t());
  to.get_den() = 1;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct ceil_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return ceil_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
trunc_mpq(mpq_class& to, const mpq_class& from, Rounding_Dir) {
  __gmpz_tdiv_q(to.get_num().get_mpz_t(),
             from.get_num().get_mpz_t(), from.get_den().get_mpz_t());
  to.get_den() = 1;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct trunc_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return trunc_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
neg_mpq(mpq_class& to, const mpq_class& from, Rounding_Dir) {
  __gmpq_neg(to.get_mpq_t(), from.get_mpq_t());
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct neg_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return neg_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
add_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y, Rounding_Dir) {
  to = x + y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct add_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return add_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
sub_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y, Rounding_Dir) {
  to = x - y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct sub_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return sub_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
mul_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y, Rounding_Dir) {
  to = x * y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct mul_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return mul_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
div_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y, Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (sgn(y) == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  to = x / y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct div_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return div_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
idiv_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y, Rounding_Dir dir) {
  if (((To_Policy::check_div_zero) ? (sgn(y) == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_DIV_ZERO);
  }
  to = x / y;
  return trunc<To_Policy, To_Policy>(to, to, dir);
}

template <typename Policy1, typename Policy2, typename Policy3> struct idiv_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return idiv_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
rem_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y, Rounding_Dir) {
  if (((To_Policy::check_div_zero) ? (sgn(y) == 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_MOD_ZERO);
  }
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_tmp; mpq_class& tmp = holder_tmp.item();
  tmp = x / y;
  tmp.get_num() %= tmp.get_den();
  to = tmp * y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct rem_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return rem_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From_Policy>
inline Result
add_2exp_mpq(mpq_class& to, const mpq_class& x, unsigned int exp,
             Rounding_Dir) {
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_v; mpz_class& v = holder_v.item();
  v = 1;
  __gmpz_mul_2exp(v.get_mpz_t(), v.get_mpz_t(), exp);
  to = x + v;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct add_2exp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, unsigned int a1, Rounding_Dir a2) { return add_2exp_mpq<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
sub_2exp_mpq(mpq_class& to, const mpq_class& x, unsigned int exp,
             Rounding_Dir) {
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_v; mpz_class& v = holder_v.item();
  v = 1;
  __gmpz_mul_2exp(v.get_mpz_t(), v.get_mpz_t(), exp);
  to = x - v;
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct sub_2exp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, unsigned int a1, Rounding_Dir a2) { return sub_2exp_mpq<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
mul_2exp_mpq(mpq_class& to, const mpq_class& x, unsigned int exp,
             Rounding_Dir) {
  __gmpz_mul_2exp(to.get_num().get_mpz_t(), x.get_num().get_mpz_t(), exp);
  to.get_den() = x.get_den();
  to.canonicalize();
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct mul_2exp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, unsigned int a1, Rounding_Dir a2) { return mul_2exp_mpq<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
div_2exp_mpq(mpq_class& to, const mpq_class& x, unsigned int exp,
             Rounding_Dir) {
  to.get_num() = x.get_num();
  __gmpz_mul_2exp(to.get_den().get_mpz_t(), x.get_den().get_mpz_t(), exp);
  to.canonicalize();
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct div_2exp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, unsigned int a1, Rounding_Dir a2) { return div_2exp_mpq<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
smod_2exp_mpq(mpq_class& to, const mpq_class& x, unsigned int exp,
              Rounding_Dir) {
  __gmpz_mul_2exp(to.get_den().get_mpz_t(), x.get_den().get_mpz_t(), exp);
  __gmpz_fdiv_r(to.get_num().get_mpz_t(), x.get_num().get_mpz_t(), to.get_den().get_mpz_t());
  __gmpz_fdiv_q_2exp(to.get_den().get_mpz_t(), to.get_den().get_mpz_t(), 1);
  bool neg = to.get_num() >= to.get_den();
  __gmpz_mul_2exp(to.get_den().get_mpz_t(), to.get_den().get_mpz_t(), 1);
  if (neg)
    to.get_num() -= to.get_den();
  __gmpz_mul_2exp(to.get_num().get_mpz_t(), to.get_num().get_mpz_t(), exp);
  to.canonicalize();
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct smod_2exp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, unsigned int a1, Rounding_Dir a2) { return smod_2exp_mpq<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
umod_2exp_mpq(mpq_class& to, const mpq_class& x, unsigned int exp,
              Rounding_Dir) {
  __gmpz_mul_2exp(to.get_den().get_mpz_t(), x.get_den().get_mpz_t(), exp);
  __gmpz_fdiv_r(to.get_num().get_mpz_t(), x.get_num().get_mpz_t(), to.get_den().get_mpz_t());
  __gmpz_mul_2exp(to.get_num().get_mpz_t(), to.get_num().get_mpz_t(), exp);
  to.canonicalize();
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct umod_2exp_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, unsigned int a1, Rounding_Dir a2) { return umod_2exp_mpq<Policy1, Policy2>(arg1, arg2, a1, a2); } };

template <typename To_Policy, typename From_Policy>
inline Result
abs_mpq(mpq_class& to, const mpq_class& from, Rounding_Dir) {
  to = abs(from);
  return V_EQ;
}

template <typename Policy1, typename Policy2> struct abs_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return abs_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
add_mul_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y,
            Rounding_Dir) {
  to += x * y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct add_mul_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return add_mul_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

template <typename To_Policy, typename From1_Policy, typename From2_Policy>
inline Result
sub_mul_mpq(mpq_class& to, const mpq_class& x, const mpq_class& y,
            Rounding_Dir) {
  to -= x * y;
  return V_EQ;
}

template <typename Policy1, typename Policy2, typename Policy3> struct sub_mul_function_struct <Policy1, Policy2, Policy3, mpq_class, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, const mpq_class &arg3, Rounding_Dir a1) { return sub_mul_mpq<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); } };

extern unsigned irrational_precision;

template <typename To_Policy, typename From_Policy>
inline Result
sqrt_mpq(mpq_class& to, const mpq_class& from, Rounding_Dir dir) {
  if (((To_Policy::check_sqrt_neg) ? (from < 0) : ((static_cast<void> (0)), false))) {
    return assign_nan<To_Policy>(to, V_SQRT_NEG);
  }
  if (from == 0) {
    to = 0;
    return V_EQ;
  }
  bool gt1 = from.get_num() > from.get_den();
  const mpz_class& from_a = gt1 ? from.get_num() : from.get_den();
  const mpz_class& from_b = gt1 ? from.get_den() : from.get_num();
  mpz_class& to_a = gt1 ? to.get_num() : to.get_den();
  mpz_class& to_b = gt1 ? to.get_den() : to.get_num();
  Rounding_Dir rdir = gt1 ? dir : inverse(dir);
  mul_2exp<To_Policy, From_Policy>(to_a, from_a,
                                   2*irrational_precision, ROUND_IGNORE);
  Result r_div
    = div<To_Policy, To_Policy, To_Policy>(to_a, to_a, from_b, rdir);
  Result r_sqrt = sqrt<To_Policy, To_Policy>(to_a, to_a, rdir);
  to_b = 1;
  mul_2exp<To_Policy, To_Policy>(to_b, to_b,
                                 irrational_precision, ROUND_IGNORE);
  to.canonicalize();
  return (r_div != V_EQ) ? r_div : r_sqrt;
}

template <typename Policy1, typename Policy2> struct sqrt_function_struct<Policy1, Policy2, mpq_class, mpq_class> { static inline Result function( mpq_class& arg1, const mpq_class &arg2, Rounding_Dir a1) { return sqrt_mpq<Policy1, Policy2>(arg1, arg2, a1); } };

template <typename Policy>
inline Result
input_mpq(mpq_class& to, std::istream& is, Rounding_Dir dir) {
  Result r = input_mpq(to, is);
  Result_Class c = result_class(r);
  switch (c) {
  case VC_MINUS_INFINITY:
  case VC_PLUS_INFINITY:
    return assign_special<Policy>(to, c, dir);
  case VC_NAN:
    return assign_nan<Policy>(to, r);
  default:
    return r;
  }
}

template <typename Policy> struct input_function_struct<Policy, mpq_class> { static inline Result function( mpq_class& arg, std::istream& a1, Rounding_Dir a2) { return input_mpq<Policy>(arg, a1, a2); } };

template <typename Policy>
inline Result
output_mpq(std::ostream& os,
           const mpq_class& from,
           const Numeric_Format&,
           Rounding_Dir) {
  os << from;
  return V_EQ;
}

template <typename Policy> struct output_function_struct<Policy, mpq_class> { static inline Result function(std::ostream& b1, const mpq_class& arg, const Numeric_Format& a1, Rounding_Dir a2) { return output_mpq<Policy>(b1, arg, a1, a2); } };

}


inline unsigned
irrational_precision() {
  return Checked::irrational_precision;
}
# 531 "checked_mpq_inlines.hh"
inline void
set_irrational_precision(const unsigned p) {
  if (p <= 2147483647)
    Checked::irrational_precision = p;
  else
    throw std::invalid_argument("PPL::set_irrational_precision(p)"
                                " with p > INT_MAX");
}

}
# 705 "checked_defs.hh" 2
# 1 "checked_ext_inlines.hh" 1
# 27 "checked_ext_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T> struct FPU_Related : public False {};
template <> struct FPU_Related<float> : public True {};
template <> struct FPU_Related<double> : public True {};
template <> struct FPU_Related<long double> : public True {};

namespace Checked {

template <typename T>
inline bool
handle_ext_natively(const T&) {
  return FPU_Related<T>::value;
}

template <typename Policy, typename Type>
inline bool
ext_to_handle(const Type& x) {
  return !handle_ext_natively(x)
    && (Policy::has_infinity || Policy::has_nan);
}

template <typename Policy, typename Type>
inline Result_Relation
sgn_ext(const Type& x) {
  if (!ext_to_handle<Policy>(x))
    goto native;
  if (is_nan<Policy>(x))
    return VR_EMPTY;
  else if (is_minf<Policy>(x))
    return VR_LT;
  else if (is_pinf<Policy>(x))
    return VR_GT;
  else {
  native:
    return sgn<Policy>(x);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
construct_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return construct_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return construct_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return construct_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return construct<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
assign_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return assign<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
neg_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else {
  native:
    return neg<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
floor_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return floor<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
ceil_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return ceil<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
trunc_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return trunc<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
abs_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x) || is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return abs<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
add_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_add_inf) ? (is_pinf<From2_Policy>(y)) : ((static_cast<void> (0)), false)))
      goto inf_add_inf;
    else
      goto minf;
  }
  else if (is_pinf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_add_inf) ? (is_minf<From2_Policy>(y)) : ((static_cast<void> (0)), false))) {
    inf_add_inf:
      return assign_nan<To_Policy>(to, V_INF_ADD_INF);
    }
    else
      goto pinf;
  }
  else {
    if (is_minf<From2_Policy>(y)) {
    minf:
      return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
    }
    else if (is_pinf<From2_Policy>(y)) {
    pinf:
      return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
    }
    else {
    native:
      return add<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
sub_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_sub_inf) ? (is_minf<From2_Policy>(y)) : ((static_cast<void> (0)), false)))
      goto inf_sub_inf;
    else
      goto minf;
  }
  else if (is_pinf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_sub_inf) ? (is_pinf<From2_Policy>(y)) : ((static_cast<void> (0)), false))) {
    inf_sub_inf:
      return assign_nan<To_Policy>(to, V_INF_SUB_INF);
    }
    else
      goto pinf;
  }
  else {
    if (is_pinf<From2_Policy>(y)) {
    minf:
      return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
    }
    else if (is_minf<From2_Policy>(y)) {
    pinf:
      return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
    }
    else {
    native:
      return sub<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (is_minf<From1_Policy>(x)) {
    switch (sgn_ext<From2_Policy>(y)) {
    case VR_LT:
      goto pinf;
    case VR_GT:
      goto minf;
    default:
      goto inf_mul_zero;
    }
  }
  else if (is_pinf<From1_Policy>(x)) {
    switch (sgn_ext<From2_Policy>(y)) {
    case VR_LT:
      goto minf;
    case VR_GT:
      goto pinf;
    default:
      goto inf_mul_zero;
    }
  }
  else {
    if (is_minf<From2_Policy>(y)) {
      switch (sgn<From1_Policy>(x)) {
      case VR_LT:
        goto pinf;
      case VR_GT:
        goto minf;
      default:
        goto inf_mul_zero;
      }
    }
    else if (is_pinf<From2_Policy>(y)) {
      switch (sgn<From1_Policy>(x)) {
      case VR_LT:
      minf:
        return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
      case VR_GT:
      pinf:
        return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
      default:
      inf_mul_zero:
        ((void) 0);
        return assign_nan<To_Policy>(to, V_INF_MUL_ZERO);
      }
    }
    else {
    native:
      return mul<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}


template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
add_mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<To_Policy>(to)
      && !ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<To_Policy>(to)
      || is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (is_minf<From1_Policy>(x)) {
    switch (sgn_ext<From2_Policy>(y)) {
    case VR_LT:
      goto a_pinf;
    case VR_GT:
      goto a_minf;
    default:
      goto inf_mul_zero;
    }
  }
  else if (is_pinf<From1_Policy>(x)) {
    switch (sgn_ext<From2_Policy>(y)) {
    case VR_LT:
      goto a_minf;
    case VR_GT:
      goto a_pinf;
    default:
      goto inf_mul_zero;
    }
  }
  else {
    if (is_minf<From2_Policy>(y)) {
      switch (sgn<From1_Policy>(x)) {
      case VR_LT:
        goto a_pinf;
      case VR_GT:
        goto a_minf;
      default:
        goto inf_mul_zero;
      }
    }
    else if (is_pinf<From2_Policy>(y)) {
      switch (sgn<From1_Policy>(x)) {
      case VR_LT:
      a_minf:
        if (((To_Policy::check_inf_add_inf) ? (is_pinf<To_Policy>(to)) : ((static_cast<void> (0)), false)))
          goto inf_add_inf;
        else
          goto minf;
      case VR_GT:
      a_pinf:
        if (((To_Policy::check_inf_add_inf) ? (is_minf<To_Policy>(to)) : ((static_cast<void> (0)), false))) {
        inf_add_inf:
          return assign_nan<To_Policy>(to, V_INF_ADD_INF);
        }
        else
          goto pinf;
      default:
      inf_mul_zero:
        ((void) 0);
        return assign_nan<To_Policy>(to, V_INF_MUL_ZERO);
      }
    }
    else {
      if (is_minf<To_Policy>(to)) {
      minf:
        return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
      }
      if (is_pinf<To_Policy>(to)) {
      pinf:
        return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
      }
    native:
      return add_mul<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
sub_mul_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<To_Policy>(to)
      && !ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<To_Policy>(to)
      || is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (is_minf<From1_Policy>(x)) {
    switch (sgn_ext<From2_Policy>(y)) {
    case VR_LT:
      goto a_pinf;
    case VR_GT:
      goto a_minf;
    default:
      goto inf_mul_zero;
    }
  }
  else if (is_pinf<From1_Policy>(x)) {
    switch (sgn_ext<From2_Policy>(y)) {
    case VR_LT:
      goto a_minf;
    case VR_GT:
      goto a_pinf;
    default:
      goto inf_mul_zero;
    }
  }
  else {
    if (is_minf<From2_Policy>(y)) {
      switch (sgn<From1_Policy>(x)) {
      case VR_LT:
        goto a_pinf;
      case VR_GT:
        goto a_minf;
      default:
        goto inf_mul_zero;
      }
    }
    else if (is_pinf<From2_Policy>(y)) {
      switch (sgn<From1_Policy>(x)) {
      case VR_LT:
      a_minf:
        if (((To_Policy::check_inf_sub_inf) ? (is_minf<To_Policy>(to)) : ((static_cast<void> (0)), false)))
          goto inf_sub_inf;
        else
          goto pinf;
      case VR_GT:
      a_pinf:
        if (((To_Policy::check_inf_sub_inf) ? (is_pinf<To_Policy>(to)) : ((static_cast<void> (0)), false))) {
        inf_sub_inf:
          return assign_nan<To_Policy>(to, V_INF_SUB_INF);
        }
        else
          goto minf;
      default:
      inf_mul_zero:
        ((void) 0);
        return assign_nan<To_Policy>(to, V_INF_MUL_ZERO);
      }
    }
    else {
      if (is_minf<To_Policy>(to)) {
      minf:
        return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
      }
      if (is_pinf<To_Policy>(to)) {
      pinf:
        return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
      }
    native:
      return sub_mul<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
div_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (is_minf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_div_inf) ? (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) : ((static_cast<void> (0)), false)))

      goto inf_div_inf;
    else {
      switch (sgn<From2_Policy>(y)) {
      case VR_LT:
        goto pinf;
      case VR_GT:
        goto minf;
      default:
        goto div_zero;
      }
    }
  }
  else if (is_pinf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_div_inf) ? (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) : ((static_cast<void> (0)), false))) {

    inf_div_inf:
      return assign_nan<To_Policy>(to, V_INF_DIV_INF);
    }
    else {
      switch (sgn<From2_Policy>(y)) {
      case VR_LT:
      minf:
        return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
      case VR_GT:
      pinf:
        return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
      default:
      div_zero:
        ((void) 0);
        return assign_nan<To_Policy>(to, V_DIV_ZERO);
      }
    }
  }
  else {
    if (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) {
      to = 0;
      return V_EQ;
    }
    else {
    native:
      return div<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}


template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
idiv_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  if (is_minf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_div_inf) ? (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) : ((static_cast<void> (0)), false)))

      goto inf_div_inf;
    else {
      switch (sgn<From2_Policy>(y)) {
      case VR_LT:
        goto pinf;
      case VR_GT:
        goto minf;
      default:
        goto div_zero;
      }
    }
  }
  else if (is_pinf<From1_Policy>(x)) {
    if (((To_Policy::check_inf_div_inf) ? (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) : ((static_cast<void> (0)), false))) {

    inf_div_inf:
      return assign_nan<To_Policy>(to, V_INF_DIV_INF);
    }
    else {
      switch (sgn<From2_Policy>(y)) {
      case VR_LT:
      minf:
        return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
      case VR_GT:
      pinf:
        return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
      default:
      div_zero:
        ((void) 0);
        return assign_nan<To_Policy>(to, V_DIV_ZERO);
      }
    }
  }
  else {
    if (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) {
      to = 0;
      return V_EQ;
    }
    else {
    native:
      return idiv<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}


template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
rem_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (!ext_to_handle<From1_Policy>(x) && !ext_to_handle<From2_Policy>(y))
    goto native;
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (((To_Policy::check_inf_mod) ? (is_minf<From1_Policy>(x) || is_pinf<From1_Policy>(x)) : ((static_cast<void> (0)), false))) {

    return assign_nan<To_Policy>(to, V_INF_MOD);
  }
  else {
    if (is_minf<From1_Policy>(y) || is_pinf<From2_Policy>(y)) {
      to = x;
      return V_EQ;
    }
    else {
    native:
      return rem<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
    }
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
add_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return add_2exp<To_Policy, From_Policy>(to, x, exp, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
sub_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return sub_2exp<To_Policy, From_Policy>(to, x, exp, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
mul_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return mul_2exp<To_Policy, From_Policy>(to, x, exp, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
div_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_MINUS_INFINITY, dir);
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return div_2exp<To_Policy, From_Policy>(to, x, exp, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
smod_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (((To_Policy::check_inf_mod) ? (is_minf<From_Policy>(x) || is_pinf<From_Policy>(x)) : ((static_cast<void> (0)), false))) {

    return assign_nan<To_Policy>(to, V_INF_MOD);
  }
  else {
  native:
    return smod_2exp<To_Policy, From_Policy>(to, x, exp, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
umod_2exp_ext(To& to, const From& x, unsigned int exp, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (((To_Policy::check_inf_mod) ? (is_minf<From_Policy>(x) || is_pinf<From_Policy>(x)) : ((static_cast<void> (0)), false))) {

    return assign_nan<To_Policy>(to, V_INF_MOD);
  }
  else {
  native:
    return umod_2exp<To_Policy, From_Policy>(to, x, exp, dir);
  }
}

template <typename To_Policy, typename From_Policy,
          typename To, typename From>
inline Result
sqrt_ext(To& to, const From& x, Rounding_Dir dir) {
  if (!ext_to_handle<From_Policy>(x))
    goto native;
  if (is_nan<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From_Policy>(x)) {
    return assign_nan<To_Policy>(to, V_SQRT_NEG);
  }
  else if (is_pinf<From_Policy>(x))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else {
  native:
    return sqrt<To_Policy, From_Policy>(to, x, dir);
  }
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
gcd_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From1_Policy>(x) || is_pinf<From1_Policy>(x))
    return abs_ext<To_Policy, From2_Policy>(to, y, dir);
  else if (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y))
    return abs_ext<To_Policy, From1_Policy>(to, x, dir);
  else
    return gcd<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
}

template <typename To1_Policy, typename To2_Policy, typename To3_Policy,
          typename From1_Policy, typename From2_Policy,
          typename To1, typename To2, typename To3,
          typename From1, typename From2>
inline Result
gcdext_ext(To1& to, To2& s, To3& t, const From1& x, const From2& y,
           Rounding_Dir dir) {
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To1_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From1_Policy>(x) || is_pinf<From1_Policy>(x)) {
    s = 0;
    t = y > 0 ? -1 : 1;
    return abs_ext<To1_Policy, From2_Policy>(to, y, dir);
  }
  else if (is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y)) {
    s = x > 0 ? -1 : 1;
    t = 0;
    return abs_ext<To1_Policy, From1_Policy>(to, x, dir);
  }
  else
    return gcdext<To1_Policy, To2_Policy, To3_Policy, From1_Policy, From2_Policy>(to, s, t, x, y, dir);
}

template <typename To_Policy, typename From1_Policy, typename From2_Policy,
          typename To, typename From1, typename From2>
inline Result
lcm_ext(To& to, const From1& x, const From2& y, Rounding_Dir dir) {
  if (is_nan<From1_Policy>(x) || is_nan<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_NAN, ROUND_IGNORE);
  else if (is_minf<From1_Policy>(x) || is_pinf<From1_Policy>(x)
           || is_minf<From2_Policy>(y) || is_pinf<From2_Policy>(y))
    return assign_special<To_Policy>(to, VC_PLUS_INFINITY, dir);
  else
    return lcm<To_Policy, From1_Policy, From2_Policy>(to, x, y, dir);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline Result_Relation
cmp_ext(const Type1& x, const Type2& y) {
  if (!ext_to_handle<Policy1>(x) && !ext_to_handle<Policy2>(y))
    goto native;
  if (is_nan<Policy1>(x) || is_nan<Policy2>(y))
    return VR_EMPTY;
  else if (is_minf<Policy1>(x))
    return is_minf<Policy2>(y) ? VR_EQ : VR_LT;
  else if (is_pinf<Policy1>(x))
    return is_pinf<Policy2>(y) ? VR_EQ : VR_GT;
  else {
    if (is_minf<Policy2>(y))
      return VR_GT;
    if (is_pinf<Policy2>(y))
      return VR_LT;
  native:
    return cmp<Policy1, Policy2>(x, y);
  }
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
lt_ext(const Type1& x, const Type2& y) {
  if (!ext_to_handle<Policy1>(x) && !ext_to_handle<Policy2>(y))
    goto native;
  if (is_nan<Policy1>(x) || is_nan<Policy2>(y))
    return false;
  if (is_pinf<Policy1>(x) || is_minf<Policy2>(y))
    return false;
  if (is_minf<Policy1>(x) || is_pinf<Policy2>(y))
    return true;
 native:
  return lt_p<Policy1, Policy2>(x, y);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
gt_ext(const Type1& x, const Type2& y) {
  return lt_ext<Policy1, Policy2>(y, x);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
le_ext(const Type1& x, const Type2& y) {
  if (!ext_to_handle<Policy1>(x) && !ext_to_handle<Policy2>(y))
    goto native;
  if (is_nan<Policy1>(x) || is_nan<Policy2>(y))
    return false;
  if (is_minf<Policy1>(x) || is_pinf<Policy2>(y))
    return true;
  if (is_pinf<Policy1>(x) || is_minf<Policy2>(y))
    return false;
 native:
  return le_p<Policy1, Policy2>(x, y);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
ge_ext(const Type1& x, const Type2& y) {
  return le_ext<Policy1, Policy2>(y, x);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
eq_ext(const Type1& x, const Type2& y) {
  if (!ext_to_handle<Policy1>(x) && !ext_to_handle<Policy2>(y))
    goto native;
  if (is_nan<Policy1>(x) || is_nan<Policy2>(y))
    return false;
  if (is_minf<Policy1>(x))
    return is_minf<Policy2>(y);
  if (is_pinf<Policy1>(x))
    return is_pinf<Policy2>(y);
  else if (is_minf<Policy2>(y) || is_pinf<Policy2>(y))
    return false;
 native:
  return eq_p<Policy1, Policy2>(x, y);
}

template <typename Policy1, typename Policy2,
          typename Type1, typename Type2>
inline bool
ne_ext(const Type1& x, const Type2& y) {
  return !eq_ext<Policy1, Policy2>(x, y);
}

template <typename Policy, typename Type>
inline Result
output_ext(std::ostream& os, const Type& x,
           const Numeric_Format& format, Rounding_Dir dir) {
  if (!ext_to_handle<Policy>(x))
    goto native;
  if (is_nan<Policy>(x)) {
    os << "nan";
    return V_NAN;
  }
  if (is_minf<Policy>(x)) {
    os << "-inf";
    return V_EQ;
  }
  if (is_pinf<Policy>(x)) {
    os << "+inf";
    return V_EQ;
  }
 native:
  return output<Policy>(os, x, format, dir);
}

template <typename To_Policy, typename To>
inline Result
input_ext(To& to, std::istream& is, Rounding_Dir dir) {
  return input<To_Policy>(to, is, dir);
}

}

}
# 706 "checked_defs.hh" 2
# 29 "Checked_Number_defs.hh" 2




namespace Parma_Polyhedra_Library {




struct Extended_Number_Policy {
  enum const_bool_value_check_overflow { check_overflow = (true) };
  enum const_bool_value_check_inf_add_inf { check_inf_add_inf = (false) };
  enum const_bool_value_check_inf_sub_inf { check_inf_sub_inf = (false) };
  enum const_bool_value_check_inf_mul_zero { check_inf_mul_zero = (false) };
  enum const_bool_value_check_div_zero { check_div_zero = (false) };
  enum const_bool_value_check_inf_div_inf { check_inf_div_inf = (false) };
  enum const_bool_value_check_inf_mod { check_inf_mod = (false) };
  enum const_bool_value_check_sqrt_neg { check_sqrt_neg = (false) };
  enum const_bool_value_has_nan { has_nan = (true) };
  enum const_bool_value_has_infinity { has_infinity = (true) };




  enum const_bool_value_fpu_check_inexact { fpu_check_inexact = (true) };
  enum const_bool_value_fpu_check_nan_result { fpu_check_nan_result = (true) };







  static void handle_result(Result r);
};





template <typename T>
struct Check_Overflow_Policy {
  enum const_bool_value_check_overflow { check_overflow = (true) };
  enum const_bool_value_check_inf_add_inf { check_inf_add_inf = (false) };
  enum const_bool_value_check_inf_sub_inf { check_inf_sub_inf = (false) };
  enum const_bool_value_check_inf_mul_zero { check_inf_mul_zero = (false) };
  enum const_bool_value_check_div_zero { check_div_zero = (false) };
  enum const_bool_value_check_inf_div_inf { check_inf_div_inf = (false) };
  enum const_bool_value_check_inf_mod { check_inf_mod = (false) };
  enum const_bool_value_check_sqrt_neg { check_sqrt_neg = (false) };
  enum const_bool_value_has_nan { has_nan = (std::numeric_limits<T>::has_quiet_NaN) };
  enum const_bool_value_has_infinity { has_infinity = (std::numeric_limits<T>::has_infinity) };
  enum const_bool_value_convertible { convertible = (true) };
  enum const_bool_value_fpu_check_inexact { fpu_check_inexact = (true) };
  enum const_bool_value_fpu_check_nan_result { fpu_check_nan_result = (true) };
};




template <typename T, typename Enable = void>
struct Native_Checked_From_Wrapper;




template <typename T>
struct Native_Checked_From_Wrapper<T, typename Enable_If<Is_Native<T>::value>::type> {
  typedef Checked_Number_Transparent_Policy<T> Policy;
  static const T& raw_value(const T& v) {
    return v;
  }
};




template <typename T, typename P>
struct Native_Checked_From_Wrapper<Checked_Number<T, P> > {
  typedef P Policy;
  static const T& raw_value(const Checked_Number<T, P>& v) {
    return v.raw_value();
  }
};




template <typename T, typename Enable = void>
struct Native_Checked_To_Wrapper;




template <typename T>
struct Native_Checked_To_Wrapper<T, typename Enable_If<Is_Native<T>::value>::type> {
  typedef Check_Overflow_Policy<T> Policy;
  static T& raw_value(T& v) {
    return v;
  }
};




template <typename T, typename P>
struct Native_Checked_To_Wrapper<Checked_Number<T, P> > {
  typedef P Policy;
  static T& raw_value(Checked_Number<T, P>& v) {
    return v.raw_value();
  }
};




template <typename T>
struct Is_Checked : public False { };




template <typename T, typename P>
struct Is_Checked<Checked_Number<T, P> > : public True { };




template <typename T>
struct Is_Native_Or_Checked
  : public Bool<Is_Native<T>::value || Is_Checked<T>::value> { };
# 169 "Checked_Number_defs.hh"
template <typename T, typename Policy>
class Checked_Number {
public:





  Checked_Number();


  Checked_Number(const Checked_Number& y);


  template <typename From, typename From_Policy>
  Checked_Number(const Checked_Number<From, From_Policy>& y, Rounding_Dir dir);


  Checked_Number(char y, Rounding_Dir dir);


  Checked_Number(signed char y, Rounding_Dir dir);


  Checked_Number(signed short y, Rounding_Dir dir);


  Checked_Number(signed int y, Rounding_Dir dir);


  Checked_Number(signed long y, Rounding_Dir dir);


  Checked_Number(signed long long y, Rounding_Dir dir);


  Checked_Number(unsigned char y, Rounding_Dir dir);


  Checked_Number(unsigned short y, Rounding_Dir dir);


  Checked_Number(unsigned int y, Rounding_Dir dir);


  Checked_Number(unsigned long y, Rounding_Dir dir);


  Checked_Number(unsigned long long y, Rounding_Dir dir);



  Checked_Number(float y, Rounding_Dir dir);




  Checked_Number(double y, Rounding_Dir dir);




  Checked_Number(long double y, Rounding_Dir dir);



  Checked_Number(const mpq_class& y, Rounding_Dir dir);


  Checked_Number(const mpz_class& y, Rounding_Dir dir);


  Checked_Number(const char* y, Rounding_Dir dir);


  template <typename From>
  Checked_Number(const From&, Rounding_Dir dir, typename Enable_If<Is_Special<From>::value, bool>::type ignored = false);


  template <typename From, typename From_Policy>
  explicit Checked_Number(const Checked_Number<From, From_Policy>& y);


  Checked_Number(char y);


  Checked_Number(signed char y);


  Checked_Number(signed short y);


  Checked_Number(signed int y);


  Checked_Number(signed long y);


  Checked_Number(signed long long y);


  Checked_Number(unsigned char y);


  Checked_Number(unsigned short y);


  Checked_Number(unsigned int y);


  Checked_Number(unsigned long y);


  Checked_Number(unsigned long long y);


  Checked_Number(float y);


  Checked_Number(double y);


  Checked_Number(long double y);


  Checked_Number(const mpq_class& y);


  Checked_Number(const mpz_class& y);


  Checked_Number(const char* y);


  template <typename From>
  Checked_Number(const From&, typename Enable_If<Is_Special<From>::value, bool>::type ignored = false);
# 313 "Checked_Number_defs.hh"
  operator T() const;


  T& raw_value();


  const T& raw_value() const;




  bool OK() const;
# 336 "Checked_Number_defs.hh"
  Result classify(bool nan = true, bool inf = true, bool sign = true) const;





  Checked_Number& operator=(const Checked_Number& y);


  template <typename From>
  Checked_Number& operator=(const From& y);


  template <typename From_Policy>
  Checked_Number& operator+=(const Checked_Number<T, From_Policy>& y);


  Checked_Number& operator+=(const T& y);


  template <typename From>
  typename Enable_If<Is_Native_Or_Checked<From>::value,
                     Checked_Number<T, Policy>&>::type
  operator+=(const From& y);


  template <typename From_Policy>
  Checked_Number& operator-=(const Checked_Number<T, From_Policy>& y);


  Checked_Number& operator-=(const T& y);


  template <typename From>
  typename Enable_If<Is_Native_Or_Checked<From>::value,
                     Checked_Number<T, Policy>&>::type
  operator-=(const From& y);


  template <typename From_Policy>
  Checked_Number& operator*=(const Checked_Number<T, From_Policy>& y);


  Checked_Number& operator*=(const T& y);


  template <typename From>
  typename Enable_If<Is_Native_Or_Checked<From>::value,
                     Checked_Number<T, Policy>&>::type
  operator*=(const From& y);


  template <typename From_Policy>
  Checked_Number& operator/=(const Checked_Number<T, From_Policy>& y);


  Checked_Number& operator/=(const T& y);


  template <typename From>
  typename Enable_If<Is_Native_Or_Checked<From>::value,
                     Checked_Number<T, Policy>&>::type
  operator/=(const From& y);


  template <typename From_Policy>
  Checked_Number& operator%=(const Checked_Number<T, From_Policy>& y);


  Checked_Number& operator%=(const T& y);


  template <typename From>
  typename Enable_If<Is_Native_Or_Checked<From>::value,
                     Checked_Number<T, Policy>& >::type
  operator%=(const From& y);
# 420 "Checked_Number_defs.hh"
  Checked_Number& operator++();


  Checked_Number operator++(int);


  Checked_Number& operator--();


  Checked_Number operator--(int);



private:

  T v;
};




template <typename T, typename P>
struct Slow_Copy<Checked_Number<T, P> > : public Bool<Slow_Copy<T>::value> {};


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_not_a_number(const T& x);


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_minus_infinity(const T& x);


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_plus_infinity(const T& x);


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, int>::type
infinity_sign(const T& x);


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_integer(const T& x);


template <typename To, typename From>
typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Special<From>::value, Result>::type
construct(To& to, const From& x, Rounding_Dir dir);


template <typename To, typename From>
typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Special<From>::value, Result>::type
assign_r(To& to, const From& x, Rounding_Dir dir);


template <typename To>
typename Enable_If<Is_Native_Or_Checked<To>::value, Result>::type
assign_r(To& to, const char* x, Rounding_Dir dir);


template <typename To, typename To_Policy>
typename Enable_If<Is_Native_Or_Checked<To>::value, Result>::type
assign_r(To& to, char* x, Rounding_Dir dir);
# 496 "Checked_Number_defs.hh"
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type assign_r(To& to, const From& x, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type floor_assign_r(To& to, const From& x, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type ceil_assign_r(To& to, const From& x, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type trunc_assign_r(To& to, const From& x, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type neg_assign_r(To& to, const From& x, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type abs_assign_r(To& to, const From& x, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type sqrt_assign_r(To& to, const From& x, Rounding_Dir dir);
# 513 "Checked_Number_defs.hh"
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type add_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type sub_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type mul_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type div_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type smod_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir);
template <typename To, typename From> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type umod_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir);
# 530 "Checked_Number_defs.hh"
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type add_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type sub_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type mul_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type div_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type idiv_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type rem_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type gcd_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type lcm_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type add_mul_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
template <typename To, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type sub_mul_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir);
# 556 "Checked_Number_defs.hh"
template <typename To1, typename To2, typename To3, typename From1, typename From2> typename Enable_If<Is_Native_Or_Checked<To1>::value && Is_Native_Or_Checked<To2>::value && Is_Native_Or_Checked<To3>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type gcdext_assign_r(To1& to, To2& s, To3& t, const From1& x, const From2& y, Rounding_Dir dir);
# 570 "Checked_Number_defs.hh"
template <typename T, typename Policy>
memory_size_type
total_memory_in_bytes(const Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
memory_size_type
external_memory_in_bytes(const Checked_Number<T, Policy>& x);
# 587 "Checked_Number_defs.hh"
template <typename T, typename Policy>
Checked_Number<T, Policy>
operator+(const Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
Checked_Number<T, Policy>
operator-(const Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
void
floor_assign(Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
void
floor_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y);



template <typename T, typename Policy>
void
ceil_assign(Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
void
ceil_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y);



template <typename T, typename Policy>
void
trunc_assign(Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
void
trunc_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y);



template <typename T, typename Policy>
void
neg_assign(Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
void
neg_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y);



template <typename T, typename Policy>
void
abs_assign(Checked_Number<T, Policy>& x);



template <typename T, typename Policy>
void
abs_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y);



template <typename T, typename Policy>
void
add_mul_assign(Checked_Number<T, Policy>& x,
               const Checked_Number<T, Policy>& y,
               const Checked_Number<T, Policy>& z);



template <typename T, typename Policy>
void
sub_mul_assign(Checked_Number<T, Policy>& x,
               const Checked_Number<T, Policy>& y,
               const Checked_Number<T, Policy>& z);



template <typename T, typename Policy>
void
gcd_assign(Checked_Number<T, Policy>& x,
           const Checked_Number<T, Policy>& y,
           const Checked_Number<T, Policy>& z);






template <typename T, typename Policy>
void
gcdext_assign(Checked_Number<T, Policy>& x,
              Checked_Number<T, Policy>& s,
              Checked_Number<T, Policy>& t,
              const Checked_Number<T, Policy>& y,
              const Checked_Number<T, Policy>& z);



template <typename T, typename Policy>
void
lcm_assign(Checked_Number<T, Policy>& x,
           const Checked_Number<T, Policy>& y,
           const Checked_Number<T, Policy>& z);



template <typename T, typename Policy>
void
mul_2exp_assign(Checked_Number<T, Policy>& x,
                const Checked_Number<T, Policy>& y,
                unsigned int exp);



template <typename T, typename Policy>
void
div_2exp_assign(Checked_Number<T, Policy>& x,
                const Checked_Number<T, Policy>& y,
                unsigned int exp);
# 725 "Checked_Number_defs.hh"
template <typename T, typename Policy>
void
exact_div_assign(Checked_Number<T, Policy>& x,
                 const Checked_Number<T, Policy>& y,
                 const Checked_Number<T, Policy>& z);



template <typename T, typename Policy>
void sqrt_assign(Checked_Number<T, Policy>& x,
                 const Checked_Number<T, Policy>& y);
# 745 "Checked_Number_defs.hh"
template <typename T1, typename T2>
inline
typename Enable_If<Is_Native_Or_Checked<T1>::value
                   && Is_Native_Or_Checked<T2>::value
                   && (Is_Checked<T1>::value || Is_Checked<T2>::value),
                   bool>::type
operator==(const T1& x, const T2& y);


template <typename T1, typename T2>
inline typename Enable_If<Is_Native_Or_Checked<T1>::value
                          && Is_Native_Or_Checked<T2>::value,
                          bool>::type
equal(const T1& x, const T2& y);



template <typename T1, typename T2>
inline
typename Enable_If<Is_Native_Or_Checked<T1>::value
                   && Is_Native_Or_Checked<T2>::value
                   && (Is_Checked<T1>::value || Is_Checked<T2>::value),
                   bool>::type
operator!=(const T1& x, const T2& y);


template <typename T1, typename T2>
inline typename Enable_If<Is_Native_Or_Checked<T1>::value
                          && Is_Native_Or_Checked<T2>::value,
                          bool>::type
not_equal(const T1& x, const T2& y);



template <typename T1, typename T2>
inline
typename Enable_If<Is_Native_Or_Checked<T1>::value
                   && Is_Native_Or_Checked<T2>::value
                   && (Is_Checked<T1>::value || Is_Checked<T2>::value),
                   bool>::type
operator>=(const T1& x, const T2& y);


template <typename T1, typename T2>
inline typename Enable_If<Is_Native_Or_Checked<T1>::value
                          && Is_Native_Or_Checked<T2>::value,
                          bool>::type
greater_or_equal(const T1& x, const T2& y);



template <typename T1, typename T2>
inline
typename Enable_If<Is_Native_Or_Checked<T1>::value
                   && Is_Native_Or_Checked<T2>::value
                   && (Is_Checked<T1>::value || Is_Checked<T2>::value),
                   bool>::type
operator>(const T1& x, const T2& y);


template <typename T1, typename T2>
inline typename Enable_If<Is_Native_Or_Checked<T1>::value
                          && Is_Native_Or_Checked<T2>::value,
                          bool>::type
greater_than(const T1& x, const T2& y);



template <typename T1, typename T2>
inline
typename Enable_If<Is_Native_Or_Checked<T1>::value
                   && Is_Native_Or_Checked<T2>::value
                   && (Is_Checked<T1>::value || Is_Checked<T2>::value),
                   bool>::type
operator<=(const T1& x, const T2& y);


template <typename T1, typename T2>
inline typename Enable_If<Is_Native_Or_Checked<T1>::value
                          && Is_Native_Or_Checked<T2>::value,
                          bool>::type
less_or_equal(const T1& x, const T2& y);



template <typename T1, typename T2>
inline
typename Enable_If<Is_Native_Or_Checked<T1>::value
                   && Is_Native_Or_Checked<T2>::value
                   && (Is_Checked<T1>::value || Is_Checked<T2>::value),
                   bool>::type
operator<(const T1& x, const T2& y);


template <typename T1, typename T2>
inline typename Enable_If<Is_Native_Or_Checked<T1>::value
                          && Is_Native_Or_Checked<T2>::value,
                          bool>::type
less_than(const T1& x, const T2& y);







template <typename From>
inline typename Enable_If<Is_Native_Or_Checked<From>::value, int>::type sgn(const From& x);
# 861 "Checked_Number_defs.hh"
template <typename From1, typename From2>
inline typename Enable_If<Is_Native_Or_Checked<From1>::value
                          && Is_Native_Or_Checked<From2>::value,
                          int>::type
cmp(const From1& x, const From2& y);







template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, Result>::type
output(std::ostream& os,
       const T& x,
       const Numeric_Format& format,
       Rounding_Dir dir);



template <typename T, typename Policy>
std::ostream&
operator<<(std::ostream& os, const Checked_Number<T, Policy>& x);



template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, void>::type
ascii_dump(std::ostream& s, const T& t);
# 1017 "Checked_Number_defs.hh"
template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, Result>::type
input(T& x, std::istream& is, Rounding_Dir dir);



template <typename T, typename Policy>
std::istream&
operator>>(std::istream& is, Checked_Number<T, Policy>& x);



template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
ascii_load(std::ostream& s, T& t);



void throw_result_exception(Result r);

template <typename T>
T
plus_infinity();

template <typename T>
T
minus_infinity();

template <typename T>
T
not_a_number();



template <typename T, typename Policy>
void swap(Checked_Number<T, Policy>& x, Checked_Number<T, Policy>& y);

template <typename T, typename Policy>
struct FPU_Related<Checked_Number<T, Policy> > : public FPU_Related<T> {};

template <typename T>
void maybe_reset_fpu_inexact();

template <typename T>
int maybe_check_fpu_inexact();

}

# 1 "Checked_Number_inlines.hh" 1
# 31 "Checked_Number_inlines.hh"
namespace Parma_Polyhedra_Library {





inline Rounding_Dir
rounding_dir(Rounding_Dir dir) {
  if (dir == ROUND_NOT_NEEDED) {



  }
  return dir;
}

inline Result
check_result(Result r, Rounding_Dir dir) {
  if (dir == ROUND_NOT_NEEDED) {



    return r;
  }
  return r;
}


template <typename T>
inline void
Checked_Number_Transparent_Policy<T>::handle_result(Result) {
}

inline void
Extended_Number_Policy::handle_result(Result r) {
  if (result_class(r) == VC_NAN)
    throw_result_exception(r);
}

template <typename T, typename Policy>
inline
Checked_Number<T, Policy>::Checked_Number()
 : v(0) {
}

template <typename T, typename Policy>
inline
Checked_Number<T, Policy>::Checked_Number(const Checked_Number& y) {

  Checked::copy<Policy, Policy>(v, y.raw_value());
}

template <typename T, typename Policy>
template <typename From, typename From_Policy>
inline
Checked_Number<T, Policy>
::Checked_Number(const Checked_Number<From, From_Policy>& y,
                 Rounding_Dir dir) {

  Policy::handle_result(check_result(Checked::assign_ext<Policy, From_Policy>
                                     (v,
                                      y.raw_value(),
                                      rounding_dir(dir)),
                                     dir)
                        );
}

template <typename T, typename Policy>
template <typename From, typename From_Policy>
inline
Checked_Number<T, Policy>
::Checked_Number(const Checked_Number<From, From_Policy>& y) {

  Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR;
  Policy::handle_result(check_result(Checked::assign_ext<Policy, From_Policy>
                                     (v,
                                      y.raw_value(),
                                      rounding_dir(dir)),
                                     dir));
}
# 134 "Checked_Number_inlines.hh"
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const char y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<char> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const char y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<char> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed char y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed char> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed char y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed char> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed short y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed short> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed short y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed short> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed int y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed int> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed int y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed int> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed long y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed long> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed long y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed long> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed long long y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed long long> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const signed long long y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<signed long long> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned char y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned char> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned char y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned char> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned short y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned short> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned short y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned short> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned int y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned int> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned int y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned int> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned long y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned long> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned long y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned long> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned long long y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned long long> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const unsigned long long y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<unsigned long long> > (v, y, rounding_dir(dir)), dir)); }

template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const float y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<float> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const float y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<float> > (v, y, rounding_dir(dir)), dir)); }


template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const double y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<double> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const double y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<double> > (v, y, rounding_dir(dir)), dir)); }


template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const long double y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<long double> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const long double y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<long double> > (v, y, rounding_dir(dir)), dir)); }

template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const mpq_class& y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<mpq_class&> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const mpq_class& y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<mpq_class&> > (v, y, rounding_dir(dir)), dir)); }
template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const mpz_class& y, Rounding_Dir dir) { Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<mpz_class&> > (v, y, rounding_dir(dir)), dir)); } template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number(const mpz_class& y) { Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR; Policy::handle_result (check_result(Checked::assign_ext<Policy, Checked_Number_Transparent_Policy<mpz_class&> > (v, y, rounding_dir(dir)), dir)); }




template <typename T, typename Policy>
inline
Checked_Number<T, Policy>::Checked_Number(const char* y, Rounding_Dir dir) {
  std::istringstream s(y);
  Policy::handle_result(check_result(Checked::input<Policy>(v,
                                                            s,
                                                            rounding_dir(dir)),
                                     dir));
}

template <typename T, typename Policy>
inline
Checked_Number<T, Policy>::Checked_Number(const char* y) {
  std::istringstream s(y);
  Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR;
  Policy::handle_result(check_result(Checked::input<Policy>(v,
                                                            s,
                                                            rounding_dir(dir)),
                                     dir));
}

template <typename T, typename Policy>
template <typename From>
inline
Checked_Number<T, Policy>
::Checked_Number(const From&,
                 Rounding_Dir dir,
                 typename Enable_If<Is_Special<From>::value, bool>::type) {
  Policy::handle_result(check_result(Checked::assign_special<Policy>(v,
                                                                     From::vclass,
                                                                     rounding_dir(dir)),
                                     dir));
}

template <typename T, typename Policy>
template <typename From>
inline
Checked_Number<T, Policy>::Checked_Number(const From&, typename Enable_If<Is_Special<From>::value, bool>::type) {
  Rounding_Dir dir = Policy::ROUND_DEFAULT_CONSTRUCTOR;
  Policy::handle_result(check_result(Checked::assign_special<Policy>(v,
                                                            From::vclass,
                                                            rounding_dir(dir)),
                                     dir));
}

template <typename To, typename From>
inline typename Enable_If<Is_Native_Or_Checked<To>::value
                          && Is_Special<From>::value, Result>::type
assign_r(To& to, const From&, Rounding_Dir dir) {
  return check_result(Checked::assign_special<typename Native_Checked_To_Wrapper<To>
                      ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to),
                                From::vclass,
                                rounding_dir(dir)),
                      dir);
}

template <typename To, typename From>
inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Special<From>::value, Result>::type
construct(To& to, const From&, Rounding_Dir dir) {
  return check_result(Checked::construct_special<typename Native_Checked_To_Wrapper<To>
                      ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to),
                                From::vclass,
                                rounding_dir(dir)),
                      dir);
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_minus_infinity(const T& x) {
  return Checked::is_minf<typename Native_Checked_From_Wrapper<T>
    ::Policy>(Native_Checked_From_Wrapper<T>::raw_value(x));
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_plus_infinity(const T& x) {
  return Checked::is_pinf<typename Native_Checked_From_Wrapper<T>
    ::Policy>(Native_Checked_From_Wrapper<T>::raw_value(x));
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, int>::type
infinity_sign(const T& x) {
  return is_minus_infinity(x) ? -1 : (is_plus_infinity(x) ? 1 : 0);
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_not_a_number(const T& x) {
  return Checked::is_nan<typename Native_Checked_From_Wrapper<T>
    ::Policy>(Native_Checked_From_Wrapper<T>::raw_value(x));
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_integer(const T& x) {
  return Checked::is_int<typename Native_Checked_From_Wrapper<T>
    ::Policy>(Native_Checked_From_Wrapper<T>::raw_value(x));
}

template <typename T, typename Policy>
inline
Checked_Number<T, Policy>::operator T() const {
  if (Policy::convertible)
    return v;
}

template <typename T, typename Policy>
inline T&
Checked_Number<T, Policy>::raw_value() {
  return v;
}

template <typename T, typename Policy>
inline const T&
Checked_Number<T, Policy>::raw_value() const {
  return v;
}


template <typename T, typename Policy>
inline const T&
raw_value(const Checked_Number<T, Policy>& x) {
  return x.raw_value();
}


template <typename T, typename Policy>
inline T&
raw_value(Checked_Number<T, Policy>& x) {
  return x.raw_value();
}

template <typename T, typename Policy>
inline bool
Checked_Number<T, Policy>::OK() const {
  return true;
}

template <typename T, typename Policy>
inline Result
Checked_Number<T, Policy>::classify(bool nan, bool inf, bool sign) const {
  return Checked::classify<Policy>(v, nan, inf, sign);
}

template <typename T, typename Policy>
inline bool
is_not_a_number(const Checked_Number<T, Policy>& x) {
  return Checked::is_nan<Policy>(x.raw_value());
}

template <typename T, typename Policy>
inline bool
is_minus_infinity(const Checked_Number<T, Policy>& x) {
  return Checked::is_minf<Policy>(x.raw_value());
}

template <typename T, typename Policy>
inline bool
is_plus_infinity(const Checked_Number<T, Policy>& x) {
  return Checked::is_pinf<Policy>(x.raw_value());
}


template <typename T, typename Policy>
inline memory_size_type
total_memory_in_bytes(const Checked_Number<T, Policy>& x) {
  return total_memory_in_bytes(x.raw_value());
}


template <typename T, typename Policy>
inline memory_size_type
external_memory_in_bytes(const Checked_Number<T, Policy>& x) {
  return external_memory_in_bytes(x.raw_value());
}



template <typename To>
inline typename Enable_If<Is_Native_Or_Checked<To>::value, Result>::type
assign_r(To& to, const char* x, Rounding_Dir dir) {
  std::istringstream s(x);
  return check_result(Checked::input<typename Native_Checked_To_Wrapper<To>
                      ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to),
                                s,
                                rounding_dir(dir)),
                      dir);
}
# 365 "Checked_Number_inlines.hh"
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type construct(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::construct_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::assign_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type floor_assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::floor_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type ceil_assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::ceil_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type trunc_assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::trunc_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type neg_assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::neg_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type abs_assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::abs_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type sqrt_assign_r(To& to, const From& x, Rounding_Dir dir) { return check_result(Checked::sqrt_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), rounding_dir(dir)), dir); }
# 393 "Checked_Number_inlines.hh"
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type add_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { return check_result(Checked::add_2exp_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), exp, rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type sub_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { return check_result(Checked::sub_2exp_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), exp, rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type mul_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { return check_result(Checked::mul_2exp_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), exp, rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type div_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { return check_result(Checked::div_2exp_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), exp, rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type smod_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { return check_result(Checked::smod_2exp_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), exp, rounding_dir(dir)), dir); }
template <typename To, typename From> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From>::value, Result>::type umod_2exp_assign_r(To& to, const From& x, unsigned int exp, Rounding_Dir dir) { return check_result(Checked::umod_2exp_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From>::raw_value(x), exp, rounding_dir(dir)), dir); }
# 422 "Checked_Number_inlines.hh"
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type add_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::add_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type sub_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::sub_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type mul_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::mul_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type div_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::div_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type idiv_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::idiv_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type rem_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::rem_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type gcd_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::gcd_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type lcm_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::lcm_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type add_mul_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::add_mul_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
template <typename To, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type sub_mul_assign_r(To& to, const From1& x, const From2& y, Rounding_Dir dir) { return check_result(Checked::sub_mul_ext<typename Native_Checked_To_Wrapper<To> ::Policy, typename Native_Checked_From_Wrapper<From1> ::Policy, typename Native_Checked_From_Wrapper<From2> ::Policy>(Native_Checked_To_Wrapper<To>::raw_value(to), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
# 465 "Checked_Number_inlines.hh"
template <typename To1, typename To2, typename To3, typename From1, typename From2> inline typename Enable_If<Is_Native_Or_Checked<To1>::value && Is_Native_Or_Checked<To2>::value && Is_Native_Or_Checked<To3>::value && Is_Native_Or_Checked<From1>::value && Is_Native_Or_Checked<From2>::value, Result>::type gcdext_assign_r(To1& to, To2& s, To3& t, const From1& x, const From2& y, Rounding_Dir dir) { return check_result (Checked::gcdext_ext<typename Native_Checked_To_Wrapper<To1>::Policy, typename Native_Checked_To_Wrapper<To2>::Policy, typename Native_Checked_To_Wrapper<To3>::Policy, typename Native_Checked_From_Wrapper<From1>::Policy, typename Native_Checked_From_Wrapper<From2>::Policy> (Native_Checked_To_Wrapper<To1>::raw_value(to), Native_Checked_To_Wrapper<To2>::raw_value(s), Native_Checked_To_Wrapper<To3>::raw_value(t), Native_Checked_From_Wrapper<From1>::raw_value(x), Native_Checked_From_Wrapper<From2>::raw_value(y), rounding_dir(dir)), dir); }
# 486 "Checked_Number_inlines.hh"
template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator ++() { Policy::handle_result((add_assign_r)(*this, *this, T(1), Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy> Checked_Number<T, Policy>::operator ++(int) { T r = v; Policy::handle_result((add_assign_r)(*this, *this, T(1), Policy::ROUND_DEFAULT_OPERATOR)); return r;}
template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator --() { Policy::handle_result((sub_assign_r)(*this, *this, T(1), Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy> Checked_Number<T, Policy>::operator --(int) { T r = v; Policy::handle_result((sub_assign_r)(*this, *this, T(1), Policy::ROUND_DEFAULT_OPERATOR)); return r;}



template <typename T, typename Policy>
inline Checked_Number<T, Policy>&
Checked_Number<T, Policy>::operator=(const Checked_Number<T, Policy>& y) {
  Checked::copy<Policy, Policy>(v, y.raw_value());
  return *this;
}
template <typename T, typename Policy>
template <typename From>
inline Checked_Number<T, Policy>&
Checked_Number<T, Policy>::operator=(const From& y) {
  Policy::handle_result(assign_r(*this, y, Policy::ROUND_DEFAULT_OPERATOR));
  return *this;
}
# 532 "Checked_Number_inlines.hh"
template <typename T, typename Policy> template <typename From_Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator +=(const Checked_Number<T, From_Policy>& y) { Policy::handle_result((add_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator +=(const T& y) { Policy::handle_result((add_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> template <typename From> inline typename Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>& >::type Checked_Number<T, Policy>::operator +=(const From& y) { Checked_Number<T, Policy> cy(y); Policy::handle_result((add_assign_r)(*this, *this, cy, Policy::ROUND_DEFAULT_OPERATOR)); return *this; }
template <typename T, typename Policy> template <typename From_Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator -=(const Checked_Number<T, From_Policy>& y) { Policy::handle_result((sub_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator -=(const T& y) { Policy::handle_result((sub_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> template <typename From> inline typename Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>& >::type Checked_Number<T, Policy>::operator -=(const From& y) { Checked_Number<T, Policy> cy(y); Policy::handle_result((sub_assign_r)(*this, *this, cy, Policy::ROUND_DEFAULT_OPERATOR)); return *this; }
template <typename T, typename Policy> template <typename From_Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator *=(const Checked_Number<T, From_Policy>& y) { Policy::handle_result((mul_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator *=(const T& y) { Policy::handle_result((mul_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> template <typename From> inline typename Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>& >::type Checked_Number<T, Policy>::operator *=(const From& y) { Checked_Number<T, Policy> cy(y); Policy::handle_result((mul_assign_r)(*this, *this, cy, Policy::ROUND_DEFAULT_OPERATOR)); return *this; }
template <typename T, typename Policy> template <typename From_Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator /=(const Checked_Number<T, From_Policy>& y) { Policy::handle_result((div_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator /=(const T& y) { Policy::handle_result((div_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> template <typename From> inline typename Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>& >::type Checked_Number<T, Policy>::operator /=(const From& y) { Checked_Number<T, Policy> cy(y); Policy::handle_result((div_assign_r)(*this, *this, cy, Policy::ROUND_DEFAULT_OPERATOR)); return *this; }
template <typename T, typename Policy> template <typename From_Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator %=(const Checked_Number<T, From_Policy>& y) { Policy::handle_result((rem_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> inline Checked_Number<T, Policy>& Checked_Number<T, Policy>::operator %=(const T& y) { Policy::handle_result((rem_assign_r)(*this, *this, y, Policy::ROUND_DEFAULT_OPERATOR)); return *this; } template <typename T, typename Policy> template <typename From> inline typename Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>& >::type Checked_Number<T, Policy>::operator %=(const From& y) { Checked_Number<T, Policy> cy(y); Policy::handle_result((rem_assign_r)(*this, *this, cy, Policy::ROUND_DEFAULT_OPERATOR)); return *this; }
# 566 "Checked_Number_inlines.hh"
template <typename T, typename Policy> inline Checked_Number<T, Policy> operator +(const Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r; Policy::handle_result((add_assign_r)(r, x, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename Type, typename T, typename Policy> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator +(const Type& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r(x); Policy::handle_result((add_assign_r)(r, r, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename T, typename Policy, typename Type> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator +(const Checked_Number<T, Policy>& x, const Type& y) { Checked_Number<T, Policy> r(y); Policy::handle_result((add_assign_r)(r, x, r, Policy::ROUND_DEFAULT_OPERATOR)); return r; }
template <typename T, typename Policy> inline Checked_Number<T, Policy> operator -(const Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r; Policy::handle_result((sub_assign_r)(r, x, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename Type, typename T, typename Policy> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator -(const Type& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r(x); Policy::handle_result((sub_assign_r)(r, r, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename T, typename Policy, typename Type> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator -(const Checked_Number<T, Policy>& x, const Type& y) { Checked_Number<T, Policy> r(y); Policy::handle_result((sub_assign_r)(r, x, r, Policy::ROUND_DEFAULT_OPERATOR)); return r; }
template <typename T, typename Policy> inline Checked_Number<T, Policy> operator *(const Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r; Policy::handle_result((mul_assign_r)(r, x, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename Type, typename T, typename Policy> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator *(const Type& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r(x); Policy::handle_result((mul_assign_r)(r, r, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename T, typename Policy, typename Type> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator *(const Checked_Number<T, Policy>& x, const Type& y) { Checked_Number<T, Policy> r(y); Policy::handle_result((mul_assign_r)(r, x, r, Policy::ROUND_DEFAULT_OPERATOR)); return r; }
template <typename T, typename Policy> inline Checked_Number<T, Policy> operator /(const Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r; Policy::handle_result((div_assign_r)(r, x, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename Type, typename T, typename Policy> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator /(const Type& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r(x); Policy::handle_result((div_assign_r)(r, r, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename T, typename Policy, typename Type> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator /(const Checked_Number<T, Policy>& x, const Type& y) { Checked_Number<T, Policy> r(y); Policy::handle_result((div_assign_r)(r, x, r, Policy::ROUND_DEFAULT_OPERATOR)); return r; }
template <typename T, typename Policy> inline Checked_Number<T, Policy> operator %(const Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r; Policy::handle_result((rem_assign_r)(r, x, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename Type, typename T, typename Policy> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator %(const Type& x, const Checked_Number<T, Policy>& y) { Checked_Number<T, Policy> r(x); Policy::handle_result((rem_assign_r)(r, r, y, Policy::ROUND_DEFAULT_OPERATOR)); return r; } template <typename T, typename Policy, typename Type> inline typename Enable_If<Is_Native<Type>::value, Checked_Number<T, Policy> >::type operator %(const Checked_Number<T, Policy>& x, const Type& y) { Checked_Number<T, Policy> r(y); Policy::handle_result((rem_assign_r)(r, x, r, Policy::ROUND_DEFAULT_OPERATOR)); return r; }
# 588 "Checked_Number_inlines.hh"
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value && (Is_Checked<T1>::value || Is_Checked<T2>::value), bool>::type operator ==(const T1& x, const T2& y) { return Checked::eq_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value && (Is_Checked<T1>::value || Is_Checked<T2>::value), bool>::type operator !=(const T1& x, const T2& y) { return Checked::ne_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value && (Is_Checked<T1>::value || Is_Checked<T2>::value), bool>::type operator >=(const T1& x, const T2& y) { return Checked::ge_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value && (Is_Checked<T1>::value || Is_Checked<T2>::value), bool>::type operator >(const T1& x, const T2& y) { return Checked::gt_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value && (Is_Checked<T1>::value || Is_Checked<T2>::value), bool>::type operator <=(const T1& x, const T2& y) { return Checked::le_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value && (Is_Checked<T1>::value || Is_Checked<T2>::value), bool>::type operator <(const T1& x, const T2& y) { return Checked::lt_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
# 609 "Checked_Number_inlines.hh"
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value, bool>::type equal(const T1& x, const T2& y) { return Checked::eq_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value, bool>::type not_equal(const T1& x, const T2& y) { return Checked::ne_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value, bool>::type greater_or_equal(const T1& x, const T2& y) { return Checked::ge_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value, bool>::type greater_than(const T1& x, const T2& y) { return Checked::gt_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value, bool>::type less_or_equal(const T1& x, const T2& y) { return Checked::le_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }
template <typename T1, typename T2> inline typename Enable_If<Is_Native_Or_Checked<T1>::value && Is_Native_Or_Checked<T2>::value, bool>::type less_than(const T1& x, const T2& y) { return Checked::lt_ext<typename Native_Checked_From_Wrapper<T1>::Policy, typename Native_Checked_From_Wrapper<T2>::Policy> (Native_Checked_From_Wrapper<T1>::raw_value(x), Native_Checked_From_Wrapper<T2>::raw_value(y)); }




template <typename T, typename Policy>
inline Checked_Number<T, Policy>
operator+(const Checked_Number<T, Policy>& x) {
  return x;
}


template <typename T, typename Policy>
inline Checked_Number<T, Policy>
operator-(const Checked_Number<T, Policy>& x) {
  Checked_Number<T, Policy> r;
  Policy::handle_result(neg_assign_r(r, x, Policy::ROUND_DEFAULT_OPERATOR));
  return r;
}
# 666 "Checked_Number_inlines.hh"
template <typename T, typename Policy> inline void sqrt_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Policy::handle_result((sqrt_assign_r)(x, y, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void floor_assign(Checked_Number<T, Policy>& x) { Policy::handle_result((floor_assign_r)(x, x, Policy::ROUND_DEFAULT_FUNCTION)); }
template <typename T, typename Policy> inline void floor_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Policy::handle_result((floor_assign_r)(x, y, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void ceil_assign(Checked_Number<T, Policy>& x) { Policy::handle_result((ceil_assign_r)(x, x, Policy::ROUND_DEFAULT_FUNCTION)); }
template <typename T, typename Policy> inline void ceil_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Policy::handle_result((ceil_assign_r)(x, y, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void trunc_assign(Checked_Number<T, Policy>& x) { Policy::handle_result((trunc_assign_r)(x, x, Policy::ROUND_DEFAULT_FUNCTION)); }
template <typename T, typename Policy> inline void trunc_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Policy::handle_result((trunc_assign_r)(x, y, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void neg_assign(Checked_Number<T, Policy>& x) { Policy::handle_result((neg_assign_r)(x, x, Policy::ROUND_DEFAULT_FUNCTION)); }
template <typename T, typename Policy> inline void neg_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Policy::handle_result((neg_assign_r)(x, y, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void abs_assign(Checked_Number<T, Policy>& x) { Policy::handle_result((abs_assign_r)(x, x, Policy::ROUND_DEFAULT_FUNCTION)); }
template <typename T, typename Policy> inline void abs_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y) { Policy::handle_result((abs_assign_r)(x, y, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void add_mul_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, const Checked_Number<T, Policy>& z) { Policy::handle_result((add_mul_assign_r)(x, y, z, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void sub_mul_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, const Checked_Number<T, Policy>& z) { Policy::handle_result((sub_mul_assign_r)(x, y, z, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void rem_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, const Checked_Number<T, Policy>& z) { Policy::handle_result((rem_assign_r)(x, y, z, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void gcd_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, const Checked_Number<T, Policy>& z) { Policy::handle_result((gcd_assign_r)(x, y, z, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void gcdext_assign(Checked_Number<T, Policy>& x, Checked_Number<T, Policy>& s, Checked_Number<T, Policy>& t, const Checked_Number<T, Policy>& y, const Checked_Number<T, Policy>& z) { Policy::handle_result((gcdext_assign_r)(x, s, t, y, z, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy> inline void lcm_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, const Checked_Number<T, Policy>& z) { Policy::handle_result((lcm_assign_r)(x, y, z, Policy::ROUND_DEFAULT_FUNCTION)); }
# 709 "Checked_Number_inlines.hh"
template <typename T, typename Policy> inline void mul_2exp_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, unsigned int exp) { Policy::handle_result((mul_2exp_assign_r)(x, y, exp, Policy::ROUND_DEFAULT_FUNCTION)); }
template <typename T, typename Policy> inline void div_2exp_assign(Checked_Number<T, Policy>& x, const Checked_Number<T, Policy>& y, unsigned int exp) { Policy::handle_result((div_2exp_assign_r)(x, y, exp, Policy::ROUND_DEFAULT_FUNCTION)); }

template <typename T, typename Policy>
inline void
exact_div_assign(Checked_Number<T, Policy>& x,
                 const Checked_Number<T, Policy>& y,
                 const Checked_Number<T, Policy>& z) {
  Policy::handle_result(div_assign_r(x, y, z, ROUND_NOT_NEEDED));
}


template <typename From>
inline typename Enable_If<Is_Native_Or_Checked<From>::value, int>::type
sgn(const From& x) {
  Result_Relation r = Checked::sgn_ext<typename Native_Checked_From_Wrapper<From>::Policy>(Native_Checked_From_Wrapper<From>::raw_value(x));
  switch (r) {
  case VR_LT:
    return -1;
  case VR_EQ:
    return 0;
  case VR_GT:
    return 1;
  default:
    throw(0);
  }
}


template <typename From1, typename From2>
inline typename Enable_If<Is_Native_Or_Checked<From1>::value
                          && Is_Native_Or_Checked<From2>::value,
                          int>::type
cmp(const From1& x, const From2& y) {
  Result_Relation r
    = Checked::cmp_ext<typename Native_Checked_From_Wrapper<From1>::Policy,
                       typename Native_Checked_From_Wrapper<From2>::Policy>
                 (Native_Checked_From_Wrapper<From1>::raw_value(x),
                  Native_Checked_From_Wrapper<From2>::raw_value(y));
  switch (r) {
  case VR_LT:
    return -1;
  case VR_EQ:
    return 0;
  case VR_GT:
    return 1;
  default:
    throw(0);
  }
}


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, Result>::type
output(std::ostream& os, const T& x,
       const Numeric_Format& format, Rounding_Dir dir) {
  return check_result(Checked::output_ext<typename Native_Checked_From_Wrapper<T>::Policy>
                      (os,
                       Native_Checked_From_Wrapper<T>::raw_value(x),
                       format,
                       rounding_dir(dir)),
                      dir);
}


template <typename T, typename Policy>
inline std::ostream&
operator<<(std::ostream& os, const Checked_Number<T, Policy>& x) {
  Policy::handle_result(output(os, x, Numeric_Format(), ROUND_IGNORE));
  return os;
}


template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, Result>::type
input(T& x, std::istream& is, Rounding_Dir dir) {
  return check_result(Checked::input_ext<typename Native_Checked_To_Wrapper<T>::Policy>
                      (Native_Checked_To_Wrapper<T>::raw_value(x),
                       is,
                       rounding_dir(dir)),
                      dir);
}


template <typename T, typename Policy>
inline std::istream& operator>>(std::istream& is,
                                Checked_Number<T, Policy>& x) {
  Result r = input(x, is, Policy::ROUND_DEFAULT_INPUT);
  if (r == V_CVT_STR_UNK)
    is.setstate(std::ios::failbit);
  else
    Policy::handle_result(r);
  return is;
}

template <typename T>
inline T
plus_infinity() {
  return PLUS_INFINITY;
}

template <typename T>
inline T
minus_infinity() {
  return MINUS_INFINITY;
}

template <typename T>
inline T
not_a_number() {
  return NOT_A_NUMBER;
}


template <typename T, typename Policy>
inline void
swap(Checked_Number<T, Policy>& x, Checked_Number<T, Policy>& y) {
  using std::swap;
  swap(x.raw_value(), y.raw_value());
}

template <typename T>
inline void
maybe_reset_fpu_inexact() {
  if (FPU_Related<T>::value)
    return fpu_reset_inexact();
}

template <typename T>
inline int
maybe_check_fpu_inexact() {
  if (FPU_Related<T>::value)
    return fpu_check_inexact();
  else
    return 0;
}

}
# 1066 "Checked_Number_defs.hh" 2
# 1 "Checked_Number_templates.hh" 1
# 28 "Checked_Number_templates.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 1 3
# 43 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
       
# 44 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/functional" 1 3
# 52 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/functional" 3
       
# 53 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/functional" 3
# 48 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 2 3

namespace std
{



  struct _Resetiosflags { ios_base::fmtflags _M_mask; };
# 63 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
  inline _Resetiosflags
  resetiosflags(ios_base::fmtflags __mask)
  {
    _Resetiosflags __x;
    __x._M_mask = __mask;
    return __x;
  }

  template<typename _CharT, typename _Traits>
    inline basic_istream<_CharT,_Traits>&
    operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f)
    {
      __is.setf(ios_base::fmtflags(0), __f._M_mask);
      return __is;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT,_Traits>&
    operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f)
    {
      __os.setf(ios_base::fmtflags(0), __f._M_mask);
      return __os;
    }


  struct _Setiosflags { ios_base::fmtflags _M_mask; };
# 97 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
  inline _Setiosflags
  setiosflags(ios_base::fmtflags __mask)
  {
    _Setiosflags __x;
    __x._M_mask = __mask;
    return __x;
  }

  template<typename _CharT, typename _Traits>
    inline basic_istream<_CharT,_Traits>&
    operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f)
    {
      __is.setf(__f._M_mask);
      return __is;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT,_Traits>&
    operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f)
    {
      __os.setf(__f._M_mask);
      return __os;
    }


  struct _Setbase { int _M_base; };
# 132 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
  inline _Setbase
  setbase(int __base)
  {
    _Setbase __x;
    __x._M_base = __base;
    return __x;
  }

  template<typename _CharT, typename _Traits>
    inline basic_istream<_CharT,_Traits>&
    operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f)
    {
      __is.setf(__f._M_base == 8 ? ios_base::oct :
       __f._M_base == 10 ? ios_base::dec :
       __f._M_base == 16 ? ios_base::hex :
       ios_base::fmtflags(0), ios_base::basefield);
      return __is;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT,_Traits>&
    operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f)
    {
      __os.setf(__f._M_base == 8 ? ios_base::oct :
  __f._M_base == 10 ? ios_base::dec :
  __f._M_base == 16 ? ios_base::hex :
  ios_base::fmtflags(0), ios_base::basefield);
      return __os;
    }


  template<typename _CharT>
    struct _Setfill { _CharT _M_c; };
# 173 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
  template<typename _CharT>
    inline _Setfill<_CharT>
    setfill(_CharT __c)
    {
      _Setfill<_CharT> __x;
      __x._M_c = __c;
      return __x;
    }

  template<typename _CharT, typename _Traits>
    inline basic_istream<_CharT,_Traits>&
    operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f)
    {
      __is.fill(__f._M_c);
      return __is;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT,_Traits>&
    operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f)
    {
      __os.fill(__f._M_c);
      return __os;
    }


  struct _Setprecision { int _M_n; };
# 208 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
  inline _Setprecision
  setprecision(int __n)
  {
    _Setprecision __x;
    __x._M_n = __n;
    return __x;
  }

  template<typename _CharT, typename _Traits>
    inline basic_istream<_CharT,_Traits>&
    operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f)
    {
      __is.precision(__f._M_n);
      return __is;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT,_Traits>&
    operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f)
    {
      __os.precision(__f._M_n);
      return __os;
    }


  struct _Setw { int _M_n; };
# 242 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iomanip" 3
  inline _Setw
  setw(int __n)
  {
    _Setw __x;
    __x._M_n = __n;
    return __x;
  }

  template<typename _CharT, typename _Traits>
    inline basic_istream<_CharT,_Traits>&
    operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f)
    {
      __is.width(__f._M_n);
      return __is;
    }

  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT,_Traits>&
    operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f)
    {
      __os.width(__f._M_n);
      return __os;
    }





  extern template ostream& operator<<(ostream&, _Setfill<char>);
  extern template ostream& operator<<(ostream&, _Setiosflags);
  extern template ostream& operator<<(ostream&, _Resetiosflags);
  extern template ostream& operator<<(ostream&, _Setbase);
  extern template ostream& operator<<(ostream&, _Setprecision);
  extern template ostream& operator<<(ostream&, _Setw);
  extern template istream& operator>>(istream&, _Setfill<char>);
  extern template istream& operator>>(istream&, _Setiosflags);
  extern template istream& operator>>(istream&, _Resetiosflags);
  extern template istream& operator>>(istream&, _Setbase);
  extern template istream& operator>>(istream&, _Setprecision);
  extern template istream& operator>>(istream&, _Setw);


  extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
  extern template wostream& operator<<(wostream&, _Setiosflags);
  extern template wostream& operator<<(wostream&, _Resetiosflags);
  extern template wostream& operator<<(wostream&, _Setbase);
  extern template wostream& operator<<(wostream&, _Setprecision);
  extern template wostream& operator<<(wostream&, _Setw);
  extern template wistream& operator>>(wistream&, _Setfill<wchar_t>);
  extern template wistream& operator>>(wistream&, _Setiosflags);
  extern template wistream& operator>>(wistream&, _Resetiosflags);
  extern template wistream& operator>>(wistream&, _Setbase);
  extern template wistream& operator>>(wistream&, _Setprecision);
  extern template wistream& operator>>(wistream&, _Setw);


}
# 29 "Checked_Number_templates.hh" 2


namespace Parma_Polyhedra_Library {

template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, void>::type
ascii_dump(std::ostream& s, const T& t) {
  if (std::numeric_limits<T>::is_exact)

    s << t;
  else {


    const std::ios::fmtflags old_flags = s.setf(std::ios::hex,
                                                std::ios::basefield);
    const unsigned char* p = reinterpret_cast<const unsigned char*>(&t);
    for (unsigned i = 0; i < sizeof(T); ++i) {
      s << std::setw(2) << std::setfill('0') << static_cast<unsigned>(p[i]);
    }
    s.flags(old_flags);

    s << " (" << t << ")";
  }
}

template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
ascii_load(std::istream& s, T& t) {
  if (std::numeric_limits<T>::is_exact) {

    s >> t;
    return !s.fail();
  }
  else {


    std::string str;
    if (!(s >> str) || str.size() != 2*sizeof(T))
      return false;
    unsigned char* p = reinterpret_cast<unsigned char*>(&t);

    for (unsigned i = 0; i < sizeof(T); ++i) {
      unsigned byte_value = 0;
      for (unsigned j = 0; j < 2; ++j) {
        byte_value <<= 4;
        unsigned half_byte_value;

        switch (str[2*i + j]) {
        case '0':
          half_byte_value = 0;
          break;
        case '1':
          half_byte_value = 1;
          break;
        case '2':
          half_byte_value = 2;
          break;
        case '3':
          half_byte_value = 3;
          break;
        case '4':
          half_byte_value = 4;
          break;
        case '5':
          half_byte_value = 5;
          break;
        case '6':
          half_byte_value = 6;
          break;
        case '7':
          half_byte_value = 7;
          break;
        case '8':
          half_byte_value = 8;
          break;
        case '9':
          half_byte_value = 9;
          break;
        case 'A':
        case 'a':
          half_byte_value = 10;
          break;
        case 'B':
        case 'b':
          half_byte_value = 11;
          break;
        case 'C':
        case 'c':
          half_byte_value = 12;
          break;
        case 'D':
        case 'd':
          half_byte_value = 13;
          break;
        case 'E':
        case 'e':
          half_byte_value = 14;
          break;
        case 'F':
        case 'f':
          half_byte_value = 15;
          break;
        default:
          return false;
        }
        byte_value += half_byte_value;
      }
      ((void) 0);
      p[i] = static_cast<unsigned char>(byte_value);
    }

    if (!(s >> str))
      return false;
    const std::string::size_type sz = str.size();
    return sz > 2 && str[0] == '(' && str[sz-1] == ')';
  }
}

}
# 1067 "Checked_Number_defs.hh" 2
# 17 "Coefficient_types.hh" 2


# 1 "GMP_Integer_types.hh" 1
# 20 "GMP_Integer_types.hh"
namespace Parma_Polyhedra_Library {
# 31 "GMP_Integer_types.hh"
typedef mpz_class GMP_Integer;





template <>
struct Coefficient_traits_template<GMP_Integer> {

  typedef const GMP_Integer& const_reference;
};

}
# 20 "Coefficient_types.hh" 2
# 152 "Coefficient_types.hh"
namespace Parma_Polyhedra_Library {
# 172 "Coefficient_types.hh"
typedef mpz_class Coefficient;





typedef Coefficient_traits_template<Coefficient> Coefficient_traits;

}
# 28 "Coefficient_defs.hh" 2
# 36 "Coefficient_defs.hh"
# 1 "GMP_Integer_defs.hh" 1
# 31 "GMP_Integer_defs.hh"
namespace Parma_Polyhedra_Library {






const mpz_class& raw_value(const GMP_Integer& x);



mpz_class& raw_value(GMP_Integer& x);
# 51 "GMP_Integer_defs.hh"
void neg_assign(GMP_Integer& x);



void neg_assign(GMP_Integer& x, const GMP_Integer& y);



void abs_assign(GMP_Integer& x);



void abs_assign(GMP_Integer& x, const GMP_Integer& y);



void rem_assign(GMP_Integer& x,
                const GMP_Integer& y, const GMP_Integer& z);



void gcd_assign(GMP_Integer& x,
                const GMP_Integer& y, const GMP_Integer& z);






void gcdext_assign(GMP_Integer& x, GMP_Integer& s, GMP_Integer& t,
                   const GMP_Integer& y, const GMP_Integer& z);



void lcm_assign(GMP_Integer& x,
                const GMP_Integer& y, const GMP_Integer& z);



void add_mul_assign(GMP_Integer& x,
                    const GMP_Integer& y, const GMP_Integer& z);



void sub_mul_assign(GMP_Integer& x,
                    const GMP_Integer& y, const GMP_Integer& z);



void mul_2exp_assign(GMP_Integer& x, const GMP_Integer& y, unsigned int exp);



void div_2exp_assign(GMP_Integer& x, const GMP_Integer& y, unsigned int exp);
# 113 "GMP_Integer_defs.hh"
void exact_div_assign(GMP_Integer& x,
                      const GMP_Integer& y, const GMP_Integer& z);



void sqrt_assign(GMP_Integer& x, const GMP_Integer& y);







int cmp(const GMP_Integer& x, const GMP_Integer& y);



}

# 1 "GMP_Integer_inlines.hh" 1
# 29 "GMP_Integer_inlines.hh"
namespace Parma_Polyhedra_Library {

inline void
neg_assign(GMP_Integer& x) {
  __gmpz_neg(x.get_mpz_t(), x.get_mpz_t());
}

inline void
neg_assign(GMP_Integer& x, const GMP_Integer& y) {
  __gmpz_neg(x.get_mpz_t(), y.get_mpz_t());
}

inline void
abs_assign(GMP_Integer& x) {
  __gmpz_abs(x.get_mpz_t(), x.get_mpz_t());
}

inline void
abs_assign(GMP_Integer& x, const GMP_Integer& y) {
  __gmpz_abs(x.get_mpz_t(), y.get_mpz_t());
}

inline void
gcd_assign(GMP_Integer& x, const GMP_Integer& y, const GMP_Integer& z) {
  __gmpz_gcd(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
}

inline void
rem_assign(GMP_Integer& x, const GMP_Integer& y, const GMP_Integer& z) {
  __gmpz_tdiv_r(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
}

inline void
gcdext_assign(GMP_Integer& x, GMP_Integer& s, GMP_Integer& t,
              const GMP_Integer& y, const GMP_Integer& z) {
  __gmpz_gcdext(x.get_mpz_t(),
             s.get_mpz_t(), t.get_mpz_t(),
             y.get_mpz_t(), z.get_mpz_t());
}

inline void
lcm_assign(GMP_Integer& x, const GMP_Integer& y, const GMP_Integer& z) {
  __gmpz_lcm(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
}

inline void
add_mul_assign(GMP_Integer& x, const GMP_Integer& y, const GMP_Integer& z) {
  __gmpz_addmul(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
}

inline void
sub_mul_assign(GMP_Integer& x, const GMP_Integer& y, const GMP_Integer& z) {
  __gmpz_submul(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
}

inline void
mul_2exp_assign(GMP_Integer& x, const GMP_Integer& y, unsigned int exp) {
  __gmpz_mul_2exp(x.get_mpz_t(), y.get_mpz_t(), exp);
}

inline void
div_2exp_assign(GMP_Integer& x, const GMP_Integer& y, unsigned int exp) {
  __gmpz_tdiv_q_2exp(x.get_mpz_t(), y.get_mpz_t(), exp);
}

inline void
exact_div_assign(GMP_Integer& x, const GMP_Integer& y, const GMP_Integer& z) {
  ((void) 0);
  __gmpz_divexact(x.get_mpz_t(), y.get_mpz_t(), z.get_mpz_t());
}

inline void
sqrt_assign(GMP_Integer& x, const GMP_Integer& y) {
  __gmpz_sqrt(x.get_mpz_t(), y.get_mpz_t());
}

inline int
cmp(const GMP_Integer& x, const GMP_Integer& y) {
  return __gmpz_cmp(x.get_mpz_t(), y.get_mpz_t());
}

inline const mpz_class&
raw_value(const GMP_Integer& x) {
  return x;
}

inline mpz_class&
raw_value(GMP_Integer& x) {
  return x;
}

}
# 133 "GMP_Integer_defs.hh" 2
# 37 "Coefficient_defs.hh" 2


namespace Parma_Polyhedra_Library {




void Coefficient_constants_initialize();




void Coefficient_constants_finalize();


Coefficient_traits::const_reference Coefficient_zero();


Coefficient_traits::const_reference Coefficient_one();

}

# 1 "Coefficient_inlines.hh" 1
# 27 "Coefficient_inlines.hh"
namespace Parma_Polyhedra_Library {
# 56 "Coefficient_inlines.hh"
inline Coefficient_traits::const_reference
Coefficient_zero() {
  extern const Coefficient* Coefficient_zero_p;
  return *Coefficient_zero_p;
}

inline Coefficient_traits::const_reference
Coefficient_one() {
  extern const Coefficient* Coefficient_one_p;
  ((void) 0);
  return *Coefficient_one_p;
}


}
# 60 "Coefficient_defs.hh" 2
# 30 "Box_defs.hh" 2

# 1 "Variables_Set_types.hh" 1
# 16 "Variables_Set_types.hh"
namespace Parma_Polyhedra_Library {

class Variables_Set;

}
# 32 "Box_defs.hh" 2

# 1 "Constraint_types.hh" 1
# 16 "Constraint_types.hh"
namespace Parma_Polyhedra_Library {

class Constraint;

}
# 34 "Box_defs.hh" 2
# 1 "Constraint_defs.hh" 1
# 29 "Constraint_defs.hh"
# 1 "Congruence_types.hh" 1
# 16 "Congruence_types.hh"
namespace Parma_Polyhedra_Library {

class Congruence;

}
# 30 "Constraint_defs.hh" 2

# 1 "Polyhedron_types.hh" 1
# 16 "Polyhedron_types.hh"
namespace Parma_Polyhedra_Library {

class Polyhedron;

}
# 32 "Constraint_defs.hh" 2
# 1 "termination_types.hh" 1
# 16 "termination_types.hh"
namespace Parma_Polyhedra_Library {

class Termination_Helpers;

}
# 33 "Constraint_defs.hh" 2
# 1 "Octagonal_Shape_types.hh" 1
# 16 "Octagonal_Shape_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class Octagonal_Shape;

class Octagonal_Shape_Helper;

}
# 34 "Constraint_defs.hh" 2
# 1 "Grid_types.hh" 1
# 16 "Grid_types.hh"
namespace Parma_Polyhedra_Library {

class Grid;

}
# 35 "Constraint_defs.hh" 2

# 1 "Linear_Expression_defs.hh" 1
# 30 "Linear_Expression_defs.hh"
# 1 "Generator_types.hh" 1
# 16 "Generator_types.hh"
namespace Parma_Polyhedra_Library {

class Generator;

}
# 31 "Linear_Expression_defs.hh" 2

# 1 "Grid_Generator_types.hh" 1
# 16 "Grid_Generator_types.hh"
namespace Parma_Polyhedra_Library {

class Grid_Generator;

}
# 33 "Linear_Expression_defs.hh" 2
# 1 "Linear_System_types.hh" 1
# 16 "Linear_System_types.hh"
namespace Parma_Polyhedra_Library {

template <typename Row>
class Linear_System;

template <typename Row>
class Linear_System_With_Bit_Matrix_iterator;

}
# 34 "Linear_Expression_defs.hh" 2
# 1 "Constraint_System_types.hh" 1
# 16 "Constraint_System_types.hh"
namespace Parma_Polyhedra_Library {

class Constraint_System;
class Constraint_System_const_iterator;

}
# 35 "Linear_Expression_defs.hh" 2
# 1 "Congruence_System_types.hh" 1
# 16 "Congruence_System_types.hh"
namespace Parma_Polyhedra_Library {

class Congruence_System;

}
# 36 "Linear_Expression_defs.hh" 2



# 1 "PIP_Problem_types.hh" 1
# 16 "PIP_Problem_types.hh"
namespace Parma_Polyhedra_Library {



enum PIP_Problem_Status {

  UNFEASIBLE_PIP_PROBLEM,

  OPTIMIZED_PIP_PROBLEM
};

class PIP_Problem;

}
# 40 "Linear_Expression_defs.hh" 2
# 1 "BHRZ03_Certificate_types.hh" 1
# 16 "BHRZ03_Certificate_types.hh"
namespace Parma_Polyhedra_Library {

class BHRZ03_Certificate;

}
# 41 "Linear_Expression_defs.hh" 2
# 1 "Scalar_Products_types.hh" 1
# 16 "Scalar_Products_types.hh"
namespace Parma_Polyhedra_Library {

class Scalar_Products;
class Topology_Adjusted_Scalar_Product_Sign;
class Topology_Adjusted_Scalar_Product_Assign;

}
# 42 "Linear_Expression_defs.hh" 2
# 1 "MIP_Problem_types.hh" 1
# 16 "MIP_Problem_types.hh"
namespace Parma_Polyhedra_Library {



enum MIP_Problem_Status {

  UNFEASIBLE_MIP_PROBLEM,

  UNBOUNDED_MIP_PROBLEM,

  OPTIMIZED_MIP_PROBLEM
};

class MIP_Problem;

}
# 43 "Linear_Expression_defs.hh" 2

# 1 "BD_Shape_types.hh" 1
# 16 "BD_Shape_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class BD_Shape;

class BD_Shape_Helpers;

}
# 45 "Linear_Expression_defs.hh" 2



# 1 "Expression_Adapter_defs.hh" 1
# 27 "Expression_Adapter_defs.hh"
# 1 "Expression_Adapter_types.hh" 1
# 16 "Expression_Adapter_types.hh"
namespace Parma_Polyhedra_Library {

class Expression_Adapter_Base;

template <typename T>
class Expression_Adapter;

template <typename T>
class Expression_Adapter_Transparent;

}
# 28 "Expression_Adapter_defs.hh" 2


# 1 "Dense_Row_defs.hh" 1
# 27 "Dense_Row_defs.hh"
# 1 "Dense_Row_types.hh" 1
# 16 "Dense_Row_types.hh"
namespace Parma_Polyhedra_Library {

class Dense_Row;

}
# 28 "Dense_Row_defs.hh" 2



# 1 "Sparse_Row_types.hh" 1
# 16 "Sparse_Row_types.hh"
namespace Parma_Polyhedra_Library {

class Sparse_Row;

}
# 32 "Dense_Row_defs.hh" 2
# 41 "Dense_Row_defs.hh"
class Parma_Polyhedra_Library::Dense_Row {
public:
  class iterator;
  class const_iterator;


  Dense_Row();

  explicit Dense_Row(const Sparse_Row& row);





  Dense_Row(dimension_type sz);
# 68 "Dense_Row_defs.hh"
  Dense_Row(dimension_type sz, dimension_type capacity);


  Dense_Row(const Dense_Row& y);






  Dense_Row(const Dense_Row& y, dimension_type capacity);





  Dense_Row(const Dense_Row& y, dimension_type sz, dimension_type capacity);





  Dense_Row(const Sparse_Row& y, dimension_type sz, dimension_type capacity);


  ~Dense_Row();


  Dense_Row& operator=(const Dense_Row& y);


  Dense_Row& operator=(const Sparse_Row& y);


  void m_swap(Dense_Row& y);


  void resize(dimension_type sz);


  void resize(dimension_type sz, dimension_type capacity);


  void clear();
# 126 "Dense_Row_defs.hh"
  void add_zeroes_and_shift(dimension_type n, dimension_type i);
# 135 "Dense_Row_defs.hh"
  void expand_within_capacity(dimension_type new_size);







  void shrink(dimension_type new_size);


  static dimension_type max_size();


  dimension_type size() const;




  Coefficient& operator[](dimension_type k);


  Coefficient_traits::const_reference operator[](dimension_type k) const;







  void normalize();



  void swap_coefficients(dimension_type i, dimension_type j);



  void swap_coefficients(iterator i, iterator j);

  iterator begin();
  const_iterator begin() const;

  iterator end();
  const_iterator end() const;



  void reset(dimension_type i);



  void reset(dimension_type first, dimension_type last);



  iterator reset(iterator itr);



  Coefficient_traits::const_reference get(dimension_type i) const;


  iterator find(dimension_type i);


  const_iterator find(dimension_type i) const;


  iterator find(iterator itr, dimension_type i);


  const_iterator find(const_iterator itr, dimension_type i) const;


  iterator lower_bound(dimension_type i);


  const_iterator lower_bound(dimension_type i) const;


  iterator lower_bound(iterator itr, dimension_type i);


  const_iterator lower_bound(const_iterator itr, dimension_type i) const;


  iterator insert(dimension_type i, Coefficient_traits::const_reference x);


  iterator insert(dimension_type i);


  iterator insert(iterator itr, dimension_type i,
                       Coefficient_traits::const_reference x);


  iterator insert(iterator itr, dimension_type i);
# 257 "Dense_Row_defs.hh"
  template <typename Func1, typename Func2>
  void combine_needs_first(const Dense_Row& y,
                           const Func1& f, const Func2& g);
# 285 "Dense_Row_defs.hh"
  template <typename Func1, typename Func2>
  void combine_needs_second(const Dense_Row& y,
                            const Func1& g, const Func2& h);
# 317 "Dense_Row_defs.hh"
  template <typename Func1, typename Func2, typename Func3>
  void combine(const Dense_Row& y,
               const Func1& f, const Func2& g, const Func3& h);
# 341 "Dense_Row_defs.hh"
  void linear_combine(const Dense_Row& y,
                      Coefficient_traits::const_reference coeff1,
                      Coefficient_traits::const_reference coeff2);
# 353 "Dense_Row_defs.hh"
  void linear_combine(const Dense_Row& y,
                      Coefficient_traits::const_reference c1,
                      Coefficient_traits::const_reference c2,
                      dimension_type start, dimension_type end);

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);





  memory_size_type total_memory_in_bytes() const;





  memory_size_type external_memory_in_bytes() const;





  memory_size_type total_memory_in_bytes(dimension_type capacity) const;





  memory_size_type external_memory_in_bytes(dimension_type capacity) const;


  bool OK() const;





  bool OK(dimension_type row_size) const;

private:
  void init(const Sparse_Row& row);

  void destroy();

  struct Impl {

    Impl();

    ~Impl();


    dimension_type size;


    dimension_type capacity;


    std::allocator<Coefficient> coeff_allocator;



    Coefficient* vec;
  };

  Impl impl;


  dimension_type capacity() const;
};

class Parma_Polyhedra_Library::Dense_Row::iterator {
public:

  typedef std::bidirectional_iterator_tag iterator_category;
  typedef Coefficient value_type;
  typedef ptrdiff_t difference_type;
  typedef value_type* pointer;
  typedef value_type& reference;

  iterator();
  iterator(Dense_Row& row1, dimension_type i1);

  Coefficient& operator*();
  Coefficient_traits::const_reference operator*() const;
# 453 "Dense_Row_defs.hh"
  dimension_type index() const;

  iterator& operator++();
  iterator operator++(int);

  iterator& operator--();
  iterator operator--(int);

  bool operator==(const iterator& x) const;
  bool operator!=(const iterator& x) const;

  operator const_iterator() const;

  bool OK() const;

private:
  Dense_Row* row;
  dimension_type i;
};

class Parma_Polyhedra_Library::Dense_Row::const_iterator {
public:

  typedef const Coefficient value_type;
  typedef ptrdiff_t difference_type;
  typedef value_type* pointer;
  typedef Coefficient_traits::const_reference reference;

  const_iterator();
  const_iterator(const Dense_Row& row1, dimension_type i1);

  Coefficient_traits::const_reference operator*() const;
# 493 "Dense_Row_defs.hh"
  dimension_type index() const;

  const_iterator& operator++();
  const_iterator operator++(int);

  const_iterator& operator--();
  const_iterator operator--(int);

  bool operator==(const const_iterator& x) const;
  bool operator!=(const const_iterator& x) const;

  bool OK() const;

private:
  const Dense_Row* row;
  dimension_type i;
};


namespace Parma_Polyhedra_Library {





void swap(Dense_Row& x, Dense_Row& y);





void iter_swap(std::vector<Dense_Row>::iterator x,
               std::vector<Dense_Row>::iterator y);





bool operator==(const Dense_Row& x, const Dense_Row& y);





bool operator!=(const Dense_Row& x, const Dense_Row& y);




void linear_combine(Dense_Row& x, const Dense_Row& y,
                    Coefficient_traits::const_reference coeff1,
                    Coefficient_traits::const_reference coeff2);






void linear_combine(Dense_Row& x, const Dense_Row& y,
                    Coefficient_traits::const_reference c1,
                    Coefficient_traits::const_reference c2,
                    dimension_type start, dimension_type end);

}

# 1 "Dense_Row_inlines.hh" 1
# 32 "Dense_Row_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Dense_Row::Impl::Impl()
  : size(0), capacity(0), coeff_allocator(), vec(0) {
}

inline
Dense_Row::Impl::~Impl() {
  while (size != 0) {
    --size;
    vec[size].~Coefficient();
  }
  coeff_allocator.deallocate(vec, capacity);
}

inline dimension_type
Dense_Row::max_size() {
  return std::numeric_limits<size_t>::max() / sizeof(Coefficient);
}

inline dimension_type
Dense_Row::size() const {
  return impl.size;
}

inline dimension_type
Dense_Row::capacity() const {
  return impl.capacity;
}

inline
Dense_Row::Dense_Row()
  : impl() {

  ((void) 0);
}

inline
Dense_Row::Dense_Row(const dimension_type sz,
                     const dimension_type capacity)
  : impl() {

  resize(sz, capacity);

  ((void) 0);
  ((void) 0);
  ((void) 0);
}

inline
Dense_Row::Dense_Row(const dimension_type sz)
  : impl() {

  resize(sz);

  ((void) 0);
  ((void) 0);
}

inline
Dense_Row::Dense_Row(const Dense_Row& y)
  : impl() {
  impl.coeff_allocator = y.impl.coeff_allocator;
  if (y.impl.vec != 0) {
    impl.capacity = y.capacity();
    impl.vec = impl.coeff_allocator.allocate(impl.capacity);
    while (impl.size != y.size()) {
      new (&impl.vec[impl.size]) Coefficient(y[impl.size]);
      ++impl.size;
    }
  }
  ((void) 0);
  ((void) 0);
  ((void) 0);
}

inline
Dense_Row::Dense_Row(const Dense_Row& y,
                     const dimension_type capacity)
  : impl() {
  ((void) 0);
  ((void) 0);

  impl.capacity = capacity;
  impl.coeff_allocator = y.impl.coeff_allocator;
  impl.vec = impl.coeff_allocator.allocate(impl.capacity);

  if (y.impl.vec != 0) {
    while (impl.size != y.size()) {
      new (&impl.vec[impl.size]) Coefficient(y[impl.size]);
      ++impl.size;
    }
  }

  ((void) 0);
  ((void) 0);
  ((void) 0);
}

inline
Dense_Row::Dense_Row(const Dense_Row& y,
                     const dimension_type sz,
                     const dimension_type capacity)
  : impl() {
  ((void) 0);
  ((void) 0);
  ((void) 0);

  impl.capacity = capacity;
  impl.coeff_allocator = y.impl.coeff_allocator;
  impl.vec = impl.coeff_allocator.allocate(impl.capacity);

  const dimension_type n = std::min(sz, y.size());
  while (impl.size != n) {
    new (&impl.vec[impl.size]) Coefficient(y[impl.size]);
    ++impl.size;
  }
  while (impl.size != sz) {
    new (&impl.vec[impl.size]) Coefficient();
    ++impl.size;
  }

  ((void) 0);
  ((void) 0);
  ((void) 0);
}

inline
Dense_Row::~Dense_Row() {

}

inline void
Dense_Row::destroy() {
  resize(0);
  impl.coeff_allocator.deallocate(impl.vec, impl.capacity);
}

inline void
Dense_Row::m_swap(Dense_Row& y) {
  using std::swap;
  swap(impl.size, y.impl.size);
  swap(impl.capacity, y.impl.capacity);
  swap(impl.coeff_allocator, y.impl.coeff_allocator);
  swap(impl.vec, y.impl.vec);
  ((void) 0);
  ((void) 0);
}

inline Dense_Row&
Dense_Row::operator=(const Dense_Row& y) {

  if (this != &y && size() == y.size()) {


    for (dimension_type i = size(); i-- > 0; )
      (*this)[i] = y[i];

    return *this;
  }

  Dense_Row x(y);
  swap(*this, x);

  return *this;
}

inline Coefficient&
Dense_Row::operator[](const dimension_type k) {
  ((void) 0);
  ((void) 0);
  return impl.vec[k];
}

inline Coefficient_traits::const_reference
Dense_Row::operator[](const dimension_type k) const {
  ((void) 0);
  ((void) 0);
  return impl.vec[k];
}

inline void
Dense_Row::swap_coefficients(dimension_type i, dimension_type j) {
  std::swap((*this)[i], (*this)[j]);
}

inline void
Dense_Row::swap_coefficients(iterator i, iterator j) {
  std::swap(*i, *j);
}

inline void
Dense_Row::reset(dimension_type i) {
  (*this)[i] = 0;
}

inline Dense_Row::iterator
Dense_Row::reset(iterator itr) {
  *itr = 0;
  ++itr;
  return itr;
}

inline Dense_Row::iterator
Dense_Row::begin() {
  return iterator(*this, 0);
}

inline Dense_Row::const_iterator
Dense_Row::begin() const {
  return const_iterator(*this, 0);
}

inline Dense_Row::iterator
Dense_Row::end() {
  return iterator(*this, size());
}

inline Dense_Row::const_iterator
Dense_Row::end() const {
  return const_iterator(*this, size());
}

inline Coefficient_traits::const_reference
Dense_Row::get(dimension_type i) const {
  return (*this)[i];
}

inline Dense_Row::iterator
Dense_Row::find(dimension_type i) {
  return iterator(*this, i);
}

inline Dense_Row::const_iterator
Dense_Row::find(dimension_type i) const {
  return const_iterator(*this, i);
}

inline Dense_Row::iterator
Dense_Row::find(iterator itr, dimension_type i) {
  (void)itr;
  return iterator(*this, i);
}

inline Dense_Row::const_iterator
Dense_Row::find(const_iterator itr, dimension_type i) const {
  (void)itr;
  return const_iterator(*this, i);
}

inline Dense_Row::iterator
Dense_Row::lower_bound(dimension_type i) {
  return find(i);
}

inline Dense_Row::const_iterator
Dense_Row::lower_bound(dimension_type i) const {
  return find(i);
}

inline Dense_Row::iterator
Dense_Row::lower_bound(iterator itr, dimension_type i) {
  return find(itr, i);
}

inline Dense_Row::const_iterator
Dense_Row::lower_bound(const_iterator itr, dimension_type i) const {
  return find(itr, i);
}

inline Dense_Row::iterator
Dense_Row::insert(dimension_type i,
                  Coefficient_traits::const_reference x) {
  (*this)[i] = x;
  return find(i);
}

inline Dense_Row::iterator
Dense_Row::insert(dimension_type i) {
  return find(i);
}

inline Dense_Row::iterator
Dense_Row::insert(iterator itr, dimension_type i,
                  Coefficient_traits::const_reference x) {
  (void)itr;
  (*this)[i] = x;
  return find(i);
}

inline Dense_Row::iterator
Dense_Row::insert(iterator itr, dimension_type i) {
  (void)itr;
  return find(i);
}

inline memory_size_type
Dense_Row::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline memory_size_type
Dense_Row::total_memory_in_bytes(dimension_type capacity) const {
  return sizeof(*this) + external_memory_in_bytes(capacity);
}


inline bool
operator!=(const Dense_Row& x, const Dense_Row& y) {
  return !(x == y);
}


inline
Dense_Row::iterator::iterator()
  : row(__null), i(0) {
  ((void) 0);
}

inline
Dense_Row::iterator::iterator(Dense_Row& row1,dimension_type i1)
  : row(&row1), i(i1) {
  ((void) 0);
}

inline Coefficient&
Dense_Row::iterator::operator*() {
  ((void) 0);
  return (*row)[i];
}

inline Coefficient_traits::const_reference
Dense_Row::iterator::operator*() const {
  ((void) 0);
  return (*row)[i];
}

inline dimension_type
Dense_Row::iterator::index() const {
  return i;
}

inline Dense_Row::iterator&
Dense_Row::iterator::operator++() {
  ((void) 0);
  ++i;
  ((void) 0);
  return *this;
}

inline Dense_Row::iterator
Dense_Row::iterator::operator++(int) {
  iterator tmp(*this);
  ++(*this);
  return tmp;
}

inline Dense_Row::iterator&
Dense_Row::iterator::operator--() {
  ((void) 0);
  --i;
  ((void) 0);
  return *this;
}

inline Dense_Row::iterator
Dense_Row::iterator::operator--(int) {
  iterator tmp(*this);
  --(*this);
  return tmp;
}

inline bool
Dense_Row::iterator::operator==(const iterator& x) const {
  return (row == x.row) && (i == x.i);
}

inline bool
Dense_Row::iterator::operator!=(const iterator& x) const {
  return !(*this == x);
}

inline
Dense_Row::iterator::operator const_iterator() const {
  return const_iterator(*row, i);
}

inline bool
Dense_Row::iterator::OK() const {
  if (row == __null)
    return true;

  return (i <= row->size());
}


inline
Dense_Row::const_iterator::const_iterator()
  : row(__null), i(0) {
  ((void) 0);
}

inline
Dense_Row::const_iterator::const_iterator(const Dense_Row& row1,
                                          dimension_type i1)
  : row(&row1), i(i1) {
  ((void) 0);
}

inline Coefficient_traits::const_reference
Dense_Row::const_iterator::operator*() const {
  ((void) 0);
  return (*row)[i];
}

inline dimension_type
Dense_Row::const_iterator::index() const {
  return i;
}

inline Dense_Row::const_iterator&
Dense_Row::const_iterator::operator++() {
  ((void) 0);
  ++i;
  ((void) 0);
  return *this;
}

inline Dense_Row::const_iterator
Dense_Row::const_iterator::operator++(int) {
  const_iterator tmp(*this);
  ++(*this);
  return tmp;
}

inline Dense_Row::const_iterator&
Dense_Row::const_iterator::operator--() {
  ((void) 0);
  --i;
  ((void) 0);
  return *this;
}

inline Dense_Row::const_iterator
Dense_Row::const_iterator::operator--(int) {
  const_iterator tmp(*this);
  --(*this);
  return tmp;
}

inline bool
Dense_Row::const_iterator::operator==(const const_iterator& x) const {
  return (row == x.row) && (i == x.i);
}

inline bool
Dense_Row::const_iterator::operator!=(const const_iterator& x) const {
  return !(*this == x);
}

inline bool
Dense_Row::const_iterator::OK() const {
  if (row == __null)
    return true;

  return (i <= row->size());
}

inline void
linear_combine(Dense_Row& x, const Dense_Row& y,
               Coefficient_traits::const_reference coeff1,
               Coefficient_traits::const_reference coeff2) {
  x.linear_combine(y, coeff1, coeff2);
}

inline void
linear_combine(Dense_Row& x, const Dense_Row& y,
               Coefficient_traits::const_reference c1,
               Coefficient_traits::const_reference c2,
               dimension_type start, dimension_type end) {
  x.linear_combine(y, c1, c2, start, end);
}


inline void
swap(Dense_Row& x, Dense_Row& y) {
  x.m_swap(y);
}


inline void
iter_swap(std::vector<Dense_Row>::iterator x,
          std::vector<Dense_Row>::iterator y) {
  swap(*x, *y);
}

}
# 559 "Dense_Row_defs.hh" 2
# 1 "Dense_Row_templates.hh" 1
# 27 "Dense_Row_templates.hh"
namespace Parma_Polyhedra_Library {


template <typename Func1, typename Func2>
void
Dense_Row::combine_needs_first(const Dense_Row& y, const Func1& ,
                               const Func2& g) {
  for (dimension_type i = size(); i-- > 0; )
    g((*this)[i], y[i]);
}

template <typename Func1, typename Func2>
void
Dense_Row::combine_needs_second(const Dense_Row& y, const Func1& g,
                                const Func2& ) {
  for (dimension_type i = size(); i-- > 0; )
    g((*this)[i], y[i]);
}

template <typename Func1, typename Func2, typename Func3>
void
Dense_Row::combine(const Dense_Row& y, const Func1& , const Func2& g,
                   const Func3& ) {
  for (dimension_type i = size(); i-- > 0; )
    g((*this)[i], y[i]);
}

}
# 560 "Dense_Row_defs.hh" 2
# 31 "Expression_Adapter_defs.hh" 2
# 1 "Sparse_Row_defs.hh" 1
# 29 "Sparse_Row_defs.hh"
# 1 "CO_Tree_defs.hh" 1
# 27 "CO_Tree_defs.hh"
# 1 "CO_Tree_types.hh" 1
# 16 "CO_Tree_types.hh"
namespace Parma_Polyhedra_Library {

class CO_Tree;

}
# 28 "CO_Tree_defs.hh" 2
# 52 "CO_Tree_defs.hh"
namespace Parma_Polyhedra_Library {
# 102 "CO_Tree_defs.hh"
class CO_Tree {

public:
  class const_iterator;
  class iterator;

private:

  typedef unsigned height_t;

  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_114 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(C_Integer<height_t>::max >= ((sizeof(dimension_type)) * static_cast<std::size_t>(8)))>) };



  class tree_iterator;
# 127 "CO_Tree_defs.hh"
  dimension_type dfs_index(const_iterator itr) const;
# 138 "CO_Tree_defs.hh"
  dimension_type dfs_index(iterator itr) const;

public:






  typedef Coefficient data_type;
  typedef Coefficient_traits::const_reference data_type_const_reference;







  class const_iterator {
  private:
  public:

    typedef std::bidirectional_iterator_tag iterator_category;
    typedef const data_type value_type;
    typedef ptrdiff_t difference_type;
    typedef value_type* pointer;
    typedef data_type_const_reference reference;





    explicit const_iterator();
# 179 "CO_Tree_defs.hh"
    explicit const_iterator(const CO_Tree& tree);
# 194 "CO_Tree_defs.hh"
    const_iterator(const CO_Tree& tree, dimension_type i);
# 203 "CO_Tree_defs.hh"
    const_iterator(const const_iterator& itr);
# 212 "CO_Tree_defs.hh"
    const_iterator(const iterator& itr);
# 221 "CO_Tree_defs.hh"
    void m_swap(const_iterator& itr);
# 230 "CO_Tree_defs.hh"
    const_iterator& operator=(const const_iterator& itr);
# 239 "CO_Tree_defs.hh"
    const_iterator& operator=(const iterator& itr);





    const_iterator& operator++();





    const_iterator& operator--();





    const_iterator operator++(int);





    const_iterator operator--(int);


    data_type_const_reference operator*() const;





    dimension_type index() const;






    bool operator==(const const_iterator& x) const;






    bool operator!=(const const_iterator& x) const;

  private:

    bool OK() const;


    const dimension_type* current_index;


    const data_type* current_data;






    friend dimension_type CO_Tree::dfs_index(const_iterator itr) const;
  };







  class iterator {
  public:

    typedef std::bidirectional_iterator_tag iterator_category;
    typedef data_type value_type;
    typedef ptrdiff_t difference_type;
    typedef value_type* pointer;
    typedef value_type& reference;





    iterator();
# 334 "CO_Tree_defs.hh"
    explicit iterator(CO_Tree& tree);
# 349 "CO_Tree_defs.hh"
    iterator(CO_Tree& tree, dimension_type i);
# 361 "CO_Tree_defs.hh"
    explicit iterator(const tree_iterator& itr);
# 370 "CO_Tree_defs.hh"
    iterator(const iterator& itr);
# 379 "CO_Tree_defs.hh"
    void m_swap(iterator& itr);
# 388 "CO_Tree_defs.hh"
    iterator& operator=(const iterator& itr);
# 397 "CO_Tree_defs.hh"
    iterator& operator=(const tree_iterator& itr);





    iterator& operator++();





    iterator& operator--();





    iterator operator++(int);





    iterator operator--(int);


    data_type& operator*();


    data_type_const_reference operator*() const;





    dimension_type index() const;






    bool operator==(const iterator& x) const;






    bool operator!=(const iterator& x) const;

  private:

    bool OK() const;


    const dimension_type* current_index;


    data_type* current_data;






    friend const_iterator& const_iterator::operator=(const iterator&);
    friend dimension_type CO_Tree::dfs_index(iterator itr) const;
  };





  CO_Tree();
# 481 "CO_Tree_defs.hh"
  CO_Tree(const CO_Tree& y);
# 500 "CO_Tree_defs.hh"
  template <typename Iterator>
  CO_Tree(Iterator i, dimension_type n);
# 510 "CO_Tree_defs.hh"
  CO_Tree& operator=(const CO_Tree& y);





  void clear();





  ~CO_Tree();





  bool empty() const;





  dimension_type size() const;


  static dimension_type max_size();


  void dump_tree() const;





  dimension_type external_memory_in_bytes() const;
# 565 "CO_Tree_defs.hh"
  iterator insert(dimension_type key);
# 586 "CO_Tree_defs.hh"
  iterator insert(dimension_type key, data_type_const_reference data);
# 614 "CO_Tree_defs.hh"
  iterator insert(iterator itr, dimension_type key);
# 644 "CO_Tree_defs.hh"
  iterator insert(iterator itr, dimension_type key,
                  data_type_const_reference data);
# 660 "CO_Tree_defs.hh"
  iterator erase(dimension_type key);
# 675 "CO_Tree_defs.hh"
  iterator erase(iterator itr);
# 689 "CO_Tree_defs.hh"
  void erase_element_and_shift_left(dimension_type key);
# 702 "CO_Tree_defs.hh"
  void increase_keys_from(dimension_type key, dimension_type n);
# 711 "CO_Tree_defs.hh"
  void fast_shift(dimension_type i, iterator itr);
# 722 "CO_Tree_defs.hh"
  void m_swap(CO_Tree& x);





  iterator begin();
# 739 "CO_Tree_defs.hh"
  const iterator& end();


  const_iterator begin() const;


  const const_iterator& end() const;





  const_iterator cbegin() const;
# 762 "CO_Tree_defs.hh"
  const const_iterator& cend() const;
# 776 "CO_Tree_defs.hh"
  iterator bisect(dimension_type key);
# 790 "CO_Tree_defs.hh"
  const_iterator bisect(dimension_type key) const;
# 814 "CO_Tree_defs.hh"
  iterator bisect_in(iterator first, iterator last, dimension_type key);
# 838 "CO_Tree_defs.hh"
  const_iterator bisect_in(const_iterator first, const_iterator last,
                           dimension_type key) const;
# 859 "CO_Tree_defs.hh"
  iterator bisect_near(iterator hint, dimension_type key);
# 879 "CO_Tree_defs.hh"
  const_iterator bisect_near(const_iterator hint, dimension_type key) const;

private:
# 904 "CO_Tree_defs.hh"
  dimension_type bisect_in(dimension_type first, dimension_type last,
                           dimension_type key) const;
# 928 "CO_Tree_defs.hh"
  dimension_type bisect_near(dimension_type hint, dimension_type key) const;
# 953 "CO_Tree_defs.hh"
  tree_iterator insert_precise(dimension_type key,
                               data_type_const_reference data,
                               tree_iterator itr);
# 964 "CO_Tree_defs.hh"
  tree_iterator insert_precise_aux(dimension_type key,
                                   data_type_const_reference data,
                                   tree_iterator itr);
# 983 "CO_Tree_defs.hh"
  void insert_in_empty_tree(dimension_type key,
                            data_type_const_reference data);
# 999 "CO_Tree_defs.hh"
  iterator erase(tree_iterator itr);
# 1008 "CO_Tree_defs.hh"
  void init(dimension_type n);
# 1017 "CO_Tree_defs.hh"
  void destroy();


  bool structure_OK() const;


  bool OK() const;
# 1032 "CO_Tree_defs.hh"
  static unsigned integer_log2(dimension_type n);
# 1050 "CO_Tree_defs.hh"
  static bool is_less_than_ratio(dimension_type numer, dimension_type denom,
                                 dimension_type ratio);
# 1070 "CO_Tree_defs.hh"
  static bool is_greater_than_ratio(dimension_type numer, dimension_type denom,
                                    dimension_type ratio);






  static void dump_subtree(tree_iterator itr);
# 1087 "CO_Tree_defs.hh"
  void rebuild_bigger_tree();
# 1099 "CO_Tree_defs.hh"
  void rebuild_smaller_tree();
# 1108 "CO_Tree_defs.hh"
  void refresh_cached_iterators();
# 1132 "CO_Tree_defs.hh"
  tree_iterator rebalance(tree_iterator itr, dimension_type key,
                          data_type_const_reference value);
# 1159 "CO_Tree_defs.hh"
  dimension_type compact_elements_in_the_rightmost_end(
    dimension_type last_in_subtree, dimension_type subtree_size,
    dimension_type key, data_type_const_reference value,
    bool add_element);
# 1190 "CO_Tree_defs.hh"
  void redistribute_elements_in_subtree(dimension_type root_index,
                                        dimension_type subtree_size,
                                        dimension_type last_used,
                                        dimension_type key,
                                        data_type_const_reference value,
                                        bool add_element);
# 1207 "CO_Tree_defs.hh"
  void move_data_from(CO_Tree& tree);
# 1220 "CO_Tree_defs.hh"
  void copy_data_from(const CO_Tree& tree);
# 1230 "CO_Tree_defs.hh"
  static dimension_type count_used_in_subtree(tree_iterator itr);
# 1248 "CO_Tree_defs.hh"
  static void move_data_element(data_type& to, data_type& from);





  static const dimension_type max_density_percent = 91;





  static const dimension_type min_density_percent = 38;
# 1270 "CO_Tree_defs.hh"
  static const dimension_type min_leaf_density_percent = 1;





  static const dimension_type unused_index = C_Integer<dimension_type>::max;





  iterator cached_end;





  const_iterator cached_const_end;


  height_t max_depth;
# 1301 "CO_Tree_defs.hh"
  dimension_type* indexes;


  std::allocator<data_type> data_allocator;
# 1315 "CO_Tree_defs.hh"
  data_type* data;






  dimension_type reserved_size;


  dimension_type size_;
};

class CO_Tree::tree_iterator {

public:
# 1340 "CO_Tree_defs.hh"
  explicit tree_iterator(CO_Tree& tree);
# 1352 "CO_Tree_defs.hh"
  tree_iterator(CO_Tree& tree, dimension_type i);
# 1364 "CO_Tree_defs.hh"
  tree_iterator(const iterator& itr, CO_Tree& tree);






  tree_iterator& operator=(const tree_iterator& itr);






  tree_iterator& operator=(const iterator& itr);






  bool operator==(const tree_iterator& itr) const;






  bool operator!=(const tree_iterator& itr) const;







  void get_root();





  void get_left_child();





  void get_right_child();





  void get_parent();
# 1432 "CO_Tree_defs.hh"
  void go_down_searching_key(dimension_type key);







  void follow_left_children_with_value();







  void follow_right_children_with_value();





  bool is_root() const;





  bool is_right_child() const;





  bool is_leaf() const;


  data_type& operator*();


  Coefficient_traits::const_reference operator*() const;





  dimension_type& index();





  dimension_type index() const;






  dimension_type key() const;


  CO_Tree& tree;





  dimension_type dfs_index() const;
# 1511 "CO_Tree_defs.hh"
  dimension_type get_offset() const;





  height_t depth() const;

private:

  bool OK() const;


  dimension_type i;
# 1533 "CO_Tree_defs.hh"
  dimension_type offset;
};





void swap(CO_Tree& x, CO_Tree& y);





void swap(CO_Tree::const_iterator& x, CO_Tree::const_iterator& y);





void swap(CO_Tree::iterator& x, CO_Tree::iterator& y);

}

# 1 "CO_Tree_inlines.hh" 1
# 27 "CO_Tree_inlines.hh"
namespace Parma_Polyhedra_Library {

inline dimension_type
CO_Tree::dfs_index(const_iterator itr) const {
  ((void) 0);
  ((void) 0);
  ((void) 0);
  const ptrdiff_t index = itr.current_index - indexes;
  return static_cast<dimension_type>(index);
}

inline dimension_type
CO_Tree::dfs_index(iterator itr) const {
  ((void) 0);
  ((void) 0);
  ((void) 0);
  const ptrdiff_t index = itr.current_index - indexes;
  return static_cast<dimension_type>(index);
}

inline
CO_Tree::CO_Tree() {
  init(0);
  ((void) 0);
}

inline
CO_Tree::CO_Tree(const CO_Tree& y) {
  ((void) 0);
  data_allocator = y.data_allocator;
  init(y.reserved_size);
  copy_data_from(y);
}

inline CO_Tree&
CO_Tree::operator=(const CO_Tree& y) {
  if (this != &y) {
    destroy();
    data_allocator = y.data_allocator;
    init(y.reserved_size);
    copy_data_from(y);
  }
  return *this;
}

inline void
CO_Tree::clear() {
  *this = CO_Tree();
}

inline
CO_Tree::~CO_Tree() {

  destroy();
}

inline bool
CO_Tree::empty() const {
  return size_ == 0;
}

inline dimension_type
CO_Tree::size() const {
  return size_;
}

inline dimension_type
CO_Tree::max_size() {
  return C_Integer<dimension_type>::max/100;
}

inline void
CO_Tree::dump_tree() const {
  if (empty())
    std::cout << "(empty tree)" << std::endl;
  else
    dump_subtree(tree_iterator(*const_cast<CO_Tree*>(this)));
}

inline CO_Tree::iterator
CO_Tree::insert(const dimension_type key) {
  if (empty())
    return insert(key, Coefficient_zero());
  else {
    tree_iterator itr(*this);
    itr.go_down_searching_key(key);
    if (itr.index() == key)
      return iterator(itr);
    else
      return iterator(insert_precise(key, Coefficient_zero(), itr));
  }
}

inline CO_Tree::iterator
CO_Tree::insert(dimension_type key, data_type_const_reference data1) {
  if (empty()) {
    insert_in_empty_tree(key, data1);
    tree_iterator itr(*this);
    ((void) 0);
    return iterator(itr);
  }
  else {
    tree_iterator itr(*this);
    itr.go_down_searching_key(key);
    return iterator(insert_precise(key, data1, itr));
  }
}

inline CO_Tree::iterator
CO_Tree::erase(dimension_type key) {
  ((void) 0);

  if (empty())
    return end();

  tree_iterator itr(*this);
  itr.go_down_searching_key(key);

  if (itr.index() == key)
    return erase(itr);

  iterator result(itr);
  if (result.index() < key)
    ++result;

  ((void) 0);






  return result;
}

inline CO_Tree::iterator
CO_Tree::erase(iterator itr) {
  ((void) 0);
  return erase(tree_iterator(itr, *this));
}

inline void
CO_Tree::m_swap(CO_Tree& x) {
  using std::swap;
  swap(max_depth, x.max_depth);
  swap(indexes, x.indexes);
  swap(data_allocator, x.data_allocator);
  swap(data, x.data);
  swap(reserved_size, x.reserved_size);
  swap(size_, x.size_);


  refresh_cached_iterators();
  x.refresh_cached_iterators();
  ((void) 0);
  ((void) 0);
}

inline CO_Tree::iterator
CO_Tree::begin() {
  return iterator(*this);
}

inline const CO_Tree::iterator&
CO_Tree::end() {
  return cached_end;
}

inline CO_Tree::const_iterator
CO_Tree::begin() const {
  return const_iterator(*this);
}

inline const CO_Tree::const_iterator&
CO_Tree::end() const {
  return cached_const_end;
}

inline CO_Tree::const_iterator
CO_Tree::cbegin() const {
  return const_iterator(*this);
}

inline const CO_Tree::const_iterator&
CO_Tree::cend() const {
  return cached_const_end;
}

inline CO_Tree::iterator
CO_Tree::bisect(dimension_type key) {
  if (empty())
    return end();
  iterator last = end();
  --last;
  return bisect_in(begin(), last, key);
}

inline CO_Tree::const_iterator
CO_Tree::bisect(dimension_type key) const {
  if (empty())
    return end();
  const_iterator last = end();
  --last;
  return bisect_in(begin(), last, key);
}

inline CO_Tree::iterator
CO_Tree::bisect_in(iterator first, iterator last, dimension_type key) {
  ((void) 0);
  ((void) 0);
  const dimension_type index
    = bisect_in(dfs_index(first), dfs_index(last), key);
  return iterator(*this, index);
}

inline CO_Tree::const_iterator
CO_Tree::bisect_in(const_iterator first, const_iterator last,
                   dimension_type key) const {
  ((void) 0);
  ((void) 0);
  const dimension_type index
    = bisect_in(dfs_index(first), dfs_index(last), key);
  return const_iterator(*this, index);
}

inline CO_Tree::iterator
CO_Tree::bisect_near(iterator hint, dimension_type key) {
  if (hint == end())
    return bisect(key);
  const dimension_type index
    = bisect_near(dfs_index(hint), key);
  return iterator(*this, index);
}

inline CO_Tree::const_iterator
CO_Tree::bisect_near(const_iterator hint, dimension_type key) const {
  if (hint == end())
    return bisect(key);
  const dimension_type index = bisect_near(dfs_index(hint), key);
  return const_iterator(*this, index);
}

inline void
CO_Tree::fast_shift(dimension_type i, iterator itr) {
  ((void) 0);
  ((void) 0);
  indexes[dfs_index(itr)] = i;
  ((void) 0);
}

inline void
CO_Tree::insert_in_empty_tree(dimension_type key,
                              data_type_const_reference data1) {
  ((void) 0);
  rebuild_bigger_tree();
  tree_iterator itr(*this);
  ((void) 0);
  new (&(*itr)) data_type(data1);


  itr.index() = key;
  ++size_;

  ((void) 0);
}

inline bool
CO_Tree::is_less_than_ratio(dimension_type numer, dimension_type denom,
                            dimension_type ratio) {
  ((void) 0);

  ((void) 0);
  ((void) 0);
  return 100*numer < ratio*denom;
}

inline bool
CO_Tree::is_greater_than_ratio(dimension_type numer, dimension_type denom,
                               dimension_type ratio) {
  ((void) 0);

  ((void) 0);
  ((void) 0);
  return 100*numer > ratio*denom;
}

inline void
CO_Tree::rebuild_smaller_tree() {
  ((void) 0);
  CO_Tree new_tree;
  new_tree.init(reserved_size / 2);
  new_tree.move_data_from(*this);
  m_swap(new_tree);
  ((void) 0);
  ((void) 0);
}

inline void
CO_Tree::refresh_cached_iterators() {
  cached_end = iterator(*this, reserved_size + 1);
  cached_const_end = const_iterator(*this, reserved_size + 1);
}

inline void
CO_Tree::move_data_element(data_type& to, data_type& from) {






  std::memcpy(&to, &from, sizeof(data_type));
}


inline
CO_Tree::const_iterator::const_iterator()
  : current_index(0), current_data(0) {



  ((void) 0);
}

inline
CO_Tree::const_iterator::const_iterator(const CO_Tree& tree1)
  : current_index(&(tree1.indexes[1])), current_data(&(tree1.data[1])) {



  if (!tree1.empty())
    while (*current_index == unused_index) {
      ++current_index;
      ++current_data;
    }
  ((void) 0);
}

inline
CO_Tree::const_iterator::const_iterator(const CO_Tree& tree1,
                                        dimension_type i)
  : current_index(&(tree1.indexes[i])), current_data(&(tree1.data[i])) {



  ((void) 0);
  ((void) 0);
  ((void) 0);
  ((void) 0);
}

inline
CO_Tree::const_iterator::const_iterator(const const_iterator& itr2) {
  (*this) = itr2;
  ((void) 0);
}

inline
CO_Tree::const_iterator::const_iterator(const iterator& itr2) {
  (*this) = itr2;
  ((void) 0);
}

inline void
CO_Tree::const_iterator::m_swap(const_iterator& itr) {
  using std::swap;
  swap(current_data, itr.current_data);
  swap(current_index, itr.current_index);



  ((void) 0);
  ((void) 0);
}

inline CO_Tree::const_iterator&
CO_Tree::const_iterator::operator=(const const_iterator& itr2) {
  current_index = itr2.current_index;
  current_data = itr2.current_data;



  ((void) 0);
  return *this;
}

inline CO_Tree::const_iterator&
CO_Tree::const_iterator::operator=(const iterator& itr2) {
  current_index = itr2.current_index;
  current_data = itr2.current_data;



  ((void) 0);
  return *this;
}

inline CO_Tree::const_iterator&
CO_Tree::const_iterator::operator++() {
  ((void) 0);
  ((void) 0);



  ++current_index;
  ++current_data;
  while (*current_index == unused_index) {
    ++current_index;
    ++current_data;
  }
  ((void) 0);
  return *this;
}

inline CO_Tree::const_iterator&
CO_Tree::const_iterator::operator--() {
  ((void) 0);
  ((void) 0);
  --current_index;
  --current_data;
  while (*current_index == unused_index) {
    --current_index;
    --current_data;
  }
  ((void) 0);
  return *this;
}

inline CO_Tree::const_iterator
CO_Tree::const_iterator::operator++(int) {
  const_iterator itr(*this);
  ++(*this);
  return itr;
}

inline CO_Tree::const_iterator
CO_Tree::const_iterator::operator--(int) {
  const_iterator itr(*this);
  --(*this);
  return itr;
}

inline Coefficient_traits::const_reference
CO_Tree::const_iterator::operator*() const {
  ((void) 0);
  ((void) 0);
  ((void) 0);



  return *current_data;
}

inline dimension_type
CO_Tree::const_iterator::index() const {
  ((void) 0);
  ((void) 0);
  ((void) 0);



  return *current_index;
}

inline bool
CO_Tree::const_iterator::operator==(const const_iterator& x) const {
  ((void) 0);

  ((void) 0);
  return (current_index == x.current_index);
}

inline bool
CO_Tree::const_iterator::operator!=(const const_iterator& x) const {
  return !(*this == x);
}


inline
CO_Tree::iterator::iterator()
  : current_index(0), current_data(0) {



  ((void) 0);
}

inline
CO_Tree::iterator::iterator(CO_Tree& tree1)
  : current_index(&(tree1.indexes[1])), current_data(&(tree1.data[1])) {



  if (!tree1.empty())
    while (*current_index == unused_index) {
      ++current_index;
      ++current_data;
    }
  ((void) 0);
}

inline
CO_Tree::iterator::iterator(CO_Tree& tree1, dimension_type i)
  : current_index(&(tree1.indexes[i])), current_data(&(tree1.data[i])) {



  ((void) 0);
  ((void) 0);
  ((void) 0);
  ((void) 0);
}

inline
CO_Tree::iterator::iterator(const tree_iterator& itr) {
  *this = itr;
  ((void) 0);
}

inline
CO_Tree::iterator::iterator(const iterator& itr2) {
  (*this) = itr2;
  ((void) 0);
}

inline void
CO_Tree::iterator::m_swap(iterator& itr) {
  using std::swap;
  swap(current_data, itr.current_data);
  swap(current_index, itr.current_index);



  ((void) 0);
  ((void) 0);
}

inline CO_Tree::iterator&
CO_Tree::iterator::operator=(const tree_iterator& itr) {
  current_index = &(itr.tree.indexes[itr.dfs_index()]);
  current_data = &(itr.tree.data[itr.dfs_index()]);



  ((void) 0);
  return *this;
}

inline CO_Tree::iterator&
CO_Tree::iterator::operator=(const iterator& itr2) {
  current_index = itr2.current_index;
  current_data = itr2.current_data;



  ((void) 0);
  return *this;
}

inline CO_Tree::iterator&
CO_Tree::iterator::operator++() {
  ((void) 0);
  ((void) 0);



  ++current_index;
  ++current_data;
  while (*current_index == unused_index) {
    ++current_index;
    ++current_data;
  }

  ((void) 0);
  return *this;
}

inline CO_Tree::iterator&
CO_Tree::iterator::operator--() {
  ((void) 0);
  ((void) 0);
  --current_index;
  --current_data;
  while (*current_index == unused_index) {
    --current_index;
    --current_data;
  }

  ((void) 0);
  return *this;
}

inline CO_Tree::iterator
CO_Tree::iterator::operator++(int) {
  iterator itr(*this);
  ++(*this);
  return itr;
}

inline CO_Tree::iterator
CO_Tree::iterator::operator--(int) {
  iterator itr(*this);
  --(*this);
  return itr;
}

inline CO_Tree::data_type&
CO_Tree::iterator::operator*() {
  ((void) 0);
  ((void) 0);
  ((void) 0);



  return *current_data;
}

inline Coefficient_traits::const_reference
CO_Tree::iterator::operator*() const {
  ((void) 0);
  ((void) 0);
  ((void) 0);



  return *current_data;
}

inline dimension_type
CO_Tree::iterator::index() const {
  ((void) 0);
  ((void) 0);
  ((void) 0);



  return *current_index;
}

inline bool
CO_Tree::iterator::operator==(const iterator& x) const {
  ((void) 0);

  ((void) 0);
  return (current_index == x.current_index);
}

inline bool
CO_Tree::iterator::operator!=(const iterator& x) const {
  return !(*this == x);
}


inline
CO_Tree::tree_iterator::tree_iterator(CO_Tree& tree1)
  : tree(tree1) {
  ((void) 0);
  get_root();
  ((void) 0);
}

inline
CO_Tree::tree_iterator::tree_iterator(CO_Tree& tree1, dimension_type i1)
  : tree(tree1) {
  ((void) 0);
  ((void) 0);
  i = i1;
  offset = least_significant_one_mask(i);
  ((void) 0);
}

inline
CO_Tree::tree_iterator::tree_iterator(const iterator& itr, CO_Tree& tree1)
  : tree(tree1) {
  ((void) 0);
  *this = itr;
  ((void) 0);
}

inline CO_Tree::tree_iterator&
CO_Tree::tree_iterator::operator=(const tree_iterator& itr) {
  ((void) 0);
  i = itr.i;
  offset = itr.offset;
  return *this;
}

inline CO_Tree::tree_iterator&
CO_Tree::tree_iterator::operator=(const iterator& itr) {
  ((void) 0);
  i = tree.dfs_index(itr);
  offset = least_significant_one_mask(i);
  return *this;
}

inline bool
CO_Tree::tree_iterator::operator==(const tree_iterator& itr) const {
  return i == itr.i;
}

inline bool
CO_Tree::tree_iterator::operator!=(const tree_iterator& itr) const {
  return !(*this == itr);
}

inline void
CO_Tree::tree_iterator::get_root() {
  i = tree.reserved_size / 2 + 1;
  offset = i;
  ((void) 0);
}

inline void
CO_Tree::tree_iterator::get_left_child() {
  ((void) 0);
  ((void) 0);
  offset /= 2;
  i -= offset;
  ((void) 0);
}

inline void
CO_Tree::tree_iterator::get_right_child() {
  ((void) 0);
  ((void) 0);
  offset /= 2;
  i += offset;
  ((void) 0);
}

inline void
CO_Tree::tree_iterator::get_parent() {
  ((void) 0);
  ((void) 0);
  i &= ~offset;
  offset *= 2;
  i |= offset;
  ((void) 0);
}

inline void
CO_Tree::tree_iterator::follow_left_children_with_value() {
  ((void) 0);
  const dimension_type* p = tree.indexes;
  p += i;
  p -= (offset - 1);
  while (*p == unused_index)
    ++p;
  const ptrdiff_t distance = p - tree.indexes;
  ((void) 0);
  i = static_cast<dimension_type>(distance);
  offset = least_significant_one_mask(i);
  ((void) 0);
}

inline void
CO_Tree::tree_iterator::follow_right_children_with_value() {
  ((void) 0);
  const dimension_type* p = tree.indexes;
  p += i;
  p += (offset - 1);
  while (*p == unused_index)
    --p;
  const ptrdiff_t distance = p - tree.indexes;
  ((void) 0);
  i = static_cast<dimension_type>(distance);
  offset = least_significant_one_mask(i);
  ((void) 0);
}

inline bool
CO_Tree::tree_iterator::is_root() const {

  ((void) 0);
  return offset == (tree.reserved_size / 2 + 1);
}

inline bool
CO_Tree::tree_iterator::is_right_child() const {
  if (is_root())
    return false;
  return (i & (2*offset)) != 0;
}

inline bool
CO_Tree::tree_iterator::is_leaf() const {
  return offset == 1;
}

inline CO_Tree::data_type&
CO_Tree::tree_iterator::operator*() {
  return tree.data[i];
}

inline Coefficient_traits::const_reference
CO_Tree::tree_iterator::operator*() const {
  return tree.data[i];
}

inline dimension_type&
CO_Tree::tree_iterator::index() {
  return tree.indexes[i];
}

inline dimension_type
CO_Tree::tree_iterator::index() const {
  return tree.indexes[i];
}

inline dimension_type
CO_Tree::tree_iterator::dfs_index() const {
  return i;
}

inline dimension_type
CO_Tree::tree_iterator::get_offset() const {
  return offset;
}

inline CO_Tree::height_t
CO_Tree::tree_iterator::depth() const {
  return integer_log2((tree.reserved_size + 1) / offset);
}

inline void
swap(CO_Tree& x, CO_Tree& y) {
  x.m_swap(y);
}

inline void
swap(CO_Tree::const_iterator& x, CO_Tree::const_iterator& y) {
  x.m_swap(y);
}

inline void
swap(CO_Tree::iterator& x, CO_Tree::iterator& y) {
  x.m_swap(y);
}

}
# 1557 "CO_Tree_defs.hh" 2
# 1 "CO_Tree_templates.hh" 1
# 27 "CO_Tree_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename Iterator>
CO_Tree::CO_Tree(Iterator i, dimension_type n) {

  if (n == 0) {
    init(0);
    ((void) 0);
    return;
  }

  const dimension_type new_max_depth = integer_log2(n) + 1;
  reserved_size = (static_cast<dimension_type>(1) << new_max_depth) - 1;

  if (is_greater_than_ratio(n, reserved_size, max_density_percent)
      && reserved_size != 3)
    reserved_size = reserved_size*2 + 1;

  init(reserved_size);

  tree_iterator root(*this);
# 56 "CO_Tree_templates.hh"
  static std::pair<dimension_type, signed char>
    stack[4U * ((sizeof(dimension_type)) * static_cast<std::size_t>(8)) + 1U];

  dimension_type stack_first_empty = 0;
# 70 "CO_Tree_templates.hh"
  stack[0].first = n;
  stack[0].second = 3;
  ++stack_first_empty;

  while (stack_first_empty != 0) {







    const dimension_type top_n = stack[stack_first_empty - 1].first;
    const signed char top_operation = stack[stack_first_empty - 1].second;

    switch (top_operation) {

    case 0:
      root.get_parent();
      --stack_first_empty;
      continue;

    case 1:
      root.get_left_child();
      break;

    case 2:
      root.get_right_child();
      break;
# 107 "CO_Tree_templates.hh"
    }



    if (top_n == 0) {
      --stack_first_empty;
    }
    else {
      if (top_n == 1) {
        ((void) 0);
        root.index() = i.index();
        new (&(*root)) data_type(*i);
        ++i;
        --stack_first_empty;
      }
      else {
        ((void) 0);

        const dimension_type half = (top_n + 1) / 2;
        stack[stack_first_empty - 1].second = 0;
        stack[stack_first_empty ] = std::make_pair(top_n - half, 2);
        stack[stack_first_empty + 1] = std::make_pair(1, 3);
        stack[stack_first_empty + 2].second = 0;
        stack[stack_first_empty + 3] = std::make_pair(half - 1, 1);
        stack_first_empty += 4;
      }
    }
  }
  size_ = n;
  ((void) 0);
}

}
# 1558 "CO_Tree_defs.hh" 2
# 30 "Sparse_Row_defs.hh" 2
# 58 "Sparse_Row_defs.hh"
class Parma_Polyhedra_Library::Sparse_Row {

public:






  typedef CO_Tree::iterator iterator;






  typedef CO_Tree::const_iterator const_iterator;
# 85 "Sparse_Row_defs.hh"
  explicit Sparse_Row(dimension_type n = 0);
# 99 "Sparse_Row_defs.hh"
  Sparse_Row(dimension_type n, dimension_type capacity);






  Sparse_Row(const Sparse_Row& y, dimension_type capacity);





  Sparse_Row(const Sparse_Row& y, dimension_type sz, dimension_type capacity);
# 122 "Sparse_Row_defs.hh"
  explicit Sparse_Row(const Dense_Row& row);





  Sparse_Row(const Dense_Row& y, dimension_type sz, dimension_type capacity);

  Sparse_Row& operator=(const Dense_Row& row);
# 139 "Sparse_Row_defs.hh"
  void m_swap(Sparse_Row& x);





  dimension_type size() const;







  dimension_type num_stored_elements() const;
# 164 "Sparse_Row_defs.hh"
  void resize(dimension_type n);
# 176 "Sparse_Row_defs.hh"
  void expand_within_capacity(dimension_type n);
# 189 "Sparse_Row_defs.hh"
  void shrink(dimension_type n);
# 205 "Sparse_Row_defs.hh"
  void delete_element_and_shift(dimension_type i);
# 226 "Sparse_Row_defs.hh"
  void add_zeroes_and_shift(dimension_type n, dimension_type i);





  iterator begin();
# 243 "Sparse_Row_defs.hh"
  const iterator& end();


  const_iterator begin() const;


  const const_iterator& end() const;





  const_iterator cbegin() const;
# 266 "Sparse_Row_defs.hh"
  const const_iterator& cend() const;


  static dimension_type max_size();





  void clear();
# 293 "Sparse_Row_defs.hh"
  Coefficient& operator[](dimension_type i);





  Coefficient_traits::const_reference operator[](dimension_type i) const;
# 311 "Sparse_Row_defs.hh"
  Coefficient_traits::const_reference get(dimension_type i) const;
# 323 "Sparse_Row_defs.hh"
  iterator find(dimension_type i);
# 341 "Sparse_Row_defs.hh"
  iterator find(iterator itr, dimension_type i);
# 353 "Sparse_Row_defs.hh"
  const_iterator find(dimension_type i) const;
# 371 "Sparse_Row_defs.hh"
  const_iterator find(const_iterator itr, dimension_type i) const;
# 387 "Sparse_Row_defs.hh"
  iterator lower_bound(dimension_type i);
# 409 "Sparse_Row_defs.hh"
  iterator lower_bound(iterator itr, dimension_type i);
# 426 "Sparse_Row_defs.hh"
  const_iterator lower_bound(dimension_type i) const;
# 448 "Sparse_Row_defs.hh"
  const_iterator lower_bound(const_iterator itr, dimension_type i) const;
# 465 "Sparse_Row_defs.hh"
  iterator insert(dimension_type i, Coefficient_traits::const_reference x);
# 488 "Sparse_Row_defs.hh"
  iterator insert(iterator itr, dimension_type i,
                  Coefficient_traits::const_reference x);
# 503 "Sparse_Row_defs.hh"
  iterator insert(dimension_type i);
# 523 "Sparse_Row_defs.hh"
  iterator insert(iterator itr, dimension_type i);
# 537 "Sparse_Row_defs.hh"
  void swap_coefficients(dimension_type i, dimension_type j);
# 547 "Sparse_Row_defs.hh"
  void fast_swap(dimension_type i, iterator itr);
# 559 "Sparse_Row_defs.hh"
  void swap_coefficients(iterator i, iterator j);
# 574 "Sparse_Row_defs.hh"
  iterator reset(iterator i);
# 592 "Sparse_Row_defs.hh"
  iterator reset(iterator first, iterator last);
# 606 "Sparse_Row_defs.hh"
  void reset(dimension_type i);
# 621 "Sparse_Row_defs.hh"
  void reset_after(dimension_type i);
# 630 "Sparse_Row_defs.hh"
  void normalize();
# 655 "Sparse_Row_defs.hh"
  template <typename Func1, typename Func2>
  void combine_needs_first(const Sparse_Row& y,
                           const Func1& f, const Func2& g);
# 683 "Sparse_Row_defs.hh"
  template <typename Func1, typename Func2>
  void combine_needs_second(const Sparse_Row& y,
                            const Func1& g, const Func2& h);
# 715 "Sparse_Row_defs.hh"
  template <typename Func1, typename Func2, typename Func3>
  void combine(const Sparse_Row& y,
               const Func1& f, const Func2& g, const Func3& h);
# 744 "Sparse_Row_defs.hh"
  void linear_combine(const Sparse_Row& y,
                      Coefficient_traits::const_reference coeff1,
                      Coefficient_traits::const_reference coeff2);







  void linear_combine(const Sparse_Row& y,
                      Coefficient_traits::const_reference c1,
                      Coefficient_traits::const_reference c2,
                      dimension_type start, dimension_type end);

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);





  memory_size_type external_memory_in_bytes() const;
# 783 "Sparse_Row_defs.hh"
  memory_size_type external_memory_in_bytes(dimension_type capacity) const;





  memory_size_type total_memory_in_bytes() const;
# 800 "Sparse_Row_defs.hh"
  memory_size_type total_memory_in_bytes(dimension_type capacity) const;


  bool OK() const;
# 812 "Sparse_Row_defs.hh"
  bool OK(dimension_type capacity) const;

private:

  CO_Tree tree;





  dimension_type size_;
};


namespace Parma_Polyhedra_Library {





void swap(Parma_Polyhedra_Library::Sparse_Row& x,
          Parma_Polyhedra_Library::Sparse_Row& y);

void swap(Parma_Polyhedra_Library::Sparse_Row& x,
          Parma_Polyhedra_Library::Dense_Row& y);

void swap(Parma_Polyhedra_Library::Dense_Row& x,
          Parma_Polyhedra_Library::Sparse_Row& y);





bool operator==(const Sparse_Row& x, const Sparse_Row& y);





bool operator!=(const Sparse_Row& x, const Sparse_Row& y);

bool operator==(const Dense_Row& x, const Sparse_Row& y);
bool operator!=(const Dense_Row& x, const Sparse_Row& y);

bool operator==(const Sparse_Row& x, const Dense_Row& y);
bool operator!=(const Sparse_Row& x, const Dense_Row& y);






void linear_combine(Sparse_Row& x, const Dense_Row& y,
                    Coefficient_traits::const_reference coeff1,
                    Coefficient_traits::const_reference coeff2);
# 876 "Sparse_Row_defs.hh"
void linear_combine(Sparse_Row& x, const Dense_Row& y,
                    Coefficient_traits::const_reference c1,
                    Coefficient_traits::const_reference c2,
                    dimension_type start, dimension_type end);






void linear_combine(Dense_Row& x, const Sparse_Row& y,
                    Coefficient_traits::const_reference coeff1,
                    Coefficient_traits::const_reference coeff2);
# 898 "Sparse_Row_defs.hh"
void linear_combine(Dense_Row& x, const Sparse_Row& y,
                    Coefficient_traits::const_reference c1,
                    Coefficient_traits::const_reference c2,
                    dimension_type start, dimension_type end);






void linear_combine(Sparse_Row& x, const Sparse_Row& y,
                    Coefficient_traits::const_reference coeff1,
                    Coefficient_traits::const_reference coeff2);
# 920 "Sparse_Row_defs.hh"
void linear_combine(Sparse_Row& x, const Sparse_Row& y,
                    Coefficient_traits::const_reference c1,
                    Coefficient_traits::const_reference c2,
                    dimension_type start, dimension_type end);

}

# 1 "Sparse_Row_inlines.hh" 1
# 29 "Sparse_Row_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Sparse_Row::Sparse_Row(dimension_type n)
  : size_(n) {
  ((void) 0);
}

inline
Sparse_Row::Sparse_Row(dimension_type n, dimension_type)
  : size_(n) {
  ((void) 0);
}

inline
Sparse_Row::Sparse_Row(const Sparse_Row& y, dimension_type)
  : tree(y.tree), size_(y.size_) {
}

inline
Sparse_Row::Sparse_Row(const Sparse_Row& y, dimension_type sz, dimension_type)
  : tree(y.begin(),
         std::distance(y.begin(), y.lower_bound(std::min(y.size(), sz)))),
    size_(sz) {
  ((void) 0);
}

inline void
Sparse_Row::m_swap(Sparse_Row& x) {
  using std::swap;
  swap(tree, x.tree);
  swap(size_, x.size_);
  ((void) 0);
  ((void) 0);
}

inline dimension_type
Sparse_Row::size() const {
  return size_;
}

inline dimension_type
Sparse_Row::num_stored_elements() const {
  return tree.size();
}

inline void
Sparse_Row::resize(dimension_type n) {
  if (n < size_)
    reset_after(n);
  size_ = n;
  ((void) 0);
}

inline void
Sparse_Row::shrink(dimension_type n) {
  ((void) 0);
  resize(n);
}

inline void
Sparse_Row::expand_within_capacity(dimension_type n) {
  ((void) 0);
  resize(n);
}

inline void
Sparse_Row::delete_element_and_shift(dimension_type i) {
  ((void) 0);
  tree.erase_element_and_shift_left(i);
  --size_;
  ((void) 0);
}

inline void
Sparse_Row::add_zeroes_and_shift(dimension_type n, dimension_type i) {
  ((void) 0);
  tree.increase_keys_from(i, n);
  size_ += n;
  ((void) 0);
}

inline Sparse_Row::iterator
Sparse_Row::begin() {
  return tree.begin();
}

inline const Sparse_Row::iterator&
Sparse_Row::end() {
  return tree.end();
}

inline Sparse_Row::const_iterator
Sparse_Row::begin() const {
  return tree.cbegin();
}

inline const Sparse_Row::const_iterator&
Sparse_Row::end() const {
  return tree.cend();
}

inline Sparse_Row::const_iterator
Sparse_Row::cbegin() const {
  return tree.cbegin();
}

inline const Sparse_Row::const_iterator&
Sparse_Row::cend() const {
  return tree.cend();
}

inline dimension_type
Sparse_Row::max_size() {
  return CO_Tree::max_size();
}

inline void
Sparse_Row::clear() {
  tree.clear();
}

inline Coefficient&
Sparse_Row::operator[](dimension_type i) {
  ((void) 0);
  iterator itr = insert(i);
  return *itr;
}

inline Coefficient_traits::const_reference
Sparse_Row::operator[](dimension_type i) const {
  return get(i);
}

inline Coefficient_traits::const_reference
Sparse_Row::get(dimension_type i) const {
  ((void) 0);
  if (tree.empty())
    return Coefficient_zero();
  const_iterator itr = find(i);
  if (itr != end())
    return *itr;
  else
    return Coefficient_zero();
}

inline Sparse_Row::iterator
Sparse_Row::find(dimension_type i) {
  ((void) 0);

  iterator itr = tree.bisect(i);

  if (itr != end() && itr.index() == i)
    return itr;

  return end();
}

inline Sparse_Row::iterator
Sparse_Row::find(iterator hint, dimension_type i) {
  ((void) 0);

  iterator itr = tree.bisect_near(hint, i);

  if (itr != end() && itr.index() == i)
    return itr;

  return end();
}

inline Sparse_Row::const_iterator
Sparse_Row::find(dimension_type i) const {
  ((void) 0);

  const_iterator itr = tree.bisect(i);

  if (itr != end() && itr.index() == i)
    return itr;

  return end();
}

inline Sparse_Row::const_iterator
Sparse_Row::find(const_iterator hint, dimension_type i) const {
  ((void) 0);

  const_iterator itr = tree.bisect_near(hint, i);

  if (itr != end() && itr.index() == i)
    return itr;

  return end();
}

inline Sparse_Row::iterator
Sparse_Row::lower_bound(dimension_type i) {
  ((void) 0);

  iterator itr = tree.bisect(i);

  if (itr == end())
    return end();

  if (itr.index() < i)
    ++itr;

  ((void) 0);

  return itr;
}

inline Sparse_Row::iterator
Sparse_Row::lower_bound(iterator hint, dimension_type i) {
  ((void) 0);

  iterator itr = tree.bisect_near(hint, i);

  if (itr == end())
    return end();

  if (itr.index() < i)
    ++itr;

  ((void) 0);

  return itr;
}

inline Sparse_Row::const_iterator
Sparse_Row::lower_bound(dimension_type i) const {
  ((void) 0);

  const_iterator itr = tree.bisect(i);

  if (itr == end())
    return end();

  if (itr.index() < i)
    ++itr;

  ((void) 0);

  return itr;
}

inline Sparse_Row::const_iterator
Sparse_Row::lower_bound(const_iterator hint, dimension_type i) const {
  ((void) 0);

  const_iterator itr = tree.bisect_near(hint, i);

  if (itr == end())
    return end();

  if (itr.index() < i)
    ++itr;

  ((void) 0);

  return itr;
}

inline Sparse_Row::iterator
Sparse_Row::insert(dimension_type i, Coefficient_traits::const_reference x) {
  ((void) 0);
  return tree.insert(i, x);
}

inline Sparse_Row::iterator
Sparse_Row::insert(iterator itr, dimension_type i,
                   Coefficient_traits::const_reference x) {
  ((void) 0);
  return tree.insert(itr, i, x);
}

inline Sparse_Row::iterator
Sparse_Row::insert(dimension_type i) {
  ((void) 0);
  return tree.insert(i);
}

inline Sparse_Row::iterator
Sparse_Row::insert(iterator itr, dimension_type i) {
  ((void) 0);
  return tree.insert(itr, i);
}

inline void
Sparse_Row::swap_coefficients(iterator i, iterator j) {
  ((void) 0);
  ((void) 0);
  using std::swap;
  swap(*i, *j);
  ((void) 0);
}

inline void
Sparse_Row::fast_swap(dimension_type i, iterator itr) {
  ((void) 0);
  ((void) 0);
  tree.fast_shift(i, itr);
  ((void) 0);
}

inline Sparse_Row::iterator
Sparse_Row::reset(iterator i) {
  iterator res = tree.erase(i);
  ((void) 0);
  return res;
}

inline void
Sparse_Row::reset(dimension_type i) {
  ((void) 0);

  tree.erase(i);
  ((void) 0);
}

inline memory_size_type
Sparse_Row::external_memory_in_bytes() const {
  return tree.external_memory_in_bytes();
}

inline memory_size_type
Sparse_Row::external_memory_in_bytes(dimension_type ) const {
  return external_memory_in_bytes();
}

inline memory_size_type
Sparse_Row::total_memory_in_bytes() const {
  return external_memory_in_bytes() + sizeof(*this);
}

inline memory_size_type
Sparse_Row::total_memory_in_bytes(dimension_type ) const {
  return total_memory_in_bytes();
}




inline void
swap(Sparse_Row& x, Sparse_Row& y) {
  x.m_swap(y);
}

}
# 928 "Sparse_Row_defs.hh" 2
# 1 "Sparse_Row_templates.hh" 1
# 27 "Sparse_Row_templates.hh"
namespace Parma_Polyhedra_Library {


template <typename Func1, typename Func2>
void
Sparse_Row::combine_needs_first(const Sparse_Row& y,
                                const Func1& f, const Func2& g) {
  if (this == &y) {
    for (iterator i = begin(), i_end = end(); i != i_end; ++i)
      g(*i, *i);
  }
  else {
    iterator i = begin();



    const iterator& i_end = end();
    const_iterator j = y.begin();
    const_iterator j_end = y.end();
    while (i != i_end && j != j_end)
      if (i.index() == j.index()) {
        g(*i, *j);
        if (*i == 0)
          i = reset(i);
        else
          ++i;
        ++j;
      }
      else
        if (i.index() < j.index()) {
          f(*i);
          if (*i == 0)
            i = reset(i);
          else
            ++i;
        }
        else
          j = y.lower_bound(j, i.index());
    while (i != i_end) {
      f(*i);
      if (*i == 0)
        i = reset(i);
      else
        ++i;
    }
  }
}

template <typename Func1, typename Func2>
void
Sparse_Row::combine_needs_second(const Sparse_Row& y,
                                 const Func1& g,
                                 const Func2& ) {
  iterator i = begin();
  for (const_iterator j = y.begin(), j_end = y.end(); j != j_end; ++j) {
    i = insert(i, j.index());
    g(*i, *j);
    if (*i == 0)
      i = reset(i);
  }
}

template <typename Func1, typename Func2, typename Func3>
void
Sparse_Row::combine(const Sparse_Row& y, const Func1& f,
                    const Func2& g, const Func3& h) {
  if (this == &y) {
    for (iterator i = begin(), i_end = end(); i != i_end; ++i)
      g(*i, *i);
  }
  else {
    iterator i = begin();



    const iterator& i_end = end();
    const_iterator j = y.begin();
    const_iterator j_end = y.end();
    while (i != i_end && j != j_end) {
      if (i.index() == j.index()) {
        g(*i, *j);
        if (*i == 0)
          i = reset(i);
        else
          ++i;
        ++j;
      }
      else
        if (i.index() < j.index()) {
          f(*i);
          if (*i == 0)
            i = reset(i);
          else
            ++i;
        }
        else {
          ((void) 0);
          i = insert(i, j.index());
          h(*i, *j);
          if (*i == 0)
            i = reset(i);
          else
            ++i;
          ++j;
        }
    }
    ((void) 0);
    while (i != i_end) {
      f(*i);
      if (*i == 0)
        i = reset(i);
      else
        ++i;
    }
    while (j != j_end) {
      i = insert(i, j.index());
      h(*i, *j);
      if (*i == 0)
        i = reset(i);
      ++j;
    }
  }
}

}
# 929 "Sparse_Row_defs.hh" 2
# 32 "Expression_Adapter_defs.hh" 2




class Parma_Polyhedra_Library::Expression_Adapter_Base {
};
# 55 "Expression_Adapter_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::Expression_Adapter
  : public Expression_Adapter_Base {
public:

  typedef Expression_Adapter<T> const_reference;

  typedef typename T::const_reference inner_type;

  typedef typename T::raw_type raw_type;


  inner_type inner() const;


  typedef typename raw_type::const_iterator const_iterator;


  Representation representation() const;


  const_iterator begin() const;


  const_iterator end() const;



  const_iterator lower_bound(Variable v) const;


  dimension_type space_dimension() const;


  Coefficient_traits::const_reference coefficient(Variable v) const;


  Coefficient_traits::const_reference inhomogeneous_term() const;


  bool is_zero() const;





  bool all_homogeneous_terms_are_zero() const;





  template <typename Expression>
  bool is_equal_to(const Expression& y) const;





  bool all_zeroes(const Variables_Set& vars) const;


  Coefficient_traits::const_reference get(dimension_type i) const;


  Coefficient_traits::const_reference get(Variable v) const;





  bool all_zeroes(dimension_type start, dimension_type end) const;


  dimension_type num_zeroes(dimension_type start, dimension_type end) const;





  Coefficient gcd(dimension_type start, dimension_type end) const;



  dimension_type last_nonzero() const;



  dimension_type last_nonzero(dimension_type first, dimension_type last) const;



  dimension_type first_nonzero(dimension_type first, dimension_type last) const;





  bool all_zeroes_except(const Variables_Set& vars,
                         dimension_type start, dimension_type end) const;


  void has_a_free_dimension_helper(std::set<dimension_type>& x) const;



  template <typename Expression>
  bool is_equal_to(const Expression& y,
                   dimension_type start, dimension_type end) const;



  template <typename Expression>
  bool is_equal_to(const Expression& y,
                   Coefficient_traits::const_reference c1,
                   Coefficient_traits::const_reference c2,
                   dimension_type start, dimension_type end) const;


  void get_row(Dense_Row& row) const;


  void get_row(Sparse_Row& row) const;



  template <typename Expression>
  bool have_a_common_variable(const Expression& y,
                              Variable first, Variable last) const;

protected:

  explicit Expression_Adapter(const raw_type& expr);

  const raw_type& raw_;
};




template <typename T>
class Parma_Polyhedra_Library::Expression_Adapter_Transparent
  : public Expression_Adapter<T> {
  typedef Expression_Adapter<T> base_type;
public:

  typedef Expression_Adapter_Transparent<T> const_reference;

  typedef typename base_type::inner_type inner_type;

  typedef typename base_type::raw_type raw_type;


  typedef typename base_type::const_iterator const_iterator;


  explicit Expression_Adapter_Transparent(const raw_type& expr);
};

# 1 "Expression_Adapter_inlines.hh" 1
# 27 "Expression_Adapter_inlines.hh"
# 1 "Variables_Set_defs.hh" 1
# 33 "Variables_Set_defs.hh"
namespace Parma_Polyhedra_Library {

namespace IO_Operators {



std::ostream&
operator<<(std::ostream& s, const Variables_Set& vs);

}

}


class Parma_Polyhedra_Library::Variables_Set
  : public std::set<dimension_type> {
private:
  typedef std::set<dimension_type> Base;

public:

  Variables_Set();


  explicit Variables_Set(const Variable v);
# 68 "Variables_Set_defs.hh"
  Variables_Set(const Variable v, const Variable w);


  static dimension_type max_space_dimension();





  dimension_type space_dimension() const;


  void insert(Variable v);



  using Base::insert;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;
};

# 1 "Variables_Set_inlines.hh" 1
# 30 "Variables_Set_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Variables_Set::Variables_Set()
  : Base() {
}

inline void
Variables_Set::insert(const Variable v) {
  insert(v.id());
}

inline
Variables_Set::Variables_Set(const Variable v)
  : Base() {
  insert(v);
}

inline dimension_type
Variables_Set::max_space_dimension() {
  return Variable::max_space_dimension();
}

inline dimension_type
Variables_Set::space_dimension() const {
  reverse_iterator i = rbegin();
  return (i == rend()) ? 0 : (*i + 1);
}

inline memory_size_type
Variables_Set::external_memory_in_bytes() const {



  enum color { red, black };
  return size() * (sizeof(color) + 3*sizeof(void*) + sizeof(dimension_type));
}

inline memory_size_type
Variables_Set::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

}
# 106 "Variables_Set_defs.hh" 2
# 28 "Expression_Adapter_inlines.hh" 2

namespace Parma_Polyhedra_Library {

template <typename T>
inline
Expression_Adapter<T>::Expression_Adapter(const raw_type& expr)
  : raw_(expr) {
}

template <typename T>
inline typename Expression_Adapter<T>::inner_type
Expression_Adapter<T>::inner() const {
  return inner_type(raw_);
}

template <typename T>
inline Representation
Expression_Adapter<T>::representation() const {
  return inner().representation();
}

template <typename T>
inline typename Expression_Adapter<T>::const_iterator
Expression_Adapter<T>::begin() const {
  return inner().begin();
}

template <typename T>
inline typename Expression_Adapter<T>::const_iterator
Expression_Adapter<T>::end() const {
  return inner().end();
}

template <typename T>
inline typename Expression_Adapter<T>::const_iterator
Expression_Adapter<T>::lower_bound(Variable v) const {
  return inner().lower_bound(v);
}

template <typename T>
inline dimension_type
Expression_Adapter<T>::space_dimension() const {
  return inner().space_dimension();
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Adapter<T>::coefficient(Variable v) const {
  return inner().coefficient(v);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Adapter<T>::inhomogeneous_term() const {
  return inner().inhomogeneous_term();
}

template <typename T>
inline bool
Expression_Adapter<T>::is_zero() const {
  return inner().is_zero();
}

template <typename T>
inline bool
Expression_Adapter<T>::all_homogeneous_terms_are_zero() const {
  return inner().all_homogeneous_terms_are_zero();
}

template <typename T>
template <typename Expression>
inline bool
Expression_Adapter<T>::is_equal_to(const Expression& y) const {
  return inner().is_equal_to(y);
}

template <typename T>
inline bool
Expression_Adapter<T>
::all_zeroes(const Variables_Set& vars) const {
  return inner().all_zeroes(vars);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Adapter<T>::get(dimension_type i) const {
  return inner().get(i);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Adapter<T>::get(Variable v) const {
  return inner().get(v);
}

template <typename T>
inline bool
Expression_Adapter<T>::all_zeroes(dimension_type start,
                                  dimension_type end) const {
  return inner().all_zeroes(start, end);
}

template <typename T>
inline dimension_type
Expression_Adapter<T>::num_zeroes(dimension_type start,
                                  dimension_type end) const {
  return inner().num_zeroes(start, end);
}

template <typename T>
inline Coefficient
Expression_Adapter<T>::gcd(dimension_type start,
                           dimension_type end) const {
  return inner().gcd(start, end);
}

template <typename T>
inline dimension_type
Expression_Adapter<T>::last_nonzero() const {
  return inner().last_nonzero();
}

template <typename T>
inline dimension_type
Expression_Adapter<T>::last_nonzero(dimension_type first,
                                    dimension_type last) const {
  return inner().last_nonzero(first, last);
}

template <typename T>
inline dimension_type
Expression_Adapter<T>::first_nonzero(dimension_type first,
                                     dimension_type last) const {
  return inner().first_nonzero(first, last);
}

template <typename T>
inline bool
Expression_Adapter<T>
::all_zeroes_except(const Variables_Set& vars,
                    dimension_type start, dimension_type end) const {
  return inner().all_zeroes_except(vars, start, end);
}

template <typename T>
inline void
Expression_Adapter<T>
::has_a_free_dimension_helper(std::set<dimension_type>& x) const {
  inner().has_a_free_dimension_helper(x);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Adapter<T>
::is_equal_to(const Expression& y,
              dimension_type start, dimension_type end) const {
  return inner().is_equal_to(y, start, end);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Adapter<T>
::is_equal_to(const Expression& y,
              Coefficient_traits::const_reference c1,
              Coefficient_traits::const_reference c2,
              dimension_type start, dimension_type end) const {
  return inner().is_equal_to(y, c1, c2, start, end);
}

template <typename T>
inline void
Expression_Adapter<T>::get_row(Dense_Row& row) const {
  inner().get_row(row);
}

template <typename T>
inline void
Expression_Adapter<T>::get_row(Sparse_Row& row) const {
  inner().get_row(row);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Adapter<T>
::have_a_common_variable(const Expression& y,
                         Variable first, Variable last) const {
  return inner().have_a_common_variable(y, first, last);
}

template <typename T>
inline
Expression_Adapter_Transparent<T>
::Expression_Adapter_Transparent(const raw_type& expr)
  : base_type(expr) {
}

}
# 215 "Expression_Adapter_defs.hh" 2
# 49 "Linear_Expression_defs.hh" 2
# 1 "Expression_Hide_Inhomo_types.hh" 1
# 16 "Expression_Hide_Inhomo_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class Expression_Hide_Inhomo;

}
# 50 "Linear_Expression_defs.hh" 2
# 1 "Expression_Hide_Last_types.hh" 1
# 16 "Expression_Hide_Last_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class Expression_Hide_Last;

}
# 51 "Linear_Expression_defs.hh" 2

# 1 "Linear_Expression_Interface_defs.hh" 1
# 27 "Linear_Expression_Interface_defs.hh"
# 1 "Linear_Expression_Interface_types.hh" 1
# 16 "Linear_Expression_Interface_types.hh"
namespace Parma_Polyhedra_Library {

class Linear_Expression_Interface;

}
# 28 "Linear_Expression_Interface_defs.hh" 2
# 50 "Linear_Expression_Interface_defs.hh"
class Parma_Polyhedra_Library::Linear_Expression_Interface {
public:
  virtual ~Linear_Expression_Interface();

  virtual bool OK() const = 0;


  virtual Representation representation() const = 0;






  class const_iterator_interface {
  public:
    typedef std::bidirectional_iterator_tag iterator_category;
    typedef const Coefficient value_type;
    typedef ptrdiff_t difference_type;
    typedef value_type* pointer;
    typedef Coefficient_traits::const_reference reference;




    virtual const_iterator_interface* clone() const = 0;

    virtual ~const_iterator_interface();




    virtual void operator++() = 0;




    virtual void operator--() = 0;


    virtual reference operator*() const = 0;





    virtual Variable variable() const = 0;






    virtual bool operator==(const const_iterator_interface& x) const = 0;
  };



  virtual const_iterator_interface* begin() const = 0;



  virtual const_iterator_interface* end() const = 0;






  virtual const_iterator_interface* lower_bound(Variable v) const = 0;


  virtual dimension_type space_dimension() const = 0;


  virtual void set_space_dimension(dimension_type n) = 0;


  virtual Coefficient_traits::const_reference
  coefficient(Variable v) const = 0;


  virtual void
  set_coefficient(Variable v, Coefficient_traits::const_reference n) = 0;


  virtual Coefficient_traits::const_reference inhomogeneous_term() const = 0;


  virtual void
  set_inhomogeneous_term(Coefficient_traits::const_reference n) = 0;
# 157 "Linear_Expression_Interface_defs.hh"
  virtual void
  linear_combine(const Linear_Expression_Interface& y, Variable v) = 0;



  virtual void linear_combine(const Linear_Expression_Interface& y,
                              Coefficient_traits::const_reference c1,
                              Coefficient_traits::const_reference c2) = 0;



  virtual void linear_combine_lax(const Linear_Expression_Interface& y,
                                  Coefficient_traits::const_reference c1,
                                  Coefficient_traits::const_reference c2) = 0;


  virtual void swap_space_dimensions(Variable v1, Variable v2) = 0;







  virtual void remove_space_dimensions(const Variables_Set& vars) = 0;



  virtual void shift_space_dimensions(Variable v, dimension_type n) = 0;
# 199 "Linear_Expression_Interface_defs.hh"
  virtual void
  permute_space_dimensions(const std::vector<Variable>& cycle) = 0;


  virtual bool is_zero() const = 0;





  virtual bool all_homogeneous_terms_are_zero() const = 0;





  virtual memory_size_type total_memory_in_bytes() const = 0;


  virtual memory_size_type external_memory_in_bytes() const = 0;


  virtual void ascii_dump(std::ostream& s) const = 0;






  virtual bool ascii_load(std::istream& s) = 0;



  virtual bool is_equal_to(const Linear_Expression_Interface& x) const = 0;







  virtual void normalize() = 0;



  virtual void sign_normalize() = 0;





  virtual void negate(dimension_type first, dimension_type last) = 0;

  virtual Linear_Expression_Interface&
  operator+=(Coefficient_traits::const_reference n) = 0;
  virtual Linear_Expression_Interface&
  operator-=(Coefficient_traits::const_reference n) = 0;
# 268 "Linear_Expression_Interface_defs.hh"
  virtual int compare(const Linear_Expression_Interface& y) const = 0;

  virtual Linear_Expression_Interface&
  operator+=(const Linear_Expression_Interface& e2) = 0;
  virtual Linear_Expression_Interface&
  operator+=(const Variable v) = 0;
  virtual Linear_Expression_Interface&
  operator-=(const Linear_Expression_Interface& e2) = 0;
  virtual Linear_Expression_Interface&
  operator-=(const Variable v) = 0;
  virtual Linear_Expression_Interface&
  operator*=(Coefficient_traits::const_reference n) = 0;
  virtual Linear_Expression_Interface&
  operator/=(Coefficient_traits::const_reference n) = 0;

  virtual void negate() = 0;

  virtual Linear_Expression_Interface&
  add_mul_assign(Coefficient_traits::const_reference n, const Variable v) = 0;

  virtual Linear_Expression_Interface&
  sub_mul_assign(Coefficient_traits::const_reference n, const Variable v) = 0;

  virtual void add_mul_assign(Coefficient_traits::const_reference factor,
                              const Linear_Expression_Interface& e2) = 0;

  virtual void sub_mul_assign(Coefficient_traits::const_reference factor,
                              const Linear_Expression_Interface& e2) = 0;

  virtual void print(std::ostream& s) const = 0;





  virtual bool all_zeroes(const Variables_Set& vars) const = 0;



  virtual bool have_a_common_variable(const Linear_Expression_Interface& x,
                                      Variable first, Variable last) const = 0;





  virtual Coefficient_traits::const_reference get(dimension_type i) const = 0;





  virtual void set(dimension_type i, Coefficient_traits::const_reference n) = 0;
# 329 "Linear_Expression_Interface_defs.hh"
  virtual bool all_zeroes(dimension_type start, dimension_type end) const = 0;







  virtual dimension_type
  num_zeroes(dimension_type start, dimension_type end) const = 0;
# 347 "Linear_Expression_Interface_defs.hh"
  virtual Coefficient gcd(dimension_type start, dimension_type end) const = 0;




  virtual void exact_div_assign(Coefficient_traits::const_reference c,
                                dimension_type start, dimension_type end) = 0;





  virtual void mul_assign(Coefficient_traits::const_reference n,
                          dimension_type start, dimension_type end) = 0;
# 380 "Linear_Expression_Interface_defs.hh"
  virtual void
  linear_combine(const Linear_Expression_Interface& y, dimension_type i) = 0;






  virtual void linear_combine(const Linear_Expression_Interface& y,
                              Coefficient_traits::const_reference c1,
                              Coefficient_traits::const_reference c2,
                              dimension_type start, dimension_type end) = 0;






  virtual void linear_combine_lax(const Linear_Expression_Interface& y,
                                  Coefficient_traits::const_reference c1,
                                  Coefficient_traits::const_reference c2,
                                  dimension_type start, dimension_type end) = 0;






  virtual dimension_type last_nonzero() const = 0;






  virtual dimension_type
  last_nonzero(dimension_type first, dimension_type last) const = 0;



  virtual dimension_type
  first_nonzero(dimension_type first, dimension_type last) const = 0;
# 430 "Linear_Expression_Interface_defs.hh"
  virtual bool
  all_zeroes_except(const Variables_Set& vars,
                    dimension_type start, dimension_type end) const = 0;





  virtual void
  scalar_product_assign(Coefficient& result,
                        const Linear_Expression_Interface& y,
                        dimension_type start, dimension_type end) const = 0;






  virtual int
  scalar_product_sign(const Linear_Expression_Interface& y,
                      dimension_type start, dimension_type end) const = 0;





  virtual void
  has_a_free_dimension_helper(std::set<dimension_type>& x) const = 0;





  virtual bool is_equal_to(const Linear_Expression_Interface& x,
                           dimension_type start, dimension_type end) const = 0;






  virtual bool is_equal_to(const Linear_Expression_Interface& x,
                           Coefficient_traits::const_reference c1,
                           Coefficient_traits::const_reference c2,
                           dimension_type start, dimension_type end) const = 0;





  virtual void get_row(Dense_Row& row) const = 0;





  virtual void get_row(Sparse_Row& row) const = 0;
};
# 53 "Linear_Expression_defs.hh" 2


namespace Parma_Polyhedra_Library {





Linear_Expression
operator+(const Linear_Expression& e1, const Linear_Expression& e2);



Linear_Expression
operator+(Variable v, Variable w);



Linear_Expression
operator+(Variable v, const Linear_Expression& e);



Linear_Expression
operator+(const Linear_Expression& e, Variable v);



Linear_Expression
operator+(Coefficient_traits::const_reference n, const Linear_Expression& e);



Linear_Expression
operator+(const Linear_Expression& e, Coefficient_traits::const_reference n);



Linear_Expression
operator+(const Linear_Expression& e);



Linear_Expression
operator-(const Linear_Expression& e);



Linear_Expression
operator-(const Linear_Expression& e1, const Linear_Expression& e2);



Linear_Expression
operator-(Variable v, Variable w);



Linear_Expression
operator-(Variable v, const Linear_Expression& e);



Linear_Expression
operator-(const Linear_Expression& e, Variable v);



Linear_Expression
operator-(Coefficient_traits::const_reference n, const Linear_Expression& e);



Linear_Expression
operator-(const Linear_Expression& e, Coefficient_traits::const_reference n);



Linear_Expression
operator*(Coefficient_traits::const_reference n, const Linear_Expression& e);



Linear_Expression
operator*(const Linear_Expression& e, Coefficient_traits::const_reference n);



Linear_Expression&
operator+=(Linear_Expression& e1, const Linear_Expression& e2);







Linear_Expression&
operator+=(Linear_Expression& e, Variable v);



Linear_Expression&
operator+=(Linear_Expression& e, Coefficient_traits::const_reference n);



Linear_Expression&
operator-=(Linear_Expression& e1, const Linear_Expression& e2);







Linear_Expression&
operator-=(Linear_Expression& e, Variable v);



Linear_Expression&
operator-=(Linear_Expression& e, Coefficient_traits::const_reference n);



Linear_Expression&
operator*=(Linear_Expression& e, Coefficient_traits::const_reference n);



Linear_Expression&
operator/=(Linear_Expression& e, Coefficient_traits::const_reference n);



void
neg_assign(Linear_Expression& e);



Linear_Expression&
add_mul_assign(Linear_Expression& e,
               Coefficient_traits::const_reference n, Variable v);



void add_mul_assign(Linear_Expression& e1,
                    Coefficient_traits::const_reference factor,
                    const Linear_Expression& e2);



void sub_mul_assign(Linear_Expression& e1,
                    Coefficient_traits::const_reference factor,
                    const Linear_Expression& e2);



Linear_Expression&
sub_mul_assign(Linear_Expression& e,
               Coefficient_traits::const_reference n, Variable v);
# 229 "Linear_Expression_defs.hh"
int compare(const Linear_Expression& x, const Linear_Expression& y);

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Linear_Expression& e);

}

}
# 288 "Linear_Expression_defs.hh"
class Parma_Polyhedra_Library::Linear_Expression {
public:
  static const Representation default_representation = SPARSE;


  explicit Linear_Expression(Representation r = default_representation);






  Linear_Expression(const Linear_Expression& e);


  Linear_Expression(const Linear_Expression& e, Representation r);


  typedef const Linear_Expression& const_reference;
  typedef Linear_Expression raw_type;






  template <typename LE_Adapter>
  explicit
  Linear_Expression(const LE_Adapter& e,
                    typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type = 0);




  template <typename LE_Adapter>
  Linear_Expression(const LE_Adapter& e, Representation r,
                    typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type = 0);
# 333 "Linear_Expression_defs.hh"
  template <typename LE_Adapter>
  explicit
  Linear_Expression(const LE_Adapter& e, dimension_type space_dim,
                    typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type = 0);





  template <typename LE_Adapter>
  Linear_Expression(const LE_Adapter& e,
                    dimension_type space_dim, Representation r,
                    typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type = 0);


  Linear_Expression& operator=(const Linear_Expression& e);


  ~Linear_Expression();





  explicit Linear_Expression(Coefficient_traits::const_reference n,
                             Representation r = default_representation);







  Linear_Expression(Variable v, Representation r = default_representation);


  Representation representation() const;


  void set_representation(Representation r);






  class const_iterator {
  private:
  public:
    typedef std::bidirectional_iterator_tag iterator_category;
    typedef const Coefficient value_type;
    typedef ptrdiff_t difference_type;
    typedef value_type* pointer;
    typedef Coefficient_traits::const_reference reference;





    explicit const_iterator();
# 401 "Linear_Expression_defs.hh"
    const_iterator(const const_iterator& itr);

    ~const_iterator();
# 412 "Linear_Expression_defs.hh"
    void m_swap(const_iterator& itr);
# 421 "Linear_Expression_defs.hh"
    const_iterator& operator=(const const_iterator& itr);






    const_iterator& operator++();






    const_iterator& operator--();


    reference operator*() const;





    Variable variable() const;






    bool operator==(const const_iterator& x) const;






    bool operator!=(const const_iterator& x) const;

  private:


    const_iterator(Linear_Expression_Interface::const_iterator_interface* itr);

    Linear_Expression_Interface::const_iterator_interface* itr;

    friend class Linear_Expression;
  };



  const_iterator begin() const;



  const_iterator end() const;



  const_iterator lower_bound(Variable v) const;


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;


  void set_space_dimension(dimension_type n);


  Coefficient_traits::const_reference coefficient(Variable v) const;


  void set_coefficient(Variable v,
                       Coefficient_traits::const_reference n);


  Coefficient_traits::const_reference inhomogeneous_term() const;


  void set_inhomogeneous_term(Coefficient_traits::const_reference n);
# 519 "Linear_Expression_defs.hh"
  void linear_combine(const Linear_Expression& y, Variable v);



  void linear_combine(const Linear_Expression& y,
                      Coefficient_traits::const_reference c1,
                      Coefficient_traits::const_reference c2);



  void linear_combine_lax(const Linear_Expression& y,
                          Coefficient_traits::const_reference c1,
                          Coefficient_traits::const_reference c2);


  void swap_space_dimensions(Variable v1, Variable v2);







  void remove_space_dimensions(const Variables_Set& vars);



  void shift_space_dimensions(Variable v, dimension_type n);
# 560 "Linear_Expression_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);


  bool is_zero() const;





  bool all_homogeneous_terms_are_zero() const;


  static void initialize();


  static void finalize();


  static const Linear_Expression& zero();





  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  void m_swap(Linear_Expression& y);


  Linear_Expression(const Linear_Expression& e, dimension_type space_dim);


  Linear_Expression(const Linear_Expression& e, dimension_type space_dim,
                    Representation r);



  bool is_equal_to(const Linear_Expression& x) const;







  void normalize();



  void sign_normalize();





  bool all_zeroes(const Variables_Set& vars) const;

private:




  static const Linear_Expression* zero_p;

  Linear_Expression_Interface* impl;






  Linear_Expression(dimension_type space_dim, bool,
                    Representation r = default_representation);





  Coefficient_traits::const_reference get(dimension_type i) const;





  void set(dimension_type i, Coefficient_traits::const_reference n);





  Coefficient_traits::const_reference get(Variable v) const;





  void set(Variable v, Coefficient_traits::const_reference n);





  bool all_zeroes(dimension_type start, dimension_type end) const;




  dimension_type num_zeroes(dimension_type start, dimension_type end) const;





  Coefficient gcd(dimension_type start, dimension_type end) const;

  void exact_div_assign(Coefficient_traits::const_reference c,
                        dimension_type start, dimension_type end);
# 709 "Linear_Expression_defs.hh"
  void linear_combine(const Linear_Expression& y, dimension_type i);



  void linear_combine(const Linear_Expression& y,
                      Coefficient_traits::const_reference c1,
                      Coefficient_traits::const_reference c2,
                      dimension_type start, dimension_type end);



  void linear_combine_lax(const Linear_Expression& y,
                          Coefficient_traits::const_reference c1,
                          Coefficient_traits::const_reference c2,
                          dimension_type start, dimension_type end);


  void mul_assign(Coefficient_traits::const_reference n,
                  dimension_type start, dimension_type end);



  dimension_type last_nonzero() const;



  dimension_type last_nonzero(dimension_type first, dimension_type last) const;



  dimension_type first_nonzero(dimension_type first, dimension_type last) const;





  bool all_zeroes_except(const Variables_Set& vars,
                         dimension_type start, dimension_type end) const;


  void scalar_product_assign(Coefficient& result,
                             const Linear_Expression& y) const;


  void scalar_product_assign(Coefficient& result, const Linear_Expression& y,
                             dimension_type start, dimension_type end) const;


  int scalar_product_sign(const Linear_Expression& y) const;



  int scalar_product_sign(const Linear_Expression& y,
                          dimension_type start, dimension_type end) const;


  void has_a_free_dimension_helper(std::set<dimension_type>& x) const;


  bool is_equal_to(const Linear_Expression& x,
                   dimension_type start, dimension_type end) const;



  bool is_equal_to(const Linear_Expression& x,
                   Coefficient_traits::const_reference c1,
                   Coefficient_traits::const_reference c2,
                   dimension_type start, dimension_type end) const;


  void get_row(Dense_Row& row) const;


  void get_row(Sparse_Row& row) const;



  bool have_a_common_variable(const Linear_Expression& x,
                              Variable first, Variable last) const;





  void negate(dimension_type first, dimension_type last);

  template <typename Row>
  friend class Linear_Expression_Impl;






  friend class Grid;
  friend class Congruence;
  friend class Polyhedron;
  friend class PIP_Tree_Node;
  friend class Grid_Generator;
  friend class Generator;
  friend class Constraint;
  friend class Constraint_System;
  friend class PIP_Problem;
  friend class BHRZ03_Certificate;
  friend class Scalar_Products;
  friend class MIP_Problem;
  friend class Box_Helpers;
  friend class Congruence_System;
  friend class BD_Shape_Helpers;
  friend class Octagonal_Shape_Helper;
  friend class Termination_Helpers;
  template <typename T>
  friend class BD_Shape;
  template <typename T>
  friend class Octagonal_Shape;
  template <typename T>
  friend class Linear_System;
  template <typename T>
  friend class Box;
  template <typename T>
  friend class Expression_Adapter;
  template <typename T>
  friend class Expression_Hide_Inhomo;
  template <typename T>
  friend class Expression_Hide_Last;

  friend Linear_Expression
  operator+(const Linear_Expression& e1, const Linear_Expression& e2);
  friend Linear_Expression
  operator+(Coefficient_traits::const_reference n, const Linear_Expression& e);
  friend Linear_Expression
  operator+(const Linear_Expression& e, Coefficient_traits::const_reference n);
  friend Linear_Expression
  operator+(Variable v, const Linear_Expression& e);
  friend Linear_Expression
  operator+(Variable v, Variable w);

  friend Linear_Expression
  operator-(const Linear_Expression& e);

  friend Linear_Expression
  operator-(const Linear_Expression& e1, const Linear_Expression& e2);
  friend Linear_Expression
  operator-(Variable v, Variable w);
  friend Linear_Expression
  operator-(Coefficient_traits::const_reference n, const Linear_Expression& e);
  friend Linear_Expression
  operator-(const Linear_Expression& e, Coefficient_traits::const_reference n);
  friend Linear_Expression
  operator-(Variable v, const Linear_Expression& e);
  friend Linear_Expression
  operator-(const Linear_Expression& e, Variable v);

  friend Linear_Expression
  operator*(Coefficient_traits::const_reference n, const Linear_Expression& e);
  friend Linear_Expression
  operator*(const Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Linear_Expression&
  operator+=(Linear_Expression& e1, const Linear_Expression& e2);
  friend Linear_Expression&
  operator+=(Linear_Expression& e, Variable v);
  friend Linear_Expression&
  operator+=(Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Linear_Expression&
  operator-=(Linear_Expression& e1, const Linear_Expression& e2);
  friend Linear_Expression&
  operator-=(Linear_Expression& e, Variable v);
  friend Linear_Expression&
  operator-=(Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Linear_Expression&
  operator*=(Linear_Expression& e, Coefficient_traits::const_reference n);
  friend Linear_Expression&
  operator/=(Linear_Expression& e, Coefficient_traits::const_reference n);

  friend void
  neg_assign(Linear_Expression& e);

  friend Linear_Expression&
  add_mul_assign(Linear_Expression& e,
                 Coefficient_traits::const_reference n, Variable v);
  friend Linear_Expression&
  sub_mul_assign(Linear_Expression& e,
                 Coefficient_traits::const_reference n, Variable v);

  friend void
  add_mul_assign(Linear_Expression& e1,
                 Coefficient_traits::const_reference factor,
                 const Linear_Expression& e2);
  friend void
  sub_mul_assign(Linear_Expression& e1,
                 Coefficient_traits::const_reference factor,
                 const Linear_Expression& e2);

  friend int
  compare(const Linear_Expression& x, const Linear_Expression& y);

  friend std::ostream&
  Parma_Polyhedra_Library::IO_Operators
  ::operator<<(std::ostream& s, const Linear_Expression& e);
};

namespace Parma_Polyhedra_Library {



void swap(Linear_Expression& x, Linear_Expression& y);



void swap(Linear_Expression::const_iterator& x,
          Linear_Expression::const_iterator& y);

}

# 1 "Linear_Expression_inlines.hh" 1
# 29 "Linear_Expression_inlines.hh"
namespace Parma_Polyhedra_Library {

inline Linear_Expression&
Linear_Expression::operator=(const Linear_Expression& e) {
  Linear_Expression tmp = e;
  swap(*this, tmp);
  return *this;
}

inline
Linear_Expression::~Linear_Expression() {
  delete impl;
}

inline Representation
Linear_Expression::representation() const {
  return impl->representation();
}

inline dimension_type
Linear_Expression::space_dimension() const {
  return impl->space_dimension();
}

inline void
Linear_Expression::set_space_dimension(dimension_type n) {
  impl->set_space_dimension(n);
}

inline Coefficient_traits::const_reference
Linear_Expression::coefficient(Variable v) const {
  return impl->coefficient(v);
}

inline void
Linear_Expression
::set_coefficient(Variable v, Coefficient_traits::const_reference n) {
  impl->set_coefficient(v, n);
}

inline Coefficient_traits::const_reference
Linear_Expression::inhomogeneous_term() const {
  return impl->inhomogeneous_term();
}

inline void
Linear_Expression
::set_inhomogeneous_term(Coefficient_traits::const_reference n) {
  impl->set_inhomogeneous_term(n);
}

inline void
Linear_Expression::swap_space_dimensions(Variable v1, Variable v2) {
  impl->swap_space_dimensions(v1, v2);
}

inline void
Linear_Expression::shift_space_dimensions(Variable v, dimension_type n) {
  impl->shift_space_dimensions(v, n);
}

inline bool
Linear_Expression::is_zero() const {
  return impl->is_zero();
}

inline bool
Linear_Expression::all_homogeneous_terms_are_zero() const {
  return impl->all_homogeneous_terms_are_zero();
}

inline const Linear_Expression&
Linear_Expression::zero() {
  ((void) 0);
  return *zero_p;
}

inline memory_size_type
Linear_Expression::external_memory_in_bytes() const {
  return impl->total_memory_in_bytes();
}

inline memory_size_type
Linear_Expression::total_memory_in_bytes() const {
  return external_memory_in_bytes() + sizeof(*this);
}


inline Linear_Expression
operator+(const Linear_Expression& e) {
  return e;
}


inline Linear_Expression
operator+(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  Linear_Expression x = e;
  x += n;
  return x;
}


inline Linear_Expression
operator+(const Linear_Expression& e, const Variable v) {
  Linear_Expression x = e;
  x += v;
  return x;
}


inline Linear_Expression
operator-(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  Linear_Expression x = e;
  x -= n;
  return x;
}


inline Linear_Expression
operator-(const Variable v, const Variable w) {
  const dimension_type v_space_dim = v.space_dimension();
  const dimension_type w_space_dim = w.space_dimension();
  const dimension_type space_dim = std::max(v_space_dim, w_space_dim);
  if (space_dim > Linear_Expression::max_space_dimension())
    throw std::length_error("Linear_Expression "
                            "PPL::operator+(v, w):\n"
                            "v or w exceed the maximum allowed "
                            "space dimension.");
  if (v_space_dim >= w_space_dim) {
    Linear_Expression e(v);
    e -= w;
    return e;
  }
  else {
    Linear_Expression e(w.space_dimension(), true);
    e -= w;
    e += v;
    return e;
  }
}


inline Linear_Expression
operator*(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  Linear_Expression x = e;
  x *= n;
  return x;
}


inline Linear_Expression&
operator+=(Linear_Expression& e, Coefficient_traits::const_reference n) {
  *e.impl += n;
  return e;
}


inline Linear_Expression&
operator-=(Linear_Expression& e, Coefficient_traits::const_reference n) {
  *e.impl -= n;
  return e;
}

inline void
Linear_Expression::m_swap(Linear_Expression& y) {
  using std::swap;
  swap(impl, y.impl);
}

inline void
Linear_Expression::normalize() {
  impl->normalize();
}

inline void
Linear_Expression::ascii_dump(std::ostream& s) const {
  impl->ascii_dump(s);
}

inline bool
Linear_Expression::ascii_load(std::istream& s) {
  return impl->ascii_load(s);
}

inline void
Linear_Expression::remove_space_dimensions(const Variables_Set& vars) {
  impl->remove_space_dimensions(vars);
}

inline void
Linear_Expression::permute_space_dimensions(const std::vector<Variable>& cycle) {
  impl->permute_space_dimensions(cycle);
}


inline Linear_Expression
operator+(const Linear_Expression& e1, const Linear_Expression& e2) {
  if (e1.space_dimension() >= e2.space_dimension()) {
    Linear_Expression e = e1;
    e += e2;
    return e;
  }
  else {
    Linear_Expression e = e2;
    e += e1;
    return e;
  }
}


inline Linear_Expression
operator+(const Variable v, const Linear_Expression& e) {
  return e + v;
}


inline Linear_Expression
operator+(Coefficient_traits::const_reference n,
               const Linear_Expression& e) {
  return e + n;
}


inline Linear_Expression
operator+(const Variable v, const Variable w) {
  const dimension_type v_space_dim = v.space_dimension();
  const dimension_type w_space_dim = w.space_dimension();
  const dimension_type space_dim = std::max(v_space_dim, w_space_dim);
  if (space_dim > Linear_Expression::max_space_dimension())
    throw std::length_error("Linear_Expression "
                            "PPL::operator+(v, w):\n"
                            "v or w exceed the maximum allowed "
                            "space dimension.");
  if (v_space_dim >= w_space_dim) {
    Linear_Expression e(v);
    e += w;
    return e;
  }
  else {
    Linear_Expression e(w);
    e += v;
    return e;
  }
}


inline Linear_Expression
operator-(const Linear_Expression& e) {
  Linear_Expression r(e);
  neg_assign(r);
  return r;
}


inline Linear_Expression
operator-(const Linear_Expression& e1, const Linear_Expression& e2) {
  if (e1.space_dimension() >= e2.space_dimension()) {
    Linear_Expression e = e1;
    e -= e2;
    return e;
  }
  else {
    Linear_Expression e = e2;
    neg_assign(e);
    e += e1;
    return e;
  }
}


inline Linear_Expression
operator-(const Variable v, const Linear_Expression& e) {
  Linear_Expression result(e, std::max(v.space_dimension(), e.space_dimension()));
  result.negate(0, e.space_dimension() + 1);
  result += v;
  return result;
}


inline Linear_Expression
operator-(const Linear_Expression& e, const Variable v) {
  Linear_Expression result(e, std::max(v.space_dimension(), e.space_dimension()));
  result -= v;
  return result;
}


inline Linear_Expression
operator-(Coefficient_traits::const_reference n,
               const Linear_Expression& e) {
  Linear_Expression result(e);
  neg_assign(result);
  result += n;
  return result;
}


inline Linear_Expression
operator*(Coefficient_traits::const_reference n,
               const Linear_Expression& e) {
  return e * n;
}


inline Linear_Expression&
operator+=(Linear_Expression& e1, const Linear_Expression& e2) {
  *e1.impl += *e2.impl;
  return e1;
}


inline Linear_Expression&
operator+=(Linear_Expression& e, const Variable v) {
  *e.impl += v;
  return e;
}


inline Linear_Expression&
operator-=(Linear_Expression& e1, const Linear_Expression& e2) {
  *e1.impl -= *e2.impl;
  return e1;
}


inline Linear_Expression&
operator-=(Linear_Expression& e, const Variable v) {
  *e.impl -= v;
  return e;
}


inline Linear_Expression&
operator*=(Linear_Expression& e, Coefficient_traits::const_reference n) {
  *e.impl *= n;
  return e;
}


inline Linear_Expression&
operator/=(Linear_Expression& e, Coefficient_traits::const_reference n) {
  *e.impl /= n;
  return e;
}


inline void
neg_assign(Linear_Expression& e) {
  e.impl->negate();
}


inline Linear_Expression&
add_mul_assign(Linear_Expression& e,
               Coefficient_traits::const_reference n,
               const Variable v) {
  e.impl->add_mul_assign(n, v);
  return e;
}


inline Linear_Expression&
sub_mul_assign(Linear_Expression& e,
                    Coefficient_traits::const_reference n,
                    const Variable v) {
  e.impl->sub_mul_assign(n, v);
  return e;
}

inline void
add_mul_assign(Linear_Expression& e1,
               Coefficient_traits::const_reference factor,
               const Linear_Expression& e2) {
  e1.impl->add_mul_assign(factor, *e2.impl);
}

inline void
sub_mul_assign(Linear_Expression& e1,
                    Coefficient_traits::const_reference factor,
                    const Linear_Expression& e2) {
  e1.impl->sub_mul_assign(factor, *e2.impl);
}

inline Coefficient_traits::const_reference
Linear_Expression::get(dimension_type i) const {
  return impl->get(i);
}

inline void
Linear_Expression::set(dimension_type i,
                       Coefficient_traits::const_reference n) {
  impl->set(i, n);
}

inline Coefficient_traits::const_reference
Linear_Expression::get(Variable v) const {
  return impl->get(v.space_dimension());
}

inline void
Linear_Expression::set(Variable v,
                       Coefficient_traits::const_reference n) {
  impl->set(v.space_dimension(), n);
}

inline bool
Linear_Expression::all_zeroes(dimension_type start, dimension_type end) const {
  return impl->all_zeroes(start, end);
}

inline dimension_type
Linear_Expression::num_zeroes(dimension_type start, dimension_type end) const {
  return impl->num_zeroes(start, end);
}

inline Coefficient
Linear_Expression::gcd(dimension_type start, dimension_type end) const {
  return impl->gcd(start, end);
}

inline void
Linear_Expression
::exact_div_assign(Coefficient_traits::const_reference c,
                   dimension_type start, dimension_type end) {
  impl->exact_div_assign(c, start, end);
}

inline void
Linear_Expression
::mul_assign(Coefficient_traits::const_reference c,
             dimension_type start, dimension_type end) {
  impl->mul_assign(c, start, end);
}

inline void
Linear_Expression::sign_normalize() {
  impl->sign_normalize();
}

inline void
Linear_Expression::negate(dimension_type first, dimension_type last) {
  impl->negate(first, last);
}

inline bool
Linear_Expression::all_zeroes(const Variables_Set& vars) const {
  return impl->all_zeroes(vars);
}

inline bool
Linear_Expression::all_zeroes_except(const Variables_Set& vars,
                                     dimension_type start,
                                     dimension_type end) const {
  return impl->all_zeroes_except(vars, start, end);
}

inline dimension_type
Linear_Expression::last_nonzero() const {
  return impl->last_nonzero();
}

inline void
Linear_Expression
::scalar_product_assign(Coefficient& result, const Linear_Expression& y) const {
  scalar_product_assign(result, y, 0, space_dimension() + 1);
}

inline void
Linear_Expression
::scalar_product_assign(Coefficient& result, const Linear_Expression& y,
                        dimension_type start, dimension_type end) const {
  impl->scalar_product_assign(result, *(y.impl), start, end);
}

inline int
Linear_Expression
::scalar_product_sign(const Linear_Expression& y) const {
  return scalar_product_sign(y, 0, space_dimension() + 1);
}

inline int
Linear_Expression
::scalar_product_sign(const Linear_Expression& y,
                      dimension_type start, dimension_type end) const {
  return impl->scalar_product_sign(*(y.impl), start, end);
}

inline dimension_type
Linear_Expression
::first_nonzero(dimension_type first, dimension_type last) const {
  return impl->first_nonzero(first, last);
}

inline dimension_type
Linear_Expression
::last_nonzero(dimension_type first, dimension_type last) const {
  return impl->last_nonzero(first, last);
}

inline void
Linear_Expression
::has_a_free_dimension_helper(std::set<dimension_type>& x) const {
  return impl->has_a_free_dimension_helper(x);
}

inline bool
Linear_Expression
::is_equal_to(const Linear_Expression& x,
              dimension_type start, dimension_type end) const {
  return impl->is_equal_to(*(x.impl), start, end);
}

inline bool
Linear_Expression
::is_equal_to(const Linear_Expression& x,
              Coefficient_traits::const_reference c1,
              Coefficient_traits::const_reference c2,
              dimension_type start, dimension_type end) const {
  return impl->is_equal_to(*(x.impl), c1, c2, start, end);
}

inline void
Linear_Expression
::get_row(Dense_Row& row) const {
  return impl->get_row(row);
}

inline void
Linear_Expression
::get_row(Sparse_Row& row) const {
  return impl->get_row(row);
}

inline void
Linear_Expression
::linear_combine(const Linear_Expression& y, dimension_type i) {
  impl->linear_combine(*y.impl, i);
}

inline void
Linear_Expression
::linear_combine(const Linear_Expression& y,
                 Coefficient_traits::const_reference c1,
                 Coefficient_traits::const_reference c2) {
  impl->linear_combine(*y.impl, c1, c2);
}

inline void
Linear_Expression
::linear_combine_lax(const Linear_Expression& y,
                     Coefficient_traits::const_reference c1,
                     Coefficient_traits::const_reference c2) {
  impl->linear_combine_lax(*y.impl, c1, c2);
}

inline int
compare(const Linear_Expression& x, const Linear_Expression& y) {
  return x.impl->compare(*y.impl);
}

inline bool
Linear_Expression::is_equal_to(const Linear_Expression& x) const {
  return impl->is_equal_to(*x.impl);
}

inline void
Linear_Expression::linear_combine(const Linear_Expression& y,
                                  Coefficient_traits::const_reference c1,
                                  Coefficient_traits::const_reference c2,
                                  dimension_type start,
                                  dimension_type end) {
  impl->linear_combine(*y.impl, c1, c2, start, end);
}

inline void
Linear_Expression::linear_combine_lax(const Linear_Expression& y,
                                      Coefficient_traits::const_reference c1,
                                      Coefficient_traits::const_reference c2,
                                      dimension_type start,
                                      dimension_type end) {
  impl->linear_combine_lax(*y.impl, c1, c2, start, end);
}

inline bool
Linear_Expression
::have_a_common_variable(const Linear_Expression& x,
                         Variable first, Variable last) const {
  return impl->have_a_common_variable(*(x.impl), first, last);
}

inline
Linear_Expression::const_iterator
::const_iterator()
  : itr(__null) {
}

inline
Linear_Expression::const_iterator
::const_iterator(const const_iterator& x)
  : itr(x.itr->clone()) {
}

inline
Linear_Expression::const_iterator
::~const_iterator() {

  delete itr;
}

inline void
Linear_Expression::const_iterator::m_swap(const_iterator& x) {
  using std::swap;
  swap(itr, x.itr);
}

inline Linear_Expression::const_iterator&
Linear_Expression::const_iterator
::operator=(const const_iterator& itr) {
  const_iterator tmp = itr;
  using std::swap;
  swap(*this, tmp);
  return *this;
}

inline Linear_Expression::const_iterator&
Linear_Expression::const_iterator
::operator++() {
  ((void) 0);
  ++(*itr);
  return *this;
}

inline Linear_Expression::const_iterator&
Linear_Expression::const_iterator
::operator--() {
  ((void) 0);
  --(*itr);
  return *this;
}

inline Linear_Expression::const_iterator::reference
Linear_Expression::const_iterator
::operator*() const {
  ((void) 0);
  return *(*itr);
}

inline Variable
Linear_Expression::const_iterator
::variable() const {
  ((void) 0);
  return itr->variable();
}

inline bool
Linear_Expression::const_iterator
::operator==(const const_iterator& x) const {
  ((void) 0);
  ((void) 0);
  return *itr == *(x.itr);
}

inline bool
Linear_Expression::const_iterator
::operator!=(const const_iterator& x) const {
  return !(*this == x);
}

inline
Linear_Expression::const_iterator
::const_iterator(Linear_Expression_Interface::const_iterator_interface* itr)
  : itr(itr) {
  ((void) 0);
}

inline Linear_Expression::const_iterator
Linear_Expression
::begin() const {
  return const_iterator(impl->begin());
}

inline Linear_Expression::const_iterator
Linear_Expression
::end() const {
  return const_iterator(impl->end());
}

inline Linear_Expression::const_iterator
Linear_Expression
::lower_bound(Variable v) const {
  return const_iterator(impl->lower_bound(v));
}

template <typename LE_Adapter>
inline
Linear_Expression::Linear_Expression(const LE_Adapter& e,
                                     typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type)
  : impl(__null) {
  Linear_Expression tmp(e.representation());
  tmp.set_space_dimension(e.space_dimension());
  tmp.set_inhomogeneous_term(e.inhomogeneous_term());
  for (typename LE_Adapter::const_iterator i = e.begin(),
         i_end = e.end(); i != i_end; ++i)
    add_mul_assign(tmp, *i, i.variable());
  using std::swap;
  swap(impl, tmp.impl);
}

template <typename LE_Adapter>
inline
Linear_Expression::Linear_Expression(const LE_Adapter& e,
                                     Representation r,
                                     typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type)
  : impl(__null) {
  Linear_Expression tmp(r);
  tmp.set_space_dimension(e.space_dimension());
  tmp.set_inhomogeneous_term(e.inhomogeneous_term());
  for (typename LE_Adapter::const_iterator i = e.begin(),
         i_end = e.end(); i != i_end; ++i)
    add_mul_assign(tmp, *i, i.variable());
  using std::swap;
  swap(impl, tmp.impl);
}

template <typename LE_Adapter>
inline
Linear_Expression::Linear_Expression(const LE_Adapter& e,
                                     dimension_type space_dim,
                                     typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type)
  : impl(__null) {
  Linear_Expression tmp(e.representation());
  tmp.set_space_dimension(space_dim);
  tmp.set_inhomogeneous_term(e.inhomogeneous_term());
  typedef typename LE_Adapter::const_iterator itr_t;
  itr_t i_end;
  if (space_dim <= e.space_dimension())
    i_end = e.lower_bound(Variable(space_dim));
  else
    i_end = e.end();
  for (itr_t i = e.begin(); i != i_end; ++i)
    add_mul_assign(tmp, *i, i.variable());
  using std::swap;
  swap(impl, tmp.impl);
}

template <typename LE_Adapter>
inline
Linear_Expression::Linear_Expression(const LE_Adapter& e,
                                     dimension_type space_dim,
                                     Representation r,
                                     typename Enable_If<Is_Same_Or_Derived<Expression_Adapter_Base, LE_Adapter>::value, void*>::type)
  : impl(__null) {
  Linear_Expression tmp(r);
  tmp.set_space_dimension(space_dim);
  tmp.set_inhomogeneous_term(e.inhomogeneous_term());
  typedef typename LE_Adapter::const_iterator itr_t;
  itr_t i_end;
  if (space_dim <= e.space_dimension())
    i_end = e.lower_bound(Variable(space_dim));
  else
    i_end = e.end();
  for (itr_t i = e.begin(); i != i_end; ++i)
    add_mul_assign(tmp, *i, i.variable());
  using std::swap;
  swap(impl, tmp.impl);
}

namespace IO_Operators {


inline std::ostream&
operator<<(std::ostream& s, const Linear_Expression& e) {
  e.impl->print(s);
  return s;
}

}


inline void
swap(Linear_Expression& x, Linear_Expression& y) {
  x.m_swap(y);
}


inline void
swap(Linear_Expression::const_iterator& x,
     Linear_Expression::const_iterator& y) {
  x.m_swap(y);
}

}
# 927 "Linear_Expression_defs.hh" 2
# 37 "Constraint_defs.hh" 2

# 1 "Topology_types.hh" 1
# 16 "Topology_types.hh"
namespace Parma_Polyhedra_Library {





enum Topology {
  NECESSARILY_CLOSED = 0,
  NOT_NECESSARILY_CLOSED = 1
};

}
# 39 "Constraint_defs.hh" 2
# 1 "Expression_Hide_Last_defs.hh" 1
# 36 "Expression_Hide_Last_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::Expression_Hide_Last
  : public Expression_Adapter<T> {
  typedef Expression_Adapter<T> base_type;
public:

  typedef Expression_Hide_Last<T> const_reference;

  typedef typename base_type::inner_type inner_type;

  typedef typename base_type::raw_type raw_type;


  typedef typename base_type::const_iterator const_iterator;


  explicit Expression_Hide_Last(const raw_type& expr, bool hide_last);


  const_iterator end() const;



  const_iterator lower_bound(Variable v) const;


  dimension_type space_dimension() const;


  Coefficient_traits::const_reference coefficient(Variable v) const;


  bool is_zero() const;





  bool all_homogeneous_terms_are_zero() const;





  template <typename Expression>
  bool is_equal_to(const Expression& y) const;





  bool all_zeroes(const Variables_Set& vars) const;


  Coefficient_traits::const_reference get(dimension_type i) const;


  Coefficient_traits::const_reference get(Variable v) const;





  bool all_zeroes(dimension_type start, dimension_type end) const;


  dimension_type num_zeroes(dimension_type start, dimension_type end) const;





  Coefficient gcd(dimension_type start, dimension_type end) const;



  dimension_type last_nonzero() const;



  dimension_type last_nonzero(dimension_type first, dimension_type last) const;



  dimension_type first_nonzero(dimension_type first, dimension_type last) const;





  bool all_zeroes_except(const Variables_Set& vars,
                         dimension_type start, dimension_type end) const;


  void has_a_free_dimension_helper(std::set<dimension_type>& x) const;



  template <typename Expression>
  bool is_equal_to(const Expression& y,
                   dimension_type start, dimension_type end) const;



  template <typename Expression>
  bool is_equal_to(const Expression& y,
                   Coefficient_traits::const_reference c1,
                   Coefficient_traits::const_reference c2,
                   dimension_type start, dimension_type end) const;


  void get_row(Dense_Row& row) const;


  void get_row(Sparse_Row& row) const;



  template <typename Expression>
  bool have_a_common_variable(const Expression& y,
                              Variable first, Variable last) const;

private:

  const bool hide_last_;
};

# 1 "Expression_Hide_Last_inlines.hh" 1
# 29 "Expression_Hide_Last_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline
Expression_Hide_Last<T>::Expression_Hide_Last(const raw_type& expr,
                                              const bool hide_last)
  : base_type(expr), hide_last_(hide_last) {
}

template <typename T>
inline dimension_type
Expression_Hide_Last<T>::space_dimension() const {
  dimension_type dim = this->inner().space_dimension();
  if (hide_last_) {
    ((void) 0);
    --dim;
  }
  return dim;
}

template <typename T>
inline typename Expression_Hide_Last<T>::const_iterator
Expression_Hide_Last<T>::end() const {
  if (hide_last_) {
    return this->inner().lower_bound(Variable(space_dimension()));
  }
  else {
    return this->inner().end();
  }
}

template <typename T>
inline typename Expression_Hide_Last<T>::const_iterator
Expression_Hide_Last<T>::lower_bound(Variable v) const {
  ((void) 0);
  return this->inner().lower_bound(v);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Hide_Last<T>::coefficient(Variable v) const {
  ((void) 0);
  return this->inner().coefficient(v);
}

template <typename T>
inline bool
Expression_Hide_Last<T>::is_zero() const {
  return this->inner().all_zeroes(0, space_dimension() + 1);
}

template <typename T>
inline bool
Expression_Hide_Last<T>::all_homogeneous_terms_are_zero() const {
  return this->inner().all_zeroes(1, space_dimension() + 1);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Last<T>
::is_equal_to(const Expression& y) const {
  const dimension_type x_dim = space_dimension();
  const dimension_type y_dim = y.space_dimension();
  if (x_dim != y_dim)
    return false;
  return is_equal_to(y, 0, x_dim + 1);
}

template <typename T>
inline bool
Expression_Hide_Last<T>::all_zeroes(const Variables_Set& vars) const {
  ((void) 0);
  return this->inner().all_zeroes(vars);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Hide_Last<T>::get(dimension_type i) const {
  ((void) 0);
  return this->inner().get(i);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Hide_Last<T>::get(Variable v) const {
  ((void) 0);
  return this->inner().get(v);
}

template <typename T>
inline bool
Expression_Hide_Last<T>::all_zeroes(dimension_type start,
                                    dimension_type end) const {
  ((void) 0);
  return this->inner().all_zeroes(start, end);
}

template <typename T>
inline dimension_type
Expression_Hide_Last<T>::num_zeroes(dimension_type start,
                                    dimension_type end) const {
  ((void) 0);
  return this->inner().num_zeroes(start, end);
}

template <typename T>
inline Coefficient
Expression_Hide_Last<T>::gcd(dimension_type start,
                             dimension_type end) const {
  ((void) 0);
  return this->inner().gcd(start, end);
}

template <typename T>
inline dimension_type
Expression_Hide_Last<T>::last_nonzero() const {
  return this->inner().last_nonzero(0, space_dimension() + 1);
}

template <typename T>
inline dimension_type
Expression_Hide_Last<T>::last_nonzero(dimension_type first,
                                      dimension_type last) const {
  ((void) 0);
  return this->inner().last_nonzero(first, last);
}

template <typename T>
inline dimension_type
Expression_Hide_Last<T>::first_nonzero(dimension_type first,
                                       dimension_type last) const {
  ((void) 0);
  return this->inner().first_nonzero(first, last);
}

template <typename T>
inline bool
Expression_Hide_Last<T>
::all_zeroes_except(const Variables_Set& vars,
                    dimension_type start, dimension_type end) const {
  ((void) 0);
  return this->inner().all_zeroes_except(vars, start, end);
}

template <typename T>
inline void
Expression_Hide_Last<T>
::has_a_free_dimension_helper(std::set<dimension_type>& x) const {
  if (x.empty())
    return;
  ((void) 0);
  this->inner().has_a_free_dimension_helper(x);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Last<T>
::is_equal_to(const Expression& y,
              dimension_type start, dimension_type end) const {
  ((void) 0);
  ((void) 0);
  return this->inner().is_equal_to(y, start, end);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Last<T>
::is_equal_to(const Expression& y,
              Coefficient_traits::const_reference c1,
              Coefficient_traits::const_reference c2,
              dimension_type start, dimension_type end) const {
  ((void) 0);
  ((void) 0);
  return this->inner().is_equal_to(y, c1, c2, start, end);
}

template <typename T>
inline void
Expression_Hide_Last<T>::get_row(Dense_Row& row) const {
  this->inner().get_row(row);
  if (hide_last_) {
    ((void) 0);
    row.resize(row.size() - 1);
  }
}

template <typename T>
inline void
Expression_Hide_Last<T>::get_row(Sparse_Row& row) const {
  this->inner().get_row(row);
  if (hide_last_) {
    ((void) 0);
    row.resize(row.size() - 1);
  }
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Last<T>
::have_a_common_variable(const Expression& y,
                         Variable first, Variable last) const {
  ((void) 0);
  ((void) 0);
  return this->inner().have_a_common_variable(y, first, last);
}

}
# 164 "Expression_Hide_Last_defs.hh" 2
# 40 "Constraint_defs.hh" 2



namespace Parma_Polyhedra_Library {



Constraint
operator<(const Linear_Expression& e1, const Linear_Expression& e2);



Constraint
operator<(Variable v1, Variable v2);



Constraint
operator<(const Linear_Expression& e, Coefficient_traits::const_reference n);



Constraint
operator<(Coefficient_traits::const_reference n, const Linear_Expression& e);



Constraint
operator>(const Linear_Expression& e1, const Linear_Expression& e2);



Constraint
operator>(Variable v1, Variable v2);



Constraint
operator>(const Linear_Expression& e, Coefficient_traits::const_reference n);



Constraint
operator>(Coefficient_traits::const_reference n, const Linear_Expression& e);



Constraint
operator==(const Linear_Expression& e1, const Linear_Expression& e2);



Constraint
operator==(Variable v1, Variable v2);



Constraint
operator==(const Linear_Expression& e, Coefficient_traits::const_reference n);



Constraint
operator==(Coefficient_traits::const_reference n, const Linear_Expression& e);



Constraint
operator<=(const Linear_Expression& e1, const Linear_Expression& e2);



Constraint
operator<=(Variable v1, Variable v2);



Constraint
operator<=(const Linear_Expression& e, Coefficient_traits::const_reference n);



Constraint
operator<=(Coefficient_traits::const_reference n, const Linear_Expression& e);



Constraint
operator>=(const Linear_Expression& e1, const Linear_Expression& e2);



Constraint
operator>=(Variable v1, Variable v2);



Constraint
operator>=(const Linear_Expression& e, Coefficient_traits::const_reference n);



Constraint
operator>=(Coefficient_traits::const_reference n, const Linear_Expression& e);
# 182 "Constraint_defs.hh"
int compare(const Constraint& x, const Constraint& y);

}
# 284 "Constraint_defs.hh"
class Parma_Polyhedra_Library::Constraint {
public:


  enum Type {

    EQUALITY,

    NONSTRICT_INEQUALITY,

    STRICT_INEQUALITY
  };







  static const Representation default_representation = SPARSE;


  explicit Constraint(Representation r = default_representation);






  Constraint(const Constraint& c);






  Constraint(const Constraint& c, dimension_type space_dim);


  Constraint(const Constraint& c, Representation r);


  Constraint(const Constraint& c, dimension_type space_dim,
             Representation r);






  explicit Constraint(const Congruence& cg,
                      Representation r = default_representation);


  ~Constraint();


  Representation representation() const;


  void set_representation(Representation r);


  Constraint& operator=(const Constraint& c);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;



  void set_space_dimension(dimension_type space_dim);


  void swap_space_dimensions(Variable v1, Variable v2);
# 371 "Constraint_defs.hh"
  bool remove_space_dimensions(const Variables_Set& vars);
# 385 "Constraint_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);



  void shift_space_dimensions(Variable v, dimension_type n);


  Type type() const;





  bool is_equality() const;





  bool is_inequality() const;





  bool is_nonstrict_inequality() const;





  bool is_strict_inequality() const;






  Coefficient_traits::const_reference coefficient(Variable v) const;


  Coefficient_traits::const_reference inhomogeneous_term() const;


  static void initialize();


  static void finalize();


  static const Constraint& zero_dim_false();





  static const Constraint& zero_dim_positivity();





  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;
# 463 "Constraint_defs.hh"
  bool is_tautological() const;
# 477 "Constraint_defs.hh"
  bool is_inconsistent() const;
# 487 "Constraint_defs.hh"
  bool is_equivalent_to(const Constraint& y) const;






  bool is_equal_to(const Constraint& y) const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  void m_swap(Constraint& y);


  static const Constraint& epsilon_geq_zero();





  static const Constraint& epsilon_leq_one();


  typedef Expression_Hide_Last<Linear_Expression> expr_type;

  expr_type expression() const;

private:


  enum Kind {
    LINE_OR_EQUALITY = 0,
    RAY_OR_POINT_OR_INEQUALITY = 1
  };

  Linear_Expression expr;

  Kind kind_;

  Topology topology_;





  static const Constraint* zero_dim_false_p;






  static const Constraint* zero_dim_positivity_p;





  static const Constraint* epsilon_geq_zero_p;






  static const Constraint* epsilon_leq_one_p;


  Constraint(dimension_type space_dim, Kind kind, Topology topology,
             Representation r = default_representation);







  Constraint(Linear_Expression& e, Kind kind, Topology topology);







  Constraint(Linear_Expression& e, Type type, Topology topology);





  bool is_line_or_equality() const;





  bool is_ray_or_point_or_inequality() const;


  void set_is_line_or_equality();


  void set_is_ray_or_point_or_inequality();




  Topology topology() const;





  bool is_not_necessarily_closed() const;





  bool is_necessarily_closed() const;







  void set_topology(Topology x);


  void set_necessarily_closed();


  void set_not_necessarily_closed();
# 642 "Constraint_defs.hh"
  void set_space_dimension_no_ok(dimension_type space_dim);





  void
  throw_invalid_argument(const char* method, const char* message) const;





  void
  throw_dimension_incompatible(const char* method,
                               const char* name_var,
                               Variable v) const;


  Coefficient_traits::const_reference epsilon_coefficient() const;


  void set_epsilon_coefficient(Coefficient_traits::const_reference n);






  void mark_as_necessarily_closed();






  void mark_as_not_necessarily_closed();


  void set_is_equality();







  void set_is_inequality();
# 703 "Constraint_defs.hh"
  void linear_combine(const Constraint& y, dimension_type i);





  void sign_normalize();







  void strong_normalize();





  bool check_strong_normalized() const;





  static Constraint construct_epsilon_geq_zero();

  friend int
  compare(const Constraint& x, const Constraint& y);

  friend class Linear_System<Constraint>;
  friend class Constraint_System;
  friend class Polyhedron;
  friend class Scalar_Products;
  friend class Topology_Adjusted_Scalar_Product_Sign;
  friend class Termination_Helpers;
  friend class Grid;
  template <typename T>
  friend class Octagonal_Shape;

  friend Constraint
  operator<(const Linear_Expression& e1, const Linear_Expression& e2);

  friend Constraint
  operator<(Variable v1, Variable v2);

  friend Constraint
  operator<(const Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Constraint
  operator<(Coefficient_traits::const_reference n, const Linear_Expression& e);

  friend Constraint
  operator>(const Linear_Expression& e1, const Linear_Expression& e2);

  friend Constraint
  operator>(Variable v1, Variable v2);

  friend Constraint
  operator>(const Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Constraint
  operator>(Coefficient_traits::const_reference n, const Linear_Expression& e);

  friend Constraint
  operator==(const Linear_Expression& e1, const Linear_Expression& e2);

  friend Constraint
  operator==(Variable v1, Variable v2);

  friend Constraint
  operator==(const Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Constraint
  operator==(Coefficient_traits::const_reference n, const Linear_Expression& e);

  friend Constraint
  operator<=(const Linear_Expression& e1, const Linear_Expression& e2);

  friend Constraint
  operator<=(Variable v1, Variable v2);

  friend Constraint
  operator<=(const Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Constraint
  operator<=(Coefficient_traits::const_reference n, const Linear_Expression& e);

  friend Constraint
  operator>=(const Linear_Expression& e1, const Linear_Expression& e2);

  friend Constraint
  operator>=(Variable v1, Variable v2);

  friend Constraint
  operator>=(const Linear_Expression& e, Coefficient_traits::const_reference n);

  friend Constraint
  operator>=(Coefficient_traits::const_reference n, const Linear_Expression& e);
};

namespace Parma_Polyhedra_Library {

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Constraint& c);



std::ostream& operator<<(std::ostream& s, const Constraint::Type& t);

}



bool
operator==(const Constraint& x, const Constraint& y);



bool
operator!=(const Constraint& x, const Constraint& y);


void swap(Constraint& x, Constraint& y);

}

# 1 "Constraint_inlines.hh" 1
# 29 "Constraint_inlines.hh"
namespace Parma_Polyhedra_Library {

inline bool
Constraint::is_necessarily_closed() const {
  return (topology_ == NECESSARILY_CLOSED);
}

inline bool
Constraint::is_not_necessarily_closed() const {
  return !is_necessarily_closed();
}

inline Constraint::expr_type
Constraint::expression() const {
  return expr_type(expr, is_not_necessarily_closed());
}

inline dimension_type
Constraint::space_dimension() const {
  return expression().space_dimension();
}

inline void
Constraint::shift_space_dimensions(Variable v, dimension_type n) {
  expr.shift_space_dimensions(v, n);
}

inline bool
Constraint::is_line_or_equality() const {
  return (kind_ == LINE_OR_EQUALITY);
}

inline bool
Constraint::is_ray_or_point_or_inequality() const {
  return (kind_ == RAY_OR_POINT_OR_INEQUALITY);
}

inline Topology
Constraint::topology() const {
  return topology_;
}

inline void
Constraint::set_is_line_or_equality() {
  kind_ = LINE_OR_EQUALITY;
}

inline void
Constraint::set_is_ray_or_point_or_inequality() {
  kind_ = RAY_OR_POINT_OR_INEQUALITY;
}

inline void
Constraint::set_topology(Topology x) {
  if (topology() == x)
    return;
  if (topology() == NECESSARILY_CLOSED) {

    expr.set_space_dimension(expr.space_dimension() + 1);
  }
  else {
    ((void) 0);
    expr.set_space_dimension(expr.space_dimension() - 1);
  }
  topology_ = x;
}

inline void
Constraint::mark_as_necessarily_closed() {
  ((void) 0);
  topology_ = NECESSARILY_CLOSED;
}

inline void
Constraint::mark_as_not_necessarily_closed() {
  ((void) 0);
  topology_ = NOT_NECESSARILY_CLOSED;
}

inline void
Constraint::set_necessarily_closed() {
  set_topology(NECESSARILY_CLOSED);
}

inline void
Constraint::set_not_necessarily_closed() {
  set_topology(NOT_NECESSARILY_CLOSED);
}

inline
Constraint::Constraint(Representation r)
  : expr(r),
    kind_(RAY_OR_POINT_OR_INEQUALITY),
    topology_(NECESSARILY_CLOSED) {
  ((void) 0);
}

inline
Constraint::Constraint(dimension_type space_dim, Kind kind, Topology topology,
                       Representation r)
  : expr(r),
    kind_(kind),
    topology_(topology) {
  expr.set_space_dimension(space_dim + 1);
  ((void) 0);
  ((void) 0);
}

inline
Constraint::Constraint(Linear_Expression& e, Kind kind, Topology topology)
  : kind_(kind),
    topology_(topology) {
  ((void) 0);
  swap(expr, e);
  if (topology == NOT_NECESSARILY_CLOSED)

    expr.set_space_dimension(expr.space_dimension() + 1);
  strong_normalize();
  ((void) 0);
}

inline
Constraint::Constraint(Linear_Expression& e, Type type, Topology topology)
  : topology_(topology) {
  ((void) 0);
  swap(expr, e);
  if (topology == NOT_NECESSARILY_CLOSED)
    expr.set_space_dimension(expr.space_dimension() + 1);
  if (type == EQUALITY)
    kind_ = LINE_OR_EQUALITY;
  else
    kind_ = RAY_OR_POINT_OR_INEQUALITY;
  strong_normalize();
  ((void) 0);
}

inline
Constraint::Constraint(const Constraint& c)
  : expr(c.expr),
    kind_(c.kind_),
    topology_(c.topology_) {

}

inline
Constraint::Constraint(const Constraint& c, Representation r)
  : expr(c.expr, r),
    kind_(c.kind_),
    topology_(c.topology_) {
  ((void) 0);
}

inline
Constraint::Constraint(const Constraint& c, const dimension_type space_dim)
  : expr(c.expr, c.is_necessarily_closed() ? space_dim : (space_dim + 1)),
    kind_(c.kind_), topology_(c.topology_) {
  ((void) 0);
  ((void) 0);
}

inline
Constraint::Constraint(const Constraint& c, const dimension_type space_dim,
                       Representation r)
  : expr(c.expr, c.is_necessarily_closed() ? space_dim : (space_dim + 1), r),
    kind_(c.kind_), topology_(c.topology_) {
  ((void) 0);
  ((void) 0);
}

inline
Constraint::~Constraint() {
}

inline Constraint&
Constraint::operator=(const Constraint& c) {
  Constraint tmp = c;
  swap(*this, tmp);

  return *this;
}

inline Representation
Constraint::representation() const {
  return expr.representation();
}

inline void
Constraint::set_representation(Representation r) {
  expr.set_representation(r);
}

inline dimension_type
Constraint::max_space_dimension() {
  return Linear_Expression::max_space_dimension();
}

inline void
Constraint::set_space_dimension_no_ok(dimension_type space_dim) {
  const dimension_type old_expr_space_dim = expr.space_dimension();
  if (topology() == NECESSARILY_CLOSED) {
    expr.set_space_dimension(space_dim);
  }
  else {
    const dimension_type old_space_dim = space_dimension();
    if (space_dim > old_space_dim) {
      expr.set_space_dimension(space_dim + 1);
      expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
    }
    else {
      expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
      expr.set_space_dimension(space_dim + 1);
    }
  }
  ((void) 0);
  if (expr.space_dimension() < old_expr_space_dim)
    strong_normalize();
}

inline void
Constraint::set_space_dimension(dimension_type space_dim) {
  set_space_dimension_no_ok(space_dim);
  ((void) 0);
}

inline bool
Constraint::remove_space_dimensions(const Variables_Set& vars) {
  expr.remove_space_dimensions(vars);
  return true;
}

inline bool
Constraint::is_equality() const {
  return is_line_or_equality();
}

inline bool
Constraint::is_inequality() const {
  return is_ray_or_point_or_inequality();
}

inline Constraint::Type
Constraint::type() const {
  if (is_equality())
    return EQUALITY;
  if (is_necessarily_closed())
    return NONSTRICT_INEQUALITY;
  if (epsilon_coefficient() < 0)
    return STRICT_INEQUALITY;
  else
    return NONSTRICT_INEQUALITY;
}

inline bool
Constraint::is_nonstrict_inequality() const {
  return type() == NONSTRICT_INEQUALITY;
}

inline bool
Constraint::is_strict_inequality() const {
  return type() == STRICT_INEQUALITY;
}

inline void
Constraint::set_is_equality() {
  set_is_line_or_equality();
}

inline void
Constraint::set_is_inequality() {
  set_is_ray_or_point_or_inequality();
}

inline Coefficient_traits::const_reference
Constraint::coefficient(const Variable v) const {
  if (v.space_dimension() > space_dimension())
    throw_dimension_incompatible("coefficient(v)", "v", v);
  return expr.coefficient(v);
}

inline Coefficient_traits::const_reference
Constraint::inhomogeneous_term() const {
  return expr.inhomogeneous_term();
}

inline memory_size_type
Constraint::external_memory_in_bytes() const {
  return expr.external_memory_in_bytes();
}

inline memory_size_type
Constraint::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline void
Constraint::strong_normalize() {
  expr.normalize();
  sign_normalize();
}


inline bool
operator==(const Constraint& x, const Constraint& y) {
  return x.is_equivalent_to(y);
}


inline bool
operator!=(const Constraint& x, const Constraint& y) {
  return !x.is_equivalent_to(y);
}


inline Constraint
operator==(const Linear_Expression& e1, const Linear_Expression& e2) {
  Linear_Expression diff(e1,
                         std::max(e1.space_dimension(), e2.space_dimension()),
                         Constraint::default_representation);
  diff -= e2;
  return Constraint(diff, Constraint::EQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator==(Variable v1, Variable v2) {
  if (v1.space_dimension() > v2.space_dimension())
    swap(v1, v2);
  ((void) 0);

  Linear_Expression diff(v1, Constraint::default_representation);
  diff -= v2;
  return Constraint(diff, Constraint::EQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>=(const Linear_Expression& e1, const Linear_Expression& e2) {
  Linear_Expression diff(e1,
                         std::max(e1.space_dimension(), e2.space_dimension()),
                         Constraint::default_representation);
  diff -= e2;
  return Constraint(diff, Constraint::NONSTRICT_INEQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>=(const Variable v1, const Variable v2) {
  Linear_Expression diff(Constraint::default_representation);
  diff.set_space_dimension(std::max(v1.space_dimension(),
                                    v2.space_dimension()));
  diff += v1;
  diff -= v2;
  return Constraint(diff, Constraint::NONSTRICT_INEQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>(const Linear_Expression& e1, const Linear_Expression& e2) {
  Linear_Expression diff(e1, Constraint::default_representation);
  diff -= e2;
  Constraint c(diff, Constraint::STRICT_INEQUALITY, NOT_NECESSARILY_CLOSED);


  c.set_epsilon_coefficient(-1);
  ((void) 0);

  return c;
}


inline Constraint
operator>(const Variable v1, const Variable v2) {
  Linear_Expression diff(Constraint::default_representation);
  diff.set_space_dimension(std::max(v1.space_dimension(),
                                    v2.space_dimension()));
  diff += v1;
  diff -= v2;
  Constraint c(diff, Constraint::STRICT_INEQUALITY, NOT_NECESSARILY_CLOSED);

  c.set_epsilon_coefficient(-1);
  ((void) 0);

  return c;
}


inline Constraint
operator==(Coefficient_traits::const_reference n, const Linear_Expression& e) {
  Linear_Expression diff(e, Constraint::default_representation);
  neg_assign(diff);
  diff += n;
  return Constraint(diff, Constraint::EQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>=(Coefficient_traits::const_reference n, const Linear_Expression& e) {
  Linear_Expression diff(e, Constraint::default_representation);
  neg_assign(diff);
  diff += n;
  return Constraint(diff, Constraint::NONSTRICT_INEQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>(Coefficient_traits::const_reference n, const Linear_Expression& e) {
  Linear_Expression diff(e, Constraint::default_representation);
  neg_assign(diff);
  diff += n;
  Constraint c(diff, Constraint::STRICT_INEQUALITY, NOT_NECESSARILY_CLOSED);


  c.set_epsilon_coefficient(-1);
  ((void) 0);

  return c;
}


inline Constraint
operator==(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  Linear_Expression diff(e, Constraint::default_representation);
  diff -= n;
  return Constraint(diff, Constraint::EQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>=(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  Linear_Expression diff(e, Constraint::default_representation);
  diff -= n;
  return Constraint(diff, Constraint::NONSTRICT_INEQUALITY, NECESSARILY_CLOSED);
}


inline Constraint
operator>(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  Linear_Expression diff(e, Constraint::default_representation);
  diff -= n;
  Constraint c(diff, Constraint::STRICT_INEQUALITY, NOT_NECESSARILY_CLOSED);


  c.set_epsilon_coefficient(-1);
  ((void) 0);

  return c;
}


inline Constraint
operator<=(const Linear_Expression& e1, const Linear_Expression& e2) {
  return e2 >= e1;
}


inline Constraint
operator<=(const Variable v1, const Variable v2) {
  return v2 >= v1;
}


inline Constraint
operator<=(Coefficient_traits::const_reference n, const Linear_Expression& e) {
  return e >= n;
}


inline Constraint
operator<=(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  return n >= e;
}


inline Constraint
operator<(const Linear_Expression& e1, const Linear_Expression& e2) {
  return e2 > e1;
}


inline Constraint
operator<(const Variable v1, const Variable v2) {
  return v2 > v1;
}


inline Constraint
operator<(Coefficient_traits::const_reference n, const Linear_Expression& e) {
  return e > n;
}


inline Constraint
operator<(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  return n > e;
}

inline const Constraint&
Constraint::zero_dim_false() {
  ((void) 0);
  return *zero_dim_false_p;
}

inline const Constraint&
Constraint::zero_dim_positivity() {
  ((void) 0);
  return *zero_dim_positivity_p;
}

inline const Constraint&
Constraint::epsilon_geq_zero() {
  ((void) 0);
  return *epsilon_geq_zero_p;
}

inline const Constraint&
Constraint::epsilon_leq_one() {
  ((void) 0);
  return *epsilon_leq_one_p;
}

inline void
Constraint::m_swap(Constraint& y) {
  using std::swap;
  swap(expr, y.expr);
  swap(kind_, y.kind_);
  swap(topology_, y.topology_);
}

inline Coefficient_traits::const_reference
Constraint::epsilon_coefficient() const {
  ((void) 0);
  return expr.coefficient(Variable(expr.space_dimension() - 1));
}

inline void
Constraint::set_epsilon_coefficient(Coefficient_traits::const_reference n) {
  ((void) 0);
  expr.set_coefficient(Variable(expr.space_dimension() - 1), n);
}


inline void
swap(Constraint& x, Constraint& y) {
  x.m_swap(y);
}

}
# 835 "Constraint_defs.hh" 2
# 35 "Box_defs.hh" 2


# 1 "Generator_System_types.hh" 1
# 16 "Generator_System_types.hh"
namespace Parma_Polyhedra_Library {

class Generator_System;
class Generator_System_const_iterator;

}
# 38 "Box_defs.hh" 2




# 1 "Poly_Con_Relation_types.hh" 1
# 16 "Poly_Con_Relation_types.hh"
namespace Parma_Polyhedra_Library {

class Poly_Con_Relation;

}
# 43 "Box_defs.hh" 2
# 1 "Poly_Gen_Relation_types.hh" 1
# 16 "Poly_Gen_Relation_types.hh"
namespace Parma_Polyhedra_Library {

class Poly_Gen_Relation;

}
# 44 "Box_defs.hh" 2


# 1 "Partially_Reduced_Product_types.hh" 1
# 16 "Partially_Reduced_Product_types.hh"
namespace Parma_Polyhedra_Library {

template <typename D1, typename D2>
class Smash_Reduction;

template <typename D1, typename D2>
class Constraints_Reduction;

template <typename D1, typename D2>
class Congruences_Reduction;

template <typename D1, typename D2>
class Shape_Preserving_Reduction;

template <typename D1, typename D2>
class No_Reduction;

template <typename D1, typename D2, typename R>
class Partially_Reduced_Product;

}
# 47 "Box_defs.hh" 2
# 1 "intervals_defs.hh" 1
# 32 "intervals_defs.hh"
namespace Parma_Polyhedra_Library {





enum I_Result {



  I_EMPTY = 1U,



  I_SINGLETON = 2U,





  I_SOME = 4U,



  I_UNIVERSE = 8U,



  I_NOT_EMPTY = I_SINGLETON | I_SOME | I_UNIVERSE,



  I_ANY = I_EMPTY | I_NOT_EMPTY,



  I_NOT_UNIVERSE = I_EMPTY | I_SINGLETON | I_SOME,



  I_NOT_DEGENERATE = I_SINGLETON | I_SOME,



  I_EXACT = 16,



  I_INEXACT = 32,



  I_CHANGED = 64,



  I_UNCHANGED = 128,



  I_SINGULARITIES = 256
};

inline I_Result
operator|(I_Result a, I_Result b) {
  return static_cast<I_Result>(static_cast<unsigned>(a)
                               | static_cast<unsigned>(b));
}

inline I_Result
operator&(I_Result a, I_Result b) {
  return static_cast<I_Result>(static_cast<unsigned>(a)
                               & static_cast<unsigned>(b));
}

inline I_Result
operator-(I_Result a, I_Result b) {
    return static_cast<I_Result>(static_cast<unsigned>(a)
                                 & ~static_cast<unsigned>(b));
}

template <typename Criteria, typename T>
struct Use_By_Ref;

struct Use_Slow_Copy;
template <typename T>
struct Use_By_Ref<Use_Slow_Copy, T>
  : public Bool<Slow_Copy<T>::value> {
};

struct By_Value;
template <typename T>
struct Use_By_Ref<By_Value, T>
  : public False {
};

struct By_Ref;
template <typename T>
struct Use_By_Ref<By_Ref, T>
  : public True {
};

template <typename T, typename Criteria = Use_Slow_Copy, typename Enable = void>
class Val_Or_Ref;

template <typename T, typename Criteria>
class Val_Or_Ref<T, Criteria,
                 typename Enable_If<!Use_By_Ref<Criteria, T>::value>::type> {
  T value;
public:
  typedef T Arg_Type;
  typedef T Return_Type;
  Val_Or_Ref()
    : value() {
  }
  explicit Val_Or_Ref(Arg_Type v, bool = false)
    : value(v) {
  }
  Val_Or_Ref& operator=(Arg_Type v) {
    value = v;
    return *this;
  }
  void set(Arg_Type v, bool = false) {
    value = v;
  }
  Return_Type get() const {
    return value;
  }
  operator Return_Type () const {
    return get();
  }
};

template <typename T, typename Criteria>
class Val_Or_Ref<T, Criteria,
                 typename Enable_If<Use_By_Ref<Criteria, T>::value>::type> {
  const T* ptr;
public:
  typedef T& Arg_Type;
  typedef const T& Return_Type;
  Val_Or_Ref()
    : ptr(0) {
  }
  explicit Val_Or_Ref(Arg_Type v)
    : ptr(&v) {
  }
  Val_Or_Ref(const T& v, bool)
    : ptr(&v) {
  }
  Val_Or_Ref& operator=(Arg_Type v) {
    ptr = &v;
    return *this;
  }
  void set(Arg_Type v) {
    ptr = &v;
  }
  void set(const T& v, bool) {
    ptr = &v;
  }
  Return_Type get() const {
    return *ptr;
  }
  operator Return_Type () const {
    return get();
  }
};

class I_Constraint_Base {
};

template <typename Derived>
class I_Constraint_Common : public I_Constraint_Base {
public:
  template <typename T>
  Result convert_real(T& to) const {
    const Derived& c = static_cast<const Derived&>(*this);
    Result r = c.rel();
    switch (r) {
    case V_EMPTY:
    case V_LGE:
      return r;
    case V_LE:
      r = assign_r(to, c.value(), (ROUND_UP | ROUND_STRICT_RELATION));
      r = result_relation_class(r);
      if (r == V_EQ)
        return V_LE;
      goto lt;
    case V_LT:
      r = assign_r(to, c.value(), ROUND_UP);
      r = result_relation_class(r);
    lt:
      switch (r) {
      case V_EMPTY:
      case V_LT_PLUS_INFINITY:
      case V_EQ_MINUS_INFINITY:
        return r;
      case V_LT:
      case V_LE:
      case V_EQ:
        return V_LT;
      default:
        break;
      }
      break;
    case V_GE:
      r = assign_r(to, c.value(), (ROUND_DOWN | ROUND_STRICT_RELATION));
      r = result_relation_class(r);
      if (r == V_EQ)
        return V_GE;
      goto gt;
    case V_GT:
      r = assign_r(to, c.value(), ROUND_DOWN);
      r = result_relation_class(r);
    gt:
      switch (r) {
      case V_EMPTY:
      case V_GT_MINUS_INFINITY:
      case V_EQ_PLUS_INFINITY:
        return r;
      case V_LT:
      case V_LE:
      case V_EQ:
        return V_GT;
      default:
        break;
      }
      break;
    case V_EQ:
      r = assign_r(to, c.value(), ROUND_CHECK);
      r = result_relation_class(r);
      ((void) 0);
      if (r == V_EQ)
        return V_EQ;
      else
        return V_EMPTY;
    case V_NE:
      r = assign_r(to, c.value(), ROUND_CHECK);
      r = result_relation_class(r);
      if (r == V_EQ)
        return V_NE;
      else
        return V_LGE;
    default:
      break;
    }
    Parma_Polyhedra_Library::ppl_unreachable();
    return V_EMPTY;
  }
  template <typename T>
  Result convert_real(T& to1, Result& rel2, T& to2) const {
    const Derived& c = static_cast<const Derived&>(*this);
    Result rel1;
    if (c.rel() != V_EQ) {
      rel2 = convert(to2);
      return V_LGE;
    }
    rel2 = assign_r(to2, c.value(), ROUND_UP);
    rel2 = result_relation_class(rel2);
    switch (rel2) {
    case V_EMPTY:
    case V_EQ_MINUS_INFINITY:
    case V_EQ:
      return V_LGE;
    default:
      break;
    }
    rel1 = assign_r(to1, c.value(), ROUND_DOWN);
    rel1 = result_relation_class(rel1);
    switch (rel1) {
    case V_EQ:
      ((void) 0);
      goto eq;
    case V_EQ_PLUS_INFINITY:
    case V_EMPTY:
      rel2 = rel1;
      return V_LGE;
    case V_GE:
      if (rel2 == V_LE && to1 == to2) {
      eq:
        rel2 = V_EQ;
        return V_LGE;
      }

    case V_GT:
    case V_GT_MINUS_INFINITY:
      return rel1;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      return V_EMPTY;
    }
    switch (rel2) {
    case V_LE:
    case V_LT:
    case V_LT_PLUS_INFINITY:
      return rel1;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      return V_EMPTY;
    }
  }
  template <typename T>
  Result convert_integer(T& to) const {
    Result rel = convert_real(to);
    switch (rel) {
    case V_LT:
      if (is_integer(to)) {
        rel = sub_assign_r(to, to, T(1), (ROUND_UP | ROUND_STRICT_RELATION));
        rel = result_relation_class(rel);
        return (rel == V_EQ) ? V_LE : rel;
      }

    case V_LE:
      rel = floor_assign_r(to, to, ROUND_UP);
      rel = result_relation_class(rel);
      ((void) 0);
      return V_LE;
    case V_GT:
      if (is_integer(to)) {
        rel = add_assign_r(to, to, T(1), (ROUND_DOWN | ROUND_STRICT_RELATION));
        rel = result_relation_class(rel);
        return (rel == V_EQ) ? V_GE : rel;
      }

    case V_GE:
      rel = ceil_assign_r(to, to, ROUND_DOWN);
      rel = result_relation_class(rel);
      ((void) 0);
      return V_GE;
    case V_EQ:
      if (is_integer(to))
        return V_EQ;
      return V_EMPTY;
    case V_NE:
      if (is_integer(to))
        return V_NE;
      return V_LGE;
    default:
      return rel;
    }
  }
};

struct I_Constraint_Rel {
  Result rel;
  I_Constraint_Rel(Result r)
    : rel(r) {
    ((void) 0);
  }
  I_Constraint_Rel(Relation_Symbol r)
    : rel(static_cast<Result>(r)) {
  }
  operator Result() const {
    return rel;
  }
};

template <typename T, typename Val_Or_Ref_Criteria = Use_Slow_Copy,
          bool extended = false>
class I_Constraint
  : public I_Constraint_Common<I_Constraint<T, Val_Or_Ref_Criteria,
                                            extended> > {
  typedef Val_Or_Ref<T, Val_Or_Ref_Criteria> Val_Ref;
  typedef typename Val_Ref::Arg_Type Arg_Type;
  typedef typename Val_Ref::Return_Type Return_Type;
  Result rel_;
  Val_Ref value_;
public:
  typedef T value_type;
  explicit I_Constraint()
    : rel_(V_LGE) {
  }
  I_Constraint(I_Constraint_Rel r, Arg_Type v)
    : rel_(r), value_(v) {
  }
  I_Constraint(I_Constraint_Rel r, const T& v, bool force)
    : rel_(r), value_(v, force) {
  }
  template <typename U>
  I_Constraint(I_Constraint_Rel r, const U& v)
    : rel_(r), value_(v) {
  }
  void set(I_Constraint_Rel r, Arg_Type v) {
    rel_ = r;
    value_.set(v);
  }
  void set(I_Constraint_Rel r, const T& v, bool force) {
    rel_ = r;
    value_.set(v, force);
  }
  template <typename U>
  void set(I_Constraint_Rel r, const U& v) {
    rel_ = r;
    value_.set(v);
  }
  Return_Type value() const {
    return value_;
  }
  Result rel() const {
    return rel_;
  }
};

template <typename T>
inline I_Constraint<T>
i_constraint(I_Constraint_Rel rel, const T& v) {
  return I_Constraint<T>(rel, v);
}

template <typename T>
inline I_Constraint<T>
i_constraint(I_Constraint_Rel rel, const T& v, bool force) {
  return I_Constraint<T>(rel, v, force);
}

template <typename T>
inline I_Constraint<T>
i_constraint(I_Constraint_Rel rel, T& v) {
  return I_Constraint<T>(rel, v);
}

template <typename T, typename Val_Or_Ref_Criteria>
inline I_Constraint<T, Val_Or_Ref_Criteria>
i_constraint(I_Constraint_Rel rel, const T& v, const Val_Or_Ref_Criteria&) {
  return I_Constraint<T, Val_Or_Ref_Criteria>(rel, v);
}

template <typename T, typename Val_Or_Ref_Criteria>
inline I_Constraint<T, Val_Or_Ref_Criteria>
i_constraint(I_Constraint_Rel rel, const T& v, bool force,
             const Val_Or_Ref_Criteria&) {
  return I_Constraint<T, Val_Or_Ref_Criteria>(rel, v, force);
}

template <typename T, typename Val_Or_Ref_Criteria>
inline I_Constraint<T, Val_Or_Ref_Criteria>
i_constraint(I_Constraint_Rel rel, T& v, const Val_Or_Ref_Criteria&) {
  return I_Constraint<T, Val_Or_Ref_Criteria>(rel, v);
}

}
# 48 "Box_defs.hh" 2
# 1 "Interval_types.hh" 1
# 16 "Interval_types.hh"
namespace Parma_Polyhedra_Library {

template <typename Boundary, typename Info>
class Interval;

}
# 49 "Box_defs.hh" 2




namespace Parma_Polyhedra_Library {

struct Interval_Base;



template <typename ITV>
void swap(Box<ITV>& x, Box<ITV>& y);






template <typename ITV>
bool operator==(const Box<ITV>& x, const Box<ITV>& y);






template <typename ITV>
bool operator!=(const Box<ITV>& x, const Box<ITV>& y);

namespace IO_Operators {



template <typename ITV>
std::ostream& operator<<(std::ostream& s, const Box<ITV>& box);

}
# 98 "Box_defs.hh"
template <typename To, typename ITV>
bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Box<ITV>& x,
                            const Box<ITV>& y,
                            Rounding_Dir dir);
# 116 "Box_defs.hh"
template <typename Temp, typename To, typename ITV>
bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Box<ITV>& x,
                            const Box<ITV>& y,
                            Rounding_Dir dir);
# 134 "Box_defs.hh"
template <typename Temp, typename To, typename ITV>
bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Box<ITV>& x,
                            const Box<ITV>& y,
                            Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2);
# 155 "Box_defs.hh"
template <typename To, typename ITV>
bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Box<ITV>& x,
                          const Box<ITV>& y,
                          Rounding_Dir dir);
# 173 "Box_defs.hh"
template <typename Temp, typename To, typename ITV>
bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Box<ITV>& x,
                          const Box<ITV>& y,
                          Rounding_Dir dir);
# 191 "Box_defs.hh"
template <typename Temp, typename To, typename ITV>
bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Box<ITV>& x,
                          const Box<ITV>& y,
                          Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2);
# 212 "Box_defs.hh"
template <typename To, typename ITV>
bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Box<ITV>& x,
                           const Box<ITV>& y,
                           Rounding_Dir dir);
# 230 "Box_defs.hh"
template <typename Temp, typename To, typename ITV>
bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Box<ITV>& x,
                           const Box<ITV>& y,
                           Rounding_Dir dir);
# 248 "Box_defs.hh"
template <typename Temp, typename To, typename ITV>
bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Box<ITV>& x,
                           const Box<ITV>& y,
                           Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2);






template <typename Specialization,
          typename Temp, typename To, typename ITV>
bool
l_m_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                    const Box<ITV>& x, const Box<ITV>& y,
                    Rounding_Dir dir,
                    Temp& tmp0, Temp& tmp1, Temp& tmp2);

}
# 298 "Box_defs.hh"
template <typename ITV>
class Parma_Polyhedra_Library::Box {
public:

  typedef ITV interval_type;


  static dimension_type max_space_dimension();




  static bool can_recycle_constraint_systems();




  static bool can_recycle_congruence_systems();
# 328 "Box_defs.hh"
  explicit Box(dimension_type num_dimensions = 0,
               Degenerate_Element kind = UNIVERSE);





  Box(const Box& y,
      Complexity_Class complexity = ANY_COMPLEXITY);





  template <typename Other_ITV>
  explicit Box(const Box<Other_ITV>& y,
               Complexity_Class complexity = ANY_COMPLEXITY);
# 356 "Box_defs.hh"
  explicit Box(const Constraint_System& cs);
# 372 "Box_defs.hh"
  Box(const Constraint_System& cs, Recycle_Input dummy);
# 382 "Box_defs.hh"
  explicit Box(const Generator_System& gs);
# 399 "Box_defs.hh"
  Box(const Generator_System& gs, Recycle_Input dummy);
# 411 "Box_defs.hh"
  explicit Box(const Congruence_System& cgs);
# 427 "Box_defs.hh"
  Box(const Congruence_System& cgs, Recycle_Input dummy);






  template <typename T>
  explicit Box(const BD_Shape<T>& bds,
               Complexity_Class complexity = POLYNOMIAL_COMPLEXITY);






  template <typename T>
  explicit Box(const Octagonal_Shape<T>& oct,
               Complexity_Class complexity = POLYNOMIAL_COMPLEXITY);
# 454 "Box_defs.hh"
  explicit Box(const Polyhedron& ph,
               Complexity_Class complexity = ANY_COMPLEXITY);






  explicit Box(const Grid& gr,
               Complexity_Class complexity = POLYNOMIAL_COMPLEXITY);






  template <typename D1, typename D2, typename R>
  explicit Box(const Partially_Reduced_Product<D1, D2, R>& dp,
               Complexity_Class complexity = ANY_COMPLEXITY);





  Box& operator=(const Box& y);





  void m_swap(Box& y);







  dimension_type space_dimension() const;






  dimension_type affine_dimension() const;


  bool is_empty() const;


  bool is_universe() const;





  bool is_topologically_closed() const;


  bool is_discrete() const;


  bool is_bounded() const;





  bool contains_integer_point() const;
# 532 "Box_defs.hh"
  bool constrains(Variable var) const;






  Poly_Con_Relation relation_with(const Constraint& c) const;






  Poly_Con_Relation relation_with(const Congruence& cg) const;






  Poly_Gen_Relation relation_with(const Generator& g) const;
# 562 "Box_defs.hh"
  bool bounds_from_above(const Linear_Expression& expr) const;
# 571 "Box_defs.hh"
  bool bounds_from_below(const Linear_Expression& expr) const;
# 597 "Box_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum) const;
# 628 "Box_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                Generator& g) const;
# 656 "Box_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum) const;
# 687 "Box_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                Generator& g) const;
# 719 "Box_defs.hh"
  bool frequency(const Linear_Expression& expr,
                 Coefficient& freq_n, Coefficient& freq_d,
                 Coefficient& val_n, Coefficient& val_d) const;







  bool contains(const Box& y) const;







  bool strictly_contains(const Box& y) const;







  bool is_disjoint_from(const Box& y) const;





  bool OK() const;
# 769 "Box_defs.hh"
  void add_constraint(const Constraint& c);
# 783 "Box_defs.hh"
  void add_constraints(const Constraint_System& cs);
# 801 "Box_defs.hh"
  void add_recycled_constraints(Constraint_System& cs);
# 813 "Box_defs.hh"
  void add_congruence(const Congruence& cg);
# 826 "Box_defs.hh"
  void add_congruences(const Congruence_System& cgs);
# 844 "Box_defs.hh"
  void add_recycled_congruences(Congruence_System& cgs);
# 855 "Box_defs.hh"
  void refine_with_constraint(const Constraint& c);
# 876 "Box_defs.hh"
  void refine_with_constraints(const Constraint_System& cs);
# 887 "Box_defs.hh"
  void refine_with_congruence(const Congruence& cg);
# 898 "Box_defs.hh"
  void refine_with_congruences(const Congruence_System& cgs);
# 909 "Box_defs.hh"
  void propagate_constraint(const Constraint& c);
# 928 "Box_defs.hh"
  void propagate_constraints(const Constraint_System& cs,
                             dimension_type max_iterations = 0);
# 941 "Box_defs.hh"
  void unconstrain(Variable var);
# 955 "Box_defs.hh"
  void unconstrain(const Variables_Set& vars);






  void intersection_assign(const Box& y);
# 971 "Box_defs.hh"
  void upper_bound_assign(const Box& y);
# 981 "Box_defs.hh"
  bool upper_bound_assign_if_exact(const Box& y);







  void difference_assign(const Box& y);
# 999 "Box_defs.hh"
  bool simplify_using_context_assign(const Box& y);
# 1022 "Box_defs.hh"
  void affine_image(Variable var,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator
                      = Coefficient_one());
# 1048 "Box_defs.hh"
  void affine_form_image(Variable var,
                         const Linear_Form<ITV>& lf);
# 1071 "Box_defs.hh"
  void affine_preimage(Variable var,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator
                         = Coefficient_one());
# 1100 "Box_defs.hh"
  void generalized_affine_image(Variable var,
                                Relation_Symbol relsym,
                                const Linear_Expression& expr,
                                Coefficient_traits::const_reference denominator
                                  = Coefficient_one());
# 1130 "Box_defs.hh"
  void
  generalized_affine_preimage(Variable var,
                              Relation_Symbol relsym,
                              const Linear_Expression& expr,
                              Coefficient_traits::const_reference denominator
                              = Coefficient_one());
# 1155 "Box_defs.hh"
  void generalized_affine_image(const Linear_Expression& lhs,
                                Relation_Symbol relsym,
                                const Linear_Expression& rhs);
# 1177 "Box_defs.hh"
  void generalized_affine_preimage(const Linear_Expression& lhs,
                                   Relation_Symbol relsym,
                                   const Linear_Expression& rhs);
# 1206 "Box_defs.hh"
  void bounded_affine_image(Variable var,
                            const Linear_Expression& lb_expr,
                            const Linear_Expression& ub_expr,
                            Coefficient_traits::const_reference denominator
                            = Coefficient_one());
# 1237 "Box_defs.hh"
  void bounded_affine_preimage(Variable var,
                               const Linear_Expression& lb_expr,
                               const Linear_Expression& ub_expr,
                               Coefficient_traits::const_reference denominator
                               = Coefficient_one());
# 1250 "Box_defs.hh"
  void time_elapse_assign(const Box& y);


  void topological_closure_assign();
# 1295 "Box_defs.hh"
  void wrap_assign(const Variables_Set& vars,
                   Bounded_Integer_Type_Width w,
                   Bounded_Integer_Type_Representation r,
                   Bounded_Integer_Type_Overflow o,
                   const Constraint_System* cs_p = 0,
                   unsigned complexity_threshold = 16,
                   bool wrap_individually = true);
# 1314 "Box_defs.hh"
  void drop_some_non_integer_points(Complexity_Class complexity
                                    = ANY_COMPLEXITY);
# 1332 "Box_defs.hh"
  void drop_some_non_integer_points(const Variables_Set& vars,
                                    Complexity_Class complexity
                                    = ANY_COMPLEXITY);
# 1351 "Box_defs.hh"
  template <typename T>
  typename Enable_If<Is_Same<T, Box>::value
                     && Is_Same_Or_Derived<Interval_Base, ITV>::value,
                     void>::type
  CC76_widening_assign(const T& y, unsigned* tp = 0);
# 1373 "Box_defs.hh"
  template <typename T, typename Iterator>
  typename Enable_If<Is_Same<T, Box>::value
                     && Is_Same_Or_Derived<Interval_Base, ITV>::value,
                     void>::type
  CC76_widening_assign(const T& y,
                       Iterator first, Iterator last);


  void widening_assign(const Box& y, unsigned* tp = 0);
# 1403 "Box_defs.hh"
  void limited_CC76_extrapolation_assign(const Box& y,
                                         const Constraint_System& cs,
                                         unsigned* tp = 0);
# 1426 "Box_defs.hh"
  template <typename T>
  typename Enable_If<Is_Same<T, Box>::value
                     && Is_Same_Or_Derived<Interval_Base, ITV>::value,
                     void>::type
  CC76_narrowing_assign(const T& y);
# 1455 "Box_defs.hh"
  void add_space_dimensions_and_embed(dimension_type m);
# 1478 "Box_defs.hh"
  void add_space_dimensions_and_project(dimension_type m);
# 1503 "Box_defs.hh"
  void concatenate_assign(const Box& y);
# 1514 "Box_defs.hh"
  void remove_space_dimensions(const Variables_Set& vars);
# 1524 "Box_defs.hh"
  void remove_higher_space_dimensions(dimension_type new_dimension);
# 1563 "Box_defs.hh"
  template <typename Partial_Function>
  void map_space_dimensions(const Partial_Function& pfunc);
# 1587 "Box_defs.hh"
  void expand_space_dimension(Variable var, dimension_type m);
# 1612 "Box_defs.hh"
  void fold_space_dimensions(const Variables_Set& vars, Variable dest);
# 1622 "Box_defs.hh"
  const ITV& get_interval(Variable var) const;







  void set_interval(Variable var, const ITV& i);
# 1663 "Box_defs.hh"
  bool has_lower_bound(Variable var,
                       Coefficient& n, Coefficient& d, bool& closed) const;
# 1697 "Box_defs.hh"
  bool has_upper_bound(Variable var,
                       Coefficient& n, Coefficient& d, bool& closed) const;


  Constraint_System constraints() const;


  Constraint_System minimized_constraints() const;


  Congruence_System congruences() const;


  Congruence_System minimized_congruences() const;


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  int32_t hash_code() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;
# 1735 "Box_defs.hh"
  bool ascii_load(std::istream& s);

private:
  template <typename Other_ITV>
  friend class Parma_Polyhedra_Library::Box;

  friend bool
  operator==<ITV>(const Box<ITV>& x, const Box<ITV>& y);

  friend std::ostream&
  Parma_Polyhedra_Library
  ::IO_Operators::operator<<<>(std::ostream& s, const Box<ITV>& box);

  template <typename Specialization, typename Temp, typename To, typename I>
  friend bool Parma_Polyhedra_Library::l_m_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const Box<I>& x, const Box<I>& y, const Rounding_Dir dir,
   Temp& tmp0, Temp& tmp1, Temp& tmp2);


  typedef std::vector<ITV> Sequence;





  typedef ITV Tmp_Interval_Type;


  Sequence seq;


# 1 "Box_Status_idefs.hh" 1
# 43 "Box_Status_idefs.hh"
class Status;

class Status {
public:

  Status();


  Status(const Status& y);


  template <typename Other_ITV>
  Status(const typename Box<Other_ITV>::Status& y);



  bool test_empty_up_to_date() const;
  void reset_empty_up_to_date();
  void set_empty_up_to_date();

  bool test_empty() const;
  void reset_empty();
  void set_empty();

  bool test_universe() const;
  void reset_universe();
  void set_universe();



  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);

private:

  typedef unsigned int flags_t;



  static const flags_t NONE = 0U;
  static const flags_t EMPTY_UP_TO_DATE = 1U << 0;
  static const flags_t EMPTY = 1U << 1;
  static const flags_t UNIVERSE = 1U << 2;



  flags_t flags;


  Status(flags_t mask);


  bool test_all(flags_t mask) const;


  bool test_any(flags_t mask) const;


  void set(flags_t mask);


  void reset(flags_t mask);
};
# 1768 "Box_defs.hh" 2



  Status status;







  bool marked_empty() const;

public:

  void set_empty();

private:

  void set_nonempty();


  void set_empty_up_to_date();


  void reset_empty_up_to_date();





  bool check_empty() const;





  const ITV& operator[](dimension_type k) const;




  static I_Result
  refine_interval_no_check(ITV& itv,
                           Constraint::Type type,
                           Coefficient_traits::const_reference numer,
                           Coefficient_traits::const_reference denom);




  void
  add_interval_constraint_no_check(dimension_type var_id,
                                   Constraint::Type type,
                                   Coefficient_traits::const_reference numer,
                                   Coefficient_traits::const_reference denom);




  void add_constraint_no_check(const Constraint& c);




  void add_constraints_no_check(const Constraint_System& cs);




  void add_congruence_no_check(const Congruence& cg);




  void add_congruences_no_check(const Congruence_System& cgs);
# 1855 "Box_defs.hh"
  void refine_no_check(const Constraint& c);
# 1869 "Box_defs.hh"
  void refine_no_check(const Constraint_System& cs);
# 1882 "Box_defs.hh"
  void refine_no_check(const Congruence& cg);
# 1895 "Box_defs.hh"
  void refine_no_check(const Congruence_System& cgs);
# 2057 "Box_defs.hh"
  void propagate_constraint_no_check(const Constraint& c);
# 2077 "Box_defs.hh"
  void propagate_constraints_no_check(const Constraint_System& cs,
                                      dimension_type max_iterations);
# 2097 "Box_defs.hh"
  bool bounds(const Linear_Expression& expr, bool from_above) const;
# 2129 "Box_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included,
               Generator& g) const;
# 2159 "Box_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included) const;





  void get_limiting_box(const Constraint_System& cs,
                        Box& limiting_box) const;



  void throw_dimension_incompatible(const char* method,
                                    const Box& y) const;

  void throw_dimension_incompatible(const char* method,
                                    dimension_type required_dim) const;

  void throw_dimension_incompatible(const char* method,
                                    const Constraint& c) const;

  void throw_dimension_incompatible(const char* method,
                                    const Congruence& cg) const;

  void throw_dimension_incompatible(const char* method,
                                    const Constraint_System& cs) const;

  void throw_dimension_incompatible(const char* method,
                                    const Congruence_System& cgs) const;

  void throw_dimension_incompatible(const char* method,
                                    const Generator& g) const;

  void throw_dimension_incompatible(const char* method,
                                    const char* le_name,
                                    const Linear_Expression& le) const;

  template <typename C>
  void throw_dimension_incompatible(const char* method,
                                    const char* lf_name,
                                    const Linear_Form<C>& lf) const;

  static void throw_constraint_incompatible(const char* method);

  static void throw_expression_too_complex(const char* method,
                                           const Linear_Expression& le);

  static void throw_invalid_argument(const char* method, const char* reason);

};

namespace Parma_Polyhedra_Library {
# 2236 "Box_defs.hh"
template <typename ITV>
Poly_Con_Relation
interval_relation(const ITV& i,
                  const Constraint::Type constraint_type,
                  Coefficient_traits::const_reference numer,
                  Coefficient_traits::const_reference denom = 1);

class Box_Helpers {
public:
# 2269 "Box_defs.hh"
  static bool extract_interval_constraint(const Constraint& c,
                                          dimension_type& c_num_vars,
                                          dimension_type& c_only_var);



  static bool extract_interval_congruence(const Congruence& cg,
                                          dimension_type& cg_num_vars,
                                          dimension_type& cg_only_var);
};

}

# 1 "Box_Status_inlines.hh" 1
# 29 "Box_Status_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename ITV>
inline
Box<ITV>::Status::Status(flags_t mask)
  : flags(mask) {
}

template <typename ITV>
inline
Box<ITV>::Status::Status(const Status& y)
  : flags(y.flags) {
}

template <typename ITV>
template <typename Other_ITV>
inline
Box<ITV>::Status::Status(const typename Box<Other_ITV>::Status& y)
  : flags(y.flags) {
}

template <typename ITV>
inline
Box<ITV>::Status::Status()
  : flags(NONE) {
}

template <typename ITV>
inline bool
Box<ITV>::Status::test_all(flags_t mask) const {
  return (flags & mask) == mask;
}

template <typename ITV>
inline bool
Box<ITV>::Status::test_any(flags_t mask) const {
  return (flags & mask) != 0;
}

template <typename ITV>
inline void
Box<ITV>::Status::set(flags_t mask) {
  flags |= mask;
}

template <typename ITV>
inline void
Box<ITV>::Status::reset(flags_t mask) {
  flags &= ~mask;
}

template <typename ITV>
inline bool
Box<ITV>::Status::test_empty_up_to_date() const {
  return test_any(EMPTY_UP_TO_DATE);
}

template <typename ITV>
inline void
Box<ITV>::Status::reset_empty_up_to_date() {
  reset(EMPTY_UP_TO_DATE);
}

template <typename ITV>
inline void
Box<ITV>::Status::set_empty_up_to_date() {
  set(EMPTY_UP_TO_DATE);
}

template <typename ITV>
inline bool
Box<ITV>::Status::test_empty() const {
  return test_any(EMPTY);
}

template <typename ITV>
inline void
Box<ITV>::Status::reset_empty() {
  reset(EMPTY);
}

template <typename ITV>
inline void
Box<ITV>::Status::set_empty() {
  set(EMPTY);
}

template <typename ITV>
inline bool
Box<ITV>::Status::test_universe() const {
  return test_any(UNIVERSE);
}

template <typename ITV>
inline void
Box<ITV>::Status::reset_universe() {
  reset(UNIVERSE);
}

template <typename ITV>
inline void
Box<ITV>::Status::set_universe() {
  set(UNIVERSE);
}

template <typename ITV>
bool
Box<ITV>::Status::OK() const {
  if (test_empty_up_to_date()
      && test_empty()
      && test_universe()) {





    return false;
  }


  return true;
}


namespace Implementation {

namespace Boxes {


const std::string empty_up_to_date = "EUP";
const std::string empty = "EM";
const std::string universe = "UN";
const char yes = '+';
const char no = '-';
const char separator = ' ';
# 172 "Box_Status_inlines.hh"
inline bool
get_field(std::istream& s, const std::string& keyword, bool& positive) {
  std::string str;
  if (!(s >> str)
      || (str[0] != yes && str[0] != no)
      || str.substr(1) != keyword)
    return false;
  positive = (str[0] == yes);
  return true;
}

}

}

template <typename ITV>
void
Box<ITV>::Status::ascii_dump(std::ostream& s) const {
  using namespace Implementation::Boxes;
  s << (test_empty_up_to_date() ? yes : no) << empty_up_to_date << separator
    << (test_empty() ? yes : no) << empty << separator
    << (test_universe() ? yes : no) << universe << separator;
}

template <typename ITV> void Box<ITV>::Status::ascii_dump() const { ascii_dump(std::cerr); } template <typename ITV> void Box<ITV>::Status::print() const { std::cerr << "No user level output operator defined " << "for " "Box<ITV>::Status" << "." << std::endl; }

template <typename ITV>
bool
Box<ITV>::Status::ascii_load(std::istream& s) {
  using namespace Implementation::Boxes;
  bool positive = Suppress_Uninitialized_Warnings_Type<bool>::synonym ();

  if (!get_field(s, Implementation::Boxes::empty_up_to_date, positive))
    return false;
  if (positive)
    set_empty_up_to_date();

  if (!get_field(s, Implementation::Boxes::empty, positive))
    return false;
  if (positive)
    set_empty();

  if (!get_field(s, universe, positive))
    return false;
  if (positive)
    set_universe();
  else
    reset_universe();


  ((void) 0);
  return true;
}

}
# 2283 "Box_defs.hh" 2
# 1 "Box_inlines.hh" 1
# 27 "Box_inlines.hh"
# 1 "Boundary_defs.hh" 1
# 29 "Boundary_defs.hh"
namespace Parma_Polyhedra_Library {

namespace Boundary_NS {

struct Property {
  enum Type {
    SPECIAL_,
    OPEN_,
  };
  typedef bool Value;
  static const Value default_value = true;
  static const Value unsupported_value = false;
  Property(Type t)
    : type(t) {
  }
  Type type;
};

static const Property SPECIAL(Property::SPECIAL_);
static const Property OPEN(Property::OPEN_);

enum Boundary_Type {
  LOWER = ROUND_DOWN,
  UPPER = ROUND_UP
};

inline Rounding_Dir
round_dir_check(Boundary_Type t, bool check = false) {
  if (check)
    return static_cast<Rounding_Dir>(t) | ROUND_STRICT_RELATION;
  else
    return static_cast<Rounding_Dir>(t);
}

template <typename T, typename Info>
inline Result
special_set_boundary_infinity(Boundary_Type type, T&, Info& info) {
  ((void) 0);
  info.set_boundary_property(type, SPECIAL);
  return V_EQ;
}

template <typename T, typename Info>
inline bool
special_is_open(Boundary_Type, const T&, const Info&) {
  return !Info::may_contain_infinity;
}

template <typename T, typename Info>
inline bool
normal_is_open(Boundary_Type type, const T& x, const Info& info) {
  if (Info::store_open)
    return info.get_boundary_property(type, OPEN);
  else
    return !Info::store_special && !Info::may_contain_infinity
      && normal_is_boundary_infinity(type, x, info);
}

template <typename T, typename Info>
inline bool
is_open(Boundary_Type type, const T& x, const Info& info) {
  if (Info::store_open)
    return info.get_boundary_property(type, OPEN);
  else
    return !Info::may_contain_infinity
      && is_boundary_infinity(type, x, info);
}

template <typename T, typename Info>
inline Result
set_unbounded(Boundary_Type type, T& x, Info& info) {
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_103 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(Info::store_special || std::numeric_limits<T>::is_bounded || std::numeric_limits<T>::has_infinity)>) };



  Result r;
  if (Info::store_special)
    r = special_set_boundary_infinity(type, x, info);
  else if (type == LOWER)
    r = assign_r(x, MINUS_INFINITY, ROUND_UP);
  else
    r = assign_r(x, PLUS_INFINITY, ROUND_DOWN);
  if (result_relation(r) == VR_EQ && !Info::may_contain_infinity)
    info.set_boundary_property(type, OPEN);
  return r;
}

template <typename T, typename Info>
inline Result
set_minus_infinity(Boundary_Type type, T& x, Info& info, bool open = false) {
  if (open) {
    ((void) 0);
  }
  else {
    ((void) 0);
  }
  Result r;
  if (Info::store_special) {
    ((void) 0);
    r = special_set_boundary_infinity(type, x, info);
  }
  else {
    r = assign_r(x, MINUS_INFINITY, round_dir_check(type));
    ((void) 0);
  }
  if (open || result_relation(r) != VR_EQ)
    info.set_boundary_property(type, OPEN);
  return r;
}

template <typename T, typename Info>
inline Result
set_plus_infinity(Boundary_Type type, T& x, Info& info, bool open = false) {
  if (open) {
    ((void) 0);
  }
  else {
    ((void) 0);
  }
  Result r;
  if (Info::store_special) {
    ((void) 0);
    r = special_set_boundary_infinity(type, x, info);
  }
  else {
    r = assign_r(x, PLUS_INFINITY, round_dir_check(type));
    ((void) 0);
  }
  if (open || result_relation(r) != VR_EQ)
    info.set_boundary_property(type, OPEN);
  return r;
}

template <typename T, typename Info>
inline Result
set_boundary_infinity(Boundary_Type type, T& x, Info& info, bool open = false) {
  ((void) 0);
  Result r;
  if (Info::store_special)
    r = special_set_boundary_infinity(type, x, info);
  else if (type == LOWER)
    r = assign_r(x, MINUS_INFINITY, round_dir_check(type));
  else
    r = assign_r(x, PLUS_INFINITY, round_dir_check(type));
  ((void) 0);
  if (open)
    info.set_boundary_property(type, OPEN);
  return r;
}

template <typename T, typename Info>
inline bool
is_domain_inf(Boundary_Type type, const T& x, const Info& info) {
  if (Info::store_special && type == LOWER)
    return info.get_boundary_property(type, SPECIAL);
  else if (std::numeric_limits<T>::has_infinity)
    return Parma_Polyhedra_Library::is_minus_infinity(x);
  else if (std::numeric_limits<T>::is_bounded)
    return x == std::numeric_limits<T>::min();
  else
    return false;
}

template <typename T, typename Info>
inline bool
is_domain_sup(Boundary_Type type, const T& x, const Info& info) {
  if (Info::store_special && type == UPPER)
    return info.get_boundary_property(type, SPECIAL);
  else if (std::numeric_limits<T>::has_infinity)
    return Parma_Polyhedra_Library::is_plus_infinity(x);
  else if (std::numeric_limits<T>::is_bounded)
      return x == std::numeric_limits<T>::max();
  else
    return false;
}

template <typename T, typename Info>
inline bool
normal_is_boundary_infinity(Boundary_Type type, const T& x, const Info&) {
  if (!std::numeric_limits<T>::has_infinity)
    return false;
  if (type == LOWER)
    return Parma_Polyhedra_Library::is_minus_infinity(x);
  else
    return Parma_Polyhedra_Library::is_plus_infinity(x);
}

template <typename T, typename Info>
inline bool
is_boundary_infinity(Boundary_Type type, const T& x, const Info& info) {
  if (Info::store_special)
    return info.get_boundary_property(type, SPECIAL);
  else
    return normal_is_boundary_infinity(type, x, info);
}

template <typename T, typename Info>
inline bool
normal_is_reverse_infinity(Boundary_Type type, const T& x, const Info&) {
  if (!Info::may_contain_infinity)
    return false;
  else if (type == LOWER)
    return Parma_Polyhedra_Library::is_plus_infinity(x);
  else
    return Parma_Polyhedra_Library::is_minus_infinity(x);
}

template <typename T, typename Info>
inline bool
is_minus_infinity(Boundary_Type type, const T& x, const Info& info) {
  if (type == LOWER) {
    if (Info::store_special)
      return info.get_boundary_property(type, SPECIAL);
    else
      return normal_is_boundary_infinity(type, x, info);
  }
  else
    return !Info::store_special && normal_is_reverse_infinity(type, x, info);
}

template <typename T, typename Info>
inline bool
is_plus_infinity(Boundary_Type type, const T& x, const Info& info) {
  if (type == UPPER) {
    if (Info::store_special)
      return info.get_boundary_property(type, SPECIAL);
    else
      return normal_is_boundary_infinity(type, x, info);
  }
  else
    return !Info::store_special && normal_is_reverse_infinity(type, x, info);
}

template <typename T, typename Info>
inline bool
is_reverse_infinity(Boundary_Type type, const T& x, const Info& info) {
  return normal_is_reverse_infinity(type, x, info);
}

template <typename T, typename Info>
inline int
infinity_sign(Boundary_Type type, const T& x, const Info& info) {
  if (is_boundary_infinity(type, x, info))
    return (type == LOWER) ? -1 : 1;
  else if (is_reverse_infinity(type, x, info))
    return (type == UPPER) ? -1 : 1;
  else
    return 0;
}

template <typename T, typename Info>
inline bool
is_boundary_infinity_closed(Boundary_Type type, const T& x, const Info& info) {
  return Info::may_contain_infinity
    && !info.get_boundary_property(type, OPEN)
    && is_boundary_infinity(type, x, info);
}

template <typename Info>
inline bool
boundary_infinity_is_open(Boundary_Type type, const Info& info) {
  return !Info::may_contain_infinity
    || info.get_boundary_property(type, OPEN);
}

template <typename T, typename Info>
inline int
sgn_b(Boundary_Type type, const T& x, const Info& info) {
  if (info.get_boundary_property(type, SPECIAL))
    return (type == LOWER) ? -1 : 1;
  else


    return Parma_Polyhedra_Library::sgn(x);
}

template <typename T, typename Info>
inline int
sgn(Boundary_Type type, const T& x, const Info& info) {
  int sign = sgn_b(type, x, info);
  if (x == 0 && info.get_boundary_property(type, OPEN))
    return (type == LOWER) ? -1 : 1;
  else
    return sign;
}

template <typename T1, typename Info1, typename T2, typename Info2>
inline bool
eq(Boundary_Type type1, const T1& x1, const Info1& info1,
   Boundary_Type type2, const T2& x2, const Info2& info2) {
  if (type1 == type2) {
    if (is_open(type1, x1, info1)
        != is_open(type2, x2, info2))
      return false;
  }
  else if (is_open(type1, x1, info1)
           || is_open(type2, x2, info2))
    return false;
  if (is_minus_infinity(type1, x1, info1))
    return is_minus_infinity(type2, x2, info2);
  else if (is_plus_infinity(type1, x1, info1))
    return is_plus_infinity(type2, x2, info2);
  else if (is_minus_infinity(type2, x2, info2)
           || is_plus_infinity(type2, x2, info2))
    return false;
  else
    return equal(x1, x2);
}

template <typename T1, typename Info1, typename T2, typename Info2>
inline bool
lt(Boundary_Type type1, const T1& x1, const Info1& info1,
   Boundary_Type type2, const T2& x2, const Info2& info2) {
  if (is_open(type1, x1, info1)) {
    if (type1 == UPPER
        && (type2 == LOWER
            || !is_open(type2, x2, info2)))
      goto le;
  }
  else if (type2 == LOWER
           && is_open(type2, x2, info2)) {
  le:
    if (is_minus_infinity(type1, x1, info1)
        || is_plus_infinity(type2, x2, info2))
      return true;
    if (is_plus_infinity(type1, x1, info1)
        || is_minus_infinity(type2, x2, info2))
      return false;
    else
      return less_or_equal(x1, x2);
  }
  if (is_plus_infinity(type1, x1, info1)
      || is_minus_infinity(type2, x2, info2))
    return false;
  if (is_minus_infinity(type1, x1, info1)
      || is_plus_infinity(type2, x2, info2))
    return true;
  else
    return less_than(x1, x2);
}

template <typename T1, typename Info1, typename T2, typename Info2>
inline bool
gt(Boundary_Type type1, const T1& x1, const Info1& info1,
   Boundary_Type type2, const T2& x2, const Info2& info2) {
  return lt(type2, x2, info2, type1, x1, info1);
}

template <typename T1, typename Info1, typename T2, typename Info2>
inline bool
le(Boundary_Type type1, const T1& x1, const Info1& info1,
   Boundary_Type type2, const T2& x2, const Info2& info2) {
  return !gt(type1, x1, info1, type2, x2, info2);
}

template <typename T1, typename Info1, typename T2, typename Info2>
inline bool
ge(Boundary_Type type1, const T1& x1, const Info1& info1,
   Boundary_Type type2, const T2& x2, const Info2& info2) {
  return !lt(type1, x1, info1, type2, x2, info2);
}

template <typename T, typename Info>
inline Result
adjust_boundary(Boundary_Type type, T& x, Info& info,
                bool open, Result r) {
  r = result_relation_class(r);
  if (type == LOWER) {
    switch (r) {
    case V_GT_MINUS_INFINITY:
      open = true;

    case V_EQ_MINUS_INFINITY:
      if (!Info::store_special)
        return r;
      if (open)
        info.set_boundary_property(type, OPEN);
      return special_set_boundary_infinity(type, x, info);
    case V_GT:
      open = true;

    case V_GE:
    case V_EQ:
      if (open)
        info.set_boundary_property(type, OPEN);
      return r;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      return V_NAN;
    }
  }
  else {
    switch (r) {
    case V_LT_PLUS_INFINITY:
      open = true;

    case V_EQ_PLUS_INFINITY:
      if (!Info::store_special)
        return r;
      if (open)
        info.set_boundary_property(type, OPEN);
      return special_set_boundary_infinity(type, x, info);
    case V_LT:
      open = true;

    case V_LE:
    case V_EQ:
      if (open)
        info.set_boundary_property(type, OPEN);
      return r;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      return V_NAN;
    }
  }
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
complement(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type, const T& x, const Info& info) {
  ((void) 0);
  bool should_shrink;
  if (info.get_boundary_property(type, SPECIAL)) {
    should_shrink = !special_is_open(type, x, info);
    if (type == LOWER)
      return set_minus_infinity(to_type, to, to_info, should_shrink);
    else
      return set_plus_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = !normal_is_open(type, x, info);
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  Result r = assign_r(to, x, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
assign(Boundary_Type to_type, To& to, To_Info& to_info,
       Boundary_Type type, const T& x, const Info& info,
       bool should_shrink = false) {
  ((void) 0);
  if (info.get_boundary_property(type, SPECIAL)) {
    should_shrink = (should_shrink || special_is_open(type, x, info));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = (should_shrink || normal_is_open(type, x, info));
  const bool check
    = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  const Result r = assign_r(to, x, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
min_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type, const T& x, const Info& info) {
  if (lt(type, x, info, to_type, to, to_info)) {
    to_info.clear_boundary_properties(to_type);
    return assign(to_type, to, to_info, type, x, info);
  }
  return V_EQ;
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
min_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type1, const T1& x1, const Info1& info1,
           Boundary_Type type2, const T2& x2, const Info2& info2) {
  if (lt(type1, x1, info1, type2, x2, info2))
    return assign(to_type, to, to_info, type1, x1, info1);
  else
    return assign(to_type, to, to_info, type2, x2, info2);
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
max_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type, const T& x, const Info& info) {
  if (gt(type, x, info, to_type, to, to_info)) {
    to_info.clear_boundary_properties(to_type);
    return assign(to_type, to, to_info, type, x, info);
  }
  return V_EQ;
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
max_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type1, const T1& x1, const Info1& info1,
           Boundary_Type type2, const T2& x2, const Info2& info2) {
  if (gt(type1, x1, info1, type2, x2, info2))
    return assign(to_type, to, to_info, type1, x1, info1);
  else
    return assign(to_type, to, to_info, type2, x2, info2);
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
neg_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type, const T& x, const Info& info) {
  ((void) 0);
  bool should_shrink;
  if (info.get_boundary_property(type, SPECIAL)) {
    should_shrink = special_is_open(type, x, info);
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = normal_is_open(type, x, info);
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  Result r = neg_assign_r(to, x, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
add_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type1, const T1& x1, const Info1& info1,
           Boundary_Type type2, const T2& x2, const Info2& info2) {
  ((void) 0);
  bool should_shrink;
  if (is_boundary_infinity(type1, x1, info1)) {
    should_shrink = (boundary_infinity_is_open(type1, info1)
                     && !is_boundary_infinity_closed(type2, x2, info2));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  else if (is_boundary_infinity(type2, x2, info2)) {
    should_shrink = (boundary_infinity_is_open(type2, info2)
                     && !is_boundary_infinity_closed(type1, x1, info1));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = (normal_is_open(type1, x1, info1)
                   || normal_is_open(type2, x2, info2));
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));

  Result r = add_assign_r(to, x1, x2, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
sub_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type1, const T1& x1, const Info1& info1,
           Boundary_Type type2, const T2& x2, const Info2& info2) {
  ((void) 0);
  bool should_shrink;
  if (is_boundary_infinity(type1, x1, info1)) {
    should_shrink = (boundary_infinity_is_open(type1, info1)
                     && !is_boundary_infinity_closed(type2, x2, info2));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  else if (is_boundary_infinity(type2, x2, info2)) {
    should_shrink = (boundary_infinity_is_open(type2, info2)
                     && !is_boundary_infinity_closed(type1, x1, info1));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = (normal_is_open(type1, x1, info1)
                   || normal_is_open(type2, x2, info2));
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));

  Result r = sub_assign_r(to, x1, x2, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
mul_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type1, const T1& x1, const Info1& info1,
           Boundary_Type type2, const T2& x2, const Info2& info2) {
  bool should_shrink;
  if (is_boundary_infinity(type1, x1, info1)) {
    should_shrink = (boundary_infinity_is_open(type1, info1)
                     && !is_boundary_infinity_closed(type2, x2, info2));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  else if (is_boundary_infinity(type2, x2, info2)) {
    should_shrink = (boundary_infinity_is_open(type2, info2)
                     && !is_boundary_infinity_closed(type1, x1, info1));
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = (normal_is_open(type1, x1, info1)
                   || normal_is_open(type2, x2, info2));
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  ((void) 0);

  Result r = mul_assign_r(to, x1, x2, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info>
inline Result
set_zero(Boundary_Type to_type, To& to, To_Info& to_info, bool should_shrink) {
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  Result r = assign_r(to, Constant<0>::value, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
mul_assign_z(Boundary_Type to_type, To& to, To_Info& to_info,
             Boundary_Type type1, const T1& x1, const Info1& info1, int x1s,
             Boundary_Type type2, const T2& x2, const Info2& info2, int x2s) {
  bool should_shrink;
  if (x1s != 0) {
    if (x2s != 0)
      return mul_assign(to_type, to, to_info,
                        type1, x1, info1,
                        type2, x2, info2);
    else
      should_shrink = info2.get_boundary_property(type2, OPEN);
  }
  else {
    should_shrink = (info1.get_boundary_property(type1, OPEN)
                     && (x2s != 0 || info2.get_boundary_property(type2, OPEN)));
  }
  return set_zero(to_type, to, to_info, should_shrink);
}

template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
div_assign(Boundary_Type to_type, To& to, To_Info& to_info,
           Boundary_Type type1, const T1& x1, const Info1& info1,
           Boundary_Type type2, const T2& x2, const Info2& info2) {
  bool should_shrink;
  if (is_boundary_infinity(type1, x1, info1)) {
    should_shrink = boundary_infinity_is_open(type1, info1);
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  else if (is_boundary_infinity(type2, x2, info2)) {
    should_shrink = boundary_infinity_is_open(type2, info2);
    return set_zero(to_type, to, to_info, should_shrink);
  }
  should_shrink = (normal_is_open(type1, x1, info1)
                   || normal_is_open(type2, x2, info2));
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  ((void) 0);

  Result r = div_assign_r(to, x1, x2, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}


template <typename To, typename To_Info, typename T1, typename Info1, typename T2, typename Info2>
inline Result
div_assign_z(Boundary_Type to_type, To& to, To_Info& to_info,
             Boundary_Type type1, const T1& x1, const Info1& info1, int x1s,
             Boundary_Type type2, const T2& x2, const Info2& info2, int x2s) {
  if (x1s != 0) {
    if (x2s != 0)
      return div_assign(to_type, to, to_info,
                        type1, x1, info1,
                        type2, x2, info2);
    else {
      return set_boundary_infinity(to_type, to, to_info, true);
    }
  }
  else {
    bool should_shrink = info1.get_boundary_property(type1, OPEN)
      && !is_boundary_infinity_closed(type2, x2, info2);
    return set_zero(to_type, to, to_info, should_shrink);
  }
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
umod_2exp_assign(Boundary_Type to_type, To& to, To_Info& to_info,
                 Boundary_Type type, const T& x, const Info& info,
                 unsigned int exp) {
  ((void) 0);
  bool should_shrink;
  if (is_boundary_infinity(type, x, info)) {
    should_shrink = boundary_infinity_is_open(type, info);
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = normal_is_open(type, x, info);
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  Result r = umod_2exp_assign_r(to, x, exp, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

template <typename To, typename To_Info, typename T, typename Info>
inline Result
smod_2exp_assign(Boundary_Type to_type, To& to, To_Info& to_info,
                 Boundary_Type type, const T& x, const Info& info,
                 unsigned int exp) {
  ((void) 0);
  bool should_shrink;
  if (is_boundary_infinity(type, x, info)) {
    should_shrink = boundary_infinity_is_open(type, info);
    return set_boundary_infinity(to_type, to, to_info, should_shrink);
  }
  should_shrink = normal_is_open(type, x, info);
  bool check = (To_Info::check_inexact || (!should_shrink && To_Info::store_open));
  Result r = smod_2exp_assign_r(to, x, exp, round_dir_check(to_type, check));
  return adjust_boundary(to_type, to, to_info, should_shrink, r);
}

}

}
# 28 "Box_inlines.hh" 2
# 1 "Constraint_System_defs.hh" 1
# 29 "Constraint_System_defs.hh"
# 1 "Linear_System_defs.hh" 1
# 29 "Linear_System_defs.hh"
# 1 "Swapping_Vector_defs.hh" 1
# 27 "Swapping_Vector_defs.hh"
# 1 "Swapping_Vector_types.hh" 1
# 16 "Swapping_Vector_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class Swapping_Vector;

}
# 28 "Swapping_Vector_defs.hh" 2





namespace Parma_Polyhedra_Library {





template <typename T>
class Swapping_Vector {

public:
  typedef typename std::vector<T>::const_iterator const_iterator;
  typedef typename std::vector<T>::iterator iterator;
  typedef typename std::vector<T>::size_type size_type;

  Swapping_Vector();
  explicit Swapping_Vector(dimension_type new_size);
  Swapping_Vector(dimension_type new_size, const T& x);

  void clear();
  void reserve(dimension_type new_capacity);
  void resize(dimension_type new_size);
  void resize(dimension_type new_size, const T& x);

  dimension_type size() const;
  dimension_type capacity() const;
  bool empty() const;

  void m_swap(Swapping_Vector& v);

  T& operator[](dimension_type i);
  const T& operator[](dimension_type i) const;

  T& back();
  const T& back() const;

  void push_back(const T& x);
  void pop_back();

  iterator begin();
  iterator end();
  const_iterator begin() const;
  const_iterator end() const;

  iterator erase(iterator itr);
  iterator erase(iterator first, iterator last);


  memory_size_type external_memory_in_bytes() const;

  dimension_type max_num_rows();

private:
  std::vector<T> impl;
};




template <typename T>
void swap(Swapping_Vector<T>& x, Swapping_Vector<T>& y);

}

# 1 "Swapping_Vector_inlines.hh" 1
# 27 "Swapping_Vector_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline
Swapping_Vector<T>::Swapping_Vector()
  : impl() {
}

template <typename T>
inline
Swapping_Vector<T>::Swapping_Vector(dimension_type i)
  : impl() {


  resize(i);
}

template <typename T>
inline
Swapping_Vector<T>::Swapping_Vector(dimension_type new_size, const T& x)
  : impl() {
  resize(new_size, x);
}

template <typename T>
inline void
Swapping_Vector<T>::clear() {
  impl.clear();
}

template <typename T>
inline void
Swapping_Vector<T>::reserve(dimension_type new_capacity) {
  if (impl.capacity() < new_capacity) {

    std::vector<T> new_impl;

    new_impl.reserve(compute_capacity(new_capacity, max_num_rows()));
    new_impl.resize(impl.size());

    using std::swap;


    for (dimension_type i = impl.size(); i-- > 0; )
      swap(new_impl[i], impl[i]);


    swap(impl, new_impl);
  }
}

template <typename T>
inline void
Swapping_Vector<T>::resize(dimension_type new_size) {
  reserve(new_size);
  impl.resize(new_size);
}

template <typename T>
inline void
Swapping_Vector<T>::resize(dimension_type new_size, const T& x) {
  reserve(new_size);
  impl.resize(new_size, x);
}

template <typename T>
inline dimension_type
Swapping_Vector<T>::size() const {
  return impl.size();
}

template <typename T>
inline dimension_type
Swapping_Vector<T>::capacity() const {
  return impl.capacity();
}

template <typename T>
inline bool
Swapping_Vector<T>::empty() const {
  return impl.empty();
}

template <typename T>
inline void
Swapping_Vector<T>::m_swap(Swapping_Vector& v) {
  using std::swap;
  swap(impl, v.impl);
}

template <typename T>
inline T&
Swapping_Vector<T>::operator[](dimension_type i) {
  return impl[i];
}

template <typename T>
inline const T&
Swapping_Vector<T>::operator[](dimension_type i) const {
  return impl[i];
}

template <typename T>
inline T&
Swapping_Vector<T>::back() {
  return impl.back();
}

template <typename T>
inline const T&
Swapping_Vector<T>::back() const {
  return impl.back();
}

template <typename T>
inline void
Swapping_Vector<T>::push_back(const T& x) {
  reserve(size() + 1);
  impl.push_back(x);
}

template <typename T>
inline void
Swapping_Vector<T>::pop_back() {
  impl.pop_back();
}

template <typename T>
inline memory_size_type
Swapping_Vector<T>::external_memory_in_bytes() const {

  memory_size_type n = impl.capacity() * sizeof(T);
  for (const_iterator i = begin(), i_end = end(); i != i_end; ++i)
    n += i->external_memory_in_bytes();
  return n;
}

template <typename T>
inline typename Swapping_Vector<T>::iterator
Swapping_Vector<T>::begin() {
  return impl.begin();
}

template <typename T>
inline typename Swapping_Vector<T>::iterator
Swapping_Vector<T>::end() {
  return impl.end();
}

template <typename T>
inline typename Swapping_Vector<T>::const_iterator
Swapping_Vector<T>::begin() const {
  return impl.begin();
}

template <typename T>
inline typename Swapping_Vector<T>::const_iterator
Swapping_Vector<T>::end() const {
  return impl.end();
}

template <typename T>
inline typename Swapping_Vector<T>::iterator
Swapping_Vector<T>::erase(iterator itr) {
  ((void) 0);
  ((void) 0);
  const dimension_type old_i = itr - begin();
  dimension_type i = old_i;
  ++i;
  while (i != size())
    swap(impl[i-1], impl[i]);
  impl.pop_back();
  return begin() + old_i;
}

template <typename T>
inline typename Swapping_Vector<T>::iterator
Swapping_Vector<T>::erase(iterator first, iterator last) {
  ((void) 0);
  ((void) 0);
  ((void) 0);
  const iterator old_first = first;
  typedef typename std::iterator_traits<iterator>::difference_type diff_t;
  const diff_t k = last - first;
  const dimension_type n = static_cast<dimension_type>(end() - last);
  using std::swap;
  for (dimension_type i = 0; i < n; ++i, ++first)
    swap(*first, *(first + k));
  impl.erase(end() - k, end());
  return old_first;
}

template <typename T>
inline dimension_type
Swapping_Vector<T>::max_num_rows() {
  return impl.max_size();
}

template <typename T>
inline void
swap(Swapping_Vector<T>& vec1, Swapping_Vector<T>& vec2) {
  vec1.m_swap(vec2);
}

}
# 97 "Swapping_Vector_defs.hh" 2
# 30 "Linear_System_defs.hh" 2





# 1 "Bit_Row_types.hh" 1
# 16 "Bit_Row_types.hh"
namespace Parma_Polyhedra_Library {

class Bit_Row;

}
# 36 "Linear_System_defs.hh" 2
# 1 "Bit_Matrix_types.hh" 1
# 16 "Bit_Matrix_types.hh"
namespace Parma_Polyhedra_Library {

class Bit_Matrix;

}
# 37 "Linear_System_defs.hh" 2
# 60 "Linear_System_defs.hh"
template <typename Row>
class Parma_Polyhedra_Library::Linear_System {
public:


  typedef typename Swapping_Vector<Row>::const_iterator iterator;
  typedef typename Swapping_Vector<Row>::const_iterator const_iterator;





  Linear_System(Topology topol, Representation r);
# 88 "Linear_System_defs.hh"
  Linear_System(Topology topol, dimension_type space_dim, Representation r);
# 98 "Linear_System_defs.hh"
  struct With_Pending {
  };


  Linear_System(const Linear_System& y);



  Linear_System(const Linear_System& y, Representation r);


  Linear_System(const Linear_System& y, With_Pending);


  Linear_System(const Linear_System& y, Representation r, With_Pending);


  Linear_System& operator=(const Linear_System& y);


  void assign_with_pending(const Linear_System& y);


  void m_swap(Linear_System& y);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();
# 141 "Linear_System_defs.hh"
  dimension_type space_dimension() const;


  void set_space_dimension(dimension_type space_dim);


  void remove_trailing_rows(dimension_type n);
# 157 "Linear_System_defs.hh"
  void remove_row(dimension_type i, bool keep_sorted = false);
# 167 "Linear_System_defs.hh"
  void remove_rows(dimension_type first, dimension_type last,
                  bool keep_sorted = false);
# 177 "Linear_System_defs.hh"
  void remove_rows(const std::vector<dimension_type>& indexes);
# 186 "Linear_System_defs.hh"
  void remove_space_dimensions(const Variables_Set& vars);



  void shift_space_dimensions(Variable v, dimension_type n);
# 205 "Linear_System_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);


  void swap_space_dimensions(Variable v1, Variable v2);




  const Row& operator[](dimension_type k) const;


  iterator begin();
  iterator end();
  const_iterator begin() const;
  const_iterator end() const;

  bool has_no_rows() const;
  dimension_type num_rows() const;


  void strong_normalize();


  void sign_normalize();




  Topology topology() const;


  bool is_sorted() const;





  bool is_necessarily_closed() const;





  dimension_type num_lines_or_equalities() const;


  dimension_type first_pending_row() const;


  dimension_type num_pending_rows() const;






  bool check_sorted() const;


  void set_topology(Topology t);


  void set_necessarily_closed();


  void set_not_necessarily_closed();







  void mark_as_necessarily_closed();







  void mark_as_not_necessarily_closed();


  void unset_pending_rows();


  void set_index_first_pending_row(dimension_type i);


  void set_sorted(bool b);
# 310 "Linear_System_defs.hh"
  void add_universe_rows_and_space_dimensions(dimension_type n);





  void insert(const Row& r);





  void insert_pending(const Row& r);





  void insert(Row& r, Recycle_Input);





  void insert_pending(Row& r, Recycle_Input);





  void insert(const Linear_System& y);


  void insert_pending(const Linear_System& r);





  void insert(Linear_System& r, Recycle_Input);



  void insert_pending(Linear_System& r, Recycle_Input);





  void sort_rows();





  void sort_rows(dimension_type first_row, dimension_type last_row);
# 375 "Linear_System_defs.hh"
  void merge_rows_assign(const Linear_System& y);





  void sort_pending_and_remove_duplicates();
# 390 "Linear_System_defs.hh"
  void sort_and_remove_with_sat(Bit_Matrix& sat);
# 404 "Linear_System_defs.hh"
  dimension_type gauss(dimension_type n_lines_or_equalities);
# 416 "Linear_System_defs.hh"
  void back_substitute(dimension_type n_lines_or_equalities);





  void simplify();


  void clear();

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;
# 439 "Linear_System_defs.hh"
  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;






  Swapping_Vector<Row> rows;


  bool OK() const;

private:
# 469 "Linear_System_defs.hh"
  void remove_row_no_ok(dimension_type i, bool keep_sorted = false);
# 478 "Linear_System_defs.hh"
  void insert_pending_no_ok(Row& r, Recycle_Input);
# 487 "Linear_System_defs.hh"
  void insert_no_ok(Row& r, Recycle_Input);






  void set_space_dimension_no_ok(dimension_type space_dim);
# 506 "Linear_System_defs.hh"
  void swap_row_intervals(dimension_type first, dimension_type last,
                          dimension_type offset);



  dimension_type space_dimension_;



  Topology row_topology;


  dimension_type index_first_pending;






  bool sorted;

  Representation representation_;


  struct Row_Less_Than {
    bool operator()(const Row& x, const Row& y) const;
  };


  struct Unique_Compare {
    Unique_Compare(const Swapping_Vector<Row>& cont,
                   dimension_type base = 0);

    bool operator()(dimension_type i, dimension_type j) const;

    const Swapping_Vector<Row>& container;
    const dimension_type base_index;
  };

  friend class Polyhedron;
  friend class Generator_System;
};

namespace Parma_Polyhedra_Library {





template <typename Row>
void swap(Parma_Polyhedra_Library::Linear_System<Row>& x,
          Parma_Polyhedra_Library::Linear_System<Row>& y);

}

namespace Parma_Polyhedra_Library {





template <typename Row>
bool operator==(const Linear_System<Row>& x, const Linear_System<Row>& y);





template <typename Row>
bool operator!=(const Linear_System<Row>& x, const Linear_System<Row>& y);

}

# 1 "Linear_System_inlines.hh" 1
# 27 "Linear_System_inlines.hh"
# 1 "Bit_Row_defs.hh" 1
# 33 "Bit_Row_defs.hh"
namespace Parma_Polyhedra_Library {
# 45 "Bit_Row_defs.hh"
void
iter_swap(std::vector<Bit_Row>::iterator x,
          std::vector<Bit_Row>::iterator y);







bool operator==(const Bit_Row& x, const Bit_Row& y);





bool operator!=(const Bit_Row& x, const Bit_Row& y);
# 77 "Bit_Row_defs.hh"
int compare(const Bit_Row& x, const Bit_Row& y);





bool subset_or_equal(const Bit_Row& x, const Bit_Row& y);
# 93 "Bit_Row_defs.hh"
bool subset_or_equal(const Bit_Row& x, const Bit_Row& y,
                     bool& strict_subset);





bool strict_subset(const Bit_Row& x, const Bit_Row& y);

}





class Parma_Polyhedra_Library::Bit_Row {
public:

  Bit_Row();


  Bit_Row(const Bit_Row& y);





  Bit_Row(const Bit_Row& y, const Bit_Row& z);


  ~Bit_Row();


  Bit_Row& operator=(const Bit_Row& y);


  void m_swap(Bit_Row& y);


  bool operator[](unsigned long k) const;


  void set(unsigned long k);


  void set_until(unsigned long k);


  void clear(unsigned long k);


  void clear_from(unsigned long k);


  void clear();


  void union_assign(const Bit_Row& x, const Bit_Row& y);


  void intersection_assign(const Bit_Row& x, const Bit_Row& y);


  void difference_assign(const Bit_Row& x, const Bit_Row& y);


  friend int compare(const Bit_Row& x, const Bit_Row& y);
  friend bool operator==(const Bit_Row& x, const Bit_Row& y);
  friend bool operator!=(const Bit_Row& x, const Bit_Row& y);
  friend bool subset_or_equal(const Bit_Row& x, const Bit_Row& y);
  friend bool subset_or_equal(const Bit_Row& x, const Bit_Row& y,
                              bool& strict_subset);
  friend bool strict_subset(const Bit_Row& x, const Bit_Row& y);


  unsigned long first() const;





  unsigned long next(unsigned long position) const;


  unsigned long last() const;





  unsigned long prev(unsigned long position) const;


  unsigned long count_ones() const;


  bool empty() const;


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  bool OK() const;

private:

  mpz_t vec;






  void union_helper(const Bit_Row& y, const Bit_Row& z);
};

# 1 "Bit_Row_inlines.hh" 1
# 33 "Bit_Row_inlines.hh"
# 1 "/usr/include/strings.h" 1 3 4
# 34 "Bit_Row_inlines.hh" 2






namespace Parma_Polyhedra_Library {

inline
Bit_Row::Bit_Row() {
  __gmpz_init(vec);
}

inline
Bit_Row::Bit_Row(const Bit_Row& y) {
  __gmpz_init_set(vec, y.vec);
}

inline
Bit_Row::Bit_Row(const Bit_Row& y, const Bit_Row& z) {
  const mp_size_t y_size = y.vec->_mp_size;
  ((void) 0);
  const mp_size_t z_size = z.vec->_mp_size;
  ((void) 0);
  if (y_size < z_size) {
    ((void) 0);

    __gmpz_init2(vec, static_cast<unsigned long>(z_size) * ((4) * static_cast<std::size_t>(8)));
    union_helper(y, z);
  }
  else {
    ((void) 0);

    __gmpz_init2(vec, static_cast<unsigned long>(y_size) * ((4) * static_cast<std::size_t>(8)));
    union_helper(z, y);
  }
}

inline
Bit_Row::~Bit_Row() {
  __gmpz_clear(vec);
}

inline Bit_Row&
Bit_Row::operator=(const Bit_Row& y) {
  __gmpz_set(vec, y.vec);
  return *this;
}

inline void
Bit_Row::set(const unsigned long k) {
  __gmpz_setbit(vec, k);
}

inline void
Bit_Row::clear(const unsigned long k) {
  __gmpz_clrbit(vec, k);
}

inline void
Bit_Row::clear_from(const unsigned long k) {
  __gmpz_tdiv_r_2exp(vec, vec, k);
}

inline unsigned long
Bit_Row::count_ones() const {
  const mp_size_t x_size = vec->_mp_size;
  ((void) 0);
  return (x_size == 0) ? 0 : __gmpn_popcount(vec->_mp_d, x_size);
}

inline bool
Bit_Row::empty() const {
  return ((vec)->_mp_size < 0 ? -1 : (vec)->_mp_size > 0) == 0;
}

inline void
Bit_Row::m_swap(Bit_Row& y) {
  __gmpz_swap(vec, y.vec);
}

inline void
Bit_Row::clear() {
  __gmpz_set_ui(vec, 0UL);
}

inline memory_size_type
Bit_Row::external_memory_in_bytes() const {
  return static_cast<memory_size_type>(vec[0]._mp_alloc) * 4;
}

inline memory_size_type
Bit_Row::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline void
Bit_Row::union_assign(const Bit_Row& x, const Bit_Row& y) {
  const mp_size_t x_size = x.vec->_mp_size;
  ((void) 0);
  const mp_size_t y_size = y.vec->_mp_size;
  ((void) 0);
  if (x_size < y_size) {
    ((void) 0);

    __gmpz_realloc2(vec, static_cast<unsigned long>(y_size) * ((4) * static_cast<std::size_t>(8)));
    union_helper(x, y);
  }
  else {
    ((void) 0);

    __gmpz_realloc2(vec, static_cast<unsigned long>(x_size) * ((4) * static_cast<std::size_t>(8)));
    union_helper(y, x);
  }
}

inline void
Bit_Row::intersection_assign(const Bit_Row& x, const Bit_Row& y) {
  __gmpz_and(vec, x.vec, y.vec);
}

inline void
Bit_Row::difference_assign(const Bit_Row& x, const Bit_Row& y) {
  Parma_Polyhedra_Library::Dirty_Temp<mpz_class> holder_complement_y; mpz_class& complement_y = holder_complement_y.item();
  __gmpz_com(complement_y.get_mpz_t(), y.vec);
  __gmpz_and(vec, x.vec, complement_y.get_mpz_t());
}

namespace Implementation {




inline unsigned int
first_one(unsigned int u) {
  return ctz(u);
}





inline unsigned int
first_one(unsigned long ul) {
  return ctz(ul);
}





inline unsigned int
first_one(unsigned long long ull) {
  return ctz(ull);
}




inline unsigned int
last_one(unsigned int u) {
  return static_cast<unsigned int>(((sizeof(u)) * static_cast<std::size_t>(8)))
    - 1U - clz(u);
}





inline unsigned int
last_one(unsigned long ul) {
  return static_cast<unsigned int>(((sizeof(ul)) * static_cast<std::size_t>(8)))
    - 1U - clz(ul);
}





inline unsigned int
last_one(unsigned long long ull) {
  return static_cast<unsigned int>(((sizeof(ull)) * static_cast<std::size_t>(8)))
    - 1U - clz(ull);
}

}


inline void
swap(Bit_Row& x, Bit_Row& y) {
  x.m_swap(y);
}


inline void
iter_swap(std::vector<Bit_Row>::iterator x,
          std::vector<Bit_Row>::iterator y) {
  swap(*x, *y);
}

}
# 213 "Bit_Row_defs.hh" 2
# 28 "Linear_System_inlines.hh" 2




namespace Parma_Polyhedra_Library {

template <typename Row>
inline memory_size_type
Linear_System<Row>::external_memory_in_bytes() const {
  return rows.external_memory_in_bytes();
}

template <typename Row>
inline memory_size_type
Linear_System<Row>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename Row>
inline bool
Linear_System<Row>::is_sorted() const {




  ((void) 0);
  return sorted;
}

template <typename Row>
inline void
Linear_System<Row>::set_sorted(const bool b) {
  sorted = b;
  ((void) 0);
}

template <typename Row>
inline
Linear_System<Row>::Linear_System(Topology topol, Representation r)
  : rows(),
    space_dimension_(0),
    row_topology(topol),
    index_first_pending(0),
    sorted(true),
    representation_(r) {

  ((void) 0);
}

template <typename Row>
inline
Linear_System<Row>::Linear_System(Topology topol,
                                  dimension_type space_dim,
                                  Representation r)
  : rows(),
    space_dimension_(0),
    row_topology(topol),
    index_first_pending(0),
    sorted(true),
    representation_(r) {
  set_space_dimension(space_dim);
  ((void) 0);
}

template <typename Row>
inline dimension_type
Linear_System<Row>::first_pending_row() const {
  return index_first_pending;
}

template <typename Row>
inline dimension_type
Linear_System<Row>::num_pending_rows() const {
  ((void) 0);
  return num_rows() - first_pending_row();
}

template <typename Row>
inline void
Linear_System<Row>::unset_pending_rows() {
  index_first_pending = num_rows();
  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::set_index_first_pending_row(const dimension_type i) {
  index_first_pending = i;
  ((void) 0);
}

template <typename Row>
inline
Linear_System<Row>::Linear_System(const Linear_System& y)
  : rows(y.rows),
    space_dimension_(y.space_dimension_),
    row_topology(y.row_topology),
    representation_(y.representation_) {

  sorted = (y.num_pending_rows() > 0) ? false : y.sorted;
  unset_pending_rows();
  ((void) 0);
}

template <typename Row>
inline
Linear_System<Row>::Linear_System(const Linear_System& y, Representation r)
  : rows(),
    space_dimension_(y.space_dimension_),
    row_topology(y.row_topology),
    representation_(r) {
  rows.resize(y.num_rows());
  for (dimension_type i = 0; i < y.num_rows(); ++i) {

    Row row(y.rows[i], r);
    swap(rows[i], row);
  }

  sorted = (y.num_pending_rows() > 0) ? false : y.sorted;
  unset_pending_rows();
  ((void) 0);
}

template <typename Row>
inline
Linear_System<Row>::Linear_System(const Linear_System& y, With_Pending)
  : rows(y.rows),
    space_dimension_(y.space_dimension_),
    row_topology(y.row_topology),
    index_first_pending(y.index_first_pending),
    sorted(y.sorted),
    representation_(y.representation_) {
  ((void) 0);
}

template <typename Row>
inline
Linear_System<Row>::Linear_System(const Linear_System& y, Representation r,
                                  With_Pending)
  : rows(),
    space_dimension_(y.space_dimension_),
    row_topology(y.row_topology),
    index_first_pending(y.index_first_pending),
    sorted(y.sorted),
    representation_(r) {
  rows.resize(y.num_rows());
  for (dimension_type i = 0; i < y.num_rows(); ++i) {

    Row row(y.rows[i], r);
    swap(rows[i], row);
  }
  ((void) 0);
}

template <typename Row>
inline Linear_System<Row>&
Linear_System<Row>::operator=(const Linear_System& y) {

  Linear_System<Row> tmp = y;
  swap(*this, tmp);
  return *this;
}

template <typename Row>
inline void
Linear_System<Row>::assign_with_pending(const Linear_System& y) {
  Linear_System<Row> tmp(y, With_Pending());
  swap(*this, tmp);
}

template <typename Row>
inline void
Linear_System<Row>::m_swap(Linear_System& y) {
  using std::swap;
  swap(rows, y.rows);
  swap(space_dimension_, y.space_dimension_);
  swap(row_topology, y.row_topology);
  swap(index_first_pending, y.index_first_pending);
  swap(sorted, y.sorted);
  swap(representation_, y.representation_);
  ((void) 0);
  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::clear() {

  rows.clear();
  index_first_pending = 0;
  sorted = true;
  space_dimension_ = 0;

  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::mark_as_necessarily_closed() {
  ((void) 0);
  row_topology = NECESSARILY_CLOSED;
  ++space_dimension_;
  for (dimension_type i = num_rows(); i-- > 0; )
    rows[i].mark_as_necessarily_closed();
}

template <typename Row>
inline void
Linear_System<Row>::mark_as_not_necessarily_closed() {
  ((void) 0);
  ((void) 0);
  row_topology = NOT_NECESSARILY_CLOSED;
  --space_dimension_;
  for (dimension_type i = num_rows(); i-- > 0; )
    rows[i].mark_as_not_necessarily_closed();
}

template <typename Row>
inline void
Linear_System<Row>::set_topology(Topology t) {
  if (topology() == t)
    return;
  for (dimension_type i = num_rows(); i-- > 0; )
    rows[i].set_topology(t);
  row_topology = t;
  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::set_necessarily_closed() {
  set_topology(NECESSARILY_CLOSED);
}

template <typename Row>
inline void
Linear_System<Row>::set_not_necessarily_closed() {
  set_topology(NOT_NECESSARILY_CLOSED);
}

template <typename Row>
inline bool
Linear_System<Row>::is_necessarily_closed() const {
  return row_topology == NECESSARILY_CLOSED;
}

template <typename Row>
inline const Row&
Linear_System<Row>::operator[](const dimension_type k) const {
  return rows[k];
}

template <typename Row>
inline typename Linear_System<Row>::iterator
Linear_System<Row>::begin() {
  return rows.begin();
}

template <typename Row>
inline typename Linear_System<Row>::iterator
Linear_System<Row>::end() {
  return rows.end();
}

template <typename Row>
inline typename Linear_System<Row>::const_iterator
Linear_System<Row>::begin() const {
  return rows.begin();
}

template <typename Row>
inline typename Linear_System<Row>::const_iterator
Linear_System<Row>::end() const {
  return rows.end();
}

template <typename Row>
inline bool
Linear_System<Row>::has_no_rows() const {
  return rows.empty();
}

template <typename Row>
inline dimension_type
Linear_System<Row>::num_rows() const {
  return rows.size();
}

template <typename Row>
inline Topology
Linear_System<Row>::topology() const {
  return row_topology;
}

template <typename Row>
inline Representation
Linear_System<Row>::representation() const {
  return representation_;
}

template <typename Row>
inline void
Linear_System<Row>::set_representation(Representation r) {
  representation_ = r;
  for (dimension_type i = 0; i < rows.size(); ++i)
    rows[i].set_representation(r);
  ((void) 0);
}

template <typename Row>
inline dimension_type
Linear_System<Row>::max_space_dimension() {
  return Row::max_space_dimension();
}

template <typename Row>
inline dimension_type
Linear_System<Row>::space_dimension() const {
  return space_dimension_;
}

template <typename Row>
inline void
Linear_System<Row>::set_space_dimension_no_ok(dimension_type space_dim) {
  for (dimension_type i = rows.size(); i-- > 0; )
    rows[i].set_space_dimension_no_ok(space_dim);
  space_dimension_ = space_dim;
}

template <typename Row>
inline void
Linear_System<Row>::set_space_dimension(dimension_type space_dim) {
  set_space_dimension_no_ok(space_dim);
  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::remove_row_no_ok(const dimension_type i,
                                     const bool keep_sorted) {
  ((void) 0);
  const bool was_pending = (i >= index_first_pending);

  if (sorted && keep_sorted && !was_pending) {
    for (dimension_type j = i + 1; j < rows.size(); ++j)
      swap(rows[j], rows[j-1]);
    rows.pop_back();
  }
  else {
    if (!was_pending)
      sorted = false;
    const bool last_row_is_pending = (num_rows() - 1 >= index_first_pending);
    if (was_pending == last_row_is_pending)

      swap(rows[i], rows.back());
    else {

      ((void) 0);
      ((void) 0);


      swap(rows[i], rows[index_first_pending - 1]);



      swap(rows[i], rows.back());
    }
    rows.pop_back();
  }
  if (!was_pending)

    --index_first_pending;
}

template <typename Row>
inline void
Linear_System<Row>::remove_row(const dimension_type i, bool keep_sorted) {
  remove_row_no_ok(i, keep_sorted);
  ((void) 0);
}


template <typename Row>
inline void
Linear_System<Row>::remove_rows(dimension_type first,
                                dimension_type last,
                                bool keep_sorted) {
  ((void) 0);
  ((void) 0);
  const dimension_type n = last - first;

  if (n == 0)
    return;



  ((void) 0);

  const bool were_pending = (first >= index_first_pending);


  if (sorted && keep_sorted && !were_pending) {

    for (dimension_type i = last; i < rows.size(); ++i)
      swap(rows[i], rows[i - n]);

    rows.resize(rows.size() - n);


    index_first_pending -= n;

    ((void) 0);
    return;
  }




  const dimension_type offset = rows.size() - n - first;




  if (index_first_pending == num_rows()) {

    ((void) 0);

    swap_row_intervals(first, last, offset);

    rows.resize(rows.size() - n);


    index_first_pending -= n;
  }
  else {

    if (were_pending) {



      swap_row_intervals(first, last, offset);

      rows.resize(rows.size() - n);


      index_first_pending -= n;
    }
    else {
      ((void) 0);
      ((void) 0);
      ((void) 0);



      ((void) 0);
      swap_row_intervals(first, last, index_first_pending - last);


      index_first_pending -= n;
      first = index_first_pending;
      last = first + n;


      swap_row_intervals(first, last, num_rows() - last);


      rows.resize(rows.size() - n);
    }
  }

  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::swap_row_intervals(dimension_type first,
                                       dimension_type last,
                                       dimension_type offset) {
  ((void) 0);
  ((void) 0);
# 522 "Linear_System_inlines.hh"
  if (first + offset < last) {

    const dimension_type k = last - first - offset;
    last -= k;
    offset += k;
  }

  if (first == last)

    return;

  for (dimension_type i = first; i < last; ++i)
    swap(rows[i], rows[i + offset]);

  if (first < index_first_pending)

    set_sorted(false);

  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::remove_rows(const std::vector<dimension_type>& indexes) {
# 560 "Linear_System_inlines.hh"
  if (indexes.empty())
    return;

  const dimension_type rows_size = rows.size();
  typedef std::vector<dimension_type>::const_iterator itr_t;




  dimension_type last_unused_row = indexes[0];
  dimension_type i = indexes[0];
  itr_t itr = indexes.begin();
  itr_t itr_end = indexes.end();
  while (itr != itr_end) {

    ((void) 0);
    if (*itr == i) {

      ++itr;
    }
    else {

      swap(rows[last_unused_row], rows[i]);
      ++last_unused_row;
    }
    ++i;
  }


  for ( ; i < rows_size; ++i) {
    swap(rows[last_unused_row], rows[i]);
    ++last_unused_row;
  }

  ((void) 0);



  rows.resize(last_unused_row);


  if (indexes[0] >= index_first_pending) {

  }
  else {
    if (indexes.back() < index_first_pending) {

      index_first_pending -= indexes.size();
    }
    else {




      itr_t j = std::lower_bound(indexes.begin(), indexes.end(),
                                 index_first_pending);
      std::iterator_traits<itr_t>::difference_type
        non_pending = j - indexes.begin();
      index_first_pending -= static_cast<dimension_type>(non_pending);
    }
  }




  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>::remove_trailing_rows(const dimension_type n) {
  ((void) 0);
  rows.resize(rows.size() - n);
  if (first_pending_row() > rows.size())
    index_first_pending = rows.size();
  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>
::permute_space_dimensions(const std::vector<Variable>& cycle) {
  for (dimension_type i = num_rows(); i-- > 0; )
    rows[i].permute_space_dimensions(cycle);
  sorted = false;
  ((void) 0);
}

template <typename Row>
inline void
Linear_System<Row>
::swap_space_dimensions(Variable v1, Variable v2) {
  ((void) 0);
  ((void) 0);
  for (dimension_type k = num_rows(); k-- > 0; )
    rows[k].swap_space_dimensions(v1, v2);
  sorted = false;
  ((void) 0);
}


template <typename Row>
inline bool
operator!=(const Linear_System<Row>& x, const Linear_System<Row>& y) {
  return !(x == y);
}

template <typename Row>
inline bool
Linear_System<Row>::Row_Less_Than::operator()(const Row& x,
                                              const Row& y) const {
  return compare(x, y) < 0;
}

template <typename Row>
inline
Linear_System<Row>::Unique_Compare
::Unique_Compare(const Swapping_Vector<Row>& cont,
                 dimension_type base)
  : container(cont), base_index(base) {
}

template <typename Row>
inline bool
Linear_System<Row>::Unique_Compare
::operator()(dimension_type i, dimension_type j) const {
  return container[base_index + i].is_equal_to(container[base_index + j]);
}


template <typename Row>
inline void
swap(Linear_System<Row>& x, Linear_System<Row>& y) {
  x.m_swap(y);
}

}
# 580 "Linear_System_defs.hh" 2
# 1 "Linear_System_templates.hh" 1
# 27 "Linear_System_templates.hh"
# 1 "Bit_Matrix_defs.hh" 1
# 33 "Bit_Matrix_defs.hh"
namespace Parma_Polyhedra_Library {







}





class Parma_Polyhedra_Library::Bit_Matrix {
public:

  Bit_Matrix();


  Bit_Matrix(dimension_type n_rows, dimension_type n_columns);


  Bit_Matrix(const Bit_Matrix& y);


  ~Bit_Matrix();


  Bit_Matrix& operator=(const Bit_Matrix& y);


  void m_swap(Bit_Matrix& y);


  Bit_Row& operator[](dimension_type k);


  const Bit_Row& operator[](dimension_type k) const;


  void clear();


  void transpose();


  void transpose_assign(const Bit_Matrix& y);


  static dimension_type max_num_rows();


  dimension_type num_columns() const;


  dimension_type num_rows() const;


  void sort_rows();
# 105 "Bit_Matrix_defs.hh"
  bool sorted_contains(const Bit_Row& row) const;
# 114 "Bit_Matrix_defs.hh"
  void add_recycled_row(Bit_Row& row);


  void remove_trailing_rows(dimension_type n);






  void remove_trailing_columns(dimension_type n);


  void resize(dimension_type new_n_rows, dimension_type new_n_columns);


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;






private:

  std::vector<Bit_Row> rows;


  dimension_type row_size;



  struct Bit_Row_Less_Than {
    bool operator()(const Bit_Row& x, const Bit_Row& y) const;
  };

  template <typename Row>
  friend class Parma_Polyhedra_Library::Linear_System;
};

namespace Parma_Polyhedra_Library {





bool operator==(const Bit_Matrix& x, const Bit_Matrix& y);





bool operator!=(const Bit_Matrix& x, const Bit_Matrix& y);

}

# 1 "Bit_Matrix_inlines.hh" 1
# 30 "Bit_Matrix_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Bit_Matrix::Bit_Matrix()
  : rows(),
    row_size(0) {
}

inline dimension_type
Bit_Matrix::max_num_rows() {
  return std::vector<Bit_Row>().max_size();
}

inline
Bit_Matrix::Bit_Matrix(const dimension_type n_rows,
                       const dimension_type n_columns)
  : rows(n_rows),
    row_size(n_columns) {
}

inline
Bit_Matrix::Bit_Matrix(const Bit_Matrix& y)
  : rows(y.rows),
    row_size(y.row_size) {
}

inline
Bit_Matrix::~Bit_Matrix() {
}

inline void
Bit_Matrix::remove_trailing_rows(const dimension_type n) {


  ((void) 0);
  if (n != 0)
    rows.resize(rows.size() - n);
  ((void) 0);
}

inline void
Bit_Matrix::remove_trailing_columns(const dimension_type n) {


  ((void) 0);
  row_size -= n;
  ((void) 0);
}

inline void
Bit_Matrix::m_swap(Bit_Matrix& y) {
  using std::swap;
  swap(row_size, y.row_size);
  swap(rows, y.rows);
}

inline Bit_Row&
Bit_Matrix::operator[](const dimension_type k) {
  ((void) 0);
  return rows[k];
}

inline const Bit_Row&
Bit_Matrix::operator[](const dimension_type k) const {
  ((void) 0);
  return rows[k];
}

inline dimension_type
Bit_Matrix::num_columns() const {
  return row_size;
}

inline dimension_type
Bit_Matrix::num_rows() const {
  return rows.size();
}

inline void
Bit_Matrix::clear() {

  std::vector<Bit_Row> tmp;
  using std::swap;
  swap(tmp, rows);
  row_size = 0;
}

inline memory_size_type
Bit_Matrix::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline bool
Bit_Matrix::Bit_Row_Less_Than::
operator()(const Bit_Row& x, const Bit_Row& y) const {
  return compare(x, y) < 0;
}

inline bool
Bit_Matrix::sorted_contains(const Bit_Row& row) const {
  ((void) 0);
  return std::binary_search(rows.begin(), rows.end(), row,
                            Bit_Row_Less_Than());
}


inline bool
operator!=(const Bit_Matrix& x, const Bit_Matrix& y) {
  return !(x == y);
}


inline void
swap(Bit_Matrix& x, Bit_Matrix& y) {
  x.m_swap(y);
}

}
# 186 "Bit_Matrix_defs.hh" 2
# 28 "Linear_System_templates.hh" 2

# 1 "Scalar_Products_defs.hh" 1
# 44 "Scalar_Products_defs.hh"
class Parma_Polyhedra_Library::Scalar_Products {
public:

  static void assign(Coefficient& z,
                     const Linear_Expression& x, const Linear_Expression& y);


  static void assign(Coefficient& z, const Constraint& c, const Generator& g);


  static void assign(Coefficient& z, const Generator& g, const Constraint& c);


  static void assign(Coefficient& z,
                     const Constraint& c, const Grid_Generator& gg);


  static void assign(Coefficient& z,
                     const Grid_Generator& gg, const Congruence& cg);


  static void assign(Coefficient& z,
                     const Congruence& cg, const Grid_Generator& gg);


  static int sign(const Linear_Expression& x, const Linear_Expression& y);


  static int sign(const Constraint& c, const Generator& g);


  static int sign(const Generator& g, const Constraint& c);


  static int sign(const Constraint& c, const Grid_Generator& g);






  static void reduced_assign(Coefficient& z,
                             const Linear_Expression& x,
                             const Linear_Expression& y);






  static void reduced_assign(Coefficient& z,
                             const Constraint& c, const Generator& g);






  static void reduced_assign(Coefficient& z,
                             const Generator& g, const Constraint& c);





  static void reduced_assign(Coefficient& z,
                             const Grid_Generator& gg, const Congruence& cg);





  static int reduced_sign(const Linear_Expression& x,
                          const Linear_Expression& y);





  static int reduced_sign(const Constraint& c, const Generator& g);





  static int reduced_sign(const Generator& g, const Constraint& c);






  static void homogeneous_assign(Coefficient& z,
                                 const Linear_Expression& x,
                                 const Linear_Expression& y);





  static void homogeneous_assign(Coefficient& z,
                                 const Linear_Expression& e,
                                 const Generator& g);





  static void homogeneous_assign(Coefficient& z,
                                 const Grid_Generator& gg,
                                 const Constraint& c);





  static void homogeneous_assign(Coefficient& z,
                                 const Grid_Generator& gg,
                                 const Congruence& cg);





  static void homogeneous_assign(Coefficient& z,
                                 const Linear_Expression& e,
                                 const Grid_Generator& g);





  static int homogeneous_sign(const Linear_Expression& x,
                              const Linear_Expression& y);





  static int homogeneous_sign(const Linear_Expression& e, const Generator& g);




  static int homogeneous_sign(const Linear_Expression& e,
                              const Grid_Generator& g);




  static int homogeneous_sign(const Grid_Generator& g, const Constraint& c);
};





class Parma_Polyhedra_Library::Topology_Adjusted_Scalar_Product_Sign {
public:

  Topology_Adjusted_Scalar_Product_Sign(const Constraint& c);


  Topology_Adjusted_Scalar_Product_Sign(const Generator& g);


  int operator()(const Constraint&, const Generator&) const;


  int operator()(const Generator&, const Constraint&) const;

private:

  typedef int (* const SPS_type)(const Linear_Expression&,
                                 const Linear_Expression&);


  SPS_type sps_fp;
};
# 30 "Linear_System_templates.hh" 2
# 1 "Scalar_Products_inlines.hh" 1
# 29 "Scalar_Products_inlines.hh"
# 1 "Generator_defs.hh" 1
# 35 "Generator_defs.hh"
# 1 "Grid_Generator_System_types.hh" 1
# 16 "Grid_Generator_System_types.hh"
namespace Parma_Polyhedra_Library {

class Grid_Generator_System;

}
# 36 "Generator_defs.hh" 2






# 1 "distances_defs.hh" 1
# 27 "distances_defs.hh"
# 1 "distances_types.hh" 1
# 16 "distances_types.hh"
namespace Parma_Polyhedra_Library {

template <typename Temp>
struct Rectilinear_Distance_Specialization;

template <typename Temp>
struct Euclidean_Distance_Specialization;

template <typename Temp>
struct L_Infinity_Distance_Specialization;

}
# 28 "distances_defs.hh" 2


template <typename Temp>
struct Parma_Polyhedra_Library::Rectilinear_Distance_Specialization {
  static void combine(Temp& running, const Temp& current, Rounding_Dir dir);

  static void finalize(Temp&, Rounding_Dir);
};

template <typename Temp>
struct Parma_Polyhedra_Library::Euclidean_Distance_Specialization {
  static void combine(Temp& running, Temp& current, Rounding_Dir dir);

  static void finalize(Temp& running, Rounding_Dir dir);
};


template <typename Temp>
struct Parma_Polyhedra_Library::L_Infinity_Distance_Specialization {
  static void combine(Temp& running, const Temp& current, Rounding_Dir);

  static void finalize(Temp&, Rounding_Dir);
};

# 1 "distances_inlines.hh" 1
# 29 "distances_inlines.hh"
namespace Parma_Polyhedra_Library {



template <typename To, typename From>
struct maybe_assign_struct {
  static inline Result
  function(const To*& top, To& tmp, const From& from, Rounding_Dir dir) {


    top = &tmp;
    return assign_r(tmp, from, dir);
  }
};

template <typename Type>
struct maybe_assign_struct<Type, Type> {
  static inline Result
  function(const Type*& top, Type&, const Type& from, Rounding_Dir) {

    top = &from;
    return V_EQ;
  }
};
# 62 "distances_inlines.hh"
template <typename To, typename From>
inline Result
maybe_assign(const To*& top, To& tmp, const From& from, Rounding_Dir dir) {
  return maybe_assign_struct<To, From>::function(top, tmp, from, dir);
}

template <typename Temp>
inline void
Rectilinear_Distance_Specialization<Temp>::combine(Temp& running,
                                                   const Temp& current,
                                                   Rounding_Dir dir) {
  add_assign_r(running, running, current, dir);
}

template <typename Temp>
inline void
Rectilinear_Distance_Specialization<Temp>::finalize(Temp&, Rounding_Dir) {
}

template <typename Temp>
inline void
Euclidean_Distance_Specialization<Temp>::combine(Temp& running,
                                                 Temp& current,
                                                 Rounding_Dir dir) {
  mul_assign_r(current, current, current, dir);
  add_assign_r(running, running, current, dir);
}

template <typename Temp>
inline void
Euclidean_Distance_Specialization<Temp>::finalize(Temp& running,
                                                  Rounding_Dir dir) {
  sqrt_assign_r(running, running, dir);
}

template <typename Temp>
inline void
L_Infinity_Distance_Specialization<Temp>::combine(Temp& running,
                                                  const Temp& current,
                                                  Rounding_Dir) {
  if (current > running)
    running = current;
}

template <typename Temp>
inline void
L_Infinity_Distance_Specialization<Temp>::finalize(Temp&, Rounding_Dir) {
}

}
# 53 "distances_defs.hh" 2
# 43 "Generator_defs.hh" 2


# 1 "Expression_Hide_Inhomo_defs.hh" 1
# 41 "Expression_Hide_Inhomo_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::Expression_Hide_Inhomo
  : public Expression_Adapter<T> {
  typedef Expression_Adapter<T> base_type;
public:

  typedef Expression_Hide_Inhomo<T> const_reference;

  typedef typename base_type::inner_type inner_type;

  typedef typename base_type::raw_type raw_type;


  explicit Expression_Hide_Inhomo(const raw_type& expr);

public:

  typedef typename base_type::const_iterator const_iterator;


  Coefficient_traits::const_reference inhomogeneous_term() const;


  bool is_zero() const;





  template <typename Expression>
  bool is_equal_to(const Expression& y) const;


  Coefficient_traits::const_reference get(dimension_type i) const;


  Coefficient_traits::const_reference get(Variable v) const;





  bool all_zeroes(const Variables_Set& vars) const;





  bool all_zeroes(dimension_type start, dimension_type end) const;




  dimension_type num_zeroes(dimension_type start, dimension_type end) const;





  Coefficient gcd(dimension_type start, dimension_type end) const;



  dimension_type last_nonzero() const;



  dimension_type last_nonzero(dimension_type first, dimension_type last) const;



  dimension_type first_nonzero(dimension_type first, dimension_type last) const;





  bool all_zeroes_except(const Variables_Set& vars,
                         dimension_type start, dimension_type end) const;


  void has_a_free_dimension_helper(std::set<dimension_type>& x) const;



  template <typename Expression>
  bool is_equal_to(const Expression& y,
                   dimension_type start, dimension_type end) const;



  template <typename Expression>
  bool is_equal_to(const Expression& y,
                   Coefficient_traits::const_reference c1,
                   Coefficient_traits::const_reference c2,
                   dimension_type start, dimension_type end) const;


  void get_row(Dense_Row& row) const;


  void get_row(Sparse_Row& row) const;
};

# 1 "Expression_Hide_Inhomo_inlines.hh" 1
# 29 "Expression_Hide_Inhomo_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
Expression_Hide_Inhomo<T>::Expression_Hide_Inhomo(const raw_type& expr)
  : base_type(expr) {
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Hide_Inhomo<T>::inhomogeneous_term() const {

  return Coefficient_zero();
}

template <typename T>
inline bool
Expression_Hide_Inhomo<T>::is_zero() const {

  return this->inner().all_homogeneous_terms_are_zero();
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Inhomo<T>
::is_equal_to(const Expression& y) const {
  const dimension_type x_dim = this->space_dimension();
  const dimension_type y_dim = y.space_dimension();
  if (x_dim != y_dim)
    return false;
  if (y.inhomogeneous_term() != 0)
    return false;

  return this->inner().is_equal_to(y, 1, x_dim + 1);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Hide_Inhomo<T>::get(dimension_type i) const {
  if (i == 0)
    return Coefficient_zero();
  else
    return this->inner().get(i);
}

template <typename T>
inline Coefficient_traits::const_reference
Expression_Hide_Inhomo<T>::get(Variable v) const {
  return this->inner().get(v);
}

template <typename T>
inline bool
Expression_Hide_Inhomo<T>
::all_zeroes(const Variables_Set& vars) const {
  return this->inner().all_zeroes(vars);
}

template <typename T>
inline bool
Expression_Hide_Inhomo<T>::all_zeroes(dimension_type start,
                                      dimension_type end) const {
  if (start == end)
    return true;
  if (start == 0)
    ++start;
  return this->inner().all_zeroes(start, end);
}

template <typename T>
inline dimension_type
Expression_Hide_Inhomo<T>::num_zeroes(dimension_type start,
                                      dimension_type end) const {
  if (start == end)
    return 0;
  dimension_type nz = 0;
  if (start == 0) {
    ++start;
    ++nz;
  }
  nz += this->inner().num_zeroes(start, end);
  return nz;
}

template <typename T>
inline Coefficient
Expression_Hide_Inhomo<T>::gcd(dimension_type start,
                               dimension_type end) const {
  if (start == end)
    return Coefficient_zero();
  if (start == 0)
    ++start;
  return this->inner().gcd(start, end);
}

template <typename T>
inline dimension_type
Expression_Hide_Inhomo<T>::last_nonzero() const {
  return this->inner().last_nonzero();
}

template <typename T>
inline dimension_type
Expression_Hide_Inhomo<T>::last_nonzero(dimension_type first,
                                        dimension_type last) const {
  if (first == last)
    return last;
  if (first == 0)
    ++first;
  return this->inner().last_nonzero(first, last);
}

template <typename T>
inline dimension_type
Expression_Hide_Inhomo<T>::first_nonzero(dimension_type first,
                                         dimension_type last) const {
  if (first == last)
    return last;
  if (first == 0)
    ++first;
  return this->inner().first_nonzero(first, last);
}

template <typename T>
inline bool
Expression_Hide_Inhomo<T>
::all_zeroes_except(const Variables_Set& vars,
                    dimension_type start, dimension_type end) const {
  if (start == end)
    return true;
  if (start == 0)
    ++start;
  return this->inner().all_zeroes_except(vars, start, end);
}

template <typename T>
inline void
Expression_Hide_Inhomo<T>
::has_a_free_dimension_helper(std::set<dimension_type>& y) const {
  bool had_0 = (y.count(0) == 1);
  this->inner().has_a_free_dimension_helper(y);
  if (had_0)
    y.insert(0);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Inhomo<T>
::is_equal_to(const Expression& y,
              dimension_type start, dimension_type end) const {
  if (start == end)
    return true;
  if (start == 0)
    ++start;
  return this->inner().is_equal_to(y, start, end);
}

template <typename T>
template <typename Expression>
inline bool
Expression_Hide_Inhomo<T>
::is_equal_to(const Expression& y,
              Coefficient_traits::const_reference c1,
              Coefficient_traits::const_reference c2,
              dimension_type start, dimension_type end) const {
  if (start == end)
    return true;
  if (start == 0)
    ++start;
  return this->inner().is_equal_to(y, c1, c2, start, end);
}

template <typename T>
inline void
Expression_Hide_Inhomo<T>::get_row(Dense_Row& row) const {
  this->inner().get_row(row);
  row.reset(0);
}

template <typename T>
inline void
Expression_Hide_Inhomo<T>::get_row(Sparse_Row& row) const {
  this->inner().get_row(row);
  row.reset(0);
}

}
# 146 "Expression_Hide_Inhomo_defs.hh" 2
# 46 "Generator_defs.hh" 2



namespace Parma_Polyhedra_Library {
# 90 "Generator_defs.hh"
int compare(const Generator& x, const Generator& y);

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Generator& g);

}



void swap(Generator& x, Generator& y);

}
# 285 "Generator_defs.hh"
class Parma_Polyhedra_Library::Generator {
public:







  static const Representation default_representation = SPARSE;







  static Generator line(const Linear_Expression& e,
                        Representation r = default_representation);







  static Generator ray(const Linear_Expression& e,
                       Representation r = default_representation);
# 322 "Generator_defs.hh"
  static Generator point(const Linear_Expression& e
                         = Linear_Expression::zero(),
                         Coefficient_traits::const_reference d
                         = Coefficient_one(),
                         Representation r = default_representation);


  static Generator point(Representation r);


  static Generator point(const Linear_Expression& e,
                         Representation r);


  explicit Generator(Representation r = default_representation);
# 346 "Generator_defs.hh"
  static Generator
  closure_point(const Linear_Expression& e = Linear_Expression::zero(),
                Coefficient_traits::const_reference d = Coefficient_one(),
                Representation r = default_representation);


  static Generator
  closure_point(Representation r);


  static Generator
  closure_point(const Linear_Expression& e, Representation r);



  Generator(const Generator& g);


  Generator(const Generator& g, Representation r);



  Generator(const Generator& g, dimension_type space_dim);


  Generator(const Generator& g, dimension_type space_dim, Representation r);


  ~Generator();


  Generator& operator=(const Generator& g);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;



  void set_space_dimension(dimension_type space_dim);


  void swap_space_dimensions(Variable v1, Variable v2);
# 408 "Generator_defs.hh"
  bool remove_space_dimensions(const Variables_Set& vars);
# 422 "Generator_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);



  void shift_space_dimensions(Variable v, dimension_type n);


  enum Type {

    LINE,

    RAY,

    POINT,

    CLOSURE_POINT
  };


  Type type() const;


  bool is_line() const;


  bool is_ray() const;




  bool is_line_or_ray() const;


  bool is_point() const;


  bool is_closure_point() const;







  Coefficient_traits::const_reference coefficient(Variable v) const;






  Coefficient_traits::const_reference divisor() const;


  static void initialize();


  static void finalize();


  static const Generator& zero_dim_point();





  static const Generator& zero_dim_closure_point();





  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  bool is_equivalent_to(const Generator& y) const;






  bool is_equal_to(const Generator& y) const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  void m_swap(Generator& y);


  typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression> >
  expr_type;

  expr_type expression() const;

private:

  enum Kind {
    LINE_OR_EQUALITY = 0,
    RAY_OR_POINT_OR_INEQUALITY = 1
  };


  Linear_Expression expr;


  Kind kind_;


  Topology topology_;





  static const Generator* zero_dim_point_p;





  static const Generator* zero_dim_closure_point_p;
# 570 "Generator_defs.hh"
  Generator(Linear_Expression& e, Type type, Topology topology);

  Generator(Linear_Expression& e, Kind kind, Topology topology);

  Generator(dimension_type space_dim, Kind kind, Topology topology,
            Representation r = default_representation);





  bool is_line_or_equality() const;





  bool is_ray_or_point_or_inequality() const;


  void set_is_line_or_equality();


  void set_is_ray_or_point_or_inequality();




  Topology topology() const;





  bool is_not_necessarily_closed() const;





  bool is_necessarily_closed() const;






  void set_topology(Topology x);


  void set_necessarily_closed();


  void set_not_necessarily_closed();







  void mark_as_necessarily_closed();






  void mark_as_not_necessarily_closed();
# 652 "Generator_defs.hh"
  void linear_combine(const Generator& y, dimension_type i);
# 661 "Generator_defs.hh"
  void set_space_dimension_no_ok(dimension_type space_dim);





  void
  throw_dimension_incompatible(const char* method,
                               const char* v_name,
                               Variable v) const;





  void
  throw_invalid_argument(const char* method, const char* reason) const;


  bool is_ray_or_point() const;


  void set_is_line();


  void set_is_ray_or_point();
# 695 "Generator_defs.hh"
  bool is_matching_closure_point(const Generator& p) const;


  Coefficient_traits::const_reference epsilon_coefficient() const;


  void set_epsilon_coefficient(Coefficient_traits::const_reference n);





  void sign_normalize();







  void strong_normalize();





  bool check_strong_normalized() const;






  void fancy_print(std::ostream& s) const;

  friend class Expression_Adapter<Generator>;
  friend class Linear_System<Generator>;
  friend class Parma_Polyhedra_Library::Scalar_Products;
  friend class Parma_Polyhedra_Library::Topology_Adjusted_Scalar_Product_Sign;
  friend class Parma_Polyhedra_Library::Topology_Adjusted_Scalar_Product_Assign;
  friend class Parma_Polyhedra_Library::Generator_System;
  friend class Parma_Polyhedra_Library::Generator_System_const_iterator;

  friend class Parma_Polyhedra_Library::Polyhedron;

  friend class Parma_Polyhedra_Library::Grid_Generator_System;
  friend class Parma_Polyhedra_Library::MIP_Problem;
  friend class Parma_Polyhedra_Library::Grid;

  friend std::ostream&
  Parma_Polyhedra_Library::IO_Operators::operator<<(std::ostream& s,
                                                    const Generator& g);

  friend int
  compare(const Generator& x, const Generator& y);
};


namespace Parma_Polyhedra_Library {



Generator line(const Linear_Expression& e,
               Representation r = Generator::default_representation);



Generator ray(const Linear_Expression& e,
              Representation r = Generator::default_representation);







Generator
point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(),
      Representation r = Generator::default_representation);



Generator
point(Representation r);







Generator
point(const Linear_Expression& e, Representation r);







Generator
closure_point(const Linear_Expression& e = Linear_Expression::zero(),
              Coefficient_traits::const_reference d = Coefficient_one(),
              Representation r = Generator::default_representation);



Generator
closure_point(Representation r);







Generator
closure_point(const Linear_Expression& e, Representation r);



bool operator==(const Generator& x, const Generator& y);



bool operator!=(const Generator& x, const Generator& y);
# 838 "Generator_defs.hh"
template <typename To>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Generator& x,
                                 const Generator& y,
                                 Rounding_Dir dir);
# 859 "Generator_defs.hh"
template <typename Temp, typename To>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Generator& x,
                                 const Generator& y,
                                 Rounding_Dir dir);
# 880 "Generator_defs.hh"
template <typename Temp, typename To>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Generator& x,
                                 const Generator& y,
                                 Rounding_Dir dir,
                                 Temp& tmp0,
                                 Temp& tmp1,
                                 Temp& tmp2);
# 904 "Generator_defs.hh"
template <typename To>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const Generator& x,
                               const Generator& y,
                               Rounding_Dir dir);
# 925 "Generator_defs.hh"
template <typename Temp, typename To>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Generator& x,
                                 const Generator& y,
                                 Rounding_Dir dir);
# 946 "Generator_defs.hh"
template <typename Temp, typename To>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const Generator& x,
                               const Generator& y,
                               Rounding_Dir dir,
                               Temp& tmp0,
                               Temp& tmp1,
                               Temp& tmp2);
# 970 "Generator_defs.hh"
template <typename To>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const Generator& x,
                                const Generator& y,
                                Rounding_Dir dir);
# 991 "Generator_defs.hh"
template <typename Temp, typename To>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const Generator& x,
                                const Generator& y,
                                Rounding_Dir dir);
# 1012 "Generator_defs.hh"
template <typename Temp, typename To>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const Generator& x,
                                const Generator& y,
                                Rounding_Dir dir,
                                Temp& tmp0,
                                Temp& tmp1,
                                Temp& tmp2);

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Generator::Type& t);

}

}

# 1 "Generator_inlines.hh" 1
# 27 "Generator_inlines.hh"
namespace Parma_Polyhedra_Library {

inline bool
Generator::is_necessarily_closed() const {
  return (topology() == NECESSARILY_CLOSED);
}

inline bool
Generator::is_not_necessarily_closed() const {
  return (topology() == NOT_NECESSARILY_CLOSED);
}

inline Generator::expr_type
Generator::expression() const {
  return expr_type(expr, is_not_necessarily_closed());
}

inline dimension_type
Generator::space_dimension() const {
  return expression().space_dimension();
}

inline bool
Generator::is_line_or_equality() const {
  return (kind_ == LINE_OR_EQUALITY);
}

inline bool
Generator::is_ray_or_point_or_inequality() const {
  return (kind_ == RAY_OR_POINT_OR_INEQUALITY);
}

inline Topology
Generator::topology() const {
  return topology_;
}

inline void
Generator::set_is_line_or_equality() {
  kind_ = LINE_OR_EQUALITY;
}

inline void
Generator::set_is_ray_or_point_or_inequality() {
  kind_ = RAY_OR_POINT_OR_INEQUALITY;
}

inline void
Generator::set_topology(Topology x) {
  if (topology() == x)
    return;
  if (topology() == NECESSARILY_CLOSED) {

    expr.set_space_dimension(expr.space_dimension() + 1);
  }
  else {
    ((void) 0);
    expr.set_space_dimension(expr.space_dimension() - 1);
  }
  topology_ = x;
}

inline void
Generator::mark_as_necessarily_closed() {
  ((void) 0);
  topology_ = NECESSARILY_CLOSED;
}

inline void
Generator::mark_as_not_necessarily_closed() {
  ((void) 0);
  topology_ = NOT_NECESSARILY_CLOSED;
}

inline void
Generator::set_necessarily_closed() {
  set_topology(NECESSARILY_CLOSED);
}

inline void
Generator::set_not_necessarily_closed() {
  set_topology(NOT_NECESSARILY_CLOSED);
}

inline
Generator::Generator(Representation r)
  : expr(r),
    kind_(RAY_OR_POINT_OR_INEQUALITY),
    topology_(NECESSARILY_CLOSED) {
  expr.set_inhomogeneous_term(Coefficient_one());
  ((void) 0);
  ((void) 0);
}

inline
Generator::Generator(dimension_type space_dim, Kind kind, Topology topology,
                     Representation r)
  : expr(r),
    kind_(kind),
    topology_(topology) {
  if (is_necessarily_closed())
    expr.set_space_dimension(space_dim);
  else
    expr.set_space_dimension(space_dim + 1);
  ((void) 0);
  ((void) 0);
}

inline
Generator::Generator(Linear_Expression& e, Type type, Topology topology)
  : topology_(topology) {
  ((void) 0);
  swap(expr, e);
  if (topology == NOT_NECESSARILY_CLOSED)
    expr.set_space_dimension(expr.space_dimension() + 1);
  if (type == LINE)
    kind_ = LINE_OR_EQUALITY;
  else
    kind_ = RAY_OR_POINT_OR_INEQUALITY;
  strong_normalize();
}

inline
Generator::Generator(Linear_Expression& e, Kind kind, Topology topology)
  : kind_(kind),
    topology_(topology) {
  swap(expr, e);
  if (topology == NOT_NECESSARILY_CLOSED)
    expr.set_space_dimension(expr.space_dimension() + 1);
  strong_normalize();
}

inline
Generator::Generator(const Generator& g)
  : expr(g.expr),
    kind_(g.kind_),
    topology_(g.topology_) {
}

inline
Generator::Generator(const Generator& g, Representation r)
  : expr(g.expr, r),
    kind_(g.kind_),
    topology_(g.topology_) {

  ((void) 0);
}

inline
Generator::Generator(const Generator& g, dimension_type space_dim)
  : expr(g.expr, g.is_necessarily_closed() ? space_dim : (space_dim + 1)),
    kind_(g.kind_),
    topology_(g.topology_) {
  ((void) 0);
  ((void) 0);
}

inline
Generator::Generator(const Generator& g, dimension_type space_dim,
                     Representation r)
  : expr(g.expr, g.is_necessarily_closed() ? space_dim : (space_dim + 1), r),
    kind_(g.kind_),
    topology_(g.topology_) {
  ((void) 0);
  ((void) 0);
}

inline
Generator::~Generator() {
}

inline Generator&
Generator::operator=(const Generator& g) {
  Generator tmp = g;
  swap(*this, tmp);

  return *this;
}

inline Representation
Generator::representation() const {
  return expr.representation();
}

inline void
Generator::set_representation(Representation r) {
  expr.set_representation(r);
}

inline dimension_type
Generator::max_space_dimension() {
  return Linear_Expression::max_space_dimension();
}

inline void
Generator::set_space_dimension_no_ok(dimension_type space_dim) {
  const dimension_type old_expr_space_dim = expr.space_dimension();
  if (topology() == NECESSARILY_CLOSED) {
    expr.set_space_dimension(space_dim);
  }
  else {
    const dimension_type old_space_dim = space_dimension();
    if (space_dim > old_space_dim) {
      expr.set_space_dimension(space_dim + 1);
      expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
    }
    else {
      expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
      expr.set_space_dimension(space_dim + 1);
    }
  }
  ((void) 0);
  if (expr.space_dimension() < old_expr_space_dim)
    strong_normalize();
}

inline void
Generator::set_space_dimension(dimension_type space_dim) {
  set_space_dimension_no_ok(space_dim);
  ((void) 0);
}

inline void
Generator::shift_space_dimensions(Variable v, dimension_type n) {
  expr.shift_space_dimensions(v, n);
}

inline bool
Generator::is_line() const {
  return is_line_or_equality();
}

inline bool
Generator::is_ray_or_point() const {
  return is_ray_or_point_or_inequality();
}

inline bool
Generator::is_line_or_ray() const {
  return expr.inhomogeneous_term() == 0;
}

inline bool
Generator::is_ray() const {
  return is_ray_or_point() && is_line_or_ray();
}

inline Generator::Type
Generator::type() const {
  if (is_line())
    return LINE;
  if (is_line_or_ray())
    return RAY;
  if (is_necessarily_closed())
    return POINT;
  else {

    if (epsilon_coefficient() == 0)
      return CLOSURE_POINT;
    else
      return POINT;
  }
}

inline bool
Generator::is_point() const {
  return type() == POINT;
}

inline bool
Generator::is_closure_point() const {
  return type() == CLOSURE_POINT;
}

inline void
Generator::set_is_line() {
  set_is_line_or_equality();
}

inline void
Generator::set_is_ray_or_point() {
  set_is_ray_or_point_or_inequality();
}

inline Coefficient_traits::const_reference
Generator::coefficient(const Variable v) const {
  if (v.space_dimension() > space_dimension())
    throw_dimension_incompatible("coefficient(v)", "v", v);
  return expr.coefficient(v);
}

inline Coefficient_traits::const_reference
Generator::divisor() const {
  Coefficient_traits::const_reference d = expr.inhomogeneous_term();
  if (!is_ray_or_point() || d == 0)
    throw_invalid_argument("divisor()",
                           "*this is neither a point nor a closure point");
  return d;
}

inline Coefficient_traits::const_reference
Generator::epsilon_coefficient() const {
  ((void) 0);
  return expr.coefficient(Variable(expr.space_dimension() - 1));
}


inline void
Generator::set_epsilon_coefficient(Coefficient_traits::const_reference n) {
  ((void) 0);
  expr.set_coefficient(Variable(expr.space_dimension() - 1), n);
}


inline memory_size_type
Generator::external_memory_in_bytes() const {
  return expr.external_memory_in_bytes();
}

inline memory_size_type
Generator::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline void
Generator::strong_normalize() {
  expr.normalize();
  sign_normalize();
}

inline const Generator&
Generator::zero_dim_point() {
  ((void) 0);
  return *zero_dim_point_p;
}

inline const Generator&
Generator::zero_dim_closure_point() {
  ((void) 0);
  return *zero_dim_closure_point_p;
}


inline Generator
line(const Linear_Expression& e, Representation r) {
  return Generator::line(e, r);
}


inline Generator
ray(const Linear_Expression& e, Representation r) {
  return Generator::ray(e, r);
}


inline Generator
point(const Linear_Expression& e, Coefficient_traits::const_reference d,
      Representation r) {
  return Generator::point(e, d, r);
}


inline Generator
point(Representation r) {
  return Generator::point(r);
}


inline Generator
point(const Linear_Expression& e, Representation r) {
  return Generator::point(e, r);
}


inline Generator
closure_point(const Linear_Expression& e,
              Coefficient_traits::const_reference d,
              Representation r) {
  return Generator::closure_point(e, d, r);
}


inline Generator
closure_point(Representation r) {
  return Generator::closure_point(r);
}


inline Generator
closure_point(const Linear_Expression& e,
              Representation r) {
  return Generator::closure_point(e, r);
}


inline bool
operator==(const Generator& x, const Generator& y) {
  return x.is_equivalent_to(y);
}


inline bool
operator!=(const Generator& x, const Generator& y) {
  return !x.is_equivalent_to(y);
}

inline void
Generator::ascii_dump(std::ostream& s) const {

  expr.ascii_dump(s);

  s << " ";

  switch (type()) {
  case Generator::LINE:
    s << "L ";
    break;
  case Generator::RAY:
    s << "R ";
    break;
  case Generator::POINT:
    s << "P ";
    break;
  case Generator::CLOSURE_POINT:
    s << "C ";
    break;
  }
  if (is_necessarily_closed())
    s << "(C)";
  else
    s << "(NNC)";
  s << "\n";
}

inline bool
Generator::ascii_load(std::istream& s) {
  std::string str;

  expr.ascii_load(s);

  if (!(s >> str))
    return false;
  if (str == "L")
    set_is_line();
  else if (str == "R" || str == "P" || str == "C")
    set_is_ray_or_point();
  else
    return false;

  std::string str2;

  if (!(s >> str2))
    return false;
  if (str2 == "(C)") {
    if (is_not_necessarily_closed())

      mark_as_necessarily_closed();
  }
  else {
    if (str2 == "(NNC)") {
      if (is_necessarily_closed())

        mark_as_not_necessarily_closed();
    }
    else
      return false;
  }


  switch (type()) {
  case Generator::LINE:
    if (str != "L")
      return false;
    break;
  case Generator::RAY:
    if (str != "R")
      return false;
    break;
  case Generator::POINT:
    if (str != "P")
      return false;
    break;
  case Generator::CLOSURE_POINT:
    if (str != "C")
      return false;
    break;
  }

  return true;
}

inline void
Generator::m_swap(Generator& y) {
  using std::swap;
  swap(expr, y.expr);
  swap(kind_, y.kind_);
  swap(topology_, y.topology_);
}




template <typename Specialization, typename Temp, typename To>
inline bool
l_m_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                    const Generator& x,
                    const Generator& y,
                    const Rounding_Dir dir,
                    Temp& tmp0,
                    Temp& tmp1,
                    Temp& tmp2) {


  if (x.is_line_or_ray() || y.is_line_or_ray())
    return false;
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    return false;


  if (x_space_dim == 0) {
    assign_r(r, 0, ROUND_NOT_NEEDED);
    return true;
  }

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_x_coord; mpq_class& x_coord = holder_x_coord.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_y_coord; mpq_class& y_coord = holder_y_coord.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_x_div; mpq_class& x_div = holder_x_div.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_y_div; mpq_class& y_div = holder_y_div.item();
  assign_r(x_div, x.divisor(), ROUND_NOT_NEEDED);
  assign_r(y_div, y.divisor(), ROUND_NOT_NEEDED);

  assign_r(tmp0, 0, ROUND_NOT_NEEDED);

  for (dimension_type i = x_space_dim; i-- > 0; ) {
    assign_r(x_coord, x.coefficient(Variable(i)), ROUND_NOT_NEEDED);
    div_assign_r(x_coord, x_coord, x_div, ROUND_NOT_NEEDED);
    assign_r(y_coord, y.coefficient(Variable(i)), ROUND_NOT_NEEDED);
    div_assign_r(y_coord, y_coord, y_div, ROUND_NOT_NEEDED);
    const Temp* tmp1p;
    const Temp* tmp2p;

    if (x_coord > y_coord) {
      maybe_assign(tmp1p, tmp1, x_coord, dir);
      maybe_assign(tmp2p, tmp2, y_coord, inverse(dir));
    }
    else {
      maybe_assign(tmp1p, tmp1, y_coord, dir);
      maybe_assign(tmp2p, tmp2, x_coord, inverse(dir));
    }
    sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
    ((void) 0);
    Specialization::combine(tmp0, tmp1, dir);
  }
  Specialization::finalize(tmp0, dir);
  assign_r(r, tmp0, dir);
  return true;
}


template <typename Temp, typename To>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Generator& x,
                            const Generator& y,
                            const Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2) {
  return l_m_distance_assign<Rectilinear_Distance_Specialization<Temp> >
    (r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Generator& x,
                            const Generator& y,
                            const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return rectilinear_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Generator& x,
                            const Generator& y,
                            const Rounding_Dir dir) {
  return rectilinear_distance_assign<To, To>(r, x, y, dir);
}


template <typename Temp, typename To>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Generator& x,
                          const Generator& y,
                          const Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2) {
  return l_m_distance_assign<Euclidean_Distance_Specialization<Temp> >
    (r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Generator& x,
                          const Generator& y,
                          const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return euclidean_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Generator& x,
                          const Generator& y,
                          const Rounding_Dir dir) {
  return euclidean_distance_assign<To, To>(r, x, y, dir);
}


template <typename Temp, typename To>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Generator& x,
                           const Generator& y,
                           const Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2) {
  return l_m_distance_assign<L_Infinity_Distance_Specialization<Temp> >
    (r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Generator& x,
                           const Generator& y,
                           const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return l_infinity_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Generator& x,
                           const Generator& y,
                           const Rounding_Dir dir) {
  return l_infinity_distance_assign<To, To>(r, x, y, dir);
}


inline void
swap(Generator& x, Generator& y) {
  x.m_swap(y);
}

}
# 1032 "Generator_defs.hh" 2
# 30 "Scalar_Products_inlines.hh" 2
# 1 "Congruence_defs.hh" 1
# 42 "Congruence_defs.hh"
namespace Parma_Polyhedra_Library {



bool
operator==(const Congruence& x, const Congruence& y);



bool
operator!=(const Congruence& x, const Congruence& y);

}
# 161 "Congruence_defs.hh"
class Parma_Polyhedra_Library::Congruence {
public:







  static const Representation default_representation = SPARSE;


  explicit Congruence(Representation r = default_representation);






  Congruence(const Congruence& cg);


  Congruence(const Congruence& cg, Representation r);






  explicit Congruence(const Constraint& c,
                      Representation r = default_representation);


  ~Congruence();


  Congruence& operator=(const Congruence& y);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;

  void permute_space_dimensions(const std::vector<Variable>& cycles);


  typedef Expression_Adapter_Transparent<Linear_Expression> expr_type;

  expr_type expression() const;






  Coefficient_traits::const_reference coefficient(Variable v) const;


  Coefficient_traits::const_reference inhomogeneous_term() const;


  Coefficient_traits::const_reference modulus() const;



  void set_modulus(Coefficient_traits::const_reference m);


  void scale(Coefficient_traits::const_reference factor);


  void affine_preimage(Variable v,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator);







  Congruence&
  operator/=(Coefficient_traits::const_reference k);
# 261 "Congruence_defs.hh"
  bool is_tautological() const;
# 273 "Congruence_defs.hh"
  bool is_inconsistent() const;





  bool is_proper_congruence() const;





  bool is_equality() const;


  static void initialize();


  static void finalize();






  static const Congruence& zero_dim_integrality();





  static const Congruence& zero_dim_false();


  static Congruence
  create(const Linear_Expression& e1, const Linear_Expression& e2,
         Representation r = default_representation);


  static Congruence
  create(const Linear_Expression& e, Coefficient_traits::const_reference n,
         Representation r = default_representation);


  static Congruence
  create(Coefficient_traits::const_reference n, const Linear_Expression& e,
         Representation r = default_representation);





  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;





  bool ascii_load(std::istream& s);


  void m_swap(Congruence& y);







  Congruence(const Congruence& cg, dimension_type new_space_dimension);


  Congruence(const Congruence& cg, dimension_type new_space_dimension,
             Representation r);



  Congruence(const Constraint& cg, dimension_type new_space_dimension,
             Representation r = default_representation);
# 374 "Congruence_defs.hh"
  Congruence(Linear_Expression& le,
             Coefficient_traits::const_reference m, Recycle_Input);


  void swap_space_dimensions(Variable v1, Variable v2);



  void set_space_dimension(dimension_type n);



  void shift_space_dimensions(Variable v, dimension_type n);







  void sign_normalize();






  void normalize();






  void strong_normalize();

private:




  static const Congruence* zero_dim_false_p;






  static const Congruence* zero_dim_integrality_p;

  Linear_Expression expr;

  Coefficient modulus_;





  bool is_equal_at_dimension(Variable v,
                             const Congruence& cg) const;





  void
  throw_invalid_argument(const char* method, const char* message) const;





  void
  throw_dimension_incompatible(const char* method,
                               const char* v_name,
                               Variable v) const;

  friend bool
  operator==(const Congruence& x, const Congruence& y);

  friend bool
  operator!=(const Congruence& x, const Congruence& y);

  friend class Scalar_Products;
  friend class Grid;
};

namespace Parma_Polyhedra_Library {

namespace IO_Operators {




std::ostream&
operator<<(std::ostream& s, const Congruence& c);

}



Congruence
operator%=(const Linear_Expression& e1, const Linear_Expression& e2);



Congruence
operator%=(const Linear_Expression& e, Coefficient_traits::const_reference n);
# 490 "Congruence_defs.hh"
Congruence
operator/(const Congruence& cg, Coefficient_traits::const_reference k);



Congruence
operator/(const Constraint& c, Coefficient_traits::const_reference m);


void
swap(Congruence& x, Congruence& y);

}

# 1 "Congruence_inlines.hh" 1
# 29 "Congruence_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Congruence::Congruence(Representation r)
  : expr(r) {
  ((void) 0);
}

inline
Congruence::Congruence(const Congruence& cg)
  : expr(cg.expr), modulus_(cg.modulus_) {
}

inline
Congruence::Congruence(const Congruence& cg, Representation r)
  : expr(cg.expr, r), modulus_(cg.modulus_) {
}

inline
Congruence::Congruence(const Congruence& cg,
                       dimension_type new_space_dimension)
  : expr(cg.expr, new_space_dimension), modulus_(cg.modulus_) {
  ((void) 0);
}

inline
Congruence::Congruence(const Congruence& cg,
                       dimension_type new_space_dimension,
                       Representation r)
  : expr(cg.expr, new_space_dimension, r), modulus_(cg.modulus_) {
  ((void) 0);
}

inline Representation
Congruence::representation() const {
  return expr.representation();
}

inline void
Congruence::set_representation(Representation r) {
  expr.set_representation(r);
}

inline Congruence::expr_type
Congruence::expression() const {
  return expr_type(expr);
}

inline void
Congruence::set_space_dimension(dimension_type n) {
  expr.set_space_dimension(n);
  ((void) 0);
}

inline void
Congruence::shift_space_dimensions(Variable v, dimension_type n) {
  expr.shift_space_dimensions(v, n);
}

inline
Congruence::~Congruence() {
}

inline
Congruence::Congruence(Linear_Expression& le,
                       Coefficient_traits::const_reference m,
                       Recycle_Input)
  : modulus_(m) {
  ((void) 0);
  swap(expr, le);

  ((void) 0);
}

inline Congruence
Congruence::create(const Linear_Expression& e,
                   Coefficient_traits::const_reference n,
                   Representation r) {
  Linear_Expression diff(e, r);
  diff -= n;
  const Congruence cg(diff, 1, Recycle_Input());
  return cg;
}

inline Congruence
Congruence::create(Coefficient_traits::const_reference n,
                   const Linear_Expression& e,
                   Representation r) {
  Linear_Expression diff(e, r);
  diff -= n;
  const Congruence cg(diff, 1, Recycle_Input());
  return cg;
}


inline Congruence
operator%=(const Linear_Expression& e1, const Linear_Expression& e2) {
  return Congruence::create(e1, e2);
}


inline Congruence
operator%=(const Linear_Expression& e, Coefficient_traits::const_reference n) {
  return Congruence::create(e, n);
}


inline Congruence
operator/(const Congruence& cg, Coefficient_traits::const_reference k) {
  Congruence ret = cg;
  ret /= k;
  return ret;
}

inline const Congruence&
Congruence::zero_dim_integrality() {
  return *zero_dim_integrality_p;
}

inline const Congruence&
Congruence::zero_dim_false() {
  return *zero_dim_false_p;
}

inline Congruence&
Congruence::operator=(const Congruence& y) {
  Congruence tmp = y;
  swap(*this, tmp);
  return *this;
}


inline Congruence
operator/(const Constraint& c, Coefficient_traits::const_reference m) {
  Congruence ret(c);
  ret /= m;
  return ret;
}

inline Congruence&
Congruence::operator/=(Coefficient_traits::const_reference k) {
  if (k >= 0)
    modulus_ *= k;
  else
    modulus_ *= -k;
  return *this;
}


inline bool
operator==(const Congruence& x, const Congruence& y) {
  if (x.space_dimension() != y.space_dimension())
    return false;
  Congruence x_temp(x);
  Congruence y_temp(y);
  x_temp.strong_normalize();
  y_temp.strong_normalize();
  return x_temp.expr.is_equal_to(y_temp.expr)
    && x_temp.modulus() == y_temp.modulus();
}


inline bool
operator!=(const Congruence& x, const Congruence& y) {
  return !(x == y);
}

inline dimension_type
Congruence::max_space_dimension() {
  return Linear_Expression::max_space_dimension();
}

inline dimension_type
Congruence::space_dimension() const {
  return expr.space_dimension();
}

inline Coefficient_traits::const_reference
Congruence::coefficient(const Variable v) const {
  if (v.space_dimension() > space_dimension())
    throw_dimension_incompatible("coefficient(v)", "v", v);
  return expr.coefficient(v);
}

inline void
Congruence::permute_space_dimensions(const std::vector<Variable>& cycles) {
  expr.permute_space_dimensions(cycles);
}

inline Coefficient_traits::const_reference
Congruence::inhomogeneous_term() const {
  return expr.inhomogeneous_term();
}

inline Coefficient_traits::const_reference
Congruence::modulus() const {
  return modulus_;
}

inline void
Congruence::set_modulus(Coefficient_traits::const_reference m) {
  modulus_ = m;
  ((void) 0);
}

inline bool
Congruence::is_proper_congruence() const {
  return modulus() > 0;
}

inline bool
Congruence::is_equality() const {
  return modulus() == 0;
}

inline bool
Congruence::is_equal_at_dimension(Variable v,
                                  const Congruence& cg) const {
  return coefficient(v) * cg.modulus() == cg.coefficient(v) * modulus();
}

inline memory_size_type
Congruence::external_memory_in_bytes() const {
  return expr.external_memory_in_bytes()
         + Parma_Polyhedra_Library::external_memory_in_bytes(modulus_);
}

inline memory_size_type
Congruence::total_memory_in_bytes() const {
  return external_memory_in_bytes() + sizeof(*this);
}

inline void
Congruence::m_swap(Congruence& y) {
  using std::swap;
  swap(expr, y.expr);
  swap(modulus_, y.modulus_);
}

inline void
Congruence::swap_space_dimensions(Variable v1, Variable v2) {
  expr.swap_space_dimensions(v1, v2);
}


inline void
swap(Congruence& x, Congruence& y) {
  x.m_swap(y);
}

}
# 505 "Congruence_defs.hh" 2
# 31 "Scalar_Products_inlines.hh" 2
# 1 "Grid_Generator_defs.hh" 1
# 43 "Grid_Generator_defs.hh"
namespace Parma_Polyhedra_Library {
# 84 "Grid_Generator_defs.hh"
int compare(const Grid_Generator& x, const Grid_Generator& y);

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Grid_Generator& g);

}



void swap(Grid_Generator& x, Grid_Generator& y);

}
# 271 "Grid_Generator_defs.hh"
class Parma_Polyhedra_Library::Grid_Generator {
public:


  enum Kind {
    LINE_OR_EQUALITY = 0,
    RAY_OR_POINT_OR_INEQUALITY = 1
  };







  static const Representation default_representation = SPARSE;







  static Grid_Generator grid_line(const Linear_Expression& e,
                                  Representation r = default_representation);
# 306 "Grid_Generator_defs.hh"
  static Grid_Generator parameter(const Linear_Expression& e
                                  = Linear_Expression::zero(),
                                  Coefficient_traits::const_reference d
                                  = Coefficient_one(),
                                  Representation r = default_representation);



  static Grid_Generator parameter(Representation r);


  static Grid_Generator parameter(const Linear_Expression& e,
                                  Representation r);
# 328 "Grid_Generator_defs.hh"
  static Grid_Generator grid_point(const Linear_Expression& e
                                   = Linear_Expression::zero(),
                                   Coefficient_traits::const_reference d
                                   = Coefficient_one(),
                                   Representation r = default_representation);


  static Grid_Generator grid_point(Representation r);


  static Grid_Generator grid_point(const Linear_Expression& e,
                                   Representation r);


  explicit Grid_Generator(Representation r = default_representation);



  Grid_Generator(const Grid_Generator& g);


  Grid_Generator(const Grid_Generator& g, Representation r);



  Grid_Generator(const Grid_Generator& g, dimension_type space_dim);


  Grid_Generator(const Grid_Generator& g, dimension_type space_dim,
                 Representation r);


  ~Grid_Generator();


  Grid_Generator& operator=(const Grid_Generator& g);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;



  void set_space_dimension(dimension_type space_dim);


  void swap_space_dimensions(Variable v1, Variable v2);
# 393 "Grid_Generator_defs.hh"
  bool remove_space_dimensions(const Variables_Set& vars);
# 407 "Grid_Generator_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);



  void shift_space_dimensions(Variable v, dimension_type n);


  enum Type {

    LINE,

    PARAMETER,

    POINT
  };


  Type type() const;


  bool is_line() const;


  bool is_parameter() const;





  bool is_line_or_parameter() const;


  bool is_point() const;





  bool is_parameter_or_point() const;







  Coefficient_traits::const_reference coefficient(Variable v) const;






  Coefficient_traits::const_reference divisor() const;


  static void initialize();


  static void finalize();


  static const Grid_Generator& zero_dim_point();





  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  bool is_equivalent_to(const Grid_Generator& y) const;






  bool is_equal_to(const Grid_Generator& y) const;





  bool all_homogeneous_terms_are_zero() const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  void m_swap(Grid_Generator& y);
# 524 "Grid_Generator_defs.hh"
  void scale_to_divisor(Coefficient_traits::const_reference d);






  void set_divisor(Coefficient_traits::const_reference d);


  typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression> >
  expr_type;

  expr_type expression() const;

private:
  Linear_Expression expr;

  Kind kind_;





  static const Grid_Generator* zero_dim_point_p;



  Grid_Generator(dimension_type space_dim, Kind kind, Topology topology,
                 Representation r = default_representation);
# 565 "Grid_Generator_defs.hh"
  Grid_Generator(Linear_Expression& e, Type t);
# 574 "Grid_Generator_defs.hh"
  void set_space_dimension_no_ok(dimension_type space_dim);





  bool is_equal_at_dimension(dimension_type dim,
                             const Grid_Generator& gg) const;






  void fancy_print(std::ostream& s) const;


  void set_is_parameter();


  void set_is_line();


  void set_is_parameter_or_point();




  Topology topology() const;





  bool is_not_necessarily_closed() const;





  bool is_necessarily_closed() const;





  bool is_line_or_equality() const;





  bool is_ray_or_point_or_inequality() const;






  void set_topology(Topology x);


  void set_necessarily_closed();


  void set_not_necessarily_closed();


  void set_is_line_or_equality();


  void set_is_ray_or_point_or_inequality();






  void sign_normalize();







  void strong_normalize();





  bool check_strong_normalized() const;
# 680 "Grid_Generator_defs.hh"
  void linear_combine(const Grid_Generator& y, dimension_type i);





  void
  throw_dimension_incompatible(const char* method,
                               const char* name_var,
                               const Variable v) const;





  void
  throw_invalid_argument(const char* method, const char* reason) const;

  friend std::ostream&
  IO_Operators::operator<<(std::ostream& s, const Grid_Generator& g);

  friend int
  compare(const Grid_Generator& x, const Grid_Generator& y);

  friend class Expression_Adapter<Grid_Generator>;
  friend class Grid_Generator_System;
  friend class Grid;
  friend class Linear_System<Grid_Generator>;
  friend class Scalar_Products;
  friend class Topology_Adjusted_Scalar_Product_Sign;
};


namespace Parma_Polyhedra_Library {







Grid_Generator
grid_line(const Linear_Expression& e,
          Representation r = Grid_Generator::default_representation);







Grid_Generator
parameter(const Linear_Expression& e = Linear_Expression::zero(),
          Coefficient_traits::const_reference d = Coefficient_one(),
          Representation r = Grid_Generator::default_representation);



Grid_Generator
parameter(Representation r);







Grid_Generator
parameter(const Linear_Expression& e, Representation r);







Grid_Generator
grid_point(const Linear_Expression& e = Linear_Expression::zero(),
           Coefficient_traits::const_reference d = Coefficient_one(),
           Representation r = Grid_Generator::default_representation);



Grid_Generator
grid_point(Representation r);







Grid_Generator
grid_point(const Linear_Expression& e, Representation r);



bool operator==(const Grid_Generator& x, const Grid_Generator& y);



bool operator!=(const Grid_Generator& x, const Grid_Generator& y);


namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Grid_Generator::Type& t);

}

}

# 1 "Grid_Generator_inlines.hh" 1
# 27 "Grid_Generator_inlines.hh"
namespace Parma_Polyhedra_Library {

inline bool
Grid_Generator::is_necessarily_closed() const {
  return true;
}

inline bool
Grid_Generator::is_not_necessarily_closed() const {
  return false;
}

inline bool
Grid_Generator::is_line_or_equality() const {
  return (kind_ == LINE_OR_EQUALITY);
}

inline bool
Grid_Generator::is_ray_or_point_or_inequality() const {
  return (kind_ == RAY_OR_POINT_OR_INEQUALITY);
}

inline Topology
Grid_Generator::topology() const {
  return NECESSARILY_CLOSED;
}

inline void
Grid_Generator::set_is_line_or_equality() {
  kind_ = LINE_OR_EQUALITY;
}

inline void
Grid_Generator::set_is_ray_or_point_or_inequality() {
  kind_ = RAY_OR_POINT_OR_INEQUALITY;
}

inline void
Grid_Generator::set_topology(Topology x) {
  (void)(x);
  ((void) 0);
}

inline void
Grid_Generator::set_necessarily_closed() {
  set_topology(NECESSARILY_CLOSED);
}

inline void
Grid_Generator::set_not_necessarily_closed() {
  set_topology(NOT_NECESSARILY_CLOSED);
}

inline
Grid_Generator::Grid_Generator(Linear_Expression& e, Type type) {
  swap(expr, e);
  if (type == LINE)
    kind_ = LINE_OR_EQUALITY;
  else
    kind_ = RAY_OR_POINT_OR_INEQUALITY;
  ((void) 0);
}

inline
Grid_Generator::Grid_Generator(Representation r)
  : expr(Coefficient_one(), r),
    kind_(RAY_OR_POINT_OR_INEQUALITY) {
  expr.set_space_dimension(1);
  ((void) 0);
}

inline
Grid_Generator::Grid_Generator(const Grid_Generator& g)
  : expr(g.expr),
    kind_(g.kind_) {
}

inline
Grid_Generator::Grid_Generator(const Grid_Generator& g, Representation r)
  : expr(g.expr, r),
    kind_(g.kind_) {
}

inline
Grid_Generator::Grid_Generator(dimension_type space_dim, Kind kind,
                               Topology topology, Representation r)
  : expr(r),
    kind_(kind) {
  (void)(topology);
  ((void) 0);
  expr.set_space_dimension(space_dim + 1);
  ((void) 0);
}

inline
Grid_Generator::Grid_Generator(const Grid_Generator& g,
                               dimension_type space_dim)
  : expr(g.expr, space_dim + 1),
    kind_(g.kind_) {
  ((void) 0);
  ((void) 0);
}

inline
Grid_Generator::Grid_Generator(const Grid_Generator& g,
                               dimension_type space_dim, Representation r)
  : expr(g.expr, space_dim + 1, r),
    kind_(g.kind_) {
  ((void) 0);
  ((void) 0);
}

inline
Grid_Generator::~Grid_Generator() {
}

inline Grid_Generator::expr_type
Grid_Generator::expression() const {
  return expr_type(expr, true);
}

inline Representation
Grid_Generator::representation() const {
  return expr.representation();
}

inline void
Grid_Generator::set_representation(Representation r) {
  expr.set_representation(r);
}

inline dimension_type
Grid_Generator::max_space_dimension() {
  return Linear_Expression::max_space_dimension() - 1;
}

inline dimension_type
Grid_Generator::space_dimension() const {
  return expression().space_dimension();
}

inline void
Grid_Generator::set_space_dimension(dimension_type space_dim) {
  const dimension_type old_space_dim = space_dimension();
  if (space_dim > old_space_dim) {
    expr.set_space_dimension(space_dim + 1);
    expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
  }
  else {
    expr.swap_space_dimensions(Variable(space_dim), Variable(old_space_dim));
    expr.set_space_dimension(space_dim + 1);
  }
  ((void) 0);
}

inline void
Grid_Generator::set_space_dimension_no_ok(dimension_type space_dim) {
  set_space_dimension(space_dim);
}

inline void
Grid_Generator::shift_space_dimensions(Variable v, dimension_type n) {
  expr.shift_space_dimensions(v, n);
}

inline Grid_Generator::Type
Grid_Generator::type() const {
  if (is_line())
    return LINE;
  return is_point() ? POINT : PARAMETER;
}

inline bool
Grid_Generator::is_line() const {
  return is_line_or_equality();
}

inline bool
Grid_Generator::is_parameter() const {
  return is_parameter_or_point() && is_line_or_parameter();
}

inline bool
Grid_Generator::is_line_or_parameter() const {
  return expr.inhomogeneous_term() == 0;
}

inline bool
Grid_Generator::is_point() const {
  return !is_line_or_parameter();
}

inline bool
Grid_Generator::is_parameter_or_point() const {
  return is_ray_or_point_or_inequality();
}

inline void
Grid_Generator::set_divisor(Coefficient_traits::const_reference d) {
  ((void) 0);
  if (is_line_or_parameter())
    expr.set_coefficient(Variable(space_dimension()), d);
  else
    expr.set_inhomogeneous_term(d);
}

inline Coefficient_traits::const_reference
Grid_Generator::divisor() const {
  if (is_line())
    throw_invalid_argument("divisor()", "*this is a line");
  if (is_line_or_parameter())
    return expr.coefficient(Variable(space_dimension()));
  else
    return expr.inhomogeneous_term();
}

inline bool
Grid_Generator::is_equal_at_dimension(dimension_type dim,
                                      const Grid_Generator& y) const {
  const Grid_Generator& x = *this;
  return x.expr.get(dim) * y.divisor() == y.expr.get(dim) * x.divisor();
}

inline void
Grid_Generator::set_is_line() {
  set_is_line_or_equality();
}

inline void
Grid_Generator::set_is_parameter_or_point() {
  set_is_ray_or_point_or_inequality();
}

inline Grid_Generator&
Grid_Generator::operator=(const Grid_Generator& g) {
  Grid_Generator tmp = g;
  swap(*this, tmp);

  return *this;
}

inline Coefficient_traits::const_reference
Grid_Generator::coefficient(const Variable v) const {
  if (v.space_dimension() > space_dimension())
    throw_dimension_incompatible("coefficient(v)", "v", v);
  return expr.coefficient(v);
}

inline memory_size_type
Grid_Generator::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline memory_size_type
Grid_Generator::external_memory_in_bytes() const {
  return expr.external_memory_in_bytes();
}

inline const Grid_Generator&
Grid_Generator::zero_dim_point() {
  ((void) 0);
  return *zero_dim_point_p;
}

inline void
Grid_Generator::strong_normalize() {
  ((void) 0);
  expr.normalize();
  sign_normalize();
}

inline void
Grid_Generator::m_swap(Grid_Generator& y) {
  using std::swap;
  swap(expr, y.expr);
  swap(kind_, y.kind_);
}


inline bool
operator==(const Grid_Generator& x, const Grid_Generator& y) {
  return x.is_equivalent_to(y);
}


inline bool
operator!=(const Grid_Generator& x, const Grid_Generator& y) {
  return !(x == y);
}


inline Grid_Generator
grid_line(const Linear_Expression& e, Representation r) {
  return Grid_Generator::grid_line(e, r);
}


inline Grid_Generator
parameter(const Linear_Expression& e,
          Coefficient_traits::const_reference d, Representation r) {
  return Grid_Generator::parameter(e, d, r);
}


inline Grid_Generator
parameter(Representation r) {
  return Grid_Generator::parameter(r);
}


inline Grid_Generator
parameter(const Linear_Expression& e, Representation r) {
  return Grid_Generator::parameter(e, r);
}


inline Grid_Generator
grid_point(const Linear_Expression& e,
           Coefficient_traits::const_reference d, Representation r) {
  return Grid_Generator::grid_point(e, d, r);
}


inline Grid_Generator
grid_point(Representation r) {
  return Grid_Generator::grid_point(r);
}


inline Grid_Generator
grid_point(const Linear_Expression& e, Representation r) {
  return Grid_Generator::grid_point(e, r);
}


inline void
swap(Grid_Generator& x, Grid_Generator& y) {
  x.m_swap(y);
}

}
# 795 "Grid_Generator_defs.hh" 2
# 32 "Scalar_Products_inlines.hh" 2

namespace Parma_Polyhedra_Library {

inline int
Scalar_Products::sign(const Linear_Expression& x, const Linear_Expression& y) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_z; Parma_Polyhedra_Library::Coefficient& z = holder_z.item();
  assign(z, x, y);
  return sgn(z);
}

inline int
Scalar_Products::reduced_sign(const Linear_Expression& x,
                              const Linear_Expression& y) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_z; Parma_Polyhedra_Library::Coefficient& z = holder_z.item();
  reduced_assign(z, x, y);
  return sgn(z);
}

inline int
Scalar_Products::homogeneous_sign(const Linear_Expression& x,
                                  const Linear_Expression& y) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_z; Parma_Polyhedra_Library::Coefficient& z = holder_z.item();
  homogeneous_assign(z, x, y);
  return sgn(z);
}

inline int
Scalar_Products::sign(const Constraint& c, const Generator& g) {
  return sign(c.expr, g.expr);
}

inline int
Scalar_Products::sign(const Generator& g, const Constraint& c) {
  return sign(g.expr, c.expr);
}

inline int
Scalar_Products::sign(const Constraint& c, const Grid_Generator& g) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_z; Parma_Polyhedra_Library::Coefficient& z = holder_z.item();
  assign(z, c, g);
  return sgn(z);
}

inline int
Scalar_Products::reduced_sign(const Constraint& c, const Generator& g) {


  ((void) 0);
  return reduced_sign(c.expr, g.expr);
}

inline int
Scalar_Products::reduced_sign(const Generator& g, const Constraint& c) {


  ((void) 0);
  return reduced_sign(g.expr, c.expr);
}

inline void
Scalar_Products::homogeneous_assign(Coefficient& z,
                                    const Linear_Expression& e,
                                    const Generator& g) {
  homogeneous_assign(z, e, g.expr);
}

inline void
Scalar_Products::homogeneous_assign(Coefficient& z,
                                    const Linear_Expression& e,
                                    const Grid_Generator& g) {
  homogeneous_assign(z, e, g.expr);
}

inline int
Scalar_Products::homogeneous_sign(const Linear_Expression& e,
                                  const Generator& g) {
  return homogeneous_sign(e, g.expr);
}

inline int
Scalar_Products::homogeneous_sign(const Linear_Expression& e,
                                  const Grid_Generator& g) {
  return homogeneous_sign(e, g.expr);
}

inline int
Scalar_Products::homogeneous_sign(const Grid_Generator& g,
                                  const Constraint& c) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_z; Parma_Polyhedra_Library::Coefficient& z = holder_z.item();
  homogeneous_assign(z, g, c);
  return sgn(z);
}

inline
Topology_Adjusted_Scalar_Product_Sign
::Topology_Adjusted_Scalar_Product_Sign(const Constraint& c)
  : sps_fp(c.is_necessarily_closed()
           ? static_cast<SPS_type>(&Scalar_Products::sign)
           : static_cast<SPS_type>(&Scalar_Products::reduced_sign)) {
}

inline
Topology_Adjusted_Scalar_Product_Sign
::Topology_Adjusted_Scalar_Product_Sign(const Generator& g)
  : sps_fp(g.is_necessarily_closed()
           ? static_cast<SPS_type>(&Scalar_Products::sign)
           : static_cast<SPS_type>(&Scalar_Products::reduced_sign)) {
}

inline int
Topology_Adjusted_Scalar_Product_Sign::operator()(const Constraint& c,
                                                  const Generator& g) const {
  ((void) 0);
  ((void) 0);


  return sps_fp(c.expr, g.expr);
}

inline int
Topology_Adjusted_Scalar_Product_Sign::operator()(const Generator& g,
                                                  const Constraint& c) const {
  ((void) 0);
  ((void) 0);


  return sps_fp(g.expr, c.expr);
}

}
# 31 "Linear_System_templates.hh" 2



# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/deque" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/deque" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/deque" 3

# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 1 3
# 36 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/functexcept.h" 3
namespace std
{

  void
  __throw_bad_exception(void);


  void
  __throw_bad_alloc(void);


  void
  __throw_bad_cast(void);

  void
  __throw_bad_typeid(void);


  void
  __throw_logic_error(const char* __s);

  void
  __throw_domain_error(const char* __s);

  void
  __throw_invalid_argument(const char* __s);

  void
  __throw_length_error(const char* __s);

  void
  __throw_out_of_range(const char* __s);

  void
  __throw_runtime_error(const char* __s);

  void
  __throw_range_error(const char* __s);

  void
  __throw_overflow_error(const char* __s);

  void
  __throw_underflow_error(const char* __s);


  void
  __throw_ios_failure(const char* __s);
}
# 67 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/deque" 2 3




# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 1 3
# 68 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
namespace std
{
# 82 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  inline size_t
  __deque_buf_size(size_t __size)
  { return __size < 512 ? size_t(512 / __size) : size_t(1); }
# 99 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  template<typename _Tp, typename _Ref, typename _Ptr>
    struct _Deque_iterator
    {
      typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
      typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;

      static size_t _S_buffer_size()
      { return __deque_buf_size(sizeof(_Tp)); }

      typedef random_access_iterator_tag iterator_category;
      typedef _Tp value_type;
      typedef _Ptr pointer;
      typedef _Ref reference;
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef _Tp** _Map_pointer;
      typedef _Deque_iterator _Self;

      _Tp* _M_cur;
      _Tp* _M_first;
      _Tp* _M_last;
      _Map_pointer _M_node;

      _Deque_iterator(_Tp* __x, _Map_pointer __y)
      : _M_cur(__x), _M_first(*__y),
        _M_last(*__y + _S_buffer_size()), _M_node(__y) {}

      _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}

      _Deque_iterator(const iterator& __x)
      : _M_cur(__x._M_cur), _M_first(__x._M_first),
        _M_last(__x._M_last), _M_node(__x._M_node) {}

      reference
      operator*() const
      { return *_M_cur; }

      pointer
      operator->() const
      { return _M_cur; }

      _Self&
      operator++()
      {
 ++_M_cur;
 if (_M_cur == _M_last)
   {
     _M_set_node(_M_node + 1);
     _M_cur = _M_first;
   }
 return *this;
      }

      _Self
      operator++(int)
      {
 _Self __tmp = *this;
 ++*this;
 return __tmp;
      }

      _Self&
      operator--()
      {
 if (_M_cur == _M_first)
   {
     _M_set_node(_M_node - 1);
     _M_cur = _M_last;
   }
 --_M_cur;
 return *this;
      }

      _Self
      operator--(int)
      {
 _Self __tmp = *this;
 --*this;
 return __tmp;
      }

      _Self&
      operator+=(difference_type __n)
      {
 const difference_type __offset = __n + (_M_cur - _M_first);
 if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
   _M_cur += __n;
 else
   {
     const difference_type __node_offset =
       __offset > 0 ? __offset / difference_type(_S_buffer_size())
                    : -difference_type((-__offset - 1)
           / _S_buffer_size()) - 1;
     _M_set_node(_M_node + __node_offset);
     _M_cur = _M_first + (__offset - __node_offset
     * difference_type(_S_buffer_size()));
   }
 return *this;
      }

      _Self
      operator+(difference_type __n) const
      {
 _Self __tmp = *this;
 return __tmp += __n;
      }

      _Self&
      operator-=(difference_type __n)
      { return *this += -__n; }

      _Self
      operator-(difference_type __n) const
      {
 _Self __tmp = *this;
 return __tmp -= __n;
      }

      reference
      operator[](difference_type __n) const
      { return *(*this + __n); }







      void
      _M_set_node(_Map_pointer __new_node)
      {
 _M_node = __new_node;
 _M_first = *__new_node;
 _M_last = _M_first + difference_type(_S_buffer_size());
      }
    };




  template<typename _Tp, typename _Ref, typename _Ptr>
    inline bool
    operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
        const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
    { return __x._M_cur == __y._M_cur; }

  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline bool
    operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
        const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    { return __x._M_cur == __y._M_cur; }

  template<typename _Tp, typename _Ref, typename _Ptr>
    inline bool
    operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
        const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
    { return !(__x == __y); }

  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline bool
    operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
        const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    { return !(__x == __y); }

  template<typename _Tp, typename _Ref, typename _Ptr>
    inline bool
    operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
       const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
    { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
                                          : (__x._M_node < __y._M_node); }

  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline bool
    operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
       const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
                                   : (__x._M_node < __y._M_node); }

  template<typename _Tp, typename _Ref, typename _Ptr>
    inline bool
    operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
       const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
    { return __y < __x; }

  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline bool
    operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
       const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    { return __y < __x; }

  template<typename _Tp, typename _Ref, typename _Ptr>
    inline bool
    operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
        const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
    { return !(__y < __x); }

  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline bool
    operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
        const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    { return !(__y < __x); }

  template<typename _Tp, typename _Ref, typename _Ptr>
    inline bool
    operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
        const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
    { return !(__x < __y); }

  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline bool
    operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
        const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    { return !(__x < __y); }





  template<typename _Tp, typename _RefL, typename _PtrL,
    typename _RefR, typename _PtrR>
    inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
    operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
       const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
    {
      return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
 (_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size())
 * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)
 + (__y._M_last - __y._M_cur);
    }

  template<typename _Tp, typename _Ref, typename _Ptr>
    inline _Deque_iterator<_Tp, _Ref, _Ptr>
    operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
    { return __x + __n; }
# 352 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  template<typename _Tp, typename _Alloc>
    class _Deque_base
    {
    public:
      typedef _Alloc allocator_type;

      allocator_type
      get_allocator() const
      { return *static_cast<const _Alloc*>(&this->_M_impl); }

      typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator;
      typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;

      _Deque_base(const allocator_type& __a, size_t __num_elements)
 : _M_impl(__a)
      { _M_initialize_map(__num_elements); }

      _Deque_base(const allocator_type& __a)
 : _M_impl(__a)
      { }

      ~_Deque_base();

    protected:



      struct _Deque_impl
 : public _Alloc {
 _Tp** _M_map;
 size_t _M_map_size;
 iterator _M_start;
 iterator _M_finish;

 _Deque_impl(const _Alloc& __a)
   : _Alloc(__a), _M_map(0), _M_map_size(0), _M_start(), _M_finish()
 { }
      };

      typedef typename _Alloc::template rebind<_Tp*>::other _Map_alloc_type;
      _Map_alloc_type _M_get_map_allocator() const
      { return _Map_alloc_type(this->get_allocator()); }

      _Tp*
      _M_allocate_node()
      { return _M_impl._Alloc::allocate(__deque_buf_size(sizeof(_Tp))); }

      void
      _M_deallocate_node(_Tp* __p)
      { _M_impl._Alloc::deallocate(__p, __deque_buf_size(sizeof(_Tp))); }

      _Tp**
      _M_allocate_map(size_t __n)
      { return _M_get_map_allocator().allocate(__n); }

      void
      _M_deallocate_map(_Tp** __p, size_t __n)
      { _M_get_map_allocator().deallocate(__p, __n); }

    protected:
      void _M_initialize_map(size_t);
      void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
      void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
      enum { _S_initial_map_size = 8 };

      _Deque_impl _M_impl;
    };

  template<typename _Tp, typename _Alloc>
  _Deque_base<_Tp,_Alloc>::~_Deque_base()
  {
    if (this->_M_impl._M_map)
    {
      _M_destroy_nodes(this->_M_impl._M_start._M_node, this->_M_impl._M_finish._M_node + 1);
      _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
    }
  }
# 440 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  template<typename _Tp, typename _Alloc>
    void
    _Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements)
    {
      size_t __num_nodes = __num_elements / __deque_buf_size(sizeof(_Tp)) + 1;

      this->_M_impl._M_map_size = std::max((size_t) _S_initial_map_size,
       __num_nodes + 2);
      this->_M_impl._M_map = _M_allocate_map(this->_M_impl._M_map_size);






      _Tp** __nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size - __num_nodes) / 2;
      _Tp** __nfinish = __nstart + __num_nodes;

      try
 { _M_create_nodes(__nstart, __nfinish); }
      catch(...)
 {
   _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
   this->_M_impl._M_map = 0;
   this->_M_impl._M_map_size = 0;
   throw;
 }

      this->_M_impl._M_start._M_set_node(__nstart);
      this->_M_impl._M_finish._M_set_node(__nfinish - 1);
      this->_M_impl._M_start._M_cur = _M_impl._M_start._M_first;
      this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first + __num_elements
                  % __deque_buf_size(sizeof(_Tp));
    }

  template<typename _Tp, typename _Alloc>
    void
    _Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
    {
      _Tp** __cur;
      try
 {
   for (__cur = __nstart; __cur < __nfinish; ++__cur)
     *__cur = this->_M_allocate_node();
 }
      catch(...)
 {
   _M_destroy_nodes(__nstart, __cur);
   throw;
 }
    }

  template<typename _Tp, typename _Alloc>
    void
    _Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
    {
      for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
 _M_deallocate_node(*__n);
    }
# 584 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  template<typename _Tp, typename _Alloc = allocator<_Tp> >
    class deque : protected _Deque_base<_Tp, _Alloc>
    {

     

      typedef _Deque_base<_Tp, _Alloc> _Base;

    public:
      typedef _Tp value_type;
      typedef typename _Alloc::pointer pointer;
      typedef typename _Alloc::const_pointer const_pointer;
      typedef typename _Alloc::reference reference;
      typedef typename _Alloc::const_reference const_reference;
      typedef typename _Base::iterator iterator;
      typedef typename _Base::const_iterator const_iterator;
      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
      typedef std::reverse_iterator<iterator> reverse_iterator;
      typedef size_t size_type;
      typedef ptrdiff_t difference_type;
      typedef typename _Base::allocator_type allocator_type;

    protected:
      typedef pointer* _Map_pointer;

      static size_t _S_buffer_size()
      { return __deque_buf_size(sizeof(_Tp)); }


      using _Base::_M_initialize_map;
      using _Base::_M_create_nodes;
      using _Base::_M_destroy_nodes;
      using _Base::_M_allocate_node;
      using _Base::_M_deallocate_node;
      using _Base::_M_allocate_map;
      using _Base::_M_deallocate_map;






      using _Base::_M_impl;

    public:





      explicit
      deque(const allocator_type& __a = allocator_type())
      : _Base(__a, 0) {}
# 645 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      deque(size_type __n, const value_type& __value,
     const allocator_type& __a = allocator_type())
      : _Base(__a, __n)
      { _M_fill_initialize(__value); }
# 657 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      explicit
      deque(size_type __n)
      : _Base(allocator_type(), __n)
      { _M_fill_initialize(value_type()); }
# 669 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      deque(const deque& __x)
      : _Base(__x.get_allocator(), __x.size())
      { std::uninitialized_copy(__x.begin(), __x.end(), this->_M_impl._M_start); }
# 687 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      template<typename _InputIterator>
        deque(_InputIterator __first, _InputIterator __last,
       const allocator_type& __a = allocator_type())
 : _Base(__a)
        {

   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   _M_initialize_dispatch(__first, __last, _Integral());
 }






      ~deque()
      { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish); }
# 712 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      deque&
      operator=(const deque& __x);
# 725 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      assign(size_type __n, const value_type& __val)
      { _M_fill_assign(__n, __val); }
# 741 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      template<typename _InputIterator>
        void
        assign(_InputIterator __first, _InputIterator __last)
        {
   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   _M_assign_dispatch(__first, __last, _Integral());
 }


      allocator_type
      get_allocator() const
      { return _Base::get_allocator(); }






      iterator
      begin()
      { return this->_M_impl._M_start; }





      const_iterator
      begin() const
      { return this->_M_impl._M_start; }





      iterator
      end()
      { return this->_M_impl._M_finish; }





      const_iterator
      end() const
      { return this->_M_impl._M_finish; }





      reverse_iterator
      rbegin()
      { return reverse_iterator(this->_M_impl._M_finish); }






      const_reverse_iterator
      rbegin() const
      { return const_reverse_iterator(this->_M_impl._M_finish); }






      reverse_iterator
      rend() { return reverse_iterator(this->_M_impl._M_start); }






      const_reverse_iterator
      rend() const
      { return const_reverse_iterator(this->_M_impl._M_start); }



      size_type
      size() const
      { return this->_M_impl._M_finish - this->_M_impl._M_start; }


      size_type
      max_size() const
      { return size_type(-1); }
# 842 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      resize(size_type __new_size, const value_type& __x)
      {
 const size_type __len = size();
 if (__new_size < __len)
   erase(this->_M_impl._M_start + __new_size, this->_M_impl._M_finish);
 else
   insert(this->_M_impl._M_finish, __new_size - __len, __x);
      }
# 861 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      resize(size_type new_size)
      { resize(new_size, value_type()); }




      bool
      empty() const
      { return this->_M_impl._M_finish == this->_M_impl._M_start; }
# 882 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      reference
      operator[](size_type __n)
      { return this->_M_impl._M_start[difference_type(__n)]; }
# 895 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      const_reference
      operator[](size_type __n) const
      { return this->_M_impl._M_start[difference_type(__n)]; }

    protected:

      void
      _M_range_check(size_type __n) const
      {
 if (__n >= this->size())
   __throw_out_of_range(("deque::_M_range_check"));
      }

    public:
# 919 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      reference
      at(size_type __n)
      { _M_range_check(__n); return (*this)[__n]; }
# 933 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      const_reference
      at(size_type __n) const
      {
 _M_range_check(__n);
 return (*this)[__n];
      }





      reference
      front()
      { return *this->_M_impl._M_start; }





      const_reference
      front() const
      { return *this->_M_impl._M_start; }





      reference
      back()
      {
 iterator __tmp = this->_M_impl._M_finish;
 --__tmp;
 return *__tmp;
      }





      const_reference
      back() const
      {
 const_iterator __tmp = this->_M_impl._M_finish;
 --__tmp;
 return *__tmp;
      }
# 989 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      push_front(const value_type& __x)
      {
 if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
   {
     std::_Construct(this->_M_impl._M_start._M_cur - 1, __x);
     --this->_M_impl._M_start._M_cur;
   }
 else
   _M_push_front_aux(__x);
      }
# 1009 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      push_back(const value_type& __x)
      {
 if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_last - 1)
   {
     std::_Construct(this->_M_impl._M_finish._M_cur, __x);
     ++this->_M_impl._M_finish._M_cur;
   }
 else
   _M_push_back_aux(__x);
      }
# 1029 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      pop_front()
      {
 if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_last - 1)
   {
     std::_Destroy(this->_M_impl._M_start._M_cur);
     ++this->_M_impl._M_start._M_cur;
   }
 else
   _M_pop_front_aux();
      }
# 1049 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      pop_back()
      {
 if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_first)
   {
     --this->_M_impl._M_finish._M_cur;
     std::_Destroy(this->_M_impl._M_finish._M_cur);
   }
 else
   _M_pop_back_aux();
      }
# 1070 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      iterator
      insert(iterator position, const value_type& __x);
# 1082 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      insert(iterator __position, size_type __n, const value_type& __x)
      { _M_fill_insert(__position, __n, __x); }
# 1096 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      template<typename _InputIterator>
        void
        insert(iterator __position, _InputIterator __first,
        _InputIterator __last)
        {

   typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
   _M_insert_dispatch(__position, __first, __last, _Integral());
 }
# 1119 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      iterator
      erase(iterator __position);
# 1138 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      iterator
      erase(iterator __first, iterator __last);
# 1150 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      swap(deque& __x)
      {
 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
 std::swap(this->_M_impl._M_map, __x._M_impl._M_map);
 std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size);
      }







      void clear();

    protected:



      template<typename _Integer>
        void
        _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
        {
   _M_initialize_map(__n);
   _M_fill_initialize(__x);
 }


      template<typename _InputIterator>
        void
        _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
          __false_type)
        {
   typedef typename iterator_traits<_InputIterator>::iterator_category
     _IterCategory;
   _M_range_initialize(__first, __last, _IterCategory());
 }
# 1204 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      template<typename _InputIterator>
        void
        _M_range_initialize(_InputIterator __first, _InputIterator __last,
       input_iterator_tag);


      template<typename _ForwardIterator>
        void
        _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
       forward_iterator_tag);
# 1228 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      _M_fill_initialize(const value_type& __value);





      template<typename _Integer>
        void
        _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
        {
   _M_fill_assign(static_cast<size_type>(__n),
    static_cast<value_type>(__val));
 }


      template<typename _InputIterator>
        void
        _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
      __false_type)
        {
   typedef typename iterator_traits<_InputIterator>::iterator_category
     _IterCategory;
   _M_assign_aux(__first, __last, _IterCategory());
 }


      template<typename _InputIterator>
        void
        _M_assign_aux(_InputIterator __first, _InputIterator __last,
        input_iterator_tag);


      template<typename _ForwardIterator>
        void
        _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
        forward_iterator_tag)
        {
   const size_type __len = std::distance(__first, __last);
   if (__len > size())
     {
       _ForwardIterator __mid = __first;
       std::advance(__mid, size());
       std::copy(__first, __mid, begin());
       insert(end(), __mid, __last);
     }
   else
     erase(std::copy(__first, __last, begin()), end());
 }



      void
      _M_fill_assign(size_type __n, const value_type& __val)
      {
 if (__n > size())
   {
     std::fill(begin(), end(), __val);
     insert(end(), __n - size(), __val);
   }
 else
   {
     erase(begin() + __n, end());
     std::fill(begin(), end(), __val);
   }
      }







      void _M_push_back_aux(const value_type&);
      void _M_push_front_aux(const value_type&);
      void _M_pop_back_aux();
      void _M_pop_front_aux();






      template<typename _Integer>
        void
        _M_insert_dispatch(iterator __pos,
      _Integer __n, _Integer __x, __true_type)
        {
   _M_fill_insert(__pos, static_cast<size_type>(__n),
    static_cast<value_type>(__x));
 }


      template<typename _InputIterator>
        void
        _M_insert_dispatch(iterator __pos,
      _InputIterator __first, _InputIterator __last,
      __false_type)
        {
   typedef typename iterator_traits<_InputIterator>::iterator_category
     _IterCategory;
          _M_range_insert_aux(__pos, __first, __last, _IterCategory());
 }


      template<typename _InputIterator>
        void
        _M_range_insert_aux(iterator __pos, _InputIterator __first,
       _InputIterator __last, input_iterator_tag);


      template<typename _ForwardIterator>
        void
        _M_range_insert_aux(iterator __pos, _ForwardIterator __first,
       _ForwardIterator __last, forward_iterator_tag);




      void
      _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);


      iterator
      _M_insert_aux(iterator __pos, const value_type& __x);


      void
      _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);


      template<typename _ForwardIterator>
        void
        _M_insert_aux(iterator __pos,
        _ForwardIterator __first, _ForwardIterator __last,
        size_type __n);
# 1372 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      iterator
      _M_reserve_elements_at_front(size_type __n)
      {
 const size_type __vacancies = this->_M_impl._M_start._M_cur
                               - this->_M_impl._M_start._M_first;
 if (__n > __vacancies)
   _M_new_elements_at_front(__n - __vacancies);
 return this->_M_impl._M_start - difference_type(__n);
      }

      iterator
      _M_reserve_elements_at_back(size_type __n)
      {
 const size_type __vacancies = (this->_M_impl._M_finish._M_last
           - this->_M_impl._M_finish._M_cur) - 1;
 if (__n > __vacancies)
   _M_new_elements_at_back(__n - __vacancies);
 return this->_M_impl._M_finish + difference_type(__n);
      }

      void
      _M_new_elements_at_front(size_type __new_elements);

      void
      _M_new_elements_at_back(size_type __new_elements);
# 1410 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
      void
      _M_reserve_map_at_back (size_type __nodes_to_add = 1)
      {
 if (__nodes_to_add + 1 > this->_M_impl._M_map_size
     - (this->_M_impl._M_finish._M_node - this->_M_impl._M_map))
   _M_reallocate_map(__nodes_to_add, false);
      }

      void
      _M_reserve_map_at_front (size_type __nodes_to_add = 1)
      {
 if (__nodes_to_add > size_type(this->_M_impl._M_start._M_node - this->_M_impl._M_map))
   _M_reallocate_map(__nodes_to_add, true);
      }

      void
      _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);

    };
# 1441 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  template<typename _Tp, typename _Alloc>
    inline bool
    operator==(const deque<_Tp, _Alloc>& __x,
                         const deque<_Tp, _Alloc>& __y)
    { return __x.size() == __y.size()
             && std::equal(__x.begin(), __x.end(), __y.begin()); }
# 1459 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_deque.h" 3
  template<typename _Tp, typename _Alloc>
    inline bool
    operator<(const deque<_Tp, _Alloc>& __x,
       const deque<_Tp, _Alloc>& __y)
    { return lexicographical_compare(__x.begin(), __x.end(),
         __y.begin(), __y.end()); }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator!=(const deque<_Tp, _Alloc>& __x,
        const deque<_Tp, _Alloc>& __y)
    { return !(__x == __y); }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator>(const deque<_Tp, _Alloc>& __x,
       const deque<_Tp, _Alloc>& __y)
    { return __y < __x; }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator<=(const deque<_Tp, _Alloc>& __x,
        const deque<_Tp, _Alloc>& __y)
    { return !(__y < __x); }


  template<typename _Tp, typename _Alloc>
    inline bool
    operator>=(const deque<_Tp, _Alloc>& __x,
        const deque<_Tp, _Alloc>& __y)
    { return !(__x < __y); }


  template<typename _Tp, typename _Alloc>
    inline void
    swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
    { __x.swap(__y); }
}
# 72 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/deque" 2 3


# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/deque.tcc" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/deque.tcc" 3
namespace std
{
  template <typename _Tp, typename _Alloc>
    deque<_Tp,_Alloc>&
    deque<_Tp,_Alloc>::
    operator=(const deque& __x)
    {
      const size_type __len = size();
      if (&__x != this)
 {
   if (__len >= __x.size())
     erase(std::copy(__x.begin(), __x.end(), this->_M_impl._M_start),
    this->_M_impl._M_finish);
   else
     {
       const_iterator __mid = __x.begin() + difference_type(__len);
       std::copy(__x.begin(), __mid, this->_M_impl._M_start);
       insert(this->_M_impl._M_finish, __mid, __x.end());
     }
 }
      return *this;
    }

  template <typename _Tp, typename _Alloc>
    typename deque<_Tp,_Alloc>::iterator
    deque<_Tp,_Alloc>::
    insert(iterator position, const value_type& __x)
    {
      if (position._M_cur == this->_M_impl._M_start._M_cur)
 {
   push_front(__x);
   return this->_M_impl._M_start;
 }
      else if (position._M_cur == this->_M_impl._M_finish._M_cur)
 {
   push_back(__x);
   iterator __tmp = this->_M_impl._M_finish;
   --__tmp;
   return __tmp;
 }
      else
        return _M_insert_aux(position, __x);
    }

  template <typename _Tp, typename _Alloc>
    typename deque<_Tp,_Alloc>::iterator
    deque<_Tp,_Alloc>::
    erase(iterator __position)
    {
      iterator __next = __position;
      ++__next;
      size_type __index = __position - this->_M_impl._M_start;
      if (__index < (size() >> 1))
 {
   std::copy_backward(this->_M_impl._M_start, __position, __next);
   pop_front();
 }
      else
 {
   std::copy(__next, this->_M_impl._M_finish, __position);
   pop_back();
 }
      return this->_M_impl._M_start + __index;
    }

  template <typename _Tp, typename _Alloc>
    typename deque<_Tp,_Alloc>::iterator
    deque<_Tp,_Alloc>::
    erase(iterator __first, iterator __last)
    {
      if (__first == this->_M_impl._M_start && __last == this->_M_impl._M_finish)
 {
   clear();
   return this->_M_impl._M_finish;
 }
      else
 {
   const difference_type __n = __last - __first;
   const difference_type __elems_before = __first - this->_M_impl._M_start;
   if (static_cast<size_type>(__elems_before) < (size() - __n) / 2)
     {
       std::copy_backward(this->_M_impl._M_start, __first, __last);
       iterator __new_start = this->_M_impl._M_start + __n;
       std::_Destroy(this->_M_impl._M_start, __new_start);
       _M_destroy_nodes(this->_M_impl._M_start._M_node, __new_start._M_node);
       this->_M_impl._M_start = __new_start;
     }
   else
     {
       std::copy(__last, this->_M_impl._M_finish, __first);
       iterator __new_finish = this->_M_impl._M_finish - __n;
       std::_Destroy(__new_finish, this->_M_impl._M_finish);
       _M_destroy_nodes(__new_finish._M_node + 1,
          this->_M_impl._M_finish._M_node + 1);
       this->_M_impl._M_finish = __new_finish;
     }
   return this->_M_impl._M_start + __elems_before;
 }
    }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    clear()
    {
      for (_Map_pointer __node = this->_M_impl._M_start._M_node + 1;
           __node < this->_M_impl._M_finish._M_node;
           ++__node)
 {
   std::_Destroy(*__node, *__node + _S_buffer_size());
   _M_deallocate_node(*__node);
 }

      if (this->_M_impl._M_start._M_node != this->_M_impl._M_finish._M_node)
 {
   std::_Destroy(this->_M_impl._M_start._M_cur, this->_M_impl._M_start._M_last);
   std::_Destroy(this->_M_impl._M_finish._M_first, this->_M_impl._M_finish._M_cur);
   _M_deallocate_node(this->_M_impl._M_finish._M_first);
 }
      else
        std::_Destroy(this->_M_impl._M_start._M_cur, this->_M_impl._M_finish._M_cur);

      this->_M_impl._M_finish = this->_M_impl._M_start;
    }

  template <typename _Tp, class _Alloc>
    template <typename _InputIterator>
      void
      deque<_Tp,_Alloc>
      ::_M_assign_aux(_InputIterator __first, _InputIterator __last,
        input_iterator_tag)
      {
        iterator __cur = begin();
        for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
          *__cur = *__first;
        if (__first == __last)
          erase(__cur, end());
        else
          insert(end(), __first, __last);
      }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
    {
      if (__pos._M_cur == this->_M_impl._M_start._M_cur)
 {
   iterator __new_start = _M_reserve_elements_at_front(__n);
   try
     {
       std::uninitialized_fill(__new_start, this->_M_impl._M_start, __x);
       this->_M_impl._M_start = __new_start;
     }
   catch(...)
     {
       _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node);
       throw;
     }
 }
      else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
 {
   iterator __new_finish = _M_reserve_elements_at_back(__n);
   try
     {
       std::uninitialized_fill(this->_M_impl._M_finish, __new_finish, __x);
       this->_M_impl._M_finish = __new_finish;
     }
   catch(...)
     {
       _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
          __new_finish._M_node + 1);
       throw;
     }
 }
      else
        _M_insert_aux(__pos, __n, __x);
    }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_fill_initialize(const value_type& __value)
    {
      _Map_pointer __cur;
      try
        {
          for (__cur = this->_M_impl._M_start._M_node;
        __cur < this->_M_impl._M_finish._M_node;
        ++__cur)
            std::uninitialized_fill(*__cur, *__cur + _S_buffer_size(), __value);
          std::uninitialized_fill(this->_M_impl._M_finish._M_first,
      this->_M_impl._M_finish._M_cur,
      __value);
        }
      catch(...)
        {
          std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur));
          throw;
        }
    }

  template <typename _Tp, typename _Alloc>
    template <typename _InputIterator>
      void
      deque<_Tp,_Alloc>::
      _M_range_initialize(_InputIterator __first, _InputIterator __last,
                          input_iterator_tag)
      {
        this->_M_initialize_map(0);
        try
          {
            for ( ; __first != __last; ++__first)
              push_back(*__first);
          }
        catch(...)
          {
            clear();
            throw;
          }
      }

  template <typename _Tp, typename _Alloc>
    template <typename _ForwardIterator>
      void
      deque<_Tp,_Alloc>::
      _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
                          forward_iterator_tag)
      {
        const size_type __n = std::distance(__first, __last);
        this->_M_initialize_map(__n);

        _Map_pointer __cur_node;
        try
          {
            for (__cur_node = this->_M_impl._M_start._M_node;
                 __cur_node < this->_M_impl._M_finish._M_node;
                 ++__cur_node)
            {
              _ForwardIterator __mid = __first;
              std::advance(__mid, _S_buffer_size());
              std::uninitialized_copy(__first, __mid, *__cur_node);
              __first = __mid;
            }
            std::uninitialized_copy(__first, __last, this->_M_impl._M_finish._M_first);
          }
        catch(...)
          {
            std::_Destroy(this->_M_impl._M_start, iterator(*__cur_node, __cur_node));
            throw;
          }
      }


  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_push_back_aux(const value_type& __t)
    {
      value_type __t_copy = __t;
      _M_reserve_map_at_back();
      *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
      try
        {
          std::_Construct(this->_M_impl._M_finish._M_cur, __t_copy);
          this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node + 1);
          this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
        }
      catch(...)
        {
          _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
          throw;
        }
    }


  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_push_front_aux(const value_type& __t)
    {
      value_type __t_copy = __t;
      _M_reserve_map_at_front();
      *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
      try
        {
          this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node - 1);
          this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
          std::_Construct(this->_M_impl._M_start._M_cur, __t_copy);
        }
      catch(...)
        {
          ++this->_M_impl._M_start;
          _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
          throw;
        }
    }


  template <typename _Tp, typename _Alloc>
    void deque<_Tp,_Alloc>::
    _M_pop_back_aux()
    {
      _M_deallocate_node(this->_M_impl._M_finish._M_first);
      this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
      this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
      std::_Destroy(this->_M_impl._M_finish._M_cur);
    }





  template <typename _Tp, typename _Alloc>
    void deque<_Tp,_Alloc>::
    _M_pop_front_aux()
    {
      std::_Destroy(this->_M_impl._M_start._M_cur);
      _M_deallocate_node(this->_M_impl._M_start._M_first);
      this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
      this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
    }

  template <typename _Tp, typename _Alloc>
    template <typename _InputIterator>
      void
      deque<_Tp,_Alloc>::
      _M_range_insert_aux(iterator __pos,
                          _InputIterator __first, _InputIterator __last,
                          input_iterator_tag)
      { std::copy(__first, __last, std::inserter(*this, __pos)); }

  template <typename _Tp, typename _Alloc>
    template <typename _ForwardIterator>
      void
      deque<_Tp,_Alloc>::
      _M_range_insert_aux(iterator __pos,
                          _ForwardIterator __first, _ForwardIterator __last,
                          forward_iterator_tag)
      {
        size_type __n = std::distance(__first, __last);
        if (__pos._M_cur == this->_M_impl._M_start._M_cur)
   {
     iterator __new_start = _M_reserve_elements_at_front(__n);
     try
       {
  std::uninitialized_copy(__first, __last, __new_start);
  this->_M_impl._M_start = __new_start;
       }
     catch(...)
       {
  _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node);
  throw;
       }
   }
        else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
   {
     iterator __new_finish = _M_reserve_elements_at_back(__n);
     try
       {
  std::uninitialized_copy(__first, __last, this->_M_impl._M_finish);
  this->_M_impl._M_finish = __new_finish;
       }
     catch(...)
       {
  _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
     __new_finish._M_node + 1);
  throw;
       }
   }
        else
          _M_insert_aux(__pos, __first, __last, __n);
      }

  template <typename _Tp, typename _Alloc>
    typename deque<_Tp, _Alloc>::iterator
    deque<_Tp,_Alloc>::
    _M_insert_aux(iterator __pos, const value_type& __x)
    {
      difference_type __index = __pos - this->_M_impl._M_start;
      value_type __x_copy = __x;
      if (static_cast<size_type>(__index) < size() / 2)
 {
   push_front(front());
   iterator __front1 = this->_M_impl._M_start;
   ++__front1;
   iterator __front2 = __front1;
   ++__front2;
   __pos = this->_M_impl._M_start + __index;
   iterator __pos1 = __pos;
   ++__pos1;
   std::copy(__front2, __pos1, __front1);
 }
      else
 {
   push_back(back());
   iterator __back1 = this->_M_impl._M_finish;
   --__back1;
   iterator __back2 = __back1;
   --__back2;
   __pos = this->_M_impl._M_start + __index;
   std::copy_backward(__pos, __back2, __back1);
 }
      *__pos = __x_copy;
      return __pos;
    }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_insert_aux(iterator __pos, size_type __n, const value_type& __x)
    {
      const difference_type __elems_before = __pos - this->_M_impl._M_start;
      size_type __length = this->size();
      value_type __x_copy = __x;
      if (__elems_before < difference_type(__length / 2))
 {
   iterator __new_start = _M_reserve_elements_at_front(__n);
   iterator __old_start = this->_M_impl._M_start;
   __pos = this->_M_impl._M_start + __elems_before;
   try
     {
       if (__elems_before >= difference_type(__n))
  {
    iterator __start_n = this->_M_impl._M_start + difference_type(__n);
    std::uninitialized_copy(this->_M_impl._M_start, __start_n,
       __new_start);
    this->_M_impl._M_start = __new_start;
    std::copy(__start_n, __pos, __old_start);
    fill(__pos - difference_type(__n), __pos, __x_copy);
  }
       else
  {
    std::__uninitialized_copy_fill(this->_M_impl._M_start, __pos,
       __new_start,
       this->_M_impl._M_start, __x_copy);
    this->_M_impl._M_start = __new_start;
    std::fill(__old_start, __pos, __x_copy);
  }
     }
   catch(...)
     {
       _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node);
       throw;
     }
 }
      else
 {
   iterator __new_finish = _M_reserve_elements_at_back(__n);
   iterator __old_finish = this->_M_impl._M_finish;
   const difference_type __elems_after =
     difference_type(__length) - __elems_before;
   __pos = this->_M_impl._M_finish - __elems_after;
   try
     {
       if (__elems_after > difference_type(__n))
  {
    iterator __finish_n = this->_M_impl._M_finish - difference_type(__n);
    std::uninitialized_copy(__finish_n, this->_M_impl._M_finish,
       this->_M_impl._M_finish);
    this->_M_impl._M_finish = __new_finish;
    std::copy_backward(__pos, __finish_n, __old_finish);
    std::fill(__pos, __pos + difference_type(__n), __x_copy);
  }
       else
  {
    std::__uninitialized_fill_copy(this->_M_impl._M_finish,
       __pos + difference_type(__n),
       __x_copy, __pos,
       this->_M_impl._M_finish);
    this->_M_impl._M_finish = __new_finish;
    std::fill(__pos, __old_finish, __x_copy);
  }
     }
   catch(...)
     {
       _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
          __new_finish._M_node + 1);
       throw;
     }
 }
    }

  template <typename _Tp, typename _Alloc>
    template <typename _ForwardIterator>
      void
      deque<_Tp,_Alloc>::
      _M_insert_aux(iterator __pos,
                    _ForwardIterator __first, _ForwardIterator __last,
                    size_type __n)
      {
        const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
        size_type __length = size();
        if (static_cast<size_type>(__elemsbefore) < __length / 2)
   {
     iterator __new_start = _M_reserve_elements_at_front(__n);
     iterator __old_start = this->_M_impl._M_start;
     __pos = this->_M_impl._M_start + __elemsbefore;
     try
       {
  if (__elemsbefore >= difference_type(__n))
    {
      iterator __start_n = this->_M_impl._M_start + difference_type(__n);
      std::uninitialized_copy(this->_M_impl._M_start, __start_n,
         __new_start);
      this->_M_impl._M_start = __new_start;
      std::copy(__start_n, __pos, __old_start);
      std::copy(__first, __last, __pos - difference_type(__n));
    }
  else
    {
      _ForwardIterator __mid = __first;
      std::advance(__mid, difference_type(__n) - __elemsbefore);
      std::__uninitialized_copy_copy(this->_M_impl._M_start, __pos,
         __first, __mid, __new_start);
      this->_M_impl._M_start = __new_start;
      std::copy(__mid, __last, __old_start);
    }
       }
     catch(...)
       {
  _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node);
  throw;
       }
   }
        else
        {
          iterator __new_finish = _M_reserve_elements_at_back(__n);
          iterator __old_finish = this->_M_impl._M_finish;
          const difference_type __elemsafter =
            difference_type(__length) - __elemsbefore;
          __pos = this->_M_impl._M_finish - __elemsafter;
          try
            {
              if (__elemsafter > difference_type(__n))
  {
    iterator __finish_n = this->_M_impl._M_finish - difference_type(__n);
    std::uninitialized_copy(__finish_n,
       this->_M_impl._M_finish,
       this->_M_impl._M_finish);
    this->_M_impl._M_finish = __new_finish;
    std::copy_backward(__pos, __finish_n, __old_finish);
    std::copy(__first, __last, __pos);
  }
              else
  {
    _ForwardIterator __mid = __first;
    std::advance(__mid, __elemsafter);
    std::__uninitialized_copy_copy(__mid, __last, __pos,
       this->_M_impl._M_finish,
       this->_M_impl._M_finish);
    this->_M_impl._M_finish = __new_finish;
    std::copy(__first, __mid, __pos);
  }
            }
          catch(...)
            {
              _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
          __new_finish._M_node + 1);
              throw;
            }
        }
      }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_new_elements_at_front(size_type __new_elems)
    {
      size_type __new_nodes
 = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
      _M_reserve_map_at_front(__new_nodes);
      size_type __i;
      try
        {
          for (__i = 1; __i <= __new_nodes; ++__i)
            *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
        }
      catch(...)
        {
          for (size_type __j = 1; __j < __i; ++__j)
            _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
          throw;
        }
    }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_new_elements_at_back(size_type __new_elems)
    {
      size_type __new_nodes
          = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
      _M_reserve_map_at_back(__new_nodes);
      size_type __i;
      try
        {
          for (__i = 1; __i <= __new_nodes; ++__i)
            *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
        }
      catch(...)
        {
          for (size_type __j = 1; __j < __i; ++__j)
            _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
          throw;
        }
    }

  template <typename _Tp, typename _Alloc>
    void
    deque<_Tp,_Alloc>::
    _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
    {
      size_type __old_num_nodes
 = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
      size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;

      _Map_pointer __new_nstart;
      if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
 {
   __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
      - __new_num_nodes) / 2
                  + (__add_at_front ? __nodes_to_add : 0);
   if (__new_nstart < this->_M_impl._M_start._M_node)
     std::copy(this->_M_impl._M_start._M_node,
      this->_M_impl._M_finish._M_node + 1,
      __new_nstart);
   else
     std::copy_backward(this->_M_impl._M_start._M_node,
          this->_M_impl._M_finish._M_node + 1,
          __new_nstart + __old_num_nodes);
 }
      else
 {
   size_type __new_map_size = this->_M_impl._M_map_size
                              + std::max(this->_M_impl._M_map_size,
      __nodes_to_add) + 2;

   _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
   __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
                  + (__add_at_front ? __nodes_to_add : 0);
   std::copy(this->_M_impl._M_start._M_node,
      this->_M_impl._M_finish._M_node + 1,
      __new_nstart);
   _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);

   this->_M_impl._M_map = __new_map;
   this->_M_impl._M_map_size = __new_map_size;
 }

      this->_M_impl._M_start._M_set_node(__new_nstart);
      this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
    }
}
# 75 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/deque" 2 3
# 35 "Linear_System_templates.hh" 2

# 1 "swapping_sort_templates.hh" 1
# 30 "swapping_sort_templates.hh"
namespace Parma_Polyhedra_Library {

namespace Implementation {

template <typename RA_Container, typename Compare>
struct Indirect_Sort_Compare {
  typedef typename RA_Container::size_type size_type;

  Indirect_Sort_Compare(const RA_Container& cont,
                        size_type base = 0,
                        Compare comp = Compare())
    : container(cont), base_index(base), compare(comp) {
  }

  bool operator()(size_type i, size_type j) const {
    return compare(container[base_index + i], container[base_index + j]);
  }

  const RA_Container& container;
  const size_type base_index;
  const Compare compare;
};

template <typename RA_Container>
struct Indirect_Unique_Compare {
  typedef typename RA_Container::size_type size_type;

  Indirect_Unique_Compare(const RA_Container& cont, size_type base = 0)
    : container(cont), base_index(base) {
  }

  bool operator()(size_type i, size_type j) const {
    return container[base_index + i] == container[base_index + j];
  }

  const RA_Container& container;
  const size_type base_index;
};

template <typename RA_Container>
struct Indirect_Swapper {
  typedef typename RA_Container::size_type size_type;

  Indirect_Swapper(RA_Container& cont, size_type base = 0)
    : container(cont), base_index(base) {
  }

  void operator()(size_type i, size_type j) const {
    using std::swap;
    swap(container[base_index + i], container[base_index + j]);
  }

  RA_Container& container;
  const size_type base_index;
};

template <typename RA_Container1, typename RA_Container2>
struct Indirect_Swapper2 {
  typedef typename RA_Container1::size_type size_type;

  Indirect_Swapper2(RA_Container1& cont1, RA_Container2& cont2)
    : container1(cont1), container2(cont2) {
  }

  void operator()(size_type i, size_type j) const {
    using std::swap;
    swap(container1[i], container1[j]);
    swap(container2[i], container2[j]);
  }

  RA_Container1& container1;
  RA_Container2& container2;
};

template <typename Sort_Comparer, typename Unique_Comparer, typename Swapper>
typename Sort_Comparer::size_type
indirect_sort_and_unique(typename Sort_Comparer::size_type num_elems,
                         Sort_Comparer sort_cmp,
                         Unique_Comparer unique_cmp,
                         Swapper indirect_swap) {
  typedef typename Sort_Comparer::size_type index_type;

  ((void) 0);
  std::vector<index_type> iv;
  iv.reserve(num_elems);
  for (index_type i = 0, i_end = num_elems; i != i_end; ++i)
    iv.push_back(i);

  typedef typename std::vector<index_type>::iterator Iter;
  const Iter iv_begin = iv.begin();
  Iter iv_end = iv.end();


  std::sort(iv_begin, iv_end, sort_cmp);




  for (index_type i = num_elems; i-- > 0; ) {
    if (i != iv[i]) {
      index_type dst = i;
      index_type src = iv[i];
      do {
        indirect_swap(src, dst);
        iv[dst] = dst;
        dst = src;
        src = iv[dst];
      } while (i != src);
      iv[dst] = dst;
    }
  }


  for (index_type i = num_elems; i-- > 0; )
    iv[i] = i;


  iv_end = std::unique(iv_begin, iv_end, unique_cmp);

  const index_type num_sorted = static_cast<index_type>(iv_end - iv_begin);
  const index_type num_duplicates = num_elems - num_sorted;
  if (num_duplicates == 0)
    return 0;


  index_type dst = 0;
  while (dst < num_sorted && dst == iv[dst])
    ++dst;
  if (dst == num_sorted)
    return num_duplicates;
  do {
    const index_type src = iv[dst];
    indirect_swap(src, dst);
    ++dst;
  }
  while (dst < num_sorted);
  return num_duplicates;
}

template <typename Iter>
Iter
swapping_unique(Iter first, Iter last) {
  return swapping_unique(first, last, std::iter_swap<Iter, Iter>);
}

}

}
# 37 "Linear_System_templates.hh" 2

namespace Parma_Polyhedra_Library {

template <typename Row>
dimension_type
Linear_System<Row>::num_lines_or_equalities() const {
  ((void) 0);
  const Linear_System& x = *this;
  dimension_type n = 0;
  for (dimension_type i = num_rows(); i-- > 0; )
    if (x[i].is_line_or_equality())
      ++n;
  return n;
}

template <typename Row>
void
Linear_System<Row>::merge_rows_assign(const Linear_System& y) {
  ((void) 0);

  ((void) 0);
  ((void) 0);

  Linear_System& x = *this;


  Swapping_Vector<Row> tmp;

  tmp.reserve(compute_capacity(x.rows.size() + y.rows.size(),
                               tmp.max_num_rows()));

  dimension_type xi = 0;
  const dimension_type x_num_rows = x.num_rows();
  dimension_type yi = 0;
  const dimension_type y_num_rows = y.num_rows();

  while (xi < x_num_rows && yi < y_num_rows) {
    const int comp = compare(x[xi], y[yi]);
    if (comp <= 0) {

      tmp.resize(tmp.size() + 1);
      swap(tmp.back(), x.rows[xi++]);
      tmp.back().set_representation(representation());
      if (comp == 0)

        ++yi;
    }
    else {

      tmp.resize(tmp.size() + 1);
      Row copy(y[yi++], space_dimension(), representation());
      swap(tmp.back(), copy);
    }
  }

  if (xi < x_num_rows)
    while (xi < x_num_rows) {
      tmp.resize(tmp.size() + 1);
      swap(tmp.back(), x.rows[xi++]);
      tmp.back().set_representation(representation());
    }
  else
    while (yi < y_num_rows) {
      tmp.resize(tmp.size() + 1);
      Row copy(y[yi++], space_dimension(), representation());
      swap(tmp.back(), copy);
    }


  swap(tmp, rows);

  unset_pending_rows();
  ((void) 0);
  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::ascii_dump(std::ostream& s) const {




  s << "topology " << (is_necessarily_closed()
                       ? "NECESSARILY_CLOSED"
                       : "NOT_NECESSARILY_CLOSED")
    << "\n"
    << num_rows() << " x " << space_dimension() << " ";
  Parma_Polyhedra_Library::ascii_dump(s, representation());
  s << " " << (sorted ? "(sorted)" : "(not_sorted)")
    << "\n"
    << "index_first_pending " << first_pending_row()
    << "\n";
  for (dimension_type i = 0; i < rows.size(); ++i)
    rows[i].ascii_dump(s);
}

template <typename Row> void Linear_System<Row>::ascii_dump() const { ascii_dump(std::cerr); } template <typename Row> void Linear_System<Row>::print() const { std::cerr << "No user level output operator defined " << "for " "Linear_System<Row>" << "." << std::endl; }

template <typename Row>
bool
Linear_System<Row>::ascii_load(std::istream& s) {
  std::string str;
  if (!(s >> str) || str != "topology")
    return false;
  if (!(s >> str))
    return false;

  clear();

  Topology t;
  if (str == "NECESSARILY_CLOSED")
    t = NECESSARILY_CLOSED;
  else {
    if (str != "NOT_NECESSARILY_CLOSED")
      return false;
    t = NOT_NECESSARILY_CLOSED;
  }

  set_topology(t);

  dimension_type nrows;
  dimension_type space_dims;
  if (!(s >> nrows))
    return false;
  if (!(s >> str) || str != "x")
    return false;
  if (!(s >> space_dims))
    return false;

  space_dimension_ = space_dims;

  if (!Parma_Polyhedra_Library::ascii_load(s, representation_))
    return false;

  if (!(s >> str) || (str != "(sorted)" && str != "(not_sorted)"))
    return false;
  const bool sortedness = (str == "(sorted)");
  dimension_type index;
  if (!(s >> str) || str != "index_first_pending")
    return false;
  if (!(s >> index))
    return false;

  Row row;
  for (dimension_type i = 0; i < nrows; ++i) {
    if (!row.ascii_load(s))
      return false;
    insert(row, Recycle_Input());
  }
  index_first_pending = index;
  sorted = sortedness;


  ((void) 0);
  return true;
}

template <typename Row>
void
Linear_System<Row>::insert(const Row& r) {
  Row tmp(r, representation());
  insert(tmp, Recycle_Input());
}

template <typename Row>
void
Linear_System<Row>::insert(Row& r, Recycle_Input) {
  insert_no_ok(r, Recycle_Input());
  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::insert_no_ok(Row& r, Recycle_Input) {
  ((void) 0);

  ((void) 0);

  const bool was_sorted = is_sorted();

  insert_pending_no_ok(r, Recycle_Input());

  if (was_sorted) {
    const dimension_type nrows = num_rows();

    if (nrows > 1) {



      sorted = (compare(rows[nrows-2], rows[nrows-1]) <= 0);
    }
    else

      sorted = true;
  }

  unset_pending_rows();
}

template <typename Row>
void
Linear_System<Row>::insert_pending_no_ok(Row& r, Recycle_Input) {
# 249 "Linear_System_templates.hh"
  ((void) 0);

  r.set_representation(representation());

  if (space_dimension() < r.space_dimension())
    set_space_dimension_no_ok(r.space_dimension());
  else
    r.set_space_dimension_no_ok(space_dimension());

  rows.resize(rows.size() + 1);
  swap(rows.back(), r);
}

template <typename Row>
void
Linear_System<Row>::insert_pending(const Row& r) {
  Row tmp(r, representation());
  insert_pending(tmp, Recycle_Input());
}

template <typename Row>
void
Linear_System<Row>::insert_pending(Row& r, Recycle_Input) {
  insert_pending_no_ok(r, Recycle_Input());
  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::insert_pending(const Linear_System& y) {
  Linear_System tmp(y, representation(), With_Pending());
  insert_pending(tmp, Recycle_Input());
}

template <typename Row>
void
Linear_System<Row>::insert_pending(Linear_System& y, Recycle_Input) {
  Linear_System& x = *this;
  ((void) 0);




  for (dimension_type i = 0; i < y.num_rows(); ++i)
    x.insert_pending(y.rows[i], Recycle_Input());

  y.clear();

  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::insert(const Linear_System& y) {
  Linear_System tmp(y, representation(), With_Pending());
  insert(tmp, Recycle_Input());
}

template <typename Row>
void
Linear_System<Row>::insert(Linear_System& y, Recycle_Input) {
  ((void) 0);


  if (y.has_no_rows())
    return;


  if (is_sorted()) {
    if (!y.is_sorted() || y.num_pending_rows() > 0)
      sorted = false;
    else {

      const dimension_type n_rows = num_rows();
      if (n_rows > 0)
        sorted = (compare(rows[n_rows-1], y[0]) <= 0);
    }
  }


  insert_pending(y, Recycle_Input());




  unset_pending_rows();

  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::remove_space_dimensions(const Variables_Set& vars) {

  ((void) 0);




  if (vars.empty())
    return;



  for (dimension_type i = 0; i < num_rows(); ) {
    const bool valid = rows[i].remove_space_dimensions(vars);
    if (!valid) {




      remove_row_no_ok(i, false);
    }
    else
      ++i;
  }

  space_dimension_ -= vars.size();

  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::shift_space_dimensions(Variable v, dimension_type n) {


  ((void) 0);
  for (dimension_type i = rows.size(); i-- > 0; )
    rows[i].shift_space_dimensions(v, n);
  space_dimension_ += n;
  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::sort_rows() {

  sort_rows(0, first_pending_row());
  sorted = true;
  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::sort_rows(const dimension_type first_row,
                              const dimension_type last_row) {
  ((void) 0);

  ((void) 0);


  const bool sorting_pending = (first_row >= first_pending_row());
  const dimension_type old_num_pending = num_pending_rows();

  const dimension_type num_elems = last_row - first_row;
  if (num_elems < 2)
    return;



  using namespace Implementation;
  typedef Swapping_Vector<Row> Cont;
  typedef Indirect_Sort_Compare<Cont, Row_Less_Than> Sort_Compare;
  typedef Indirect_Swapper<Cont> Swapper;
  const dimension_type num_duplicates
    = indirect_sort_and_unique(num_elems,
                               Sort_Compare(rows, first_row),
                               Unique_Compare(rows, first_row),
                               Swapper(rows, first_row));

  if (num_duplicates > 0) {
    typedef typename Cont::iterator Iter;
    typedef typename std::iterator_traits<Iter>::difference_type diff_t;
    Iter last = rows.begin() + static_cast<diff_t>(last_row);
    Iter first = last - + static_cast<diff_t>(num_duplicates);
    rows.erase(first, last);
  }

  if (sorting_pending) {
    ((void) 0);
    index_first_pending = num_rows() - (old_num_pending - num_duplicates);
  }
  else {
    index_first_pending = num_rows() - old_num_pending;
  }

  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::strong_normalize() {
  const dimension_type nrows = rows.size();

  for (dimension_type i = nrows; i-- > 0; )
    rows[i].strong_normalize();
  sorted = (nrows <= 1);
  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::sign_normalize() {
  const dimension_type nrows = rows.size();

  for (dimension_type i = nrows; i-- > 0; )
    rows[i].sign_normalize();
  sorted = (nrows <= 1);
  ((void) 0);
}


template <typename Row>
bool
operator==(const Linear_System<Row>& x, const Linear_System<Row>& y) {
  if (x.space_dimension() != y.space_dimension())
    return false;
  const dimension_type x_num_rows = x.num_rows();
  const dimension_type y_num_rows = y.num_rows();
  if (x_num_rows != y_num_rows)
    return false;
  if (x.first_pending_row() != y.first_pending_row())
    return false;





  for (dimension_type i = x_num_rows; i-- > 0; )
    if (x[i] != y[i])
      return false;
  return true;
}

template <typename Row>
void
Linear_System<Row>::sort_and_remove_with_sat(Bit_Matrix& sat) {

  ((void) 0);
  if (first_pending_row() <= 1) {
    set_sorted(true);
    return;
  }

  const dimension_type num_elems = sat.num_rows();


  typedef Swapping_Vector<Row> Cont;
  const Implementation::Indirect_Sort_Compare<Cont, Row_Less_Than>
    sort_cmp(rows);
  const Unique_Compare unique_cmp(rows);
  const Implementation::Indirect_Swapper2<Cont, Bit_Matrix> swapper(rows, sat);

  const dimension_type num_duplicates
    = Implementation::indirect_sort_and_unique(num_elems, sort_cmp,
                                               unique_cmp, swapper);

  const dimension_type new_first_pending_row
    = first_pending_row() - num_duplicates;

  if (num_pending_rows() > 0) {

    const dimension_type n_rows = num_rows() - 1;
    for (dimension_type i = 0; i < num_duplicates; ++i)
      swap(rows[new_first_pending_row + i], rows[n_rows - i]);
  }


  rows.resize(rows.size() - num_duplicates);
  index_first_pending = new_first_pending_row;

  sat.remove_trailing_rows(num_duplicates);


  sorted = true;

  ((void) 0);
}

template <typename Row>
dimension_type
Linear_System<Row>::gauss(const dimension_type n_lines_or_equalities) {



  ((void) 0);
  ((void) 0);





  dimension_type rank = 0;

  bool changed = false;

  const dimension_type num_cols
    = is_necessarily_closed() ? space_dimension() + 1 : space_dimension() + 2;



  for (dimension_type j = num_cols; j-- > 0; )
    for (dimension_type i = rank; i < n_lines_or_equalities; ++i) {


      if ((*this)[i].expr.get(j) == 0)
        continue;


      if (i > rank) {
        swap(rows[i], rows[rank]);

        changed = true;
      }



      for (dimension_type k = i + 1; k < n_lines_or_equalities; ++k) {
        if (rows[k].expr.get(Variable(j - 1)) != 0) {
          rows[k].linear_combine(rows[rank], j);
          changed = true;
        }
      }

      ++rank;

      break;
    }
  if (changed)
    sorted = false;

  ((void) 0);
  return rank;
}

template <typename Row>
void
Linear_System<Row>
::back_substitute(const dimension_type n_lines_or_equalities) {



  ((void) 0);
  ((void) 0);





  const dimension_type nrows = num_rows();

  bool still_sorted = is_sorted();


  std::deque<bool> check_for_sortedness;
  if (still_sorted)
    check_for_sortedness.insert(check_for_sortedness.end(), nrows, false);

  for (dimension_type k = n_lines_or_equalities; k-- > 0; ) {



    Row& row_k = rows[k];
    const dimension_type j = row_k.expr.last_nonzero();

    ((void) 0);


    for (dimension_type i = k; i-- > 0; ) {
      Row& row_i = rows[i];
      if (row_i.expr.get(Variable(j - 1)) != 0) {


        row_i.linear_combine(row_k, j);
        if (still_sorted) {


          if (i > 0)
            check_for_sortedness[i-1] = true;
          check_for_sortedness[i] = true;
        }
      }
    }






    const bool have_to_negate = (row_k.expr.get(Variable(j - 1)) < 0);
    if (have_to_negate)
      neg_assign(row_k.expr);







    for (dimension_type i = n_lines_or_equalities; i < nrows; ++i) {
      Row& row_i = rows[i];
      if (row_i.expr.get(Variable(j - 1)) != 0) {


        row_i.linear_combine(row_k, j);
        if (still_sorted) {


          if (i > n_lines_or_equalities)
            check_for_sortedness[i-1] = true;
          check_for_sortedness[i] = true;
        }
      }
    }
    if (have_to_negate)

      neg_assign(row_k.expr);

    ((void) 0);
  }


  for (dimension_type i = 0; still_sorted && i+1 < nrows; ++i)
    if (check_for_sortedness[i])

      still_sorted = (compare((*this)[i], (*this)[i+1]) <= 0);


  sorted = still_sorted;

  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>::simplify() {

  ((void) 0);


  const dimension_type old_nrows = num_rows();
  dimension_type nrows = old_nrows;
  dimension_type n_lines_or_equalities = 0;
  for (dimension_type i = 0; i < nrows; ++i)
    if ((*this)[i].is_line_or_equality()) {
      if (n_lines_or_equalities < i) {
        swap(rows[i], rows[n_lines_or_equalities]);

        ((void) 0);
      }
      ++n_lines_or_equalities;
    }

  const dimension_type rank = gauss(n_lines_or_equalities);

  if (rank < n_lines_or_equalities) {
    const dimension_type
      n_rays_or_points_or_inequalities = nrows - n_lines_or_equalities;
    const dimension_type
      num_swaps = std::min(n_lines_or_equalities - rank,
                           n_rays_or_points_or_inequalities);
    for (dimension_type i = num_swaps; i-- > 0; )
      swap(rows[--nrows], rows[rank + i]);
    remove_trailing_rows(old_nrows - nrows);
    if (n_rays_or_points_or_inequalities > num_swaps)
      set_sorted(false);
    unset_pending_rows();
    n_lines_or_equalities = rank;
  }

  back_substitute(n_lines_or_equalities);

  ((void) 0);
}

template <typename Row>
void
Linear_System<Row>
::add_universe_rows_and_space_dimensions(const dimension_type n) {
  ((void) 0);
  const bool was_sorted = is_sorted();
  const dimension_type old_n_rows = num_rows();
  const dimension_type old_space_dim
    = is_necessarily_closed() ? space_dimension() : space_dimension() + 1;
  set_space_dimension(space_dimension() + n);
  rows.resize(rows.size() + n);

  for (dimension_type i = old_n_rows; i-- > 0; )
    swap(rows[i], rows[i + n]);
  for (dimension_type i = n, c = old_space_dim; i-- > 0; ) {



    if (Variable(c).space_dimension() <= space_dimension()) {

      Linear_Expression le(representation());
      le.set_space_dimension(space_dimension());
      le += Variable(c);
      Row r(le, Row::LINE_OR_EQUALITY, row_topology);
      swap(r, rows[i]);
    }
    else {

      ((void) 0);
      Linear_Expression le(Variable(c), representation());
      Row r(le, Row::LINE_OR_EQUALITY, NECESSARILY_CLOSED);
      r.mark_as_not_necessarily_closed();
      swap(r, rows[i]);

    }
    ++c;
  }


  if (was_sorted)
    sorted = (compare(rows[n-1], rows[n]) <= 0);



  if (!is_necessarily_closed()) {

    ((void) 0);
    if (!is_sorted()) {
      for (dimension_type i = n; i-- > 0; ) {
        rows[i].expr.swap_space_dimensions(Variable(old_space_dim - 1),
                                           Variable(old_space_dim - 1 + n));
        ((void) 0);
      }
    }
    else {
      dimension_type old_eps_index = old_space_dim - 1;


      for (dimension_type i = n; i-- > 0; ++old_eps_index) {
        rows[i].expr.swap_space_dimensions(Variable(old_eps_index),
                                           Variable(old_eps_index + 1));
        ((void) 0);
      }

      sorted = true;
    }
  }

  set_index_first_pending_row(index_first_pending + n);
}

template <typename Row>
void
Linear_System<Row>::sort_pending_and_remove_duplicates() {
  ((void) 0);
  ((void) 0);



  const dimension_type first_pending = first_pending_row();
  sort_rows(first_pending, num_rows());


  const dimension_type old_num_rows = num_rows();
  dimension_type num_rows = old_num_rows;

  dimension_type k1 = 0;
  dimension_type k2 = first_pending;
  dimension_type num_duplicates = 0;


  while (k1 < first_pending && k2 < num_rows) {
    const int cmp = compare(rows[k1], rows[k2]);
    if (cmp == 0) {

      ++num_duplicates;
      --num_rows;

      ++k1;

      if (k2 < num_rows)
        swap(rows[k2], rows[k2 + num_duplicates]);
    }
    else if (cmp < 0)

      ++k1;
    else {



      ++k2;
      if (num_duplicates > 0 && k2 < num_rows)
        swap(rows[k2], rows[k2 + num_duplicates]);
    }
  }


  if (num_duplicates > 0) {
    if (k2 < num_rows)
      for (++k2; k2 < num_rows; ++k2)
        swap(rows[k2], rows[k2 + num_duplicates]);
    rows.resize(num_rows);
  }
  sorted = true;
  ((void) 0);
}

template <typename Row>
bool
Linear_System<Row>::check_sorted() const {
  for (dimension_type i = first_pending_row(); i-- > 1; )
    if (compare(rows[i], rows[i-1]) < 0)
      return false;
  return true;
}

template <typename Row>
bool
Linear_System<Row>::OK() const {





  for (dimension_type i = rows.size(); i-- > 0; ) {
    if (rows[i].representation() != representation()) {




      return false;
    }
    if (rows[i].space_dimension() != space_dimension()) {




      return false;
    }
  }

  for (dimension_type i = rows.size(); i-- > 0; )
    if (rows[i].topology() != topology()) {




      return false;
    }


  if (first_pending_row() > num_rows()) {




    return false;
  }


  const dimension_type n_rows = num_rows();
  for (dimension_type i = 0; i < n_rows; ++i)
    if (topology() != rows[i].topology()) {





      return false;
    }

  if (sorted && !check_sorted()) {




    return false;
  }


  return true;
}

}
# 581 "Linear_System_defs.hh" 2
# 30 "Constraint_System_defs.hh" 2
# 38 "Constraint_System_defs.hh"
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iterator" 1 3
# 64 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iterator" 3
       
# 65 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iterator" 3
# 73 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iterator" 3
# 1 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stream_iterator.h" 1 3
# 38 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stream_iterator.h" 3
       
# 39 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stream_iterator.h" 3



namespace std
{

  template<typename _Tp, typename _CharT = char,
           typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
    class istream_iterator
    : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
    {
    public:
      typedef _CharT char_type;
      typedef _Traits traits_type;
      typedef basic_istream<_CharT, _Traits> istream_type;

    private:
      istream_type* _M_stream;
      _Tp _M_value;
      bool _M_ok;

    public:

      istream_iterator()
      : _M_stream(0), _M_ok(false) {}


      istream_iterator(istream_type& __s)
      : _M_stream(&__s)
      { _M_read(); }

      istream_iterator(const istream_iterator& __obj)
      : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
        _M_ok(__obj._M_ok)
      { }

      const _Tp&
      operator*() const
      {
 ;


 return _M_value;
      }

      const _Tp*
      operator->() const { return &(operator*()); }

      istream_iterator&
      operator++()
      {
 ;


 _M_read();
 return *this;
      }

      istream_iterator
      operator++(int)
      {
 ;


 istream_iterator __tmp = *this;
 _M_read();
 return __tmp;
      }

      bool
      _M_equal(const istream_iterator& __x) const
      { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }

    private:
      void
      _M_read()
      {
 _M_ok = (_M_stream && *_M_stream) ? true : false;
 if (_M_ok)
   {
     *_M_stream >> _M_value;
     _M_ok = *_M_stream ? true : false;
   }
      }
    };


  template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
    inline bool
    operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
        const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
    { return __x._M_equal(__y); }


  template <class _Tp, class _CharT, class _Traits, class _Dist>
    inline bool
    operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
        const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
    { return !__x._M_equal(__y); }
# 150 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stream_iterator.h" 3
  template<typename _Tp, typename _CharT = char,
           typename _Traits = char_traits<_CharT> >
    class ostream_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
    {
    public:


      typedef _CharT char_type;
      typedef _Traits traits_type;
      typedef basic_ostream<_CharT, _Traits> ostream_type;


    private:
      ostream_type* _M_stream;
      const _CharT* _M_string;

    public:

      ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
# 181 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stream_iterator.h" 3
      ostream_iterator(ostream_type& __s, const _CharT* __c)
      : _M_stream(&__s), _M_string(__c) { }


      ostream_iterator(const ostream_iterator& __obj)
      : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }



      ostream_iterator&
      operator=(const _Tp& __value)
      {
 ;


 *_M_stream << __value;
 if (_M_string) *_M_stream << _M_string;
 return *this;
      }

      ostream_iterator&
      operator*()
      { return *this; }

      ostream_iterator&
      operator++()
      { return *this; }

      ostream_iterator&
      operator++(int)
      { return *this; }
    };
}
# 74 "/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iterator" 2 3
# 39 "Constraint_System_defs.hh" 2


namespace Parma_Polyhedra_Library {

namespace IO_Operators {







std::ostream& operator<<(std::ostream& s, const Constraint_System& cs);

}






bool operator==(const Constraint_System& x, const Constraint_System& y);






bool operator!=(const Constraint_System& x, const Constraint_System& y);


void
swap(Constraint_System& x, Constraint_System& y);

}
# 136 "Constraint_System_defs.hh"
class Parma_Polyhedra_Library::Constraint_System {
public:
  typedef Constraint row_type;

  static const Representation default_representation = SPARSE;


  explicit Constraint_System(Representation r = default_representation);


  explicit Constraint_System(const Constraint& c,
                             Representation r = default_representation);


  explicit Constraint_System(const Congruence_System& cgs,
                             Representation r = default_representation);






  Constraint_System(const Constraint_System& cs);


  Constraint_System(const Constraint_System& cs, Representation r);


  ~Constraint_System();


  Constraint_System& operator=(const Constraint_System& y);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;


  void set_space_dimension(dimension_type space_dim);





  bool has_equalities() const;





  bool has_strict_inequalities() const;





  void insert(const Constraint& c);


  static void initialize();


  static void finalize();




  static const Constraint_System& zero_dim_empty();

  typedef Constraint_System_const_iterator const_iterator;


  bool empty() const;





  void clear();






  const_iterator begin() const;


  const_iterator end() const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  void m_swap(Constraint_System& y);

private:
  Linear_System<Constraint> sys;





  static const Constraint_System* zero_dim_empty_p;

  friend class Constraint_System_const_iterator;

  friend bool operator==(const Constraint_System& x,
                         const Constraint_System& y);


  explicit Constraint_System(Topology topol,
                             Representation r = default_representation);






  Constraint_System(Topology topol, dimension_type space_dim,
                    Representation r = default_representation);


  dimension_type num_equalities() const;


  dimension_type num_inequalities() const;







  void simplify();
# 302 "Constraint_System_defs.hh"
  bool adjust_topology_and_space_dimension(Topology new_topology,
                                           dimension_type new_space_dim);


  const Constraint& operator[](dimension_type k) const;


  bool satisfies_all_constraints(const Generator& g) const;
# 346 "Constraint_System_defs.hh"
  void affine_preimage(Variable v,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator);






  void insert_pending(const Constraint& c);


  void add_low_level_constraints();


  Topology topology() const;

  dimension_type num_rows() const;





  bool is_necessarily_closed() const;


  dimension_type num_pending_rows() const;


  dimension_type first_pending_row() const;


  bool is_sorted() const;


  void unset_pending_rows();


  void set_index_first_pending_row(dimension_type i);


  void set_sorted(bool b);
# 397 "Constraint_System_defs.hh"
  void remove_row(dimension_type i, bool keep_sorted = false);







  void remove_rows(const std::vector<dimension_type>& indexes);
# 415 "Constraint_System_defs.hh"
  void remove_rows(dimension_type first, dimension_type last,
                   bool keep_sorted = false);


  void remove_trailing_rows(dimension_type n);







  void remove_space_dimensions(const Variables_Set& vars);



  void shift_space_dimensions(Variable v, dimension_type n);
# 445 "Constraint_System_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);


  void swap_space_dimensions(Variable v1, Variable v2);

  bool has_no_rows() const;


  void strong_normalize();





  void sort_rows();





  void insert_pending(Constraint& r, Recycle_Input);



  void insert_pending(Constraint_System& r, Recycle_Input);





  void insert(Constraint& r, Recycle_Input);





  void insert(Constraint_System& r, Recycle_Input);


  void insert_pending(const Constraint_System& r);
# 494 "Constraint_System_defs.hh"
  void merge_rows_assign(const Constraint_System& y);





  void insert(const Constraint_System& y);






  void mark_as_necessarily_closed();






  void mark_as_not_necessarily_closed();
# 528 "Constraint_System_defs.hh"
  dimension_type gauss(dimension_type n_lines_or_equalities);
# 540 "Constraint_System_defs.hh"
  void back_substitute(dimension_type n_lines_or_equalities);


  void assign_with_pending(const Constraint_System& y);





  void sort_pending_and_remove_duplicates();
# 558 "Constraint_System_defs.hh"
  void sort_and_remove_with_sat(Bit_Matrix& sat);





  bool check_sorted() const;





  dimension_type num_lines_or_equalities() const;
# 585 "Constraint_System_defs.hh"
  void add_universe_rows_and_space_dimensions(dimension_type n);

  friend class Polyhedron;
  friend class Termination_Helpers;
};
# 609 "Constraint_System_defs.hh"
class Parma_Polyhedra_Library::Constraint_System_const_iterator
  : public std::iterator<std::forward_iterator_tag,
                         Constraint,
                         ptrdiff_t,
                         const Constraint*,
                         const Constraint&> {
public:

  Constraint_System_const_iterator();


  Constraint_System_const_iterator(const Constraint_System_const_iterator& y);


  ~Constraint_System_const_iterator();


  Constraint_System_const_iterator&
  operator=(const Constraint_System_const_iterator& y);


  const Constraint& operator*() const;


  const Constraint* operator->() const;


  Constraint_System_const_iterator& operator++();


  Constraint_System_const_iterator operator++(int);





  bool operator==(const Constraint_System_const_iterator& y) const;





  bool operator!=(const Constraint_System_const_iterator& y) const;

private:
  friend class Constraint_System;


  Linear_System<Constraint>::const_iterator i;


  const Linear_System<Constraint>* csp;


  Constraint_System_const_iterator(const Linear_System<Constraint>
                                   ::const_iterator& iter,
                                   const Constraint_System& cs);


  void skip_forward();
};

namespace Parma_Polyhedra_Library {

namespace Implementation {




dimension_type
num_constraints(const Constraint_System& cs);

}

}
# 29 "Box_inlines.hh" 2
# 1 "Constraint_System_inlines.hh" 1
# 29 "Constraint_System_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Constraint_System::Constraint_System(Representation r)
  : sys(NECESSARILY_CLOSED, r) {
}

inline
Constraint_System::Constraint_System(const Constraint& c, Representation r)
  : sys(c.topology(), r) {
  sys.insert(c);
}

inline
Constraint_System::Constraint_System(const Constraint_System& cs)
  : sys(cs.sys) {
}

inline
Constraint_System::Constraint_System(const Constraint_System& cs,
                                     Representation r)
  : sys(cs.sys, r) {
}

inline
Constraint_System::Constraint_System(const Topology topol, Representation r)
  : sys(topol, r) {
}

inline
Constraint_System::Constraint_System(const Topology topol,
                                     const dimension_type space_dim,
                                     Representation r)
  : sys(topol, space_dim, r) {
}

inline
Constraint_System::~Constraint_System() {
}

inline Constraint_System&
Constraint_System::operator=(const Constraint_System& y) {
  Constraint_System tmp = y;
  swap(*this, tmp);
  return *this;
}

inline const Constraint&
Constraint_System::operator[](const dimension_type k) const {
  return sys[k];
}

inline Representation
Constraint_System::representation() const {
  return sys.representation();
}

inline void
Constraint_System::set_representation(Representation r) {
  sys.set_representation(r);
}

inline dimension_type
Constraint_System::max_space_dimension() {
  return Linear_System<Constraint>::max_space_dimension();
}

inline dimension_type
Constraint_System::space_dimension() const {
  return sys.space_dimension();
}

inline void
Constraint_System::set_space_dimension(dimension_type space_dim) {
  return sys.set_space_dimension(space_dim);
}

inline void
Constraint_System::clear() {
  sys.clear();
}

inline const Constraint_System&
Constraint_System::zero_dim_empty() {
  ((void) 0);
  return *zero_dim_empty_p;
}

inline
Constraint_System_const_iterator::Constraint_System_const_iterator()
  : i(), csp(0) {
}

inline
Constraint_System_const_iterator::Constraint_System_const_iterator(const Constraint_System_const_iterator& y)
  : i(y.i), csp(y.csp) {
}

inline
Constraint_System_const_iterator::~Constraint_System_const_iterator() {
}

inline Constraint_System_const_iterator&
Constraint_System_const_iterator::operator=(const Constraint_System_const_iterator& y) {
  i = y.i;
  csp = y.csp;
  return *this;
}

inline const Constraint&
Constraint_System_const_iterator::operator*() const {
  return *i;
}

inline const Constraint*
Constraint_System_const_iterator::operator->() const {
  return i.operator->();
}

inline Constraint_System_const_iterator&
Constraint_System_const_iterator::operator++() {
  ++i;
  skip_forward();
  return *this;
}

inline Constraint_System_const_iterator
Constraint_System_const_iterator::operator++(int) {
  const Constraint_System_const_iterator tmp = *this;
  operator++();
  return tmp;
}

inline bool
Constraint_System_const_iterator::operator==(const Constraint_System_const_iterator& y) const {
  return i == y.i;
}

inline bool
Constraint_System_const_iterator::operator!=(const Constraint_System_const_iterator& y) const {
  return i != y.i;
}

inline
Constraint_System_const_iterator::
Constraint_System_const_iterator(const Linear_System<Constraint>::const_iterator& iter,
               const Constraint_System& cs)
  : i(iter), csp(&cs.sys) {
}

inline Constraint_System_const_iterator
Constraint_System::begin() const {
  const_iterator i(sys.begin(), *this);
  i.skip_forward();
  return i;
}

inline Constraint_System_const_iterator
Constraint_System::end() const {
  const Constraint_System_const_iterator i(sys.end(), *this);
  return i;
}

inline bool
Constraint_System::empty() const {
  return begin() == end();
}

inline void
Constraint_System::add_low_level_constraints() {
  if (sys.is_necessarily_closed())

    insert(Constraint::zero_dim_positivity());
  else {

    insert(Constraint::epsilon_leq_one());
    insert(Constraint::epsilon_geq_zero());
  }
}

inline void
Constraint_System::m_swap(Constraint_System& y) {
  swap(sys, y.sys);
}

inline memory_size_type
Constraint_System::external_memory_in_bytes() const {
  return sys.external_memory_in_bytes();
}

inline memory_size_type
Constraint_System::total_memory_in_bytes() const {
  return external_memory_in_bytes() + sizeof(*this);
}

inline void
Constraint_System::simplify() {
  sys.simplify();
}

inline Topology
Constraint_System::topology() const {
  return sys.topology();
}

inline dimension_type
Constraint_System::num_rows() const {
  return sys.num_rows();
}

inline bool
Constraint_System::is_necessarily_closed() const {
  return sys.is_necessarily_closed();
}

inline dimension_type
Constraint_System::num_pending_rows() const {
  return sys.num_pending_rows();
}

inline dimension_type
Constraint_System::first_pending_row() const {
  return sys.first_pending_row();
}

inline bool
Constraint_System::is_sorted() const {
  return sys.is_sorted();
}

inline void
Constraint_System::unset_pending_rows() {
  sys.unset_pending_rows();
}

inline void
Constraint_System::set_index_first_pending_row(dimension_type i) {
  sys.set_index_first_pending_row(i);
}

inline void
Constraint_System::set_sorted(bool b) {
  sys.set_sorted(b);
}

inline void
Constraint_System::remove_row(dimension_type i, bool keep_sorted) {
  sys.remove_row(i, keep_sorted);
}

inline void
Constraint_System::remove_rows(dimension_type first, dimension_type last,
                               bool keep_sorted) {
  sys.remove_rows(first, last, keep_sorted);
}

inline void
Constraint_System::remove_rows(const std::vector<dimension_type>& indexes) {
  sys.remove_rows(indexes);
}

inline void
Constraint_System::remove_trailing_rows(dimension_type n) {
  sys.remove_trailing_rows(n);
}

inline void
Constraint_System
::remove_space_dimensions(const Variables_Set& vars) {
  sys.remove_space_dimensions(vars);
}

inline void
Constraint_System
::shift_space_dimensions(Variable v, dimension_type n) {
  sys.shift_space_dimensions(v, n);
}

inline void
Constraint_System
::permute_space_dimensions(const std::vector<Variable>& cycle) {
  sys.permute_space_dimensions(cycle);
}

inline void
Constraint_System
::swap_space_dimensions(Variable v1, Variable v2) {
  sys.swap_space_dimensions(v1, v2);
}

inline bool
Constraint_System::has_no_rows() const {
  return sys.has_no_rows();
}

inline void
Constraint_System::strong_normalize() {
  sys.strong_normalize();
}

inline void
Constraint_System::sort_rows() {
  sys.sort_rows();
}

inline void
Constraint_System::insert_pending(Constraint_System& r, Recycle_Input) {
  sys.insert_pending(r.sys, Recycle_Input());
}

inline void
Constraint_System::insert(Constraint_System& r, Recycle_Input) {
  sys.insert(r.sys, Recycle_Input());
}

inline void
Constraint_System::insert_pending(const Constraint_System& r) {
  sys.insert_pending(r.sys);
}

inline void
Constraint_System::merge_rows_assign(const Constraint_System& y) {
  sys.merge_rows_assign(y.sys);
}

inline void
Constraint_System::insert(const Constraint_System& y) {
  sys.insert(y.sys);
}

inline void
Constraint_System::mark_as_necessarily_closed() {
  sys.mark_as_necessarily_closed();
}

inline void
Constraint_System::mark_as_not_necessarily_closed() {
  sys.mark_as_not_necessarily_closed();
}

inline dimension_type
Constraint_System::gauss(dimension_type n_lines_or_equalities) {
  return sys.gauss(n_lines_or_equalities);
}

inline void
Constraint_System::back_substitute(dimension_type n_lines_or_equalities) {
  sys.back_substitute(n_lines_or_equalities);
}

inline void
Constraint_System::assign_with_pending(const Constraint_System& y) {
  sys.assign_with_pending(y.sys);
}

inline void
Constraint_System::sort_pending_and_remove_duplicates() {
  sys.sort_pending_and_remove_duplicates();
}

inline void
Constraint_System::sort_and_remove_with_sat(Bit_Matrix& sat) {
  sys.sort_and_remove_with_sat(sat);
}

inline bool
Constraint_System::check_sorted() const {
  return sys.check_sorted();
}

inline dimension_type
Constraint_System::num_lines_or_equalities() const {
  return sys.num_lines_or_equalities();
}

inline void
Constraint_System::add_universe_rows_and_space_dimensions(dimension_type n) {
  sys.add_universe_rows_and_space_dimensions(n);
}

inline bool
operator==(const Constraint_System& x, const Constraint_System& y) {
  return x.sys == y.sys;
}

inline bool
operator!=(const Constraint_System& x, const Constraint_System& y) {
  return !(x == y);
}


inline void
swap(Constraint_System& x, Constraint_System& y) {
  x.m_swap(y);
}

namespace Implementation {




inline dimension_type
num_constraints(const Constraint_System& cs) {
  return static_cast<dimension_type>(std::distance(cs.begin(), cs.end()));
}

}

}
# 30 "Box_inlines.hh" 2
# 1 "Congruence_System_defs.hh" 1
# 37 "Congruence_System_defs.hh"
namespace Parma_Polyhedra_Library {


bool
operator==(const Congruence_System& x, const Congruence_System& y);

}
# 102 "Congruence_System_defs.hh"
class Parma_Polyhedra_Library::Congruence_System {
public:

  typedef Congruence row_type;

  static const Representation default_representation = SPARSE;


  explicit Congruence_System(Representation r = default_representation);


  explicit Congruence_System(dimension_type d,
                             Representation r = default_representation);


  explicit Congruence_System(const Congruence& cg,
                             Representation r = default_representation);
# 128 "Congruence_System_defs.hh"
  explicit Congruence_System(const Constraint& c,
                             Representation r = default_representation);


  explicit Congruence_System(const Constraint_System& cs,
                             Representation r = default_representation);







  Congruence_System(const Congruence_System& cgs);


  Congruence_System(const Congruence_System& cgs, Representation r);


  ~Congruence_System();


  Congruence_System& operator=(const Congruence_System& y);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;





  bool is_equal_to(const Congruence_System& y) const;





  bool has_linear_equalities() const;


  void clear();
# 186 "Congruence_System_defs.hh"
  void insert(const Congruence& cg);







  void insert(Congruence& cg, Recycle_Input);
# 207 "Congruence_System_defs.hh"
  void insert(const Constraint& c);
# 217 "Congruence_System_defs.hh"
  void insert(const Congruence_System& y);





  void insert(Congruence_System& cgs, Recycle_Input);


  static void initialize();


  static void finalize();


  static const Congruence_System& zero_dim_empty();
# 249 "Congruence_System_defs.hh"
  class const_iterator
    : public std::iterator<std::forward_iterator_tag,
                           Congruence,
                           ptrdiff_t,
                           const Congruence*,
                           const Congruence&> {
  public:

    const_iterator();


    const_iterator(const const_iterator& y);


    ~const_iterator();


    const_iterator& operator=(const const_iterator& y);


    const Congruence& operator*() const;


    const Congruence* operator->() const;


    const_iterator& operator++();


    const_iterator operator++(int);





    bool operator==(const const_iterator& y) const;





    bool operator!=(const const_iterator& y) const;

  private:
    friend class Congruence_System;


    Swapping_Vector<Congruence>::const_iterator i;


    const Swapping_Vector<Congruence>* csp;


    const_iterator(const Swapping_Vector<Congruence>::const_iterator& iter,
                   const Congruence_System& cgs);


    void skip_forward();
  };


  bool empty() const;






  const_iterator begin() const;


  const_iterator end() const;
# 330 "Congruence_System_defs.hh"
  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  dimension_type num_equalities() const;


  dimension_type num_proper_congruences() const;


  void m_swap(Congruence_System& y);
# 371 "Congruence_System_defs.hh"
  void add_unit_rows_and_space_dimensions(dimension_type dims);
# 385 "Congruence_System_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);


  void swap_space_dimensions(Variable v1, Variable v2);






  bool set_space_dimension(dimension_type new_space_dim);



protected:

  bool satisfies_all_congruences(const Grid_Generator& g) const;

private:

  dimension_type num_rows() const;


  bool has_no_rows() const;


  const Congruence& operator[](dimension_type k) const;


  void normalize_moduli();
# 454 "Congruence_System_defs.hh"
  void affine_preimage(Variable v,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator);
# 471 "Congruence_System_defs.hh"
  void concatenate(const Congruence_System& y);
# 480 "Congruence_System_defs.hh"
  void insert_verbatim(Congruence& cg, Recycle_Input);






  void remove_rows(dimension_type first, dimension_type last,
                   bool keep_sorted);

  void remove_trailing_rows(dimension_type n);





  static const Congruence_System* zero_dim_empty_p;

  Swapping_Vector<Congruence> rows;

  dimension_type space_dimension_;

  Representation representation_;
# 513 "Congruence_System_defs.hh"
  bool has_a_free_dimension() const;

  friend class Grid;

  friend bool
  operator==(const Congruence_System& x, const Congruence_System& y);
};

namespace Parma_Polyhedra_Library {

namespace IO_Operators {







std::ostream&
operator<<(std::ostream& s, const Congruence_System& cgs);

}


void
swap(Congruence_System& x, Congruence_System& y);

}
# 31 "Box_inlines.hh" 2
# 1 "Congruence_System_inlines.hh" 1
# 29 "Congruence_System_inlines.hh"
namespace Parma_Polyhedra_Library {

inline const Congruence&
Congruence_System::operator[](const dimension_type k) const {
  return rows[k];
}

inline dimension_type
Congruence_System::num_rows() const {
  return rows.size();
}

inline bool
Congruence_System::has_no_rows() const {
  return num_rows() == 0;
}

inline void
Congruence_System::remove_trailing_rows(dimension_type n) {
  ((void) 0);
  rows.resize(num_rows() - n);
}

inline void
Congruence_System::insert(const Congruence& cg) {
  Congruence tmp = cg;
  insert(tmp, Recycle_Input());
}

inline void
Congruence_System::insert(Congruence& cg, Recycle_Input) {
  ((void) 0);
  cg.strong_normalize();
  ((void) 0);
  insert_verbatim(cg, Recycle_Input());
  ((void) 0);
}

inline
Congruence_System::Congruence_System(Representation r)
  : rows(),
    space_dimension_(0),
    representation_(r) {
}

inline
Congruence_System::Congruence_System(const Congruence& cg, Representation r)
  : rows(),
    space_dimension_(0),
    representation_(r) {
  insert(cg);
}

inline
Congruence_System::Congruence_System(const Constraint& c, Representation r)
  : rows(),
    space_dimension_(0),
    representation_(r) {
  insert(c);
}

inline
Congruence_System::Congruence_System(const Congruence_System& cgs)
  : rows(cgs.rows),
    space_dimension_(cgs.space_dimension_),
    representation_(cgs.representation_) {
}

inline
Congruence_System::Congruence_System(const Congruence_System& cgs,
                                     Representation r)
  : rows(cgs.rows),
    space_dimension_(cgs.space_dimension_),
    representation_(r) {
  if (cgs.representation() != r) {
    for (dimension_type i = 0; i < num_rows(); ++i)
      rows[i].set_representation(representation());
  }
}

inline
Congruence_System::Congruence_System(const dimension_type d, Representation r)
  : rows(),
    space_dimension_(d),
    representation_(r) {
}

inline
Congruence_System::~Congruence_System() {
}

inline Congruence_System&
Congruence_System::operator=(const Congruence_System& y) {
  Congruence_System tmp = y;
  swap(*this, tmp);
  return *this;
}

inline Representation
Congruence_System::representation() const {
  return representation_;
}

inline void
Congruence_System::set_representation(Representation r) {
  if (representation_ == r)
    return;
  representation_ = r;
  for (dimension_type i = 0; i < num_rows(); ++i)
    rows[i].set_representation(r);
  ((void) 0);
}

inline dimension_type
Congruence_System::max_space_dimension() {
  return Congruence::max_space_dimension();
}

inline dimension_type
Congruence_System::space_dimension() const {
  return space_dimension_;
}

inline void
Congruence_System::clear() {
  rows.clear();
  space_dimension_ = 0;
}

inline const Congruence_System&
Congruence_System::zero_dim_empty() {
  ((void) 0);
  return *zero_dim_empty_p;
}

inline
Congruence_System::const_iterator::const_iterator()
  : i(), csp(0) {
}

inline
Congruence_System::const_iterator::const_iterator(const const_iterator& y)
  : i(y.i), csp(y.csp) {
}

inline
Congruence_System::const_iterator::~const_iterator() {
}

inline Congruence_System::const_iterator&
Congruence_System::const_iterator::operator=(const const_iterator& y) {
  i = y.i;
  csp = y.csp;
  return *this;
}

inline const Congruence&
Congruence_System::const_iterator::operator*() const {
  return *i;
}

inline const Congruence*
Congruence_System::const_iterator::operator->() const {
  return i.operator->();
}

inline Congruence_System::const_iterator&
Congruence_System::const_iterator::operator++() {
  ++i;
  skip_forward();
  return *this;
}

inline Congruence_System::const_iterator
Congruence_System::const_iterator::operator++(int) {
  const const_iterator tmp = *this;
  operator++();
  return tmp;
}

inline bool
Congruence_System::const_iterator::operator==(const const_iterator& y) const {
  return i == y.i;
}

inline bool
Congruence_System::const_iterator::operator!=(const const_iterator& y) const {
  return i != y.i;
}

inline
Congruence_System::const_iterator::
const_iterator(const Swapping_Vector<Congruence>::const_iterator& iter,
               const Congruence_System& cgs)
  : i(iter), csp(&cgs.rows) {
}

inline Congruence_System::const_iterator
Congruence_System::begin() const {
  const_iterator i(rows.begin(), *this);
  i.skip_forward();
  return i;
}

inline Congruence_System::const_iterator
Congruence_System::end() const {
  const const_iterator i(rows.end(), *this);
  return i;
}

inline bool
Congruence_System::empty() const {
  return begin() == end();
}

inline void
Congruence_System::m_swap(Congruence_System& y) {
  using std::swap;
  swap(rows, y.rows);
  swap(space_dimension_, y.space_dimension_);
  swap(representation_, y.representation_);
  ((void) 0);
  ((void) 0);
}

inline memory_size_type
Congruence_System::external_memory_in_bytes() const {
  return rows.external_memory_in_bytes();
}

inline memory_size_type
Congruence_System::total_memory_in_bytes() const {
  return rows.external_memory_in_bytes() + sizeof(*this);
}


inline void
swap(Congruence_System& x, Congruence_System& y) {
  x.m_swap(y);
}

}
# 32 "Box_inlines.hh" 2


namespace Parma_Polyhedra_Library {

template <typename ITV>
inline bool
Box<ITV>::marked_empty() const {
  return status.test_empty_up_to_date() && status.test_empty();
}

template <typename ITV>
inline void
Box<ITV>::set_empty() {
  status.set_empty();
  status.set_empty_up_to_date();
}

template <typename ITV>
inline void
Box<ITV>::set_nonempty() {
  status.reset_empty();
  status.set_empty_up_to_date();
}

template <typename ITV>
inline void
Box<ITV>::set_empty_up_to_date() {
  status.set_empty_up_to_date();
}

template <typename ITV>
inline void
Box<ITV>::reset_empty_up_to_date() {
  return status.reset_empty_up_to_date();
}

template <typename ITV>
inline
Box<ITV>::Box(const Box& y, Complexity_Class)
  : seq(y.seq), status(y.status) {
}

template <typename ITV>
inline Box<ITV>&
Box<ITV>::operator=(const Box& y) {
  seq = y.seq;
  status = y.status;
  return *this;
}

template <typename ITV>
inline void
Box<ITV>::m_swap(Box& y) {
  Box& x = *this;
  using std::swap;
  swap(x.seq, y.seq);
  swap(x.status, y.status);
}

template <typename ITV>
inline
Box<ITV>::Box(const Constraint_System& cs, Recycle_Input) {

  Box<ITV> tmp(cs);
  this->m_swap(tmp);
}

template <typename ITV>
inline
Box<ITV>::Box(const Generator_System& gs, Recycle_Input) {

  Box<ITV> tmp(gs);
  this->m_swap(tmp);
}

template <typename ITV>
inline
Box<ITV>::Box(const Congruence_System& cgs, Recycle_Input) {

  Box<ITV> tmp(cgs);
  this->m_swap(tmp);
}

template <typename ITV>
inline memory_size_type
Box<ITV>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename ITV>
inline dimension_type
Box<ITV>::space_dimension() const {
  return seq.size();
}

template <typename ITV>
inline dimension_type
Box<ITV>::max_space_dimension() {


  return Sequence().max_size() - 1;
}

template <typename ITV>
inline int32_t
Box<ITV>::hash_code() const {
  return hash_code_from_dimension(space_dimension());
}

template <typename ITV>
inline const ITV&
Box<ITV>::operator[](const dimension_type k) const {
  ((void) 0);
  return seq[k];
}

template <typename ITV>
inline const ITV&
Box<ITV>::get_interval(const Variable var) const {
  if (space_dimension() < var.space_dimension())
    throw_dimension_incompatible("get_interval(v)", "v", var);

  if (is_empty()) {
    static ITV empty_interval(EMPTY);
    return empty_interval;
  }

  return seq[var.id()];
}

template <typename ITV>
inline void
Box<ITV>::set_interval(const Variable var, const ITV& i) {
  const dimension_type space_dim = space_dimension();
  if (space_dim < var.space_dimension())
    throw_dimension_incompatible("set_interval(v, i)", "v", var);

  if (is_empty() && space_dim >= 2)


    return;

  seq[var.id()] = i;
  reset_empty_up_to_date();

  ((void) 0);
}

template <typename ITV>
inline bool
Box<ITV>::is_empty() const {
  return marked_empty() || check_empty();
}

template <typename ITV>
inline bool
Box<ITV>::bounds_from_above(const Linear_Expression& expr) const {
  return bounds(expr, true);
}

template <typename ITV>
inline bool
Box<ITV>::bounds_from_below(const Linear_Expression& expr) const {
  return bounds(expr, false);
}

template <typename ITV>
inline bool
Box<ITV>::maximize(const Linear_Expression& expr,
                   Coefficient& sup_n, Coefficient& sup_d,
                   bool& maximum) const {
  return max_min(expr, true, sup_n, sup_d, maximum);
}

template <typename ITV>
inline bool
Box<ITV>::maximize(const Linear_Expression& expr,
                   Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                   Generator& g) const {
  return max_min(expr, true, sup_n, sup_d, maximum, g);
}

template <typename ITV>
inline bool
Box<ITV>::minimize(const Linear_Expression& expr,
                   Coefficient& inf_n, Coefficient& inf_d,
                   bool& minimum) const {
  return max_min(expr, false, inf_n, inf_d, minimum);
}

template <typename ITV>
inline bool
Box<ITV>::minimize(const Linear_Expression& expr,
                   Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                   Generator& g) const {
  return max_min(expr, false, inf_n, inf_d, minimum, g);
}

template <typename ITV>
inline bool
Box<ITV>::strictly_contains(const Box& y) const {
  const Box& x = *this;
  return x.contains(y) && !y.contains(x);
}

template <typename ITV>
inline void
Box<ITV>::expand_space_dimension(const Variable var,
                                 const dimension_type m) {
  const dimension_type space_dim = space_dimension();

  if (var.space_dimension() > space_dim)
    throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var);



  if (m > max_space_dimension() - space_dim)
    throw_invalid_argument("expand_dimension(v, m)",
                           "adding m new space dimensions exceeds "
                           "the maximum allowed space dimension");



  seq.insert(seq.end(), m, seq[var.id()]);
  ((void) 0);
}

template <typename ITV>
inline bool
operator!=(const Box<ITV>& x, const Box<ITV>& y) {
  return !(x == y);
}

template <typename ITV>
inline bool
Box<ITV>::has_lower_bound(const Variable var,
                          Coefficient& n, Coefficient& d, bool& closed) const {


  ((void) 0);
  const dimension_type k = var.id();
  ((void) 0);
  const ITV& seq_k = seq[k];

  if (seq_k.lower_is_boundary_infinity())
    return false;

  closed = !seq_k.lower_is_open();

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_lr; mpq_class& lr = holder_lr.item();
  assign_r(lr, seq_k.lower(), ROUND_NOT_NEEDED);
  n = lr.get_num();
  d = lr.get_den();

  return true;
}

template <typename ITV>
inline bool
Box<ITV>::has_upper_bound(const Variable var,
                          Coefficient& n, Coefficient& d, bool& closed) const {


  ((void) 0);
  const dimension_type k = var.id();
  ((void) 0);
  const ITV& seq_k = seq[k];

  if (seq_k.upper_is_boundary_infinity())
    return false;

  closed = !seq_k.upper_is_open();

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_ur; mpq_class& ur = holder_ur.item();
  assign_r(ur, seq_k.upper(), ROUND_NOT_NEEDED);
  n = ur.get_num();
  d = ur.get_den();

  return true;
}

template <typename ITV>
inline void
Box<ITV>::add_constraint(const Constraint& c) {
  const dimension_type c_space_dim = c.space_dimension();

  if (c_space_dim > space_dimension())
    throw_dimension_incompatible("add_constraint(c)", c);

  add_constraint_no_check(c);
}

template <typename ITV>
inline void
Box<ITV>::add_constraints(const Constraint_System& cs) {

  if (cs.space_dimension() > space_dimension())
    throw_dimension_incompatible("add_constraints(cs)", cs);

  add_constraints_no_check(cs);
}

template <typename T>
inline void
Box<T>::add_recycled_constraints(Constraint_System& cs) {
  add_constraints(cs);
}

template <typename ITV>
inline void
Box<ITV>::add_congruence(const Congruence& cg) {
  const dimension_type cg_space_dim = cg.space_dimension();

  if (cg_space_dim > space_dimension())
    throw_dimension_incompatible("add_congruence(cg)", cg);

  add_congruence_no_check(cg);
}

template <typename ITV>
inline void
Box<ITV>::add_congruences(const Congruence_System& cgs) {
  if (cgs.space_dimension() > space_dimension())
    throw_dimension_incompatible("add_congruences(cgs)", cgs);
  add_congruences_no_check(cgs);
}

template <typename T>
inline void
Box<T>::add_recycled_congruences(Congruence_System& cgs) {
  add_congruences(cgs);
}

template <typename T>
inline bool
Box<T>::can_recycle_constraint_systems() {
  return false;
}

template <typename T>
inline bool
Box<T>::can_recycle_congruence_systems() {
  return false;
}

template <typename T>
inline void
Box<T>::widening_assign(const Box& y, unsigned* tp) {
  CC76_widening_assign(y, tp);
}

template <typename ITV>
inline Congruence_System
Box<ITV>::minimized_congruences() const {

  return congruences();
}

template <typename ITV>
inline I_Result
Box<ITV>
::refine_interval_no_check(ITV& itv,
                           const Constraint::Type type,
                           Coefficient_traits::const_reference numer,
                           Coefficient_traits::const_reference denom) {
  ((void) 0);





  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  assign_r(q.get_num(), numer, ROUND_NOT_NEEDED);
  assign_r(q.get_den(), denom, ROUND_NOT_NEEDED);
  q.canonicalize();

  q = -q;

  Relation_Symbol rel_sym;
  switch (type) {
  case Constraint::EQUALITY:
    rel_sym = EQUAL;
    break;
  case Constraint::NONSTRICT_INEQUALITY:
    rel_sym = (denom > 0) ? GREATER_OR_EQUAL : LESS_OR_EQUAL;
    break;
  case Constraint::STRICT_INEQUALITY:
    rel_sym = (denom > 0) ? GREATER_THAN : LESS_THAN;
    break;
  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    return I_ANY;
  }
  I_Result res = itv.add_constraint(i_constraint(rel_sym, q));
  ((void) 0);
  return res;
}

template <typename ITV>
inline void
Box<ITV>
::add_interval_constraint_no_check(const dimension_type var_id,
                                   const Constraint::Type type,
                                   Coefficient_traits::const_reference numer,
                                   Coefficient_traits::const_reference denom) {
  ((void) 0);
  ((void) 0);
  ((void) 0);
  refine_interval_no_check(seq[var_id], type, numer, denom);



  reset_empty_up_to_date();
  ((void) 0);
}

template <typename ITV>
inline void
Box<ITV>::refine_with_constraint(const Constraint& c) {
  const dimension_type c_space_dim = c.space_dimension();

  if (c_space_dim > space_dimension())
    throw_dimension_incompatible("refine_with_constraint(c)", c);


  if (marked_empty())
    return;

  refine_no_check(c);
}

template <typename ITV>
inline void
Box<ITV>::refine_with_constraints(const Constraint_System& cs) {

  if (cs.space_dimension() > space_dimension())
    throw_dimension_incompatible("refine_with_constraints(cs)", cs);


  if (marked_empty())
    return;

  refine_no_check(cs);
}

template <typename ITV>
inline void
Box<ITV>::refine_with_congruence(const Congruence& cg) {
  const dimension_type cg_space_dim = cg.space_dimension();

  if (cg_space_dim > space_dimension())
    throw_dimension_incompatible("refine_with_congruence(cg)", cg);


  if (marked_empty())
    return;

  refine_no_check(cg);
}

template <typename ITV>
inline void
Box<ITV>::refine_with_congruences(const Congruence_System& cgs) {

  if (cgs.space_dimension() > space_dimension())
    throw_dimension_incompatible("refine_with_congruences(cgs)", cgs);


  if (marked_empty())
    return;

  refine_no_check(cgs);
}

template <typename ITV>
inline void
Box<ITV>::propagate_constraint(const Constraint& c) {
  const dimension_type c_space_dim = c.space_dimension();

  if (c_space_dim > space_dimension())
    throw_dimension_incompatible("propagate_constraint(c)", c);


  if (marked_empty())
    return;

  propagate_constraint_no_check(c);
}

template <typename ITV>
inline void
Box<ITV>::propagate_constraints(const Constraint_System& cs,
                                const dimension_type max_iterations) {

  if (cs.space_dimension() > space_dimension())
    throw_dimension_incompatible("propagate_constraints(cs)", cs);


  if (marked_empty())
    return;

  propagate_constraints_no_check(cs, max_iterations);
}

template <typename ITV>
inline void
Box<ITV>::unconstrain(const Variable var) {
  const dimension_type var_id = var.id();

  if (space_dimension() < var_id + 1)
    throw_dimension_incompatible("unconstrain(var)", var_id + 1);


  if (marked_empty())
    return;



  ITV& seq_var = seq[var_id];
  if (seq_var.is_empty())
    set_empty();
  else
    seq_var.assign(UNIVERSE);

  ((void) 0);
}


template <typename Temp, typename To, typename ITV>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Box<ITV>& x,
                            const Box<ITV>& y,
                            const Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2) {
  return l_m_distance_assign<Rectilinear_Distance_Specialization<Temp> >
    (r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename ITV>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Box<ITV>& x,
                            const Box<ITV>& y,
                            const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return rectilinear_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename ITV>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Box<ITV>& x,
                            const Box<ITV>& y,
                            const Rounding_Dir dir) {


  return Parma_Polyhedra_Library
    ::rectilinear_distance_assign<To, To, ITV>(r, x, y, dir);
}


template <typename Temp, typename To, typename ITV>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Box<ITV>& x,
                          const Box<ITV>& y,
                          const Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2) {
  return l_m_distance_assign<Euclidean_Distance_Specialization<Temp> >
    (r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename ITV>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Box<ITV>& x,
                          const Box<ITV>& y,
                          const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return euclidean_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename ITV>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Box<ITV>& x,
                          const Box<ITV>& y,
                          const Rounding_Dir dir) {


  return Parma_Polyhedra_Library
    ::euclidean_distance_assign<To, To, ITV>(r, x, y, dir);
}


template <typename Temp, typename To, typename ITV>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Box<ITV>& x,
                           const Box<ITV>& y,
                           const Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2) {
  return l_m_distance_assign<L_Infinity_Distance_Specialization<Temp> >
    (r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename ITV>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Box<ITV>& x,
                           const Box<ITV>& y,
                           const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return l_infinity_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename ITV>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Box<ITV>& x,
                           const Box<ITV>& y,
                           const Rounding_Dir dir) {


  return Parma_Polyhedra_Library
    ::l_infinity_distance_assign<To, To, ITV>(r, x, y, dir);
}


template <typename ITV>
inline void
swap(Box<ITV>& x, Box<ITV>& y) {
  x.m_swap(y);
}

}
# 2284 "Box_defs.hh" 2
# 1 "Box_templates.hh" 1
# 30 "Box_templates.hh"
# 1 "Generator_System_defs.hh" 1
# 33 "Generator_System_defs.hh"
# 1 "Poly_Con_Relation_defs.hh" 1
# 31 "Poly_Con_Relation_defs.hh"
namespace Parma_Polyhedra_Library {





bool operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y);



bool operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y);



Poly_Con_Relation operator&&(const Poly_Con_Relation& x,
                             const Poly_Con_Relation& y);







Poly_Con_Relation operator-(const Poly_Con_Relation& x,
                            const Poly_Con_Relation& y);

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Poly_Con_Relation& r);

}

}







class Parma_Polyhedra_Library::Poly_Con_Relation {
private:

  typedef unsigned int flags_t;



  static const flags_t NOTHING = 0U;
  static const flags_t IS_DISJOINT = 1U << 0;
  static const flags_t STRICTLY_INTERSECTS = 1U << 1;
  static const flags_t IS_INCLUDED = 1U << 2;
  static const flags_t SATURATES = 1U << 3;



  static const flags_t EVERYTHING
  = IS_DISJOINT
  | STRICTLY_INTERSECTS
  | IS_INCLUDED
  | SATURATES;


  flags_t flags;


  static bool implies(flags_t x, flags_t y);


  Poly_Con_Relation(flags_t mask);

  friend bool
  operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
  friend bool
  operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y);

  friend Poly_Con_Relation
  operator&&(const Poly_Con_Relation& x, const Poly_Con_Relation& y);

  friend Poly_Con_Relation
  operator-(const Poly_Con_Relation& x, const Poly_Con_Relation& y);

  friend std::ostream&
  Parma_Polyhedra_Library::
  IO_Operators::operator<<(std::ostream& s, const Poly_Con_Relation& r);

public:






  flags_t get_flags() const;

public:

  static Poly_Con_Relation nothing();





  static Poly_Con_Relation is_disjoint();





  static Poly_Con_Relation strictly_intersects();





  static Poly_Con_Relation is_included();





  static Poly_Con_Relation saturates();

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;


  bool implies(const Poly_Con_Relation& y) const;


  bool OK() const;
};

# 1 "Poly_Con_Relation_inlines.hh" 1
# 27 "Poly_Con_Relation_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Poly_Con_Relation::Poly_Con_Relation(flags_t mask)
  : flags(mask) {
}

inline Poly_Con_Relation::flags_t
Poly_Con_Relation::get_flags() const {
  return flags;
}

inline Poly_Con_Relation
Poly_Con_Relation::nothing() {
  return Poly_Con_Relation(NOTHING);
}

inline Poly_Con_Relation
Poly_Con_Relation::is_disjoint() {
  return Poly_Con_Relation(IS_DISJOINT);
}

inline Poly_Con_Relation
Poly_Con_Relation::strictly_intersects() {
  return Poly_Con_Relation(STRICTLY_INTERSECTS);
}

inline Poly_Con_Relation
Poly_Con_Relation::is_included() {
  return Poly_Con_Relation(IS_INCLUDED);
}

inline Poly_Con_Relation
Poly_Con_Relation::saturates() {
  return Poly_Con_Relation(SATURATES);
}

inline bool
Poly_Con_Relation::implies(flags_t x, flags_t y) {
  return (x & y) == y;
}

inline bool
Poly_Con_Relation::implies(const Poly_Con_Relation& y) const {
  return implies(flags, y.flags);
}


inline bool
operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
  return x.flags == y.flags;
}


inline bool
operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
  return x.flags != y.flags;
}


inline Poly_Con_Relation
operator&&(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
  return Poly_Con_Relation(x.flags | y.flags);
}


inline Poly_Con_Relation
operator-(const Poly_Con_Relation& x, const Poly_Con_Relation& y) {
  return Poly_Con_Relation(x.flags & ~y.flags);
}

}
# 165 "Poly_Con_Relation_defs.hh" 2
# 34 "Generator_System_defs.hh" 2



namespace Parma_Polyhedra_Library {

namespace IO_Operators {







std::ostream& operator<<(std::ostream& s, const Generator_System& gs);

}






bool operator==(const Generator_System& x, const Generator_System& y);






bool operator!=(const Generator_System& x, const Generator_System& y);


void
swap(Generator_System& x, Generator_System& y);

}
# 187 "Generator_System_defs.hh"
class Parma_Polyhedra_Library::Generator_System {
public:
  typedef Generator row_type;

  static const Representation default_representation = SPARSE;


  Generator_System(Representation r = default_representation);


  explicit Generator_System(const Generator& g,
                            Representation r = default_representation);



  Generator_System(const Generator_System& gs);


  Generator_System(const Generator_System& gs, Representation r);


  ~Generator_System();


  Generator_System& operator=(const Generator_System& y);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;


  void set_space_dimension(dimension_type space_dim);





  void clear();





  void insert(const Generator& g);





  void insert(Generator& g, Recycle_Input);


  static void initialize();


  static void finalize();




  static const Generator_System& zero_dim_univ();

  typedef Generator_System_const_iterator const_iterator;


  bool empty() const;






  const_iterator begin() const;


  const_iterator end() const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;
# 286 "Generator_System_defs.hh"
  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  void m_swap(Generator_System& y);

private:

  bool has_no_rows() const;







  void remove_space_dimensions(const Variables_Set& vars);



  void shift_space_dimensions(Variable v, dimension_type n);
# 325 "Generator_System_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);


  void swap_space_dimensions(Variable v1, Variable v2);

  dimension_type num_rows() const;
# 345 "Generator_System_defs.hh"
  void add_universe_rows_and_space_dimensions(dimension_type n);

  Topology topology() const;


  dimension_type first_pending_row() const;


  void unset_pending_rows();


  void set_sorted(bool b);


  bool is_sorted() const;


  void set_index_first_pending_row(dimension_type i);





  bool is_necessarily_closed() const;


  void assign_with_pending(const Generator_System& y);


  dimension_type num_pending_rows() const;





  void sort_pending_and_remove_duplicates();
# 389 "Generator_System_defs.hh"
  void sort_and_remove_with_sat(Bit_Matrix& sat);





  void sort_rows();





  bool check_sorted() const;





  dimension_type num_lines_or_equalities() const;
# 417 "Generator_System_defs.hh"
  void remove_row(dimension_type i, bool keep_sorted = false);
# 427 "Generator_System_defs.hh"
  void remove_rows(dimension_type first, dimension_type last,
                   bool keep_sorted = false);







  void remove_rows(const std::vector<dimension_type>& indexes);


  void remove_trailing_rows(dimension_type n);
# 453 "Generator_System_defs.hh"
  dimension_type gauss(dimension_type n_lines_or_equalities);
# 465 "Generator_System_defs.hh"
  void back_substitute(dimension_type n_lines_or_equalities);


  void strong_normalize();
# 478 "Generator_System_defs.hh"
  void merge_rows_assign(const Generator_System& y);





  void insert(const Generator_System& y);


  void insert_pending(const Generator_System& r);





  static const Generator_System* zero_dim_univ_p;

  friend class Generator_System_const_iterator;


  explicit Generator_System(Topology topol,
                            Representation r = default_representation);






  Generator_System(Topology topol, dimension_type space_dim,
                   Representation r = default_representation);
# 516 "Generator_System_defs.hh"
  bool adjust_topology_and_space_dimension(Topology new_topology,
                                           dimension_type new_space_dim);
# 526 "Generator_System_defs.hh"
  void add_corresponding_points();





  bool has_points() const;
# 541 "Generator_System_defs.hh"
  void add_corresponding_closure_points();
# 553 "Generator_System_defs.hh"
  bool has_closure_points() const;



  void convert_into_non_necessarily_closed();


  const Generator& operator[](dimension_type k) const;





  Parma_Polyhedra_Library::Poly_Con_Relation
  relation_with(const Constraint& c) const;


  bool satisfied_by_all_generators(const Constraint& c) const;





  bool satisfied_by_all_generators_C(const Constraint& c) const;





  bool satisfied_by_all_generators_NNC(const Constraint& c) const;
# 611 "Generator_System_defs.hh"
  void affine_image(Variable v,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator);


  dimension_type num_lines() const;


  dimension_type num_rays() const;






  void remove_invalid_lines_and_rays();







  void simplify();






  void insert_pending(const Generator& g);






  void insert_pending(Generator& g, Recycle_Input);

  Linear_System<Generator> sys;

  friend bool
  operator==(const Generator_System& x, const Generator_System& y);

  friend class Polyhedron;
};
# 679 "Generator_System_defs.hh"
class Parma_Polyhedra_Library::Generator_System_const_iterator
  : public std::iterator<std::forward_iterator_tag,
        Generator,
        ptrdiff_t,
        const Generator*,
        const Generator&> {
public:

  Generator_System_const_iterator();


  Generator_System_const_iterator(const Generator_System_const_iterator& y);


  ~Generator_System_const_iterator();


  Generator_System_const_iterator& operator=(const Generator_System_const_iterator& y);


  const Generator& operator*() const;


  const Generator* operator->() const;


  Generator_System_const_iterator& operator++();


  Generator_System_const_iterator operator++(int);





  bool operator==(const Generator_System_const_iterator& y) const;





  bool operator!=(const Generator_System_const_iterator& y) const;

private:
  friend class Generator_System;


  Linear_System<Generator>::const_iterator i;


  const Linear_System<Generator>* gsp;


  Generator_System_const_iterator(const Linear_System<Generator>::const_iterator& iter,
      const Generator_System& gsys);





  void skip_forward();
};
# 31 "Box_templates.hh" 2
# 1 "Generator_System_inlines.hh" 1
# 29 "Generator_System_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Generator_System::Generator_System(Representation r)
  : sys(NECESSARILY_CLOSED, r) {
}

inline
Generator_System::Generator_System(const Generator& g, Representation r)
  : sys(g.topology(), r) {
  sys.insert(g);
}

inline
Generator_System::Generator_System(const Generator_System& gs)
  : sys(gs.sys) {
}

inline
Generator_System::Generator_System(const Generator_System& gs,
                                   Representation r)
  : sys(gs.sys, r) {
}

inline
Generator_System::Generator_System(const Topology topol, Representation r)
  : sys(topol, r) {
}

inline
Generator_System::Generator_System(const Topology topol,
                                   const dimension_type space_dim,
                                   Representation r)
  : sys(topol, space_dim, r) {
}

inline
Generator_System::~Generator_System() {
}

inline Generator_System&
Generator_System::operator=(const Generator_System& y) {
  Generator_System tmp = y;
  swap(*this, tmp);
  return *this;
}

inline Representation
Generator_System::representation() const {
  return sys.representation();
}

inline void
Generator_System::set_representation(Representation r) {
  sys.set_representation(r);
}

inline dimension_type
Generator_System::max_space_dimension() {
  return Linear_System<Generator>::max_space_dimension();
}

inline dimension_type
Generator_System::space_dimension() const {
  return sys.space_dimension();
}

inline void
Generator_System::set_space_dimension(dimension_type space_dim) {
  const dimension_type old_space_dim = space_dimension();
  sys.set_space_dimension_no_ok(space_dim);

  if (space_dim < old_space_dim)

    remove_invalid_lines_and_rays();





  ((void) 0);
  ((void) 0);
}

inline void
Generator_System::clear() {
  sys.clear();
}

inline const Generator&
Generator_System::operator[](const dimension_type k) const {
  return sys[k];
}

inline void
Generator_System
::remove_space_dimensions(const Variables_Set& vars) {
  sys.remove_space_dimensions(vars);
}

inline void
Generator_System
::shift_space_dimensions(Variable v, dimension_type n) {
  sys.shift_space_dimensions(v, n);
}

inline void
Generator_System
::permute_space_dimensions(const std::vector<Variable>& cycle) {
  sys.permute_space_dimensions(cycle);
}

inline void
Generator_System
::swap_space_dimensions(Variable v1, Variable v2) {
  sys.swap_space_dimensions(v1, v2);
}

inline dimension_type
Generator_System::num_rows() const {
  return sys.num_rows();
}

inline void
Generator_System::add_universe_rows_and_space_dimensions(dimension_type n) {
  sys.add_universe_rows_and_space_dimensions(n);
}

inline Topology
Generator_System::topology() const {
  return sys.topology();
}

inline dimension_type
Generator_System::first_pending_row() const {
  return sys.first_pending_row();
}

inline void
Generator_System::unset_pending_rows() {
  sys.unset_pending_rows();
}

inline void
Generator_System::set_sorted(bool b) {
  sys.set_sorted(b);
}

inline bool
Generator_System::is_sorted() const {
  return sys.is_sorted();
}

inline void
Generator_System::set_index_first_pending_row(dimension_type i) {
  sys.set_index_first_pending_row(i);
}

inline bool
Generator_System::is_necessarily_closed() const {
  return sys.is_necessarily_closed();
}

inline void
Generator_System::assign_with_pending(const Generator_System& y) {
  sys.assign_with_pending(y.sys);
}

inline dimension_type
Generator_System::num_pending_rows() const {
  return sys.num_pending_rows();
}

inline void
Generator_System::sort_pending_and_remove_duplicates() {
  return sys.sort_pending_and_remove_duplicates();
}

inline void
Generator_System::sort_and_remove_with_sat(Bit_Matrix& sat) {
  sys.sort_and_remove_with_sat(sat);
}

inline void
Generator_System::sort_rows() {
  sys.sort_rows();
}

inline bool
Generator_System::check_sorted() const {
  return sys.check_sorted();
}

inline dimension_type
Generator_System::num_lines_or_equalities() const {
  return sys.num_lines_or_equalities();
}

inline void
Generator_System::remove_row(dimension_type i, bool keep_sorted) {
  sys.remove_row(i, keep_sorted);
}

inline void
Generator_System::remove_rows(dimension_type first, dimension_type last,
                              bool keep_sorted) {
  sys.remove_rows(first, last, keep_sorted);
}

inline void
Generator_System::remove_rows(const std::vector<dimension_type>& indexes) {
  sys.remove_rows(indexes);
}

inline void
Generator_System::remove_trailing_rows(dimension_type n) {
  sys.remove_trailing_rows(n);
}

inline dimension_type
Generator_System::gauss(dimension_type n_lines_or_equalities) {
  return sys.gauss(n_lines_or_equalities);
}

inline void
Generator_System::back_substitute(dimension_type n_lines_or_equalities) {
  sys.back_substitute(n_lines_or_equalities);
}

inline void
Generator_System::strong_normalize() {
  sys.strong_normalize();
}

inline void
Generator_System::merge_rows_assign(const Generator_System& y) {
  sys.merge_rows_assign(y.sys);
}

inline void
Generator_System::insert(const Generator_System& y) {
  sys.insert(y.sys);
}

inline void
Generator_System::insert_pending(const Generator_System& r) {
  sys.insert_pending(r.sys);
}

inline bool
operator==(const Generator_System& x, const Generator_System& y) {
  return x.sys == y.sys;
}

inline bool
operator!=(const Generator_System& x, const Generator_System& y) {
  return !(x == y);
}

inline
Generator_System_const_iterator::Generator_System_const_iterator()
  : i(), gsp(0) {
}

inline
Generator_System_const_iterator::Generator_System_const_iterator(const Generator_System_const_iterator& y)
  : i(y.i), gsp(y.gsp) {
}

inline
Generator_System_const_iterator::~Generator_System_const_iterator() {
}

inline
Generator_System_const_iterator&
Generator_System_const_iterator::operator=(const Generator_System_const_iterator& y) {
  i = y.i;
  gsp = y.gsp;
  return *this;
}

inline const Generator&
Generator_System_const_iterator::operator*() const {
  return *i;
}

inline const Generator*
Generator_System_const_iterator::operator->() const {
  return i.operator->();
}

inline Generator_System_const_iterator&
Generator_System_const_iterator::operator++() {
  ++i;
  if (!gsp->is_necessarily_closed())
    skip_forward();
  return *this;
}

inline Generator_System_const_iterator
Generator_System_const_iterator::operator++(int) {
  const Generator_System_const_iterator tmp = *this;
  operator++();
  return tmp;
}

inline bool
Generator_System_const_iterator::operator==(const Generator_System_const_iterator& y) const {
  return i == y.i;
}

inline bool
Generator_System_const_iterator::operator!=(const Generator_System_const_iterator& y) const {
  return i != y.i;
}

inline
Generator_System_const_iterator::
Generator_System_const_iterator(const Linear_System<Generator>::const_iterator& iter,
                                const Generator_System& gs)
  : i(iter), gsp(&gs.sys) {
}

inline bool
Generator_System::empty() const {
  return sys.has_no_rows();
}

inline bool
Generator_System::has_no_rows() const {
  return sys.has_no_rows();
}

inline Generator_System::const_iterator
Generator_System::begin() const {
  const_iterator i(sys.begin(), *this);
  if (!sys.is_necessarily_closed())
    i.skip_forward();
  return i;
}

inline Generator_System::const_iterator
Generator_System::end() const {
  const const_iterator i(sys.end(), *this);
  return i;
}

inline const Generator_System&
Generator_System::zero_dim_univ() {
  ((void) 0);
  return *zero_dim_univ_p;
}

inline void
Generator_System::m_swap(Generator_System& y) {
  swap(sys, y.sys);
}

inline memory_size_type
Generator_System::external_memory_in_bytes() const {
  return sys.external_memory_in_bytes();
}

inline memory_size_type
Generator_System::total_memory_in_bytes() const {
  return external_memory_in_bytes() + sizeof(*this);
}

inline void
Generator_System::simplify() {
  sys.simplify();
  remove_invalid_lines_and_rays();
}


inline void
swap(Generator_System& x, Generator_System& y) {
  x.m_swap(y);
}

}
# 32 "Box_templates.hh" 2

# 1 "Poly_Gen_Relation_defs.hh" 1
# 31 "Poly_Gen_Relation_defs.hh"
namespace Parma_Polyhedra_Library {





bool operator==(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);



bool operator!=(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);



Poly_Gen_Relation operator&&(const Poly_Gen_Relation& x,
                             const Poly_Gen_Relation& y);







Poly_Gen_Relation operator-(const Poly_Gen_Relation& x,
                            const Poly_Gen_Relation& y);

namespace IO_Operators {



std::ostream& operator<<(std::ostream& s, const Poly_Gen_Relation& r);

}

}







class Parma_Polyhedra_Library::Poly_Gen_Relation {
private:

  typedef unsigned int flags_t;



  static const flags_t NOTHING = 0U;
  static const flags_t SUBSUMES = 1U << 0;



  static const flags_t EVERYTHING
  = SUBSUMES;


  flags_t flags;


  static bool implies(flags_t x, flags_t y);


  Poly_Gen_Relation(flags_t mask);

  friend bool
  operator==(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);
  friend bool
  operator!=(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);

  friend Poly_Gen_Relation
  operator&&(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);

  friend Poly_Gen_Relation
  operator-(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);

  friend std::ostream&
  Parma_Polyhedra_Library::
  IO_Operators::operator<<(std::ostream& s, const Poly_Gen_Relation& r);

public:






  flags_t get_flags() const;

public:

  static Poly_Gen_Relation nothing();


  static Poly_Gen_Relation subsumes();

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;


  bool implies(const Poly_Gen_Relation& y) const;


  bool OK() const;
};

# 1 "Poly_Gen_Relation_inlines.hh" 1
# 27 "Poly_Gen_Relation_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Poly_Gen_Relation::Poly_Gen_Relation(flags_t mask)
  : flags(mask) {
}

inline Poly_Gen_Relation::flags_t
Poly_Gen_Relation::get_flags() const {
  return flags;
}

inline Poly_Gen_Relation
Poly_Gen_Relation::nothing() {
  return Poly_Gen_Relation(NOTHING);
}

inline Poly_Gen_Relation
Poly_Gen_Relation::subsumes() {
  return Poly_Gen_Relation(SUBSUMES);
}

inline bool
Poly_Gen_Relation::implies(flags_t x, flags_t y) {
  return (x & y) == y;
}

inline bool
Poly_Gen_Relation::implies(const Poly_Gen_Relation& y) const {
  return implies(flags, y.flags);
}


inline bool
operator==(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) {
  return x.flags == y.flags;
}


inline bool
operator!=(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) {
  return x.flags != y.flags;
}


inline Poly_Gen_Relation
operator&&(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) {
  return Poly_Gen_Relation(x.flags | y.flags);
}


inline Poly_Gen_Relation
operator-(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y) {
  return Poly_Gen_Relation(x.flags & ~y.flags);
}

}
# 138 "Poly_Gen_Relation_defs.hh" 2
# 34 "Box_templates.hh" 2
# 1 "Polyhedron_defs.hh" 1
# 45 "Polyhedron_defs.hh"
# 1 "H79_Certificate_types.hh" 1
# 16 "H79_Certificate_types.hh"
namespace Parma_Polyhedra_Library {

class H79_Certificate;

}
# 46 "Polyhedron_defs.hh" 2
# 54 "Polyhedron_defs.hh"
namespace Parma_Polyhedra_Library {

namespace IO_Operators {
# 67 "Polyhedron_defs.hh"
std::ostream&
operator<<(std::ostream& s, const Polyhedron& ph);

}



void swap(Polyhedron& x, Polyhedron& y);
# 84 "Polyhedron_defs.hh"
bool operator==(const Polyhedron& x, const Polyhedron& y);
# 94 "Polyhedron_defs.hh"
bool operator!=(const Polyhedron& x, const Polyhedron& y);

namespace Interfaces {







bool is_necessarily_closed_for_interfaces(const Polyhedron& ph);

}

}
# 369 "Polyhedron_defs.hh"
class Parma_Polyhedra_Library::Polyhedron {
public:

  typedef Coefficient coefficient_type;


  static dimension_type max_space_dimension();





  static bool can_recycle_constraint_systems();


  static void initialize();


  static void finalize();




  static bool can_recycle_congruence_systems();

protected:
# 406 "Polyhedron_defs.hh"
  Polyhedron(Topology topol,
             dimension_type num_dimensions,
             Degenerate_Element kind);





  Polyhedron(const Polyhedron& y,
             Complexity_Class complexity = ANY_COMPLEXITY);
# 430 "Polyhedron_defs.hh"
  Polyhedron(Topology topol, const Constraint_System& cs);
# 451 "Polyhedron_defs.hh"
  Polyhedron(Topology topol, Constraint_System& cs, Recycle_Input dummy);
# 467 "Polyhedron_defs.hh"
  Polyhedron(Topology topol, const Generator_System& gs);
# 489 "Polyhedron_defs.hh"
  Polyhedron(Topology topol, Generator_System& gs, Recycle_Input dummy);
# 505 "Polyhedron_defs.hh"
  template <typename Interval>
  Polyhedron(Topology topol, const Box<Interval>& box,
             Complexity_Class complexity = ANY_COMPLEXITY);





  Polyhedron& operator=(const Polyhedron& y);

public:




  dimension_type space_dimension() const;






  dimension_type affine_dimension() const;


  const Constraint_System& constraints() const;


  const Constraint_System& minimized_constraints() const;


  const Generator_System& generators() const;


  const Generator_System& minimized_generators() const;


  Congruence_System congruences() const;






  Congruence_System minimized_congruences() const;
# 558 "Polyhedron_defs.hh"
  Poly_Con_Relation relation_with(const Constraint& c) const;
# 567 "Polyhedron_defs.hh"
  Poly_Gen_Relation relation_with(const Generator& g) const;
# 576 "Polyhedron_defs.hh"
  Poly_Con_Relation relation_with(const Congruence& cg) const;





  bool is_empty() const;





  bool is_universe() const;





  bool is_topologically_closed() const;







  bool is_disjoint_from(const Polyhedron& y) const;


  bool is_discrete() const;





  bool is_bounded() const;





  bool contains_integer_point() const;
# 626 "Polyhedron_defs.hh"
  bool constrains(Variable var) const;
# 635 "Polyhedron_defs.hh"
  bool bounds_from_above(const Linear_Expression& expr) const;
# 644 "Polyhedron_defs.hh"
  bool bounds_from_below(const Linear_Expression& expr) const;
# 670 "Polyhedron_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum) const;
# 701 "Polyhedron_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                Generator& g) const;
# 729 "Polyhedron_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum) const;
# 760 "Polyhedron_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                Generator& g) const;
# 792 "Polyhedron_defs.hh"
  bool frequency(const Linear_Expression& expr,
                 Coefficient& freq_n, Coefficient& freq_d,
                 Coefficient& val_n, Coefficient& val_d) const;







  bool contains(const Polyhedron& y) const;







  bool strictly_contains(const Polyhedron& y) const;
# 829 "Polyhedron_defs.hh"
  bool OK(bool check_not_empty = false) const;
# 848 "Polyhedron_defs.hh"
  void add_constraint(const Constraint& c);
# 859 "Polyhedron_defs.hh"
  void add_generator(const Generator& g);
# 870 "Polyhedron_defs.hh"
  void add_congruence(const Congruence& cg);
# 884 "Polyhedron_defs.hh"
  void add_constraints(const Constraint_System& cs);
# 902 "Polyhedron_defs.hh"
  void add_recycled_constraints(Constraint_System& cs);
# 917 "Polyhedron_defs.hh"
  void add_generators(const Generator_System& gs);
# 936 "Polyhedron_defs.hh"
  void add_recycled_generators(Generator_System& gs);
# 950 "Polyhedron_defs.hh"
  void add_congruences(const Congruence_System& cgs);
# 968 "Polyhedron_defs.hh"
  void add_recycled_congruences(Congruence_System& cgs);







  void refine_with_constraint(const Constraint& c);







  void refine_with_congruence(const Congruence& cg);
# 996 "Polyhedron_defs.hh"
  void refine_with_constraints(const Constraint_System& cs);
# 1008 "Polyhedron_defs.hh"
  void refine_with_congruences(const Congruence_System& cgs);
# 1035 "Polyhedron_defs.hh"
  template <typename FP_Format, typename Interval_Info>
  void refine_with_linear_form_inequality(
  const Linear_Form< Interval<FP_Format, Interval_Info> >& left,
  const Linear_Form< Interval<FP_Format, Interval_Info> >& right,
  bool is_strict = false);
# 1069 "Polyhedron_defs.hh"
  template <typename FP_Format, typename Interval_Info>
  void generalized_refine_with_linear_form_inequality(
  const Linear_Form< Interval<FP_Format, Interval_Info> >& left,
  const Linear_Form< Interval<FP_Format, Interval_Info> >& right,
  Relation_Symbol relsym);






  template <typename FP_Format, typename Interval_Info>
  void refine_fp_interval_abstract_store(
       Box< Interval<FP_Format, Interval_Info> >& store)
       const;
# 1095 "Polyhedron_defs.hh"
  void unconstrain(Variable var);
# 1109 "Polyhedron_defs.hh"
  void unconstrain(const Variables_Set& vars);
# 1118 "Polyhedron_defs.hh"
  void intersection_assign(const Polyhedron& y);
# 1127 "Polyhedron_defs.hh"
  void poly_hull_assign(const Polyhedron& y);


  void upper_bound_assign(const Polyhedron& y);
# 1141 "Polyhedron_defs.hh"
  void poly_difference_assign(const Polyhedron& y);


  void difference_assign(const Polyhedron& y);
# 1155 "Polyhedron_defs.hh"
  bool simplify_using_context_assign(const Polyhedron& y);
# 1246 "Polyhedron_defs.hh"
  void affine_image(Variable var,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator
                      = Coefficient_one());
# 1273 "Polyhedron_defs.hh"
  template <typename FP_Format, typename Interval_Info>
  void affine_form_image(Variable var,
  const Linear_Form<Interval <FP_Format, Interval_Info> >& lf);
# 1364 "Polyhedron_defs.hh"
  void affine_preimage(Variable var,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator
                         = Coefficient_one());
# 1395 "Polyhedron_defs.hh"
  void generalized_affine_image(Variable var,
                                Relation_Symbol relsym,
                                const Linear_Expression& expr,
                                Coefficient_traits::const_reference denominator
                                = Coefficient_one());
# 1427 "Polyhedron_defs.hh"
  void
  generalized_affine_preimage(Variable var,
                              Relation_Symbol relsym,
                              const Linear_Expression& expr,
                              Coefficient_traits::const_reference denominator
                              = Coefficient_one());
# 1454 "Polyhedron_defs.hh"
  void generalized_affine_image(const Linear_Expression& lhs,
                                Relation_Symbol relsym,
                                const Linear_Expression& rhs);
# 1478 "Polyhedron_defs.hh"
  void generalized_affine_preimage(const Linear_Expression& lhs,
                                   Relation_Symbol relsym,
                                   const Linear_Expression& rhs);
# 1508 "Polyhedron_defs.hh"
  void bounded_affine_image(Variable var,
                            const Linear_Expression& lb_expr,
                            const Linear_Expression& ub_expr,
                            Coefficient_traits::const_reference denominator
                            = Coefficient_one());
# 1540 "Polyhedron_defs.hh"
  void bounded_affine_preimage(Variable var,
                               const Linear_Expression& lb_expr,
                               const Linear_Expression& ub_expr,
                               Coefficient_traits::const_reference denominator
                               = Coefficient_one());
# 1554 "Polyhedron_defs.hh"
  void time_elapse_assign(const Polyhedron& y);
# 1602 "Polyhedron_defs.hh"
  void wrap_assign(const Variables_Set& vars,
                   Bounded_Integer_Type_Width w,
                   Bounded_Integer_Type_Representation r,
                   Bounded_Integer_Type_Overflow o,
                   const Constraint_System* cs_p = 0,
                   unsigned complexity_threshold = 16,
                   bool wrap_individually = true);
# 1621 "Polyhedron_defs.hh"
  void drop_some_non_integer_points(Complexity_Class complexity
                                    = ANY_COMPLEXITY);
# 1639 "Polyhedron_defs.hh"
  void drop_some_non_integer_points(const Variables_Set& vars,
                                    Complexity_Class complexity
                                    = ANY_COMPLEXITY);


  void topological_closure_assign();
# 1662 "Polyhedron_defs.hh"
  void BHRZ03_widening_assign(const Polyhedron& y, unsigned* tp = 0);
# 1685 "Polyhedron_defs.hh"
  void limited_BHRZ03_extrapolation_assign(const Polyhedron& y,
                                           const Constraint_System& cs,
                                           unsigned* tp = 0);
# 1710 "Polyhedron_defs.hh"
  void bounded_BHRZ03_extrapolation_assign(const Polyhedron& y,
                                           const Constraint_System& cs,
                                           unsigned* tp = 0);
# 1730 "Polyhedron_defs.hh"
  void H79_widening_assign(const Polyhedron& y, unsigned* tp = 0);


  void widening_assign(const Polyhedron& y, unsigned* tp = 0);
# 1756 "Polyhedron_defs.hh"
  void limited_H79_extrapolation_assign(const Polyhedron& y,
                                        const Constraint_System& cs,
                                        unsigned* tp = 0);
# 1781 "Polyhedron_defs.hh"
  void bounded_H79_extrapolation_assign(const Polyhedron& y,
                                        const Constraint_System& cs,
                                        unsigned* tp = 0);
# 1815 "Polyhedron_defs.hh"
  void add_space_dimensions_and_embed(dimension_type m);
# 1842 "Polyhedron_defs.hh"
  void add_space_dimensions_and_project(dimension_type m);
# 1855 "Polyhedron_defs.hh"
  void concatenate_assign(const Polyhedron& y);
# 1867 "Polyhedron_defs.hh"
  void remove_space_dimensions(const Variables_Set& vars);
# 1877 "Polyhedron_defs.hh"
  void remove_higher_space_dimensions(dimension_type new_dimension);
# 1919 "Polyhedron_defs.hh"
  template <typename Partial_Function>
  void map_space_dimensions(const Partial_Function& pfunc);
# 1943 "Polyhedron_defs.hh"
  void expand_space_dimension(Variable var, dimension_type m);
# 1968 "Polyhedron_defs.hh"
  void fold_space_dimensions(const Variables_Set& vars, Variable dest);



  friend bool operator==(const Polyhedron& x, const Polyhedron& y);





  ~Polyhedron();
# 1987 "Polyhedron_defs.hh"
  void m_swap(Polyhedron& y);

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  int32_t hash_code() const;



private:
  static const Representation default_con_sys_repr = DENSE;
  static const Representation default_gen_sys_repr = DENSE;


  Constraint_System con_sys;


  Generator_System gen_sys;


  Bit_Matrix sat_c;


  Bit_Matrix sat_g;


# 1 "Ph_Status_idefs.hh" 1
# 86 "Ph_Status_idefs.hh"
class Status {
public:

  Status();



  bool test_zero_dim_univ() const;
  void reset_zero_dim_univ();
  void set_zero_dim_univ();

  bool test_empty() const;
  void reset_empty();
  void set_empty();

  bool test_c_up_to_date() const;
  void reset_c_up_to_date();
  void set_c_up_to_date();

  bool test_g_up_to_date() const;
  void reset_g_up_to_date();
  void set_g_up_to_date();

  bool test_c_minimized() const;
  void reset_c_minimized();
  void set_c_minimized();

  bool test_g_minimized() const;
  void reset_g_minimized();
  void set_g_minimized();

  bool test_sat_c_up_to_date() const;
  void reset_sat_c_up_to_date();
  void set_sat_c_up_to_date();

  bool test_sat_g_up_to_date() const;
  void reset_sat_g_up_to_date();
  void set_sat_g_up_to_date();

  bool test_c_pending() const;
  void reset_c_pending();
  void set_c_pending();

  bool test_g_pending() const;
  void reset_g_pending();
  void set_g_pending();



  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);

private:

  typedef unsigned int flags_t;



  static const flags_t ZERO_DIM_UNIV = 0U;
  static const flags_t EMPTY = 1U << 0;
  static const flags_t C_UP_TO_DATE = 1U << 1;
  static const flags_t G_UP_TO_DATE = 1U << 2;
  static const flags_t C_MINIMIZED = 1U << 3;
  static const flags_t G_MINIMIZED = 1U << 4;
  static const flags_t SAT_C_UP_TO_DATE = 1U << 5;
  static const flags_t SAT_G_UP_TO_DATE = 1U << 6;
  static const flags_t CS_PENDING = 1U << 7;
  static const flags_t GS_PENDING = 1U << 8;



  flags_t flags;


  Status(flags_t mask);


  bool test_all(flags_t mask) const;


  bool test_any(flags_t mask) const;


  void set(flags_t mask);


  void reset(flags_t mask);
};
# 2032 "Polyhedron_defs.hh" 2



  Status status;


  dimension_type space_dim;


  Topology topology() const;





  bool is_necessarily_closed() const;

  friend bool
  Parma_Polyhedra_Library::Interfaces
  ::is_necessarily_closed_for_interfaces(const Polyhedron&);
# 2060 "Polyhedron_defs.hh"
  void refine_no_check(const Constraint& c);
# 2070 "Polyhedron_defs.hh"
  bool marked_empty() const;


  bool constraints_are_up_to_date() const;


  bool generators_are_up_to_date() const;






  bool constraints_are_minimized() const;






  bool generators_are_minimized() const;


  bool has_pending_constraints() const;


  bool has_pending_generators() const;





  bool has_something_pending() const;


  bool can_have_something_pending() const;





  bool sat_c_is_up_to_date() const;





  bool sat_g_is_up_to_date() const;
# 2128 "Polyhedron_defs.hh"
  void set_zero_dim_univ();





  void set_empty();


  void set_constraints_up_to_date();


  void set_generators_up_to_date();


  void set_constraints_minimized();


  void set_generators_minimized();


  void set_constraints_pending();


  void set_generators_pending();


  void set_sat_c_up_to_date();


  void set_sat_g_up_to_date();







  void clear_empty();






  void clear_constraints_up_to_date();






  void clear_generators_up_to_date();


  void clear_constraints_minimized();


  void clear_generators_minimized();


  void clear_pending_constraints();


  void clear_pending_generators();


  void clear_sat_c_up_to_date();


  void clear_sat_g_up_to_date();
# 2216 "Polyhedron_defs.hh"
  bool process_pending() const;
# 2226 "Polyhedron_defs.hh"
  bool process_pending_constraints() const;





  void process_pending_generators() const;
# 2241 "Polyhedron_defs.hh"
  void remove_pending_to_obtain_constraints() const;
# 2254 "Polyhedron_defs.hh"
  bool remove_pending_to_obtain_generators() const;
# 2267 "Polyhedron_defs.hh"
  void update_constraints() const;
# 2281 "Polyhedron_defs.hh"
  bool update_generators() const;
# 2298 "Polyhedron_defs.hh"
  void update_sat_c() const;
# 2315 "Polyhedron_defs.hh"
  void update_sat_g() const;
# 2327 "Polyhedron_defs.hh"
  void obtain_sorted_constraints() const;
# 2339 "Polyhedron_defs.hh"
  void obtain_sorted_generators() const;
# 2349 "Polyhedron_defs.hh"
  void obtain_sorted_constraints_with_sat_c() const;
# 2359 "Polyhedron_defs.hh"
  void obtain_sorted_generators_with_sat_g() const;
# 2375 "Polyhedron_defs.hh"
  bool minimize() const;







  bool strongly_minimize_constraints() const;







  bool strongly_minimize_generators() const;


  Constraint_System simplified_constraints() const;



  enum Three_Valued_Boolean {
    TVB_TRUE,
    TVB_FALSE,
    TVB_DONT_KNOW
  };


  Three_Valued_Boolean quick_equivalence_test(const Polyhedron& y) const;


  bool is_included_in(const Polyhedron& y) const;
# 2427 "Polyhedron_defs.hh"
  bool bounds(const Linear_Expression& expr, bool from_above) const;
# 2460 "Polyhedron_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included,
               Generator& g) const;
# 2472 "Polyhedron_defs.hh"
  void select_CH78_constraints(const Polyhedron& y,
                               Constraint_System& cs_selection) const;






  void select_H79_constraints(const Polyhedron& y,
                              Constraint_System& cs_selected,
                              Constraint_System& cs_not_selected) const;

  bool BHRZ03_combining_constraints(const Polyhedron& y,
                                    const BHRZ03_Certificate& y_cert,
                                    const Polyhedron& H79,
                                    const Constraint_System& x_minus_H79_cs);

  bool BHRZ03_evolving_points(const Polyhedron& y,
                              const BHRZ03_Certificate& y_cert,
                              const Polyhedron& H79);

  bool BHRZ03_evolving_rays(const Polyhedron& y,
                            const BHRZ03_Certificate& y_cert,
                            const Polyhedron& H79);

  static void modify_according_to_evolution(Linear_Expression& ray,
                                            const Linear_Expression& x,
                                            const Linear_Expression& y);
# 2531 "Polyhedron_defs.hh"
  template <typename Linear_System1, typename Linear_System2>
  static void add_space_dimensions(Linear_System1& sys1,
                                   Linear_System2& sys2,
                                   Bit_Matrix& sat1,
                                   Bit_Matrix& sat2,
                                   dimension_type add_dim);






  template <typename Source_Linear_System, typename Dest_Linear_System>
  static bool minimize(bool con_to_gen,
                       Source_Linear_System& source,
                       Dest_Linear_System& dest,
                       Bit_Matrix& sat);






  template <typename Source_Linear_System1, typename Source_Linear_System2,
            typename Dest_Linear_System>
  static bool add_and_minimize(bool con_to_gen,
                               Source_Linear_System1& source1,
                               Dest_Linear_System& dest,
                               Bit_Matrix& sat,
                               const Source_Linear_System2& source2);






  template <typename Source_Linear_System, typename Dest_Linear_System>
  static bool add_and_minimize(bool con_to_gen,
                               Source_Linear_System& source,
                               Dest_Linear_System& dest,
                               Bit_Matrix& sat);



  template <typename Source_Linear_System, typename Dest_Linear_System>
  static dimension_type conversion(Source_Linear_System& source,
                                   dimension_type start,
                                   Dest_Linear_System& dest,
                                   Bit_Matrix& sat,
                                   dimension_type num_lines_or_equalities);






  template <typename Linear_System1>
  static dimension_type simplify(Linear_System1& sys, Bit_Matrix& sat);
# 2599 "Polyhedron_defs.hh"
  static dimension_type* simplify_num_saturators_p;







  static size_t simplify_num_saturators_size;

  template <typename Interval> friend class Parma_Polyhedra_Library::Box;
  template <typename T> friend class Parma_Polyhedra_Library::BD_Shape;
  template <typename T> friend class Parma_Polyhedra_Library::Octagonal_Shape;
  friend class Parma_Polyhedra_Library::Grid;
  friend class Parma_Polyhedra_Library::BHRZ03_Certificate;
  friend class Parma_Polyhedra_Library::H79_Certificate;

protected:
# 2633 "Polyhedron_defs.hh"
  bool BFT00_poly_hull_assign_if_exact(const Polyhedron& y);

  bool BHZ09_poly_hull_assign_if_exact(const Polyhedron& y);
  bool BHZ09_C_poly_hull_assign_if_exact(const Polyhedron& y);
  bool BHZ09_NNC_poly_hull_assign_if_exact(const Polyhedron& y);





protected:
  void throw_invalid_argument(const char* method, const char* reason) const;

  void throw_topology_incompatible(const char* method,
                                   const char* ph_name,
                                   const Polyhedron& ph) const;
  void throw_topology_incompatible(const char* method,
                                   const char* c_name,
                                   const Constraint& c) const;
  void throw_topology_incompatible(const char* method,
                                   const char* g_name,
                                   const Generator& g) const;
  void throw_topology_incompatible(const char* method,
                                   const char* cs_name,
                                   const Constraint_System& cs) const;
  void throw_topology_incompatible(const char* method,
                                   const char* gs_name,
                                   const Generator_System& gs) const;

  void throw_dimension_incompatible(const char* method,
                                    const char* other_name,
                                    dimension_type other_dim) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* ph_name,
                                    const Polyhedron& ph) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* le_name,
                                    const Linear_Expression& le) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* c_name,
                                    const Constraint& c) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* g_name,
                                    const Generator& g) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* cg_name,
                                    const Congruence& cg) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* cs_name,
                                    const Constraint_System& cs) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* gs_name,
                                    const Generator_System& gs) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* cgs_name,
                                    const Congruence_System& cgs) const;
  template <typename C>
  void throw_dimension_incompatible(const char* method,
                                    const char* lf_name,
                                    const Linear_Form<C>& lf) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* var_name,
                                    Variable var) const;
  void throw_dimension_incompatible(const char* method,
                                    dimension_type required_space_dim) const;




  static dimension_type
  check_space_dimension_overflow(dimension_type dim, dimension_type max,
                                 const Topology topol,
                                 const char* method, const char* reason);

  static dimension_type
  check_space_dimension_overflow(dimension_type dim, const Topology topol,
                                 const char* method, const char* reason);

  template <typename Object>
  static Object&
  check_obj_space_dimension_overflow(Object& input, Topology topol,
                                     const char* method, const char* reason);

  void throw_invalid_generator(const char* method,
                               const char* g_name) const;

  void throw_invalid_generators(const char* method,
                                const char* gs_name) const;
# 2740 "Polyhedron_defs.hh"
  void drop_some_non_integer_points(const Variables_Set* vars_p,
                                    Complexity_Class complexity);
# 2761 "Polyhedron_defs.hh"
  template <typename FP_Format, typename Interval_Info>
  void overapproximate_linear_form(
  const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
  const dimension_type lf_dimension,
  Linear_Form<Interval <FP_Format, Interval_Info> >& result);
# 2786 "Polyhedron_defs.hh"
  template <typename FP_Format, typename Interval_Info>
  static void convert_to_integer_expression(
              const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
              const dimension_type lf_dimension,
              Linear_Expression& result);
# 2818 "Polyhedron_defs.hh"
  template <typename FP_Format, typename Interval_Info>
  static void
  convert_to_integer_expressions(const Linear_Form<Interval<FP_Format,
                                                            Interval_Info> >&
                                 lf,
                                 const dimension_type lf_dimension,
                                 Linear_Expression& res,
                                 Coefficient& res_low_coeff,
                                 Coefficient& res_hi_coeff,
                                 Coefficient& denominator);

  template <typename Linear_System1, typename Row2>
  static bool
  add_to_system_and_check_independence(Linear_System1& eq_sys,
                                       const Row2& eq);
};

# 1 "Ph_Status_inlines.hh" 1
# 27 "Ph_Status_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Polyhedron::Status::Status(flags_t mask)
  : flags(mask) {
}

inline
Polyhedron::Status::Status()
  : flags(ZERO_DIM_UNIV) {
}

inline bool
Polyhedron::Status::test_all(flags_t mask) const {
  return (flags & mask) == mask;
}

inline bool
Polyhedron::Status::test_any(flags_t mask) const {
  return (flags & mask) != 0;
}

inline void
Polyhedron::Status::set(flags_t mask) {
  flags |= mask;
}

inline void
Polyhedron::Status::reset(flags_t mask) {
  flags &= ~mask;
}

inline bool
Polyhedron::Status::test_zero_dim_univ() const {
  return flags == ZERO_DIM_UNIV;
}

inline void
Polyhedron::Status::reset_zero_dim_univ() {

  if (flags == ZERO_DIM_UNIV)

    flags = EMPTY;
}

inline void
Polyhedron::Status::set_zero_dim_univ() {

  flags = ZERO_DIM_UNIV;
}

inline bool
Polyhedron::Status::test_empty() const {
  return test_any(EMPTY);
}

inline void
Polyhedron::Status::reset_empty() {
  reset(EMPTY);
}

inline void
Polyhedron::Status::set_empty() {
  flags = EMPTY;
}

inline bool
Polyhedron::Status::test_c_up_to_date() const {
  return test_any(C_UP_TO_DATE);
}

inline void
Polyhedron::Status::reset_c_up_to_date() {
  reset(C_UP_TO_DATE);
}

inline void
Polyhedron::Status::set_c_up_to_date() {
  set(C_UP_TO_DATE);
}

inline bool
Polyhedron::Status::test_g_up_to_date() const {
  return test_any(G_UP_TO_DATE);
}

inline void
Polyhedron::Status::reset_g_up_to_date() {
  reset(G_UP_TO_DATE);
}

inline void
Polyhedron::Status::set_g_up_to_date() {
  set(G_UP_TO_DATE);
}

inline bool
Polyhedron::Status::test_c_minimized() const {
  return test_any(C_MINIMIZED);
}

inline void
Polyhedron::Status::reset_c_minimized() {
  reset(C_MINIMIZED);
}

inline void
Polyhedron::Status::set_c_minimized() {
  set(C_MINIMIZED);
}

inline bool
Polyhedron::Status::test_g_minimized() const {
  return test_any(G_MINIMIZED);
}

inline void
Polyhedron::Status::reset_g_minimized() {
  reset(G_MINIMIZED);
}

inline void
Polyhedron::Status::set_g_minimized() {
  set(G_MINIMIZED);
}


inline bool
Polyhedron::Status::test_c_pending() const {
  return test_any(CS_PENDING);
}

inline void
Polyhedron::Status::reset_c_pending() {
  reset(CS_PENDING);
}

inline void
Polyhedron::Status::set_c_pending() {
  set(CS_PENDING);
}

inline bool
Polyhedron::Status::test_g_pending() const {
  return test_any(GS_PENDING);
}

inline void
Polyhedron::Status::reset_g_pending() {
  reset(GS_PENDING);
}

inline void
Polyhedron::Status::set_g_pending() {
  set(GS_PENDING);
}


inline bool
Polyhedron::Status::test_sat_c_up_to_date() const {
  return test_any(SAT_C_UP_TO_DATE);
}

inline void
Polyhedron::Status::reset_sat_c_up_to_date() {
  reset(SAT_C_UP_TO_DATE);
}

inline void
Polyhedron::Status::set_sat_c_up_to_date() {
  set(SAT_C_UP_TO_DATE);
}

inline bool
Polyhedron::Status::test_sat_g_up_to_date() const {
  return test_any(SAT_G_UP_TO_DATE);
}

inline void
Polyhedron::Status::reset_sat_g_up_to_date() {
  reset(SAT_G_UP_TO_DATE);
}

inline void
Polyhedron::Status::set_sat_g_up_to_date() {
  set(SAT_G_UP_TO_DATE);
}

}
# 2836 "Polyhedron_defs.hh" 2
# 1 "Polyhedron_inlines.hh" 1
# 32 "Polyhedron_inlines.hh"
namespace Parma_Polyhedra_Library {

inline memory_size_type
Polyhedron::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline dimension_type
Polyhedron::space_dimension() const {
  return space_dim;
}

inline int32_t
Polyhedron::hash_code() const {
  return hash_code_from_dimension(space_dimension());
}

inline dimension_type
Polyhedron::max_space_dimension() {
  using std::min;


  return min(std::numeric_limits<dimension_type>::max() - 1,
             min(Constraint_System::max_space_dimension(),
                 Generator_System::max_space_dimension()
                 )
             );
}

inline Topology
Polyhedron::topology() const {


  return con_sys.topology();
}

inline bool
Polyhedron::is_discrete() const {
  return affine_dimension() == 0;
}

inline bool
Polyhedron::is_necessarily_closed() const {


  return con_sys.is_necessarily_closed();
}

inline void
Polyhedron::upper_bound_assign(const Polyhedron& y) {
  poly_hull_assign(y);
}

inline void
Polyhedron::difference_assign(const Polyhedron& y) {
  poly_difference_assign(y);
}

inline void
Polyhedron::widening_assign(const Polyhedron& y, unsigned* tp) {
  H79_widening_assign(y, tp);
}

inline
Polyhedron::~Polyhedron() {
}

inline void
Polyhedron::m_swap(Polyhedron& y) {
  if (topology() != y.topology())
    throw_topology_incompatible("swap(y)", "y", y);
  using std::swap;
  swap(con_sys, y.con_sys);
  swap(gen_sys, y.gen_sys);
  swap(sat_c, y.sat_c);
  swap(sat_g, y.sat_g);
  swap(status, y.status);
  swap(space_dim, y.space_dim);
}


inline void
swap(Polyhedron& x, Polyhedron& y) {
  x.m_swap(y);
}

inline bool
Polyhedron::can_recycle_constraint_systems() {
  return true;
}

inline bool
Polyhedron::can_recycle_congruence_systems() {
  return false;
}

inline bool
Polyhedron::marked_empty() const {
  return status.test_empty();
}

inline bool
Polyhedron::constraints_are_up_to_date() const {
  return status.test_c_up_to_date();
}

inline bool
Polyhedron::generators_are_up_to_date() const {
  return status.test_g_up_to_date();
}

inline bool
Polyhedron::constraints_are_minimized() const {
  return status.test_c_minimized();
}

inline bool
Polyhedron::generators_are_minimized() const {
  return status.test_g_minimized();
}

inline bool
Polyhedron::sat_c_is_up_to_date() const {
  return status.test_sat_c_up_to_date();
}

inline bool
Polyhedron::sat_g_is_up_to_date() const {
  return status.test_sat_g_up_to_date();
}

inline bool
Polyhedron::has_pending_constraints() const {
  return status.test_c_pending();
}

inline bool
Polyhedron::has_pending_generators() const {
  return status.test_g_pending();
}

inline bool
Polyhedron::has_something_pending() const {
  return status.test_c_pending() || status.test_g_pending();
}

inline bool
Polyhedron::can_have_something_pending() const {
  return constraints_are_minimized()
    && generators_are_minimized()
    && (sat_c_is_up_to_date() || sat_g_is_up_to_date());
}

inline bool
Polyhedron::is_empty() const {
  if (marked_empty())
    return true;



  if (generators_are_up_to_date() && !has_pending_constraints())
    return false;
  return !minimize();
}

inline void
Polyhedron::set_constraints_up_to_date() {
  status.set_c_up_to_date();
}

inline void
Polyhedron::set_generators_up_to_date() {
  status.set_g_up_to_date();
}

inline void
Polyhedron::set_constraints_minimized() {
  set_constraints_up_to_date();
  status.set_c_minimized();
}

inline void
Polyhedron::set_generators_minimized() {
  set_generators_up_to_date();
  status.set_g_minimized();
}

inline void
Polyhedron::set_constraints_pending() {
  status.set_c_pending();
}

inline void
Polyhedron::set_generators_pending() {
  status.set_g_pending();
}

inline void
Polyhedron::set_sat_c_up_to_date() {
  status.set_sat_c_up_to_date();
}

inline void
Polyhedron::set_sat_g_up_to_date() {
  status.set_sat_g_up_to_date();
}

inline void
Polyhedron::clear_empty() {
  status.reset_empty();
}

inline void
Polyhedron::clear_constraints_minimized() {
  status.reset_c_minimized();
}

inline void
Polyhedron::clear_generators_minimized() {
  status.reset_g_minimized();
}

inline void
Polyhedron::clear_pending_constraints() {
  status.reset_c_pending();
}

inline void
Polyhedron::clear_pending_generators() {
  status.reset_g_pending();
}

inline void
Polyhedron::clear_sat_c_up_to_date() {
  status.reset_sat_c_up_to_date();

}

inline void
Polyhedron::clear_sat_g_up_to_date() {
  status.reset_sat_g_up_to_date();

}

inline void
Polyhedron::clear_constraints_up_to_date() {
  clear_pending_constraints();
  clear_constraints_minimized();
  clear_sat_c_up_to_date();
  clear_sat_g_up_to_date();
  status.reset_c_up_to_date();

}

inline void
Polyhedron::clear_generators_up_to_date() {
  clear_pending_generators();
  clear_generators_minimized();
  clear_sat_c_up_to_date();
  clear_sat_g_up_to_date();
  status.reset_g_up_to_date();

}

inline bool
Polyhedron::process_pending() const {
  ((void) 0);
  ((void) 0);

  if (has_pending_constraints())
    return process_pending_constraints();

  ((void) 0);
  process_pending_generators();
  return true;
}

inline bool
Polyhedron::bounds_from_above(const Linear_Expression& expr) const {
  return bounds(expr, true);
}

inline bool
Polyhedron::bounds_from_below(const Linear_Expression& expr) const {
  return bounds(expr, false);
}

inline bool
Polyhedron::maximize(const Linear_Expression& expr,
                     Coefficient& sup_n, Coefficient& sup_d,
                     bool& maximum) const {
  Generator g(point());
  return max_min(expr, true, sup_n, sup_d, maximum, g);
}

inline bool
Polyhedron::maximize(const Linear_Expression& expr,
                     Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                     Generator& g) const {
  return max_min(expr, true, sup_n, sup_d, maximum, g);
}

inline bool
Polyhedron::minimize(const Linear_Expression& expr,
                     Coefficient& inf_n, Coefficient& inf_d,
                     bool& minimum) const {
  Generator g(point());
  return max_min(expr, false, inf_n, inf_d, minimum, g);
}

inline bool
Polyhedron::minimize(const Linear_Expression& expr,
                     Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                     Generator& g) const {
  return max_min(expr, false, inf_n, inf_d, minimum, g);
}

inline Constraint_System
Polyhedron::simplified_constraints() const {
  ((void) 0);
  Constraint_System cs(con_sys);
  if (cs.num_pending_rows() > 0)
    cs.unset_pending_rows();
  if (has_pending_constraints() || !constraints_are_minimized())
    cs.simplify();
  return cs;
}

inline Congruence_System
Polyhedron::congruences() const {
  return Congruence_System(minimized_constraints());
}

inline Congruence_System
Polyhedron::minimized_congruences() const {
  return Congruence_System(minimized_constraints());
}

inline void
Polyhedron::add_recycled_congruences(Congruence_System& cgs) {
  add_congruences(cgs);
}

template <typename FP_Format, typename Interval_Info>
inline void
Polyhedron::generalized_refine_with_linear_form_inequality(
            const Linear_Form< Interval<FP_Format, Interval_Info> >& left,
            const Linear_Form< Interval<FP_Format, Interval_Info> >& right,
            const Relation_Symbol relsym) {
  switch (relsym) {
  case EQUAL:

    refine_with_linear_form_inequality(left, right, false);
    refine_with_linear_form_inequality(right, left, false);
    break;
  case LESS_THAN:
    refine_with_linear_form_inequality(left, right, true);
    break;
  case LESS_OR_EQUAL:
    refine_with_linear_form_inequality(left, right, false);
    break;
  case GREATER_THAN:
    refine_with_linear_form_inequality(right, left, true);
    break;
  case GREATER_OR_EQUAL:
    refine_with_linear_form_inequality(right, left, false);
    break;
  case NOT_EQUAL:
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
}

template <typename FP_Format, typename Interval_Info>
inline void
Polyhedron::
refine_fp_interval_abstract_store(
       Box< Interval<FP_Format, Interval_Info> >& store) const {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_416 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<FP_Format>::is_exact)>) };



  typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
  store.intersection_assign(Box<FP_Interval_Type>(*this));

}


inline bool
operator!=(const Polyhedron& x, const Polyhedron& y) {
  return !(x == y);
}

inline bool
Polyhedron::strictly_contains(const Polyhedron& y) const {
  const Polyhedron& x = *this;
  return x.contains(y) && !y.contains(x);
}

inline void
Polyhedron::drop_some_non_integer_points(Complexity_Class complexity) {
  const Variables_Set* const p_vs = 0;
  drop_some_non_integer_points(p_vs, complexity);
}

inline void
Polyhedron::drop_some_non_integer_points(const Variables_Set& vars,
                                         Complexity_Class complexity) {
  drop_some_non_integer_points(&vars, complexity);
}


namespace Interfaces {

inline bool
is_necessarily_closed_for_interfaces(const Polyhedron& ph) {
  return ph.is_necessarily_closed();
}

}

}
# 2837 "Polyhedron_defs.hh" 2
# 1 "Polyhedron_templates.hh" 1
# 28 "Polyhedron_templates.hh"
# 1 "MIP_Problem_defs.hh" 1
# 29 "MIP_Problem_defs.hh"
# 1 "Matrix_defs.hh" 1
# 27 "Matrix_defs.hh"
# 1 "Matrix_types.hh" 1
# 16 "Matrix_types.hh"
namespace Parma_Polyhedra_Library {

template <typename Row>
class Matrix;

}
# 28 "Matrix_defs.hh" 2
# 36 "Matrix_defs.hh"
template <typename Row>
class Parma_Polyhedra_Library::Matrix {

public:
  typedef typename Swapping_Vector<Row>::iterator iterator;
  typedef typename Swapping_Vector<Row>::const_iterator const_iterator;


  static dimension_type max_num_rows();


  static dimension_type max_num_columns();
# 58 "Matrix_defs.hh"
  explicit Matrix(dimension_type n = 0);
# 72 "Matrix_defs.hh"
  Matrix(dimension_type num_rows, dimension_type num_columns);
# 82 "Matrix_defs.hh"
  void m_swap(Matrix& x);





  dimension_type num_rows() const;





  dimension_type num_columns() const;



  dimension_type capacity() const;
# 109 "Matrix_defs.hh"
  bool has_no_rows() const;


  void resize(dimension_type n);



  void reserve_rows(dimension_type n);
# 146 "Matrix_defs.hh"
  void resize(dimension_type num_rows, dimension_type num_columns);
# 164 "Matrix_defs.hh"
  void add_zero_rows_and_columns(dimension_type n, dimension_type m);
# 178 "Matrix_defs.hh"
  void add_zero_rows(dimension_type n);
# 191 "Matrix_defs.hh"
  void add_row(const Row& x);
# 205 "Matrix_defs.hh"
  void add_recycled_row(Row& y);
# 219 "Matrix_defs.hh"
  void remove_trailing_rows(dimension_type n);

  void remove_rows(iterator first, iterator last);
# 253 "Matrix_defs.hh"
  void permute_columns(const std::vector<dimension_type>& cycles);


  void swap_columns(dimension_type i, dimension_type j);
# 269 "Matrix_defs.hh"
  void add_zero_columns(dimension_type n);
# 290 "Matrix_defs.hh"
  void add_zero_columns(dimension_type n, dimension_type i);
# 308 "Matrix_defs.hh"
  void remove_column(dimension_type i);
# 326 "Matrix_defs.hh"
  void remove_trailing_columns(dimension_type n);


  void clear();





  iterator begin();





  iterator end();





  const_iterator begin() const;





  const_iterator end() const;
# 362 "Matrix_defs.hh"
  Row& operator[](dimension_type i);
# 371 "Matrix_defs.hh"
  const Row& operator[](dimension_type i) const;
# 380 "Matrix_defs.hh"
  bool ascii_load(std::istream& s);

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  memory_size_type total_memory_in_bytes() const;






  memory_size_type external_memory_in_bytes() const;


  bool OK() const;

private:

  Swapping_Vector<Row> rows;


  dimension_type num_columns_;
};

namespace Parma_Polyhedra_Library {




template <typename Row>
void swap(Matrix<Row>& x, Matrix<Row>& y);





template <typename Row>
bool operator==(const Matrix<Row>& x, const Matrix<Row>& y);





template <typename Row>
bool operator!=(const Matrix<Row>& x, const Matrix<Row>& y);

}


# 1 "Matrix_inlines.hh" 1
# 27 "Matrix_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename Row>
inline dimension_type
Matrix<Row>::max_num_rows() {
  return std::vector<Row>().max_size();
}

template <typename Row>
inline dimension_type
Matrix<Row>::max_num_columns() {
  return Row::max_size();
}

template <typename Row>
inline void
Matrix<Row>::m_swap(Matrix& x) {
  using std::swap;
  swap(rows, x.rows);
  swap(num_columns_, x.num_columns_);
}

template <typename Row>
inline dimension_type
Matrix<Row>::num_rows() const {
  return rows.size();
}

template <typename Row>
inline dimension_type
Matrix<Row>::num_columns() const {
  return num_columns_;
}

template <typename Row>
inline dimension_type
Matrix<Row>::capacity() const {
  return rows.capacity();
}

template <typename Row>
inline bool
Matrix<Row>::has_no_rows() const {
  return num_rows() == 0;
}

template <typename Row>
inline void
Matrix<Row>::resize(dimension_type n) {
  resize(n, n);
}

template <typename Row>
inline void
Matrix<Row>::reserve_rows(dimension_type requested_capacity) {

  rows.reserve(requested_capacity);
}

template <typename Row>
inline void
Matrix<Row>::add_zero_rows_and_columns(dimension_type n, dimension_type m) {
  resize(num_rows() + n, num_columns() + m);
}

template <typename Row>
inline void
Matrix<Row>::add_zero_rows(dimension_type n) {
  resize(num_rows() + n, num_columns());
}

template <typename Row>
inline void
Matrix<Row>::add_row(const Row& x) {

  Row row(x);
  add_zero_rows(1);

  swap(rows.back(), row);
  ((void) 0);
}

template <typename Row>
inline void
Matrix<Row>::add_recycled_row(Row& x) {
  add_zero_rows(1);
  swap(rows.back(), x);
  ((void) 0);
}

template <typename Row>
inline void
Matrix<Row>::remove_trailing_rows(dimension_type n) {
  resize(num_rows() - n, num_columns());
}

template <typename Row>
inline void
Matrix<Row>::remove_rows(iterator first, iterator last) {
  rows.erase(first, last);
}

template <typename Row>
inline void
Matrix<Row>::add_zero_columns(dimension_type n) {
  resize(num_rows(), num_columns() + n);
}

template <typename Row>
inline void
Matrix<Row>::remove_trailing_columns(dimension_type n) {
  ((void) 0);
  resize(num_rows(), num_columns() - n);
}

template <typename Row>
inline void
Matrix<Row>::clear() {
  resize(0, 0);
}

template <typename Row>
inline typename Matrix<Row>::iterator
Matrix<Row>::begin() {
  return rows.begin();
}

template <typename Row>
inline typename Matrix<Row>::iterator
Matrix<Row>::end() {
  return rows.end();
}

template <typename Row>
inline typename Matrix<Row>::const_iterator
Matrix<Row>::begin() const {
  return rows.begin();
}

template <typename Row>
inline typename Matrix<Row>::const_iterator
Matrix<Row>::end() const {
  return rows.end();
}

template <typename Row>
inline Row&
Matrix<Row>::operator[](dimension_type i) {
  ((void) 0);
  return rows[i];
}

template <typename Row>
inline const Row&
Matrix<Row>::operator[](dimension_type i) const {
  ((void) 0);
  return rows[i];
}

template <typename Row>
inline memory_size_type
Matrix<Row>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename Row>
inline void
swap(Matrix<Row>& x, Matrix<Row>& y) {
  x.m_swap(y);
}

}
# 435 "Matrix_defs.hh" 2
# 1 "Matrix_templates.hh" 1
# 27 "Matrix_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename Row>
Matrix<Row>::Matrix(dimension_type n)
  : rows(n), num_columns_(n) {
  for (dimension_type i = 0; i < rows.size(); ++i)
    rows[i].resize(num_columns_);
  ((void) 0);
}

template <typename Row>
Matrix<Row>::Matrix(dimension_type num_rows, dimension_type num_columns)
  : rows(num_rows), num_columns_(num_columns) {
  for (dimension_type i = 0; i < rows.size(); ++i)
    rows[i].resize(num_columns_);
  ((void) 0);
}

template <typename Row>
void
Matrix<Row>::resize(dimension_type num_rows, dimension_type num_columns) {
  const dimension_type old_num_rows = rows.size();
  rows.resize(num_rows);
  if (old_num_rows < num_rows) {
    for (dimension_type i = old_num_rows; i < num_rows; ++i)
      rows[i].resize(num_columns);
    if (num_columns_ != num_columns) {
      num_columns_ = num_columns;
      for (dimension_type i = 0; i < old_num_rows; ++i)
        rows[i].resize(num_columns);
    }
  }
  else
    if (num_columns_ != num_columns) {
      num_columns_ = num_columns;
      for (dimension_type i = 0; i < num_rows; ++i)
        rows[i].resize(num_columns);
    }
  ((void) 0);
}

template <typename Row>
void
Matrix<Row>::permute_columns(const std::vector<dimension_type>& cycles) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_tmp; Parma_Polyhedra_Library::Coefficient& tmp = holder_tmp.item();
  const dimension_type n = cycles.size();
  ((void) 0);
  for (dimension_type k = num_rows(); k-- > 0; ) {
    Row& rows_k = (*this)[k];
    for (dimension_type i = 0, j = 0; i < n; i = ++j) {

      while (cycles[j] != 0)
        ++j;

      ((void) 0);
      if (j - i == 2)

        rows_k.swap_coefficients(cycles[i], cycles[i + 1]);
      else {

        tmp = rows_k.get(cycles[j - 1]);
        for (dimension_type l = (j - 1); l > i; --l)
          rows_k.swap_coefficients(cycles[l-1], cycles[l]);
        if (tmp == 0)
          rows_k.reset(cycles[i]);
        else {
          using std::swap;
          swap(tmp, rows_k[cycles[i]]);
        }
      }
    }
  }
}

template <typename Row>
void
Matrix<Row>::swap_columns(dimension_type i, dimension_type j) {
  for (dimension_type k = num_rows(); k-- > 0; )
    (*this)[k].swap_coefficients(i, j);
}

template <typename Row>
void
Matrix<Row>::add_zero_columns(dimension_type n, dimension_type i) {
  for (dimension_type j = rows.size(); j-- > 0; )
    rows[j].add_zeroes_and_shift(n, i);
  num_columns_ += n;
  ((void) 0);
}

template <typename Row>
void
Matrix<Row>::remove_column(dimension_type i) {
  for (dimension_type j = rows.size(); j-- > 0; )
    rows[j].delete_element_and_shift(i);
  --num_columns_;
  ((void) 0);
}

template <typename Row>
void
Matrix<Row>::ascii_dump(std::ostream& s) const {
  s << num_rows() << " x ";
  s << num_columns() << "\n";
  for (const_iterator i = begin(), i_end = end(); i !=i_end; ++i)
    i->ascii_dump(s);
}

template <typename Row> void Matrix<Row>::ascii_dump() const { ascii_dump(std::cerr); } template <typename Row> void Matrix<Row>::print() const { std::cerr << "No user level output operator defined " << "for " "Matrix<Row>" << "." << std::endl; }

template <typename Row>
bool
Matrix<Row>::ascii_load(std::istream& s) {
  std::string str;
  dimension_type new_num_rows;
  dimension_type new_num_cols;
  if (!(s >> new_num_rows))
    return false;
  if (!(s >> str) || str != "x")
    return false;
  if (!(s >> new_num_cols))
    return false;

  for (iterator i = rows.begin(), i_end = rows.end(); i != i_end; ++i)
    i->clear();

  resize(new_num_rows, new_num_cols);

  for (dimension_type row = 0; row < new_num_rows; ++row)
    if (!rows[row].ascii_load(s))
      return false;


  ((void) 0);
  return true;
}

template <typename Row>
memory_size_type
Matrix<Row>::external_memory_in_bytes() const {
  return rows.external_memory_in_bytes();
}

template <typename Row>
bool
Matrix<Row>::OK() const {
  for (const_iterator i = begin(), i_end = end(); i != i_end; ++i)
    if (i->size() != num_columns_)
      return false;
  return true;
}


template <typename Row>
bool
operator==(const Matrix<Row>& x, const Matrix<Row>& y) {
  if (x.num_rows() != y.num_rows())
    return false;
  if (x.num_columns() != y.num_columns())
    return false;
  for (dimension_type i = x.num_rows(); i-- > 0; )
    if (x[i] != y[i])
      return false;
  return true;
}


template <typename Row>
bool
operator!=(const Matrix<Row>& x, const Matrix<Row>& y) {
  return !(x == y);
}

}
# 436 "Matrix_defs.hh" 2
# 30 "MIP_Problem_defs.hh" 2
# 42 "MIP_Problem_defs.hh"
namespace Parma_Polyhedra_Library {

namespace IO_Operators {



std::ostream&
operator<<(std::ostream& s, const MIP_Problem& mip);

}



void swap(MIP_Problem& x, MIP_Problem& y);

}
# 87 "MIP_Problem_defs.hh"
class Parma_Polyhedra_Library::MIP_Problem {
public:
# 102 "MIP_Problem_defs.hh"
  explicit MIP_Problem(dimension_type dim = 0);
# 140 "MIP_Problem_defs.hh"
  template <typename In>
  MIP_Problem(dimension_type dim,
              In first, In last,
              const Variables_Set& int_vars,
              const Linear_Expression& obj = Linear_Expression::zero(),
              Optimization_Mode mode = MAXIMIZATION);
# 178 "MIP_Problem_defs.hh"
  template <typename In>
  MIP_Problem(dimension_type dim,
              In first, In last,
              const Linear_Expression& obj = Linear_Expression::zero(),
              Optimization_Mode mode = MAXIMIZATION);
# 209 "MIP_Problem_defs.hh"
  MIP_Problem(dimension_type dim,
              const Constraint_System& cs,
              const Linear_Expression& obj = Linear_Expression::zero(),
              Optimization_Mode mode = MAXIMIZATION);


  MIP_Problem(const MIP_Problem& y);


  ~MIP_Problem();


  MIP_Problem& operator=(const MIP_Problem& y);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;





  const Variables_Set& integer_space_dimensions() const;

private:

  typedef std::vector<Constraint*> Constraint_Sequence;

public:

  class const_iterator {
  private:
    typedef Constraint_Sequence::const_iterator Base;
    typedef std::iterator_traits<Base> Base_Traits;
  public:
    typedef Base_Traits::iterator_category iterator_category;
    typedef Base_Traits::difference_type difference_type;
    typedef const Constraint value_type;
    typedef const Constraint* pointer;
    typedef const Constraint& reference;


    difference_type operator-(const const_iterator& y) const;


    const_iterator& operator++();


    const_iterator& operator--();


    const_iterator operator++(int);


    const_iterator operator--(int);


    const_iterator& operator+=(difference_type n);


    const_iterator& operator-=(difference_type n);


    const_iterator operator+(difference_type n) const;


    const_iterator operator-(difference_type n) const;


    reference operator*() const;


    pointer operator->() const;






    bool operator==(const const_iterator& y) const;






    bool operator!=(const const_iterator& y) const;

  private:

    explicit const_iterator(Base base);


    Base itr;

    friend class MIP_Problem;
  };





  const_iterator constraints_begin() const;





  const_iterator constraints_end() const;


  const Linear_Expression& objective_function() const;


  Optimization_Mode optimization_mode() const;





  void clear();
# 347 "MIP_Problem_defs.hh"
  void add_space_dimensions_and_embed(dimension_type m);
# 357 "MIP_Problem_defs.hh"
  void add_to_integer_space_dimensions(const Variables_Set& i_vars);
# 366 "MIP_Problem_defs.hh"
  void add_constraint(const Constraint& c);
# 376 "MIP_Problem_defs.hh"
  void add_constraints(const Constraint_System& cs);







  void set_objective_function(const Linear_Expression& obj);


  void set_optimization_mode(Optimization_Mode mode);






  bool is_satisfiable() const;







  MIP_Problem_Status solve() const;
# 422 "MIP_Problem_defs.hh"
  void evaluate_objective_function(const Generator& evaluating_point,
                                   Coefficient& numer,
                                   Coefficient& denom) const;






  const Generator& feasible_point() const;







  const Generator& optimizing_point() const;
# 450 "MIP_Problem_defs.hh"
  void optimal_value(Coefficient& numer, Coefficient& denom) const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  void m_swap(MIP_Problem& y);


  enum Control_Parameter_Name {

    PRICING
  };


  enum Control_Parameter_Value {

    PRICING_STEEPEST_EDGE_FLOAT,

    PRICING_STEEPEST_EDGE_EXACT,

    PRICING_TEXTBOOK
  };


  Control_Parameter_Value
  get_control_parameter(Control_Parameter_Name name) const;


  void set_control_parameter(Control_Parameter_Value value);

private:

  dimension_type external_space_dim;





  dimension_type internal_space_dim;


  typedef Sparse_Row Row;





  Matrix<Row> tableau;

  typedef Row working_cost_type;


  working_cost_type working_cost;
# 529 "MIP_Problem_defs.hh"
  std::vector<std::pair<dimension_type, dimension_type> > mapping;


  std::vector<dimension_type> base;


  enum Status {

    UNSATISFIABLE,

    SATISFIABLE,

    UNBOUNDED,

    OPTIMIZED,





    PARTIALLY_SATISFIABLE
  };


  Status status;






  Control_Parameter_Value pricing;






  bool initialized;


  std::vector<Constraint*> input_cs;
# 581 "MIP_Problem_defs.hh"
  dimension_type inherited_constraints;


  dimension_type first_pending_constraint;


  Linear_Expression input_obj_function;


  Optimization_Mode opt_mode;


  Generator last_generator;





  Variables_Set i_variables;


  struct RAII_Temporary_Real_Relaxation {
    MIP_Problem& lp;
    Variables_Set i_vars;

    RAII_Temporary_Real_Relaxation(MIP_Problem& mip)
      : lp(mip), i_vars() {

      using std::swap;
      swap(i_vars, lp.i_variables);
    }

    ~RAII_Temporary_Real_Relaxation() {

      using std::swap;
      swap(i_vars, lp.i_variables);
    }
  };
  friend struct RAII_Temporary_Real_Relaxation;


  struct Inherit_Constraints {};


  MIP_Problem(const MIP_Problem& y, Inherit_Constraints);


  void add_constraint_helper(const Constraint& c);


  void process_pending_constraints();





  void second_phase();
# 653 "MIP_Problem_defs.hh"
  MIP_Problem_Status
  compute_tableau(std::vector<dimension_type>& worked_out_row);
# 707 "MIP_Problem_defs.hh"
  bool parse_constraints(dimension_type& additional_tableau_rows,
                         dimension_type& additional_slack_variables,
                         std::deque<bool>& is_tableau_constraint,
                         std::deque<bool>& is_satisfied_inequality,
                         std::deque<bool>& is_nonnegative_variable,
                         std::deque<bool>& is_remergeable_variable) const;
# 724 "MIP_Problem_defs.hh"
  dimension_type
  get_exiting_base_index(dimension_type entering_var_index) const;
# 742 "MIP_Problem_defs.hh"
  static void linear_combine(Row& x, const Row& y, const dimension_type k);
# 762 "MIP_Problem_defs.hh"
  static void linear_combine(Dense_Row& x, const Sparse_Row& y,
                             const dimension_type k);



  static bool is_unbounded_obj_function(
    const Linear_Expression& obj_function,
    const std::vector<std::pair<dimension_type, dimension_type> >& mapping,
    Optimization_Mode optimization_mode);
# 781 "MIP_Problem_defs.hh"
  void pivot(dimension_type entering_var_index,
             dimension_type exiting_base_index);
# 793 "MIP_Problem_defs.hh"
  dimension_type textbook_entering_index() const;
# 820 "MIP_Problem_defs.hh"
  dimension_type steepest_edge_exact_entering_index() const;
# 833 "MIP_Problem_defs.hh"
  dimension_type steepest_edge_float_entering_index() const;
# 843 "MIP_Problem_defs.hh"
  bool compute_simplex_using_exact_pricing();
# 854 "MIP_Problem_defs.hh"
  bool compute_simplex_using_steepest_edge_float();
# 872 "MIP_Problem_defs.hh"
  void erase_artificials(dimension_type begin_artificials,
                         dimension_type end_artificials);

  bool is_in_base(dimension_type var_index,
                  dimension_type& row_index) const;





  void compute_generator() const;
# 896 "MIP_Problem_defs.hh"
  dimension_type merge_split_variable(dimension_type var_index);


  static bool is_satisfied(const Constraint& c, const Generator& g);


  static bool is_saturated(const Constraint& c, const Generator& g);
# 923 "MIP_Problem_defs.hh"
  static MIP_Problem_Status solve_mip(bool& have_incumbent_solution,
                                      mpq_class& incumbent_solution_value,
                                      Generator& incumbent_solution_point,
                                      MIP_Problem& mip,
                                      const Variables_Set& i_vars);




  bool is_lp_satisfiable() const;
# 948 "MIP_Problem_defs.hh"
  static bool is_mip_satisfiable(MIP_Problem& mip,
                                 const Variables_Set& i_vars,
                                 Generator& p);
# 967 "MIP_Problem_defs.hh"
  static bool choose_branching_variable(const MIP_Problem& mip,
                                        const Variables_Set& i_vars,
                                        dimension_type& branching_index);
};

# 1 "MIP_Problem_inlines.hh" 1
# 30 "MIP_Problem_inlines.hh"
namespace Parma_Polyhedra_Library {

inline dimension_type
MIP_Problem::max_space_dimension() {
  return Constraint::max_space_dimension();
}

inline dimension_type
MIP_Problem::space_dimension() const {
  return external_space_dim;
}


inline
MIP_Problem::MIP_Problem(const MIP_Problem& y)
  : external_space_dim(y.external_space_dim),
    internal_space_dim(y.internal_space_dim),
    tableau(y.tableau),
    working_cost(y.working_cost),
    mapping(y.mapping),
    base(y.base),
    status(y.status),
    pricing(y.pricing),
    initialized(y.initialized),
    input_cs(),
    inherited_constraints(0),
    first_pending_constraint(),
    input_obj_function(y.input_obj_function),
    opt_mode(y.opt_mode),
    last_generator(y.last_generator),
    i_variables(y.i_variables) {
  input_cs.reserve(y.input_cs.size());
  for (Constraint_Sequence::const_iterator i = y.input_cs.begin(),
         i_end = y.input_cs.end(); i != i_end; ++i)
    add_constraint_helper(*(*i));
  ((void) 0);
}

inline
MIP_Problem::MIP_Problem(const MIP_Problem& y, Inherit_Constraints)
  : external_space_dim(y.external_space_dim),
    internal_space_dim(y.internal_space_dim),
    tableau(y.tableau),
    working_cost(y.working_cost),
    mapping(y.mapping),
    base(y.base),
    status(y.status),
    pricing(y.pricing),
    initialized(y.initialized),
    input_cs(y.input_cs),

    inherited_constraints(y.input_cs.size()),
    first_pending_constraint(y.first_pending_constraint),
    input_obj_function(y.input_obj_function),
    opt_mode(y.opt_mode),
    last_generator(y.last_generator),
    i_variables(y.i_variables) {
  ((void) 0);
}

inline void
MIP_Problem::add_constraint_helper(const Constraint& c) {

  const dimension_type size = input_cs.size();
  if (size == input_cs.capacity()) {
    const dimension_type max_size = input_cs.max_size();
    if (size == max_size)
      throw std::length_error("MIP_Problem::add_constraint(): "
                              "too many constraints");

    input_cs.reserve(compute_capacity(size + 1, max_size));
  }



  input_cs.push_back(new Constraint(c));
}

inline
MIP_Problem::~MIP_Problem() {


  for (Constraint_Sequence::const_iterator
         i = nth_iter(input_cs, inherited_constraints),
         i_end = input_cs.end(); i != i_end; ++i)
    delete *i;
}


inline void
MIP_Problem::set_optimization_mode(const Optimization_Mode mode) {
  if (opt_mode != mode) {
    opt_mode = mode;
    if (status == UNBOUNDED || status == OPTIMIZED)
      status = SATISFIABLE;
    ((void) 0);
  }
}

inline const Linear_Expression&
MIP_Problem::objective_function() const {
  return input_obj_function;
}

inline Optimization_Mode
MIP_Problem::optimization_mode() const {
  return opt_mode;
}

inline void
MIP_Problem::optimal_value(Coefficient& numer, Coefficient& denom) const {
  const Generator& g = optimizing_point();
  evaluate_objective_function(g, numer, denom);
}

inline MIP_Problem::const_iterator
MIP_Problem::constraints_begin() const {
  return const_iterator(input_cs.begin());
}

inline MIP_Problem::const_iterator
MIP_Problem::constraints_end() const {
  return const_iterator(input_cs.end());
}

inline const Variables_Set&
MIP_Problem::integer_space_dimensions() const {
  return i_variables;
}

inline MIP_Problem::Control_Parameter_Value
MIP_Problem::get_control_parameter(Control_Parameter_Name name) const {
  (void)(name);
  ((void) 0);
  return pricing;
}

inline void
MIP_Problem::set_control_parameter(Control_Parameter_Value value) {
  pricing = value;
}

inline void
MIP_Problem::m_swap(MIP_Problem& y) {
  using std::swap;
  swap(external_space_dim, y.external_space_dim);
  swap(internal_space_dim, y.internal_space_dim);
  swap(tableau, y.tableau);
  swap(working_cost, y.working_cost);
  swap(mapping, y.mapping);
  swap(initialized, y.initialized);
  swap(base, y.base);
  swap(status, y.status);
  swap(pricing, y.pricing);
  swap(input_cs, y.input_cs);
  swap(inherited_constraints, y.inherited_constraints);
  swap(first_pending_constraint, y.first_pending_constraint);
  swap(input_obj_function, y.input_obj_function);
  swap(opt_mode, y.opt_mode);
  swap(last_generator, y.last_generator);
  swap(i_variables, y.i_variables);
}

inline MIP_Problem&
MIP_Problem::operator=(const MIP_Problem& y) {
  MIP_Problem tmp(y);
  m_swap(tmp);
  return *this;
}

inline void
MIP_Problem::clear() {
  MIP_Problem tmp;
  m_swap(tmp);
}


inline memory_size_type
MIP_Problem::external_memory_in_bytes() const {
  memory_size_type n
    = working_cost.external_memory_in_bytes()
    + tableau.external_memory_in_bytes()
    + input_obj_function.external_memory_in_bytes()
    + last_generator.external_memory_in_bytes();



  n += input_cs.capacity() * sizeof(Constraint*);
  for (Constraint_Sequence::const_iterator
         i = nth_iter(input_cs, inherited_constraints),
         i_end = input_cs.end(); i != i_end; ++i)
    n += ((*i)->total_memory_in_bytes());


  n += base.capacity() * sizeof(dimension_type);

  n += mapping.capacity() * sizeof(std::pair<dimension_type, dimension_type>);
  return n;
}

inline memory_size_type
MIP_Problem::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline
MIP_Problem::const_iterator::const_iterator(Base base)
  : itr(base) {
}

inline MIP_Problem::const_iterator::difference_type
MIP_Problem::const_iterator::operator-(const const_iterator& y) const {
  return itr - y.itr;
}

inline MIP_Problem::const_iterator&
MIP_Problem::const_iterator::operator++() {
  ++itr;
  return *this;
}

inline MIP_Problem::const_iterator&
MIP_Problem::const_iterator::operator--() {
  --itr;
  return *this;
}

inline MIP_Problem::const_iterator
MIP_Problem::const_iterator::operator++(int) {
  const_iterator x = *this;
  operator++();
  return x;
}

inline MIP_Problem::const_iterator
MIP_Problem::const_iterator::operator--(int) {
  const_iterator x = *this;
  operator--();
  return x;
}

inline MIP_Problem::const_iterator
MIP_Problem::const_iterator::operator+(difference_type n) const {
  return const_iterator(itr + n);
}

inline MIP_Problem::const_iterator
MIP_Problem::const_iterator::operator-(difference_type n) const {
  return const_iterator(itr - n);
}

inline MIP_Problem::const_iterator&
MIP_Problem::const_iterator::operator+=(difference_type n) {
  itr += n;
  return *this;
}

inline MIP_Problem::const_iterator&
MIP_Problem::const_iterator::operator-=(difference_type n) {
  itr -= n;
  return *this;
}

inline MIP_Problem::const_iterator::reference
MIP_Problem::const_iterator::operator*() const {
  return *(*itr);
}

inline MIP_Problem::const_iterator::pointer
MIP_Problem::const_iterator::operator->() const {
  return *itr;
}

inline bool
MIP_Problem::const_iterator::operator==(const const_iterator& y) const {
  return itr == y.itr;
}

inline bool
MIP_Problem::const_iterator::operator!=(const const_iterator& y) const {
  return itr != y.itr;
}


inline void
swap(MIP_Problem& x, MIP_Problem& y) {
  x.m_swap(y);
}

}
# 973 "MIP_Problem_defs.hh" 2
# 1 "MIP_Problem_templates.hh" 1
# 29 "MIP_Problem_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename In>
MIP_Problem::MIP_Problem(const dimension_type dim,
                         In first, In last,
                         const Variables_Set& int_vars,
                         const Linear_Expression& obj,
                         const Optimization_Mode mode)
  : external_space_dim(dim),
    internal_space_dim(0),
    tableau(),
    working_cost(0),
    mapping(),
    base(),
    status(PARTIALLY_SATISFIABLE),
    pricing(PRICING_STEEPEST_EDGE_FLOAT),
    initialized(false),
    input_cs(),
    inherited_constraints(0),
    first_pending_constraint(0),
    input_obj_function(obj),
    opt_mode(mode),
    last_generator(point()),
    i_variables(int_vars) {


  if (i_variables.space_dimension() > external_space_dim) {
    std::ostringstream s;
    s << "PPL::MIP_Problem::MIP_Problem"
      << "(dim, first, last, int_vars, obj, mode):\n"
      << "dim == "<< external_space_dim << " and int_vars.space_dimension() =="
      << " " << i_variables.space_dimension() << " are dimension"
      "incompatible.";
    throw std::invalid_argument(s.str());
  }


  if (dim > max_space_dimension())
    throw std::length_error("PPL::MIP_Problem:: MIP_Problem(dim, first, "
                            "last, int_vars, obj, mode):\n"
                            "dim exceeds the maximum allowed"
                            "space dimension.");

  if (obj.space_dimension() > dim) {
    std::ostringstream s;
    s << "PPL::MIP_Problem::MIP_Problem(dim, first, last,"
      << "int_vars, obj, mode):\n"
      << "obj.space_dimension() == "<< obj.space_dimension()
      << " exceeds d == "<< dim << ".";
    throw std::invalid_argument(s.str());
  }

  try {
    for (In i = first; i != last; ++i) {
      if (i->is_strict_inequality())
        throw std::invalid_argument("PPL::MIP_Problem::"
                                    "MIP_Problem(dim, first, last, int_vars,"
                                    "obj, mode):\nrange [first, last) contains"
                                    "a strict inequality constraint.");
      if (i->space_dimension() > dim) {
        std::ostringstream s;
        s << "PPL::MIP_Problem::"
          << "MIP_Problem(dim, first, last, int_vars, obj, mode):\n"
          << "range [first, last) contains a constraint having space"
          << "dimension  == " << i->space_dimension() << " that exceeds"
          "this->space_dimension == " << dim << ".";
        throw std::invalid_argument(s.str());
      }
      add_constraint_helper(*i);
    }
  } catch (...) {


    for (Constraint_Sequence::const_iterator
          i = input_cs.begin(), i_end = input_cs.end(); i != i_end; ++i)
      delete *i;

    throw;
  }
  ((void) 0);
}

template <typename In>
MIP_Problem::MIP_Problem(dimension_type dim,
                         In first, In last,
                         const Linear_Expression& obj,
                         Optimization_Mode mode)
  : external_space_dim(dim),
    internal_space_dim(0),
    tableau(),
    working_cost(0),
    mapping(),
    base(),
    status(PARTIALLY_SATISFIABLE),
    pricing(PRICING_STEEPEST_EDGE_FLOAT),
    initialized(false),
    input_cs(),
    inherited_constraints(0),
    first_pending_constraint(0),
    input_obj_function(obj),
    opt_mode(mode),
    last_generator(point()),
    i_variables() {

  if (dim > max_space_dimension())
    throw std::length_error("PPL::MIP_Problem::"
                            "MIP_Problem(dim, first, last, obj, mode):\n"
                            "dim exceeds the maximum allowed space "
                            "dimension.");

  if (obj.space_dimension() > dim) {
    std::ostringstream s;
    s << "PPL::MIP_Problem::MIP_Problem(dim, first, last,"
      << " obj, mode):\n"
      << "obj.space_dimension() == "<< obj.space_dimension()
      << " exceeds d == "<< dim << ".";
    throw std::invalid_argument(s.str());
  }

  try {
    for (In i = first; i != last; ++i) {
      if (i->is_strict_inequality())
        throw std::invalid_argument("PPL::MIP_Problem::"
                                    "MIP_Problem(dim, first, last, obj, mode):"
                                    "\n"
                                    "range [first, last) contains a strict "
                                    "inequality constraint.");
      if (i->space_dimension() > dim) {
        std::ostringstream s;
        s << "PPL::MIP_Problem::"
          << "MIP_Problem(dim, first, last, obj, mode):\n"
          << "range [first, last) contains a constraint having space"
          << "dimension" << " == " << i->space_dimension() << " that exceeds"
          "this->space_dimension == " << dim << ".";
        throw std::invalid_argument(s.str());
      }
      add_constraint_helper(*i);
    }
  } catch (...) {


    for (Constraint_Sequence::const_iterator
          i = input_cs.begin(), i_end = input_cs.end(); i != i_end; ++i)
      delete *i;

    throw;
  }
  ((void) 0);
}

}
# 974 "MIP_Problem_defs.hh" 2
# 29 "Polyhedron_templates.hh" 2
# 1 "Interval_defs.hh" 1
# 29 "Interval_defs.hh"
# 1 "assign_or_swap.hh" 1
# 28 "assign_or_swap.hh"
# 1 "Has_Assign_Or_Swap.hh" 1
# 29 "Has_Assign_Or_Swap.hh"
namespace Parma_Polyhedra_Library {






template <typename T, typename Enable = void>
struct Has_Assign_Or_Swap : public False {
};






template <typename T>
struct Has_Assign_Or_Swap<T,
                          typename Enable_If_Is<void (T::*)(T& x),
                                                &T::assign_or_swap>::type>
  : public True {
};

}
# 29 "assign_or_swap.hh" 2


namespace Parma_Polyhedra_Library {






template <typename T>
inline typename Enable_If<Has_Assign_Or_Swap<T>::value, void>::type
assign_or_swap(T& to, T& from) {
  to.assign_or_swap(from);
}






template <typename T>
inline typename Enable_If<!Has_Assign_Or_Swap<T>::value
                          && !Slow_Copy<T>::value, void>::type
assign_or_swap(T& to, T& from) {
  to = from;
}






template <typename T>
inline typename Enable_If<!Has_Assign_Or_Swap<T>::value
                          && Slow_Copy<T>::value, void>::type
assign_or_swap(T& to, T& from) {
  using std::swap;
  swap(to, from);
}

}
# 30 "Interval_defs.hh" 2


# 1 "Interval_Info_defs.hh" 1
# 31 "Interval_Info_defs.hh"
namespace Parma_Polyhedra_Library {

namespace Interval_NS {

struct Property {
  enum Type {
    CARDINALITY_0_,
    CARDINALITY_1_,
    CARDINALITY_IS_
  };
  typedef bool Value;
  static const Value default_value = true;
  static const Value unsupported_value = false;
  Property(Type t)
    : type(t) {
  }
  Type type;
};

const Property CARDINALITY_0(Property::CARDINALITY_0_);
const Property CARDINALITY_1(Property::CARDINALITY_1_);
const Property CARDINALITY_IS(Property::CARDINALITY_IS_);

template <typename T>
inline void
reset_bits(T& bits) {
  bits = 0;
}

template <typename T>
inline void
reset_bit(T& bits, unsigned int bit) {
  bits &= ~(static_cast<T>(1) << bit);
}

template <typename T>
inline void
set_bit(T& bits, unsigned int bit, bool value) {
  if (value)
    bits |= static_cast<T>(1) << bit;
  else
    reset_bit(bits, bit);
}

template <typename T>
inline bool
get_bit(const T& bits, unsigned int bit) {
  return (bits & (static_cast<T>(1) << bit)) != 0;
}

template <typename T>
inline void
set_bits(T& bits, unsigned int start, unsigned int len, T value) {
  bits &= ~(((static_cast<T>(1) << len) - 1) << start);
  bits |= value << start;
}

template <typename T>
inline T
get_bits(T& bits, unsigned int start, unsigned int len) {
  return (bits >> start) & ((static_cast<T>(1) << len) - 1);
}

}

using namespace Interval_NS;
using namespace Boundary_NS;


template <typename Policy>
class Interval_Info_Null {
public:
  enum const_bool_value_may_be_empty { may_be_empty = (Policy::may_be_empty) };
  enum const_bool_value_may_contain_infinity { may_contain_infinity = (Policy::may_contain_infinity) };
  enum const_bool_value_check_inexact { check_inexact = (Policy::check_inexact) };
  enum const_bool_value_store_special { store_special = (false) };
  enum const_bool_value_store_open { store_open = (false) };
  enum const_bool_value_cache_empty { cache_empty = (false) };
  enum const_bool_value_cache_singleton { cache_singleton = (false) };
  Interval_Info_Null() {
  }
  void clear() {
  }
  void clear_boundary_properties(Boundary_Type) {
  }

  template <typename Property>
  void set_boundary_property(Boundary_Type, const Property&, typename Property::Value = Property::default_value) {
  }
  template <typename Property>
  typename Property::Value get_boundary_property(Boundary_Type, const Property&) const {
    return Property::unsupported_value;
  }
  template <typename Property>
  void set_interval_property(const Property&, typename Property::Value = Property::default_value) {
  }
  template <typename Property>
  typename Property::Value get_interval_property(const Property&) const {
    return Property::unsupported_value;
  }


  void m_swap(Interval_Info_Null& y);

  void ascii_dump(std::ostream& s) const;
  bool ascii_load(std::istream& s);
};

template <typename Policy>
class Interval_Info_Null_Open : public Interval_Info_Null<Policy> {
public:
  enum const_bool_value_store_open { store_open = (true) };
  Interval_Info_Null_Open(bool o)
    : open(o) {
  }
  bool get_boundary_property(Boundary_Type,
                             const Boundary_NS::Property& p) const {
    if (p.type == Boundary_NS::Property::OPEN_)
      return open;
    else
      return Boundary_NS::Property::unsupported_value;
  }

  void ascii_dump(std::ostream& s) const;
  bool ascii_load(std::istream& s);

private:
  bool open;
};


template <typename T, typename Policy>
class Interval_Info_Bitset {
public:
  enum const_bool_value_may_be_empty { may_be_empty = (Policy::may_be_empty) };
  enum const_bool_value_may_contain_infinity { may_contain_infinity = (Policy::may_contain_infinity) };
  enum const_bool_value_check_inexact { check_inexact = (Policy::check_inexact) };
  enum const_bool_value_store_special { store_special = (Policy::store_special) };
  enum const_bool_value_store_open { store_open = (Policy::store_open) };
  enum const_bool_value_cache_empty { cache_empty = (Policy::cache_empty) };
  enum const_bool_value_cache_singleton { cache_singleton = (Policy::cache_singleton) };
  enum anonymous_enum_lower_special_bit { lower_special_bit = (Policy::next_bit) };
  enum anonymous_enum_lower_open_bit { lower_open_bit = (lower_special_bit + (store_special ? 1 : 0)) };
  enum anonymous_enum_upper_special_bit { upper_special_bit = (lower_open_bit + (store_open ? 1 : 0)) };
  enum anonymous_enum_upper_open_bit { upper_open_bit = (upper_special_bit + (store_special ? 1 : 0)) };
  enum anonymous_enum_cardinality_is_bit { cardinality_is_bit = (upper_open_bit + (store_open ? 1 : 0)) };
  enum anonymous_enum_cardinality_0_bit { cardinality_0_bit = (cardinality_is_bit + ((cache_empty || cache_singleton) ? 1 : 0)) };

  enum anonymous_enum_cardinality_1_bit { cardinality_1_bit = (cardinality_0_bit + (cache_empty ? 1 : 0)) };
  enum anonymous_enum_next_bit { next_bit = (cardinality_1_bit + (cache_singleton ? 1 : 0)) };

  Interval_Info_Bitset() {


    clear();
  }

  void clear() {
    reset_bits(bitset);
  }
  void clear_boundary_properties(Boundary_Type t) {
    set_boundary_property(t, SPECIAL, false);
    set_boundary_property(t, OPEN, false);
  }
  void set_boundary_property(Boundary_Type t,
                             const Boundary_NS::Property& p,
                             bool value = true) {
    switch (p.type) {
    case Boundary_NS::Property::SPECIAL_:
      if (store_special) {
        if (t == LOWER)
          set_bit(bitset, lower_special_bit, value);
        else
          set_bit(bitset, upper_special_bit, value);
      }
      break;
    case Boundary_NS::Property::OPEN_:
      if (store_open) {
        if (t == LOWER)
          set_bit(bitset, lower_open_bit, value);
        else
          set_bit(bitset, upper_open_bit, value);
      }
      break;
    default:
      break;
    }
  }
  bool get_boundary_property(Boundary_Type t, const Boundary_NS::Property& p) const {
    switch (p.type) {
    case Boundary_NS::Property::SPECIAL_:
      if (!store_special)
        return false;
      if (t == LOWER)
        return get_bit(bitset, lower_special_bit);
      else
        return get_bit(bitset, upper_special_bit);
    case Boundary_NS::Property::OPEN_:
      if (!store_open)
        return false;
      else if (t == LOWER)
        return get_bit(bitset, lower_open_bit);
      else
        return get_bit(bitset, upper_open_bit);
    default:
      return false;
    }
  }
  void set_interval_property(const Interval_NS::Property& p, bool value = true) {
    switch (p.type) {
    case Interval_NS::Property::CARDINALITY_0_:
      if (cache_empty)
        set_bit(bitset, cardinality_0_bit, value);
      break;
    case Interval_NS::Property::CARDINALITY_1_:
      if (cache_singleton)
        set_bit(bitset, cardinality_1_bit, value);
      break;
    case Interval_NS::Property::CARDINALITY_IS_:
      if (cache_empty || cache_singleton)
        set_bit(bitset, cardinality_is_bit, value);
      break;
    default:
      break;
    }
  }
  bool get_interval_property(Interval_NS::Property p) const {
    switch (p.type) {
    case Interval_NS::Property::CARDINALITY_0_:
      return cache_empty && get_bit(bitset, cardinality_0_bit);
    case Interval_NS::Property::CARDINALITY_1_:
      return cache_singleton && get_bit(bitset, cardinality_1_bit);
    case Interval_NS::Property::CARDINALITY_IS_:
      return (cache_empty || cache_singleton)
        && get_bit(bitset, cardinality_is_bit);
    default:
      return false;
    }
  }


  void m_swap(Interval_Info_Bitset& y);

  void ascii_dump(std::ostream& s) const;
  bool ascii_load(std::istream& s);

protected:
  T bitset;
};

}

# 1 "Interval_Info_inlines.hh" 1
# 29 "Interval_Info_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename Policy>
inline void
Interval_Info_Null<Policy>::m_swap(Interval_Info_Null<Policy>&) {
}

template <typename Policy>
inline void
Interval_Info_Null<Policy>::ascii_dump(std::ostream&) const {
}

template <typename Policy>
inline bool
Interval_Info_Null<Policy>::ascii_load(std::istream&) {
  return true;
}

template <typename Policy>
inline void
Interval_Info_Null_Open<Policy>::ascii_dump(std::ostream& s) const {
  s << (open ? "open" : "closed");
}

template <typename Policy>
inline bool
Interval_Info_Null_Open<Policy>::ascii_load(std::istream& s) {
  std::string str;
  if (!(s >> str))
    return false;
  if (str == "open") {
    open = true;
    return true;
  }
  if (str == "closed") {
    open = false;
    return true;
  }
  return false;
}

template <typename T, typename Policy>
inline void
Interval_Info_Bitset<T, Policy>::m_swap(Interval_Info_Bitset<T, Policy>& y) {
  using std::swap;
  swap(bitset, y.bitset);
}

template <typename T, typename Policy>
inline void
Interval_Info_Bitset<T, Policy>::ascii_dump(std::ostream& s) const {
  const std::ios::fmtflags old_flags = s.setf(std::ios::hex,
                                              std::ios::basefield);
  s << bitset;
  s.flags(old_flags);
}

template <typename T, typename Policy>
inline bool
Interval_Info_Bitset<T, Policy>::ascii_load(std::istream& s) {
  const std::ios::fmtflags old_flags = s.setf(std::ios::hex,
                                              std::ios::basefield);
  s >> bitset;
  s.flags(old_flags);
  return !s.fail();
}




template <typename Policy>
inline void
swap(Interval_Info_Null<Policy>& x, Interval_Info_Null<Policy>& y) {
  x.m_swap(y);
}




template <typename T, typename Policy>
inline void
swap(Interval_Info_Bitset<T, Policy>& x, Interval_Info_Bitset<T, Policy>& y) {
  x.m_swap(y);
}

}
# 284 "Interval_Info_defs.hh" 2
# 33 "Interval_defs.hh" 2





namespace Parma_Polyhedra_Library {

enum Ternary { T_YES, T_NO, T_MAYBE };

inline I_Result
combine(Result l, Result u) {
  const unsigned res
    = static_cast<unsigned>(l) | (static_cast<unsigned>(u) << 6);
  return static_cast<I_Result>(res);
}

struct Interval_Base {
};

using namespace Boundary_NS;
using namespace Interval_NS;

template <typename T, typename Enable = void>
struct Is_Singleton : public Is_Native_Or_Checked<T> {};

template <typename T>
struct Is_Interval : public Is_Same_Or_Derived<Interval_Base, T> {};
# 83 "Interval_defs.hh"
template <typename Boundary, typename Info>
class Interval : public Interval_Base, private Info {
private:
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_89 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!Info::store_special || !std::numeric_limits<Boundary>::has_infinity)>) };



  Info& w_info() const {
    return const_cast<Interval&>(*this);
  }

public:
  typedef Boundary boundary_type;
  typedef Info info_type;

  typedef Interval_NS::Property Property;

  template <typename T>
  typename Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type
  operator=(const T& x) {
    assign(x);
    return *this;
  }

  template <typename T>
  typename Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type
  operator+=(const T& x) {
    add_assign(*this, x);
    return *this;
  }
  template <typename T>
  typename Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type
  operator-=(const T& x) {
    sub_assign(*this, x);
    return *this;
  }
  template <typename T>
  typename Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type
  operator*=(const T& x) {
    mul_assign(*this, x);
    return *this;
  }
  template <typename T>
  typename Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type
  operator/=(const T& x) {
    div_assign(*this, x);
    return *this;
  }


  void m_swap(Interval& y);

  Info& info() {
    return *this;
  }

  const Info& info() const {
    return *this;
  }

  Boundary& lower() {
    return lower_;
  }

  const Boundary& lower() const {
    return lower_;
  }

  Boundary& upper() {
    return upper_;
  }

  const Boundary& upper() const {
    return upper_;
  }

  I_Constraint<boundary_type> lower_constraint() const {
    ((void) 0);
    if (info().get_boundary_property(LOWER, SPECIAL))
      return I_Constraint<boundary_type>();
    return i_constraint(lower_is_open() ? GREATER_THAN : GREATER_OR_EQUAL,
                        lower(), true);
  }
  I_Constraint<boundary_type> upper_constraint() const {
    ((void) 0);
    if (info().get_boundary_property(UPPER, SPECIAL))
      return I_Constraint<boundary_type>();
    return i_constraint(upper_is_open() ? LESS_THAN : LESS_OR_EQUAL,
                        upper(), true);
  }

  bool is_empty() const {
    return lt(UPPER, upper(), info(), LOWER, lower(), info());
  }

  bool check_empty(I_Result r) const {
    return (r & I_ANY) == I_EMPTY
      || ((r & I_ANY) != I_NOT_EMPTY && is_empty());
  }

  bool is_singleton() const {
    return eq(LOWER, lower(), info(), UPPER, upper(), info());
  }

  bool lower_is_open() const {
    ((void) 0);
    return is_open(LOWER, lower(), info());
  }

  bool upper_is_open() const {
    ((void) 0);
    return is_open(UPPER, upper(), info());
  }

  bool lower_is_boundary_infinity() const {
    ((void) 0);
    return Boundary_NS::is_boundary_infinity(LOWER, lower(), info());
  }

  bool upper_is_boundary_infinity() const {
    ((void) 0);
    return Boundary_NS::is_boundary_infinity(UPPER, upper(), info());
  }

  bool lower_is_domain_inf() const {
    ((void) 0);
    return Boundary_NS::is_domain_inf(LOWER, lower(), info());
  }

  bool upper_is_domain_sup() const {
    ((void) 0);
    return Boundary_NS::is_domain_sup(UPPER, upper(), info());
  }

  bool is_bounded() const {
    ((void) 0);
    return !lower_is_boundary_infinity() && !upper_is_boundary_infinity();
  }

  bool is_universe() const {
    ((void) 0);
    return lower_is_domain_inf() && upper_is_domain_sup();
  }

  I_Result lower_extend() {
    info().clear_boundary_properties(LOWER);
    set_unbounded(LOWER, lower(), info());
    return I_ANY;
  }

  template <typename C>
  typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
  lower_extend(const C& c);

  I_Result upper_extend() {
    info().clear_boundary_properties(UPPER);
    set_unbounded(UPPER, upper(), info());
    return I_ANY;
  }

  template <typename C>
  typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
  upper_extend(const C& c);

  I_Result build() {
    return assign(UNIVERSE);
  }

  template <typename C>
  typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
  build(const C& c) {
    Relation_Symbol rs;
    switch (c.rel()) {
    case V_LGE:
    case V_GT_MINUS_INFINITY:
    case V_LT_PLUS_INFINITY:
      return assign(UNIVERSE);
    default:
      return assign(EMPTY);
    case V_LT:
    case V_LE:
    case V_GT:
    case V_GE:
    case V_EQ:
    case V_NE:
      assign(UNIVERSE);
      rs = static_cast<Relation_Symbol>(c.rel());
      return refine_existential(rs, c.value());
    }
  }

  template <typename C1, typename C2>
  typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C1>::value
                     &&
                     Is_Same_Or_Derived<I_Constraint_Base, C2>::value,
                     I_Result>::type
  build(const C1& c1, const C2& c2) {
    switch (c1.rel()) {
    case V_LGE:
      return build(c2);
    case V_NAN:
      return assign(EMPTY);
    default:
      break;
    }
    switch (c2.rel()) {
    case V_LGE:
      return build(c1);
    case V_NAN:
      return assign(EMPTY);
    default:
      break;
    }
    build(c1);
    const I_Result r = add_constraint(c2);
    return r - (I_CHANGED | I_UNCHANGED);
  }

  template <typename C>
  typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
  add_constraint(const C& c) {
    Interval x;
    x.build(c);
    return intersect_assign(x);
  }

  I_Result assign(Degenerate_Element e) {
    I_Result r;
    info().clear();
    switch (e) {
    case EMPTY:
      lower_ = 1;
      upper_ = 0;
      r = I_EMPTY | I_EXACT;
      break;
    case UNIVERSE:
      set_unbounded(LOWER, lower(), info());
      set_unbounded(UPPER, upper(), info());
      r = I_UNIVERSE | I_EXACT;
      break;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      r = I_EMPTY;
      break;
    }
    ((void) 0);
    return r;
  }

  template <typename From>
  typename Enable_If<Is_Special<From>::value, I_Result>::type
  assign(const From&) {
    info().clear();
    Result rl;
    Result ru;
    switch (From::vclass) {
    case VC_MINUS_INFINITY:
      rl = Boundary_NS::set_minus_infinity(LOWER, lower(), info());
      ru = Boundary_NS::set_minus_infinity(UPPER, upper(), info());
      break;
    case VC_PLUS_INFINITY:
      rl = Boundary_NS::set_plus_infinity(LOWER, lower(), info());
      ru = Boundary_NS::set_plus_infinity(UPPER, upper(), info());
      break;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      rl = V_NAN;
      ru = V_NAN;
      break;
    }
    ((void) 0);
    return combine(rl, ru);
  }

  I_Result set_infinities() {
    info().clear();
    Result rl = Boundary_NS::set_minus_infinity(LOWER, lower(), info());
    Result ru = Boundary_NS::set_plus_infinity(UPPER, upper(), info());
    ((void) 0);
    return combine(rl, ru);
  }

  static bool is_always_topologically_closed() {
    return !Info::store_open;
  }

  bool is_topologically_closed() const {
    ((void) 0);
    return is_always_topologically_closed()
      || is_empty()
      || ((lower_is_boundary_infinity() || !lower_is_open())
          && (upper_is_boundary_infinity() || !upper_is_open()));
  }


  void topological_closure_assign() {
    if (!Info::store_open || is_empty())
      return;
    if (lower_is_open() && !lower_is_boundary_infinity())
      info().set_boundary_property(LOWER, OPEN, false);
    if (upper_is_open() && !upper_is_boundary_infinity())
      info().set_boundary_property(UPPER, OPEN, false);
  }

  void remove_inf() {
    ((void) 0);
    if (!Info::store_open)
      return;
    info().set_boundary_property(LOWER, OPEN, true);
  }

  void remove_sup() {
    ((void) 0);
    if (!Info::store_open)
      return;
    info().set_boundary_property(UPPER, OPEN, true);
  }

  int infinity_sign() const {
    ((void) 0);
    if (is_reverse_infinity(LOWER, lower(), info()))
      return 1;
    else if (is_reverse_infinity(UPPER, upper(), info()))
      return -1;
    else
      return 0;
  }

  bool contains_integer_point() const {
    ((void) 0);
    if (is_empty())
      return false;
    if (!is_bounded())
      return true;
    Boundary l;
    if (lower_is_open()) {
      add_assign_r(l, lower(), Boundary(1), ROUND_DOWN);
      floor_assign_r(l, l, ROUND_DOWN);
    }
    else
      ceil_assign_r(l, lower(), ROUND_DOWN);
    Boundary u;
    if (upper_is_open()) {
      sub_assign_r(u, upper(), Boundary(1), ROUND_UP);
      ceil_assign_r(u, u, ROUND_UP);
    }
    else
      floor_assign_r(u, upper(), ROUND_UP);
    return u >= l;
  }

  void drop_some_non_integer_points() {
    if (is_empty())
      return;
    if (lower_is_open() && !lower_is_boundary_infinity()) {
      add_assign_r(lower(), lower(), Boundary(1), ROUND_DOWN);
      floor_assign_r(lower(), lower(), ROUND_DOWN);
      info().set_boundary_property(LOWER, OPEN, false);
    }
    else
      ceil_assign_r(lower(), lower(), ROUND_DOWN);
    if (upper_is_open() && !upper_is_boundary_infinity()) {
      sub_assign_r(upper(), upper(), Boundary(1), ROUND_UP);
      ceil_assign_r(upper(), upper(), ROUND_UP);
      info().set_boundary_property(UPPER, OPEN, false);
    }
    else
      floor_assign_r(upper(), upper(), ROUND_UP);
  }

  template <typename From>
  typename Enable_If<Is_Singleton<From>::value || Is_Interval<From>::value, I_Result>::type
  wrap_assign(Bounded_Integer_Type_Width w,
              Bounded_Integer_Type_Representation r,
              const From& refinement) {
    if (is_empty())
      return I_EMPTY;
    if (lower_is_boundary_infinity() || upper_is_boundary_infinity())
      return assign(refinement);
    Parma_Polyhedra_Library::Dirty_Temp<Boundary> holder_u; Boundary& u = holder_u.item();
    Result result = sub_2exp_assign_r(u, upper(), w, ROUND_UP);
    if (result_overflow(result) == 0 && u > lower())
      return assign(refinement);
    info().clear();
    switch (r) {
    case UNSIGNED:
      umod_2exp_assign(LOWER, lower(), info(),
                       LOWER, lower(), info(), w);
      umod_2exp_assign(UPPER, upper(), info(),
                       UPPER, upper(), info(), w);
      break;
    case SIGNED_2_COMPLEMENT:
      smod_2exp_assign(LOWER, lower(), info(),
                       LOWER, lower(), info(), w);
      smod_2exp_assign(UPPER, upper(), info(),
                       UPPER, upper(), info(), w);
      break;
    default:
      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
    if (le(LOWER, lower(), info(), UPPER, upper(), info()))
      return intersect_assign(refinement);
    Parma_Polyhedra_Library::Dirty_Temp<Interval> holder_tmp; Interval& tmp = holder_tmp.item();
    tmp.info().clear();
    Boundary_NS::assign(LOWER, tmp.lower(), tmp.info(),
                        LOWER, lower(), info());
    set_unbounded(UPPER, tmp.upper(), tmp.info());
    tmp.intersect_assign(refinement);
    lower_extend();
    intersect_assign(refinement);
    return join_assign(tmp);
  }


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;

  void ascii_dump(std::ostream& s) const;
  bool ascii_load(std::istream& s);

  bool OK() const {
    if (!Info::may_be_empty && is_empty()) {



      return false;
    }

    if (is_open(LOWER, lower(), info())) {
      if (is_plus_infinity(LOWER, lower(), info())) {



      }
    }
    else if (!Info::may_contain_infinity
             && (is_minus_infinity(LOWER, lower(), info())
                 || is_plus_infinity(LOWER, lower(), info()))) {



      return false;
    }
    if (!info().get_boundary_property(LOWER, SPECIAL)) {
      if (is_not_a_number(lower())) {



        return false;
      }
    }

    if (is_open(UPPER, upper(), info())) {
      if (is_minus_infinity(UPPER, upper(), info())) {



      }
    }
    else if (!Info::may_contain_infinity
             && (is_minus_infinity(UPPER, upper(), info())
                 || is_plus_infinity(UPPER, upper(), info()))) {




      return false;
    }
    if (!info().get_boundary_property(UPPER, SPECIAL)) {
      if (is_not_a_number(upper())) {



        return false;
      }
    }


    return true;
  }

  Interval() {
  }

  template <typename T>
  explicit Interval(const T& x) {
    assign(x);
  }





  explicit Interval(const char* s);

  template <typename T>
  typename Enable_If<Is_Singleton<T>::value
                     || Is_Interval<T>::value, bool>::type
  contains(const T& y) const;

  template <typename T>
  typename Enable_If<Is_Singleton<T>::value
                     || Is_Interval<T>::value, bool>::type
  strictly_contains(const T& y) const;

  template <typename T>
  typename Enable_If<Is_Singleton<T>::value
                     || Is_Interval<T>::value, bool>::type
  is_disjoint_from(const T& y) const;


  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  assign(const From& x);

  template <typename Type>
  typename Enable_If<Is_Singleton<Type>::value
                     || Is_Interval<Type>::value, bool>::type
  can_be_exactly_joined_to(const Type& x) const;

  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  join_assign(const From& x);

  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value
                       || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value
                          || Is_Interval<From2>::value)), I_Result>::type
  join_assign(const From1& x, const From2& y);

  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  intersect_assign(const From& x);

  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value
                       || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value
                          || Is_Interval<From2>::value)), I_Result>::type
  intersect_assign(const From1& x, const From2& y);





  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  difference_assign(const From& x);





  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value
                       || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value
                          || Is_Interval<From2>::value)), I_Result>::type
  difference_assign(const From1& x, const From2& y);





  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  lower_approximation_difference_assign(const From& x);
# 667 "Interval_defs.hh"
  template <typename From>
  typename Enable_If<Is_Interval<From>::value, bool>::type
  simplify_using_context_assign(const From& y);





  template <typename From>
  typename Enable_If<Is_Interval<From>::value, void>::type
  empty_intersection_assign(const From& y);
# 694 "Interval_defs.hh"
  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  refine_existential(Relation_Symbol rel, const From& x);
# 714 "Interval_defs.hh"
  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  refine_universal(Relation_Symbol rel, const From& x);

  template <typename From>
  typename Enable_If<Is_Singleton<From>::value
                     || Is_Interval<From>::value, I_Result>::type
  neg_assign(const From& x);

  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value || Is_Interval<From2>::value)), I_Result>::type
  add_assign(const From1& x, const From2& y);

  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value || Is_Interval<From2>::value)), I_Result>::type
  sub_assign(const From1& x, const From2& y);

  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value || Is_Interval<From2>::value)), I_Result>::type
  mul_assign(const From1& x, const From2& y);

  template <typename From1, typename From2>
  typename Enable_If<((Is_Singleton<From1>::value || Is_Interval<From1>::value)
                      && (Is_Singleton<From2>::value || Is_Interval<From2>::value)), I_Result>::type
  div_assign(const From1& x, const From2& y);

  template <typename From, typename Iterator>
  typename Enable_If<Is_Interval<From>::value, void>::type
  CC76_widening_assign(const From& y, Iterator first, Iterator last);

private:
  Boundary lower_;
  Boundary upper_;
};



template <typename Boundary, typename Info>
void swap(Interval<Boundary, Info>& x, Interval<Boundary, Info>& y);

}

# 1 "Interval_inlines.hh" 1
# 27 "Interval_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename Boundary, typename Info>
inline memory_size_type
Interval<Boundary, Info>::external_memory_in_bytes() const {
  return Parma_Polyhedra_Library::external_memory_in_bytes(lower())
    + Parma_Polyhedra_Library::external_memory_in_bytes(upper());
}

template <typename Boundary, typename Info>
inline memory_size_type
Interval<Boundary, Info>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename Boundary, typename Info>
inline void
Interval<Boundary, Info>::m_swap(Interval<Boundary, Info>& y) {
  using std::swap;
  swap(lower(), y.lower());
  swap(upper(), y.upper());
  swap(info(), y.info());
}

template <typename Boundary, typename Info>
inline bool
f_is_empty(const Interval<Boundary, Info>& x) {
  return x.is_empty();
}
template <typename Boundary, typename Info>
inline bool
f_is_singleton(const Interval<Boundary, Info>& x) {
  return x.is_singleton();
}
template <typename Boundary, typename Info>
inline int
infinity_sign(const Interval<Boundary, Info>& x) {
  return x.infinity_sign();
}

namespace Interval_NS {

template <typename Boundary, typename Info>
inline const Boundary&
f_lower(const Interval<Boundary, Info>& x) {
  return x.lower();
}
template <typename Boundary, typename Info>
inline const Boundary&
f_upper(const Interval<Boundary, Info>& x) {
  return x.upper();
}
template <typename Boundary, typename Info>
inline const Info&
f_info(const Interval<Boundary, Info>& x) {
  return x.info();
}

struct Scalar_As_Interval_Policy {
  enum const_bool_value_may_be_empty { may_be_empty = (true) };
  enum const_bool_value_may_contain_infinity { may_contain_infinity = (true) };
  enum const_bool_value_check_inexact { check_inexact = (false) };
};

typedef Interval_Info_Null<Scalar_As_Interval_Policy>
Scalar_As_Interval_Info;

const Scalar_As_Interval_Info SCALAR_INFO;

typedef Interval_Info_Null_Open<Scalar_As_Interval_Policy>
Scalar_As_Interval_Info_Open;

template <typename T>
inline typename Enable_If<Is_Singleton<T>::value, const T&>::type
f_lower(const T& x) {
  return x;
}
template <typename T>
inline typename Enable_If<Is_Singleton<T>::value, const T&>::type
f_upper(const T& x) {
  return x;
}
template <typename T>
inline typename Enable_If<Is_Singleton<T>::value,
                          const Scalar_As_Interval_Info&>::type
f_info(const T&) {
  return SCALAR_INFO;
}
template <typename T>
inline typename Enable_If<Is_Singleton<T>::value,
                          Scalar_As_Interval_Info_Open>::type
f_info(const T&, bool open) {
  return Scalar_As_Interval_Info_Open(open);
}

template <typename T>
inline typename Enable_If<Is_Singleton<T>::value, bool>::type
f_is_empty(const T& x) {
  return is_not_a_number(x);
}

template <typename T>
inline typename Enable_If<Is_Singleton<T>::value, bool>::type
f_is_singleton(const T& x) {
  return !f_is_empty(x);
}

}

template <typename T>
inline typename Enable_If<Is_Singleton<T>::value
                          || Is_Interval<T>::value, bool>::type
is_singleton_integer(const T& x) {
  return is_singleton(x) && is_integer(f_lower(x));
}

template <typename T>
inline typename Enable_If<Is_Singleton<T>::value
                          || Is_Interval<T>::value, bool>::type
check_empty_arg(const T& x) {
  if (f_info(x).may_be_empty)
    return f_is_empty(x);
  else {
    ((void) 0);
    return false;
  }
}

template <typename T1, typename T2>
inline typename Enable_If<((Is_Singleton<T1>::value
                            || Is_Interval<T1>::value)
                           && (Is_Singleton<T2>::value
                               || Is_Interval<T2>::value)
                           && (Is_Interval<T1>::value
                               || Is_Interval<T2>::value)),
                          bool>::type
operator==(const T1& x, const T2& y) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x))
    return check_empty_arg(y);
  else if (check_empty_arg(y))
    return false;
  return eq(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y))
    && eq(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y));
}

template <typename T1, typename T2>
inline typename Enable_If<((Is_Singleton<T1>::value
                            || Is_Interval<T1>::value)
                           && (Is_Singleton<T2>::value
                               || Is_Interval<T2>::value)
                           && (Is_Interval<T1>::value
                               || Is_Interval<T2>::value)),
                          bool>::type
operator!=(const T1& x, const T2& y) {
  return !(x == y);
}

template <typename Boundary, typename Info>
template <typename T>
inline typename Enable_If<Is_Singleton<T>::value
                          || Is_Interval<T>::value, bool>::type
Interval<Boundary, Info>::contains(const T& y) const {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(y))
    return true;
  if (check_empty_arg(*this))
    return false;
  return le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y))
    && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y));
}

template <typename Boundary, typename Info>
template <typename T>
inline typename Enable_If<Is_Singleton<T>::value
                          || Is_Interval<T>::value, bool>::type
Interval<Boundary, Info>::strictly_contains(const T& y) const {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(y))
    return !check_empty_arg(*this);
  if (check_empty_arg(*this))
    return false;
  return (lt(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y))
          && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y)))
    || (le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y))
        && gt(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y)));
}

template <typename Boundary, typename Info>
template <typename T>
inline typename Enable_If<Is_Singleton<T>::value
                          || Is_Interval<T>::value, bool>::type
Interval<Boundary, Info>::is_disjoint_from(const T& y) const {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(*this) || check_empty_arg(y))
    return true;
  return gt(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y))
    || lt(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y));
}

template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>::assign(const From& x) {
  ((void) 0);
  if (check_empty_arg(x))
    return assign(EMPTY);
  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  const Result rl = Boundary_NS::assign(LOWER, lower(), to_info,
                                        LOWER, f_lower(x), f_info(x));
  const Result ru = Boundary_NS::assign(UPPER, upper(), to_info,
                                        UPPER, f_upper(x), f_info(x));
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}

template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>::join_assign(const From& x) {
  ((void) 0);
  if (check_empty_arg(*this))
    return assign(x);
  if (check_empty_arg(x))
    return combine(V_EQ, V_EQ);
  Result rl;
  Result ru;
  rl = min_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
  ru = max_assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
  ((void) 0);
  return combine(rl, ru);
}

template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::join_assign(const From1& x, const From2& y) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x))
    return assign(y);
  if (check_empty_arg(y))
    return assign(x);
  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  Result rl;
  Result ru;
  rl = min_assign(LOWER, lower(), to_info,
                  LOWER, f_lower(x), f_info(x),
                  LOWER, f_lower(y), f_info(y));
  ru = max_assign(UPPER, upper(), to_info,
                  UPPER, f_upper(x), f_info(x),
                  UPPER, f_upper(y), f_info(y));
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}

template <typename Boundary, typename Info>
template <typename Type>
inline typename Enable_If<Is_Singleton<Type>::value
                          || Is_Interval<Type>::value, bool>::type
Interval<Boundary, Info>::can_be_exactly_joined_to(const Type& x) const {
  Parma_Polyhedra_Library::Dirty_Temp<Boundary> holder_b; Boundary& b = holder_b.item();
  if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) {
    b = lower();
    return eq(LOWER, b, info(), UPPER, f_upper(x), f_info(x));
  }
  else if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) {
    b = upper();
    return eq(UPPER, b, info(), LOWER, f_lower(x), f_info(x));
  }
  return true;
}


template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>::intersect_assign(const From& x) {
  ((void) 0);
  max_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
  min_assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
  ((void) 0);
  return I_ANY;
}

template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::intersect_assign(const From1& x,
                                                 const From2& y) {
  ((void) 0);
  ((void) 0);
  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  max_assign(LOWER, lower(), to_info,
             LOWER, f_lower(x), f_info(x),
             LOWER, f_lower(y), f_info(y));
  min_assign(UPPER, upper(), to_info,
             UPPER, f_upper(x), f_info(x),
             UPPER, f_upper(y), f_info(y));
  assign_or_swap(info(), to_info);
  ((void) 0);
  return I_NOT_EMPTY;
}

template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>::difference_assign(const From& x) {
  ((void) 0);
  if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))
      || gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)))
    return combine(V_EQ, V_EQ);
  bool nl = ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
  bool nu = le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
  Result rl = V_EQ;
  Result ru = V_EQ;
  if (nl) {
    if (nu)
      return assign(EMPTY);
    else {
      info().clear_boundary_properties(LOWER);
      rl = complement(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x));
    }
  }
  else if (nu) {
    info().clear_boundary_properties(UPPER);
    ru = complement(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x));
  }
  ((void) 0);
  return combine(rl, ru);
}

template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::difference_assign(const From1& x,
                                                  const From2& y) {
  ((void) 0);
  ((void) 0);
  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  if (lt(UPPER, f_upper(x), f_info(x), LOWER, f_lower(y), f_info(y))
      || gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y)))
    return assign(x);
  bool nl = ge(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y));
  bool nu = le(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y));
  Result rl = V_EQ;
  Result ru = V_EQ;
  if (nl) {
    if (nu)
      return assign(EMPTY);
    else {
      rl = complement(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y));
      ru = Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
    }
  }
  else if (nu) {
    ru = complement(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y));
    rl = Boundary_NS::assign(LOWER, lower(), info(),
                             LOWER, f_lower(x), f_info(x));
  }
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}

template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>
::refine_existential(Relation_Symbol rel, const From& x) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x))
    return assign(EMPTY);
  switch (rel) {
  case LESS_THAN:
    {
      if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(UPPER);
      Boundary_NS::assign(UPPER, upper(), info(),
                          UPPER, f_upper(x), f_info(x), true);
      return I_ANY;
    }
  case LESS_OR_EQUAL:
    {
      if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(UPPER);
      Boundary_NS::assign(UPPER, upper(), info(),
                          UPPER, f_upper(x), f_info(x));
      return I_ANY;
    }
  case GREATER_THAN:
    {
      if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(LOWER);
      Boundary_NS::assign(LOWER, lower(), info(),
                          LOWER, f_lower(x), f_info(x), true);
      return I_ANY;
    }
  case GREATER_OR_EQUAL:
    {
      if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(LOWER);
      Boundary_NS::assign(LOWER, lower(), info(),
                          LOWER, f_lower(x), f_info(x));
      return I_ANY;
    }
  case EQUAL:
    return intersect_assign(x);
  case NOT_EQUAL:
    {
      if (!f_is_singleton(x))
        return combine(V_EQ, V_EQ);
      if (check_empty_arg(*this))
        return I_EMPTY;
      if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
        remove_inf();
      if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
        remove_sup();
      return I_ANY;
    }
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return I_EMPTY;
  }
}

template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>::refine_universal(Relation_Symbol rel,
                                                 const From& x) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x))
    return combine(V_EQ, V_EQ);
  switch (rel) {
  case LESS_THAN:
    {
      if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(UPPER);
      Result ru = Boundary_NS::assign(UPPER, upper(), info(),
                                      LOWER, f_lower(x), SCALAR_INFO,
                                      !is_open(LOWER, f_lower(x), f_info(x)));
      (void)(ru);
      return I_ANY;
    }
  case LESS_OR_EQUAL:
    {
      if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(UPPER);
      Result ru = Boundary_NS::assign(UPPER, upper(), info(),
                                      LOWER, f_lower(x), SCALAR_INFO);
      (void)(ru);
      return I_ANY;
    }
  case GREATER_THAN:
    {
      if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(LOWER);
      Result rl = Boundary_NS::assign(LOWER, lower(), info(),
                                      UPPER, f_upper(x), SCALAR_INFO,
                                      !is_open(UPPER, f_upper(x), f_info(x)));
      (void)(rl);
      return I_ANY;
    }
  case GREATER_OR_EQUAL:
    {
      if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)))
        return combine(V_EQ, V_EQ);
      info().clear_boundary_properties(LOWER);
      Result rl = Boundary_NS::assign(LOWER, lower(), info(),
                                      UPPER, f_upper(x), SCALAR_INFO);
      (void)(rl);
      return I_ANY;
    }
  case EQUAL:
    if (!f_is_singleton(x))
      return assign(EMPTY);
    return intersect_assign(x);
  case NOT_EQUAL:
    {
      if (check_empty_arg(*this))
        return I_EMPTY;
      if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
        remove_inf();
      if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
        remove_sup();
      return I_ANY;
    }
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return I_EMPTY;
  }
}

template <typename To_Boundary, typename To_Info>
template <typename From>
inline typename Enable_If<Is_Singleton<From>::value
                          || Is_Interval<From>::value, I_Result>::type
Interval<To_Boundary, To_Info>::neg_assign(const From& x) {
  ((void) 0);
  if (check_empty_arg(x))
    return assign(EMPTY);
  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  Result rl;
  Result ru;
  Parma_Polyhedra_Library::Dirty_Temp<To_Boundary> holder_to_lower; To_Boundary& to_lower = holder_to_lower.item();
  rl = Boundary_NS::neg_assign(LOWER, to_lower, to_info, UPPER, f_upper(x), f_info(x));
  ru = Boundary_NS::neg_assign(UPPER, upper(), to_info, LOWER, f_lower(x), f_info(x));
  assign_or_swap(lower(), to_lower);
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}

template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::add_assign(const From1& x, const From2& y) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x) || check_empty_arg(y))
    return assign(EMPTY);
  int inf_sign = Parma_Polyhedra_Library::infinity_sign(x);
  if (inf_sign != 0) {
    if (Parma_Polyhedra_Library::infinity_sign(y) == -inf_sign)
      return assign(EMPTY);
  }
  else
    inf_sign = Parma_Polyhedra_Library::infinity_sign(y);
  if (inf_sign < 0)
    return assign(MINUS_INFINITY);
  else if (inf_sign > 0)
    return assign(PLUS_INFINITY);
  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  Result rl = Boundary_NS::add_assign(LOWER, lower(), to_info,
                                      LOWER, f_lower(x), f_info(x),
                                      LOWER, f_lower(y), f_info(y));
  Result ru = Boundary_NS::add_assign(UPPER, upper(), to_info,
                                      UPPER, f_upper(x), f_info(x),
                                      UPPER, f_upper(y), f_info(y));
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}

template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::sub_assign(const From1& x, const From2& y) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x) || check_empty_arg(y))
    return assign(EMPTY);
  int inf_sign = Parma_Polyhedra_Library::infinity_sign(x);
  if (inf_sign != 0) {
    if (Parma_Polyhedra_Library::infinity_sign(y) == inf_sign)
      return assign(EMPTY);
  }
  else
    inf_sign = -Parma_Polyhedra_Library::infinity_sign(y);
  if (inf_sign < 0)
    return assign(MINUS_INFINITY);
  else if (inf_sign > 0)
    return assign(PLUS_INFINITY);

  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  Result rl;
  Result ru;
  Parma_Polyhedra_Library::Dirty_Temp<To_Boundary> holder_to_lower; To_Boundary& to_lower = holder_to_lower.item();
  rl = Boundary_NS::sub_assign(LOWER, to_lower, to_info,
                               LOWER, f_lower(x), f_info(x),
                               UPPER, f_upper(y), f_info(y));
  ru = Boundary_NS::sub_assign(UPPER, upper(), to_info,
                               UPPER, f_upper(x), f_info(x),
                               LOWER, f_lower(y), f_info(y));
  assign_or_swap(lower(), to_lower);
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}
# 663 "Interval_inlines.hh"
template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::mul_assign(const From1& x, const From2& y) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x) || check_empty_arg(y))
    return assign(EMPTY);
  int xls = sgn_b(LOWER, f_lower(x), f_info(x));
  int xus = (xls > 0) ? 1 : sgn_b(UPPER, f_upper(x), f_info(x));
  int yls = sgn_b(LOWER, f_lower(y), f_info(y));
  int yus = (yls > 0) ? 1 : sgn_b(UPPER, f_upper(y), f_info(y));
  int inf_sign = Parma_Polyhedra_Library::infinity_sign(x);
  int ls;
  int us;
  if (inf_sign != 0) {
    ls = yls;
    us = yus;
    goto inf;
  }
  else {
    inf_sign = Parma_Polyhedra_Library::infinity_sign(y);
    if (inf_sign != 0) {
      ls = xls;
      us = xus;
    inf:
      if (ls == 0 && us == 0)
        return assign(EMPTY);
      if (ls == -us)
        return set_infinities();
      if (ls < 0 || us < 0)
        inf_sign = -inf_sign;
      if (inf_sign < 0)
        return assign(MINUS_INFINITY);
      else
        return assign(PLUS_INFINITY);
    }
  }

  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  Result rl;
  Result ru;
  Parma_Polyhedra_Library::Dirty_Temp<To_Boundary> holder_to_lower; To_Boundary& to_lower = holder_to_lower.item();

  if (xls >= 0) {
    if (yls >= 0) {

      rl = mul_assign_z(LOWER, to_lower, to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        LOWER, f_lower(y), f_info(y), yls);
      ru = mul_assign_z(UPPER, upper(), to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        UPPER, f_upper(y), f_info(y), yus);
    }
    else if (yus <= 0) {

      rl = mul_assign_z(LOWER, to_lower, to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        LOWER, f_lower(y), f_info(y), yls);
      ru = mul_assign_z(UPPER, upper(), to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        UPPER, f_upper(y), f_info(y), yus);
    }
    else {

      rl = mul_assign_z(LOWER, to_lower, to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        LOWER, f_lower(y), f_info(y), yls);
      ru = mul_assign_z(UPPER, upper(), to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        UPPER, f_upper(y), f_info(y), yus);
    }
  }
  else if (xus <= 0) {
    if (yls >= 0) {

      rl = mul_assign_z(LOWER, to_lower, to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        UPPER, f_upper(y), f_info(y), yus);
      ru = mul_assign_z(UPPER, upper(), to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        LOWER, f_lower(y), f_info(y), yls);
    }
    else if (yus <= 0) {

      rl = mul_assign_z(LOWER, to_lower, to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        UPPER, f_upper(y), f_info(y), yus);
      ru = mul_assign_z(UPPER, upper(), to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        LOWER, f_lower(y), f_info(y), yls);
    }
    else {

      rl = mul_assign_z(LOWER, to_lower, to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        UPPER, f_upper(y), f_info(y), yus);
      ru = mul_assign_z(UPPER, upper(), to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        LOWER, f_lower(y), f_info(y), yls);
    }
  }
  else if (yls >= 0) {

    rl = mul_assign_z(LOWER, to_lower, to_info,
                      LOWER, f_lower(x), f_info(x), xls,
                      UPPER, f_upper(y), f_info(y), yus);
    ru = mul_assign_z(UPPER, upper(), to_info,
                      UPPER, f_upper(x), f_info(x), xus,
                      UPPER, f_upper(y), f_info(y), yus);
  }
  else if (yus <= 0) {

    rl = mul_assign_z(LOWER, to_lower, to_info,
                      UPPER, f_upper(x), f_info(x), xus,
                      LOWER, f_lower(y), f_info(y), yls);
    ru = mul_assign_z(UPPER, upper(), to_info,
                      LOWER, f_lower(x), f_info(x), xls,
                      LOWER, f_lower(y), f_info(y), yls);
  }
  else {

    Parma_Polyhedra_Library::Dirty_Temp<To_Boundary> holder_tmp; To_Boundary& tmp = holder_tmp.item();
    Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_tmp_info; To_Info& tmp_info = holder_tmp_info.item();
    tmp_info.clear();
    Result tmp_r;
    tmp_r = Boundary_NS::mul_assign(LOWER, tmp, tmp_info,
                                    UPPER, f_upper(x), f_info(x),
                                    LOWER, f_lower(y), f_info(y));
    rl = Boundary_NS::mul_assign(LOWER, to_lower, to_info,
                                 LOWER, f_lower(x), f_info(x),
                                 UPPER, f_upper(y), f_info(y));
    if (gt(LOWER, to_lower, to_info, LOWER, tmp, tmp_info)) {
      to_lower = tmp;
      rl = tmp_r;
    }
    tmp_info.clear();
    tmp_r = Boundary_NS::mul_assign(UPPER, tmp, tmp_info,
                                    UPPER, f_upper(x), f_info(x),
                                    UPPER, f_upper(y), f_info(y));
    ru = Boundary_NS::mul_assign(UPPER, upper(), to_info,
                                 LOWER, f_lower(x), f_info(x),
                                 LOWER, f_lower(y), f_info(y));
    if (lt(UPPER, upper(), to_info, UPPER, tmp, tmp_info)) {
      upper() = tmp;
      ru = tmp_r;
    }
  }
  assign_or_swap(lower(), to_lower);
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}
# 832 "Interval_inlines.hh"
template <typename To_Boundary, typename To_Info>
template <typename From1, typename From2>
inline typename Enable_If<((Is_Singleton<From1>::value
                            || Is_Interval<From1>::value)
                           && (Is_Singleton<From2>::value
                               || Is_Interval<From2>::value)), I_Result>::type
Interval<To_Boundary, To_Info>::div_assign(const From1& x, const From2& y) {
  ((void) 0);
  ((void) 0);
  if (check_empty_arg(x) || check_empty_arg(y))
    return assign(EMPTY);
  int yls = sgn_b(LOWER, f_lower(y), f_info(y));
  int yus = (yls > 0) ? 1 : sgn_b(UPPER, f_upper(y), f_info(y));
  if (yls == 0 && yus == 0)
    return assign(EMPTY);
  int inf_sign = Parma_Polyhedra_Library::infinity_sign(x);
  if (inf_sign != 0) {
    if (Parma_Polyhedra_Library::infinity_sign(y) != 0)
      return assign(EMPTY);
    if (yls == -yus)
      return set_infinities();
    if (yls < 0 || yus < 0)
    inf_sign = -inf_sign;
    if (inf_sign < 0)
      return assign(MINUS_INFINITY);
    else
      return assign(PLUS_INFINITY);
  }
  int xls = sgn_b(LOWER, f_lower(x), f_info(x));
  int xus = (xls > 0) ? 1 : sgn_b(UPPER, f_upper(x), f_info(x));

  Parma_Polyhedra_Library::Dirty_Temp<To_Info> holder_to_info; To_Info& to_info = holder_to_info.item();
  to_info.clear();
  Result rl;
  Result ru;
  Parma_Polyhedra_Library::Dirty_Temp<To_Boundary> holder_to_lower; To_Boundary& to_lower = holder_to_lower.item();
  if (yls >= 0) {
    if (xls >= 0) {
      rl = div_assign_z(LOWER, to_lower, to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        UPPER, f_upper(y), f_info(y), yus);
      ru = div_assign_z(UPPER, upper(), to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        LOWER, f_lower(y), f_info(y), yls);
    }
    else if (xus <= 0) {
      rl = div_assign_z(LOWER, to_lower, to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        LOWER, f_lower(y), f_info(y), yls);
      ru = div_assign_z(UPPER, upper(), to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        UPPER, f_upper(y), f_info(y), yus);
    }
    else {
      rl = div_assign_z(LOWER, to_lower, to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        LOWER, f_lower(y), f_info(y), yls);
      ru = div_assign_z(UPPER, upper(), to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        LOWER, f_lower(y), f_info(y), yls);
    }
  }
  else if (yus <= 0) {
    if (xls >= 0) {
      rl = div_assign_z(LOWER, to_lower, to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        UPPER, f_upper(y), f_info(y), yus);
      ru = div_assign_z(UPPER, upper(), to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        LOWER, f_lower(y), f_info(y), yls);
    }
    else if (xus <= 0) {
      rl = div_assign_z(LOWER, to_lower, to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        LOWER, f_lower(y), f_info(y), yls);
      ru = div_assign_z(UPPER, upper(), to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        UPPER, f_upper(y), f_info(y), yus);
    }
    else {
      rl = div_assign_z(LOWER, to_lower, to_info,
                        UPPER, f_upper(x), f_info(x), xus,
                        UPPER, f_upper(y), f_info(y), yus);
      ru = div_assign_z(UPPER, upper(), to_info,
                        LOWER, f_lower(x), f_info(x), xls,
                        UPPER, f_upper(y), f_info(y), yus);
    }
  }
  else {
    return static_cast<I_Result>(assign(UNIVERSE) | I_SINGULARITIES);
  }
  assign_or_swap(lower(), to_lower);
  assign_or_swap(info(), to_info);
  ((void) 0);
  return combine(rl, ru);
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator+(const Interval<B, Info>& x, const T& y) {
  Interval<B, Info> z;
  z.add_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator+(const T& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.add_assign(x, y);
  return z;
}

template <typename B, typename Info>
inline Interval<B, Info>
operator+(const Interval<B, Info>& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.add_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator-(const Interval<B, Info>& x, const T& y) {
  Interval<B, Info> z;
  z.sub_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator-(const T& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.sub_assign(x, y);
  return z;
}

template <typename B, typename Info>
inline Interval<B, Info>
operator-(const Interval<B, Info>& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.sub_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator*(const Interval<B, Info>& x, const T& y) {
  Interval<B, Info> z;
  z.mul_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator*(const T& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.mul_assign(x, y);
  return z;
}

template <typename B, typename Info>
inline Interval<B, Info>
operator*(const Interval<B, Info>& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.mul_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator/(const Interval<B, Info>& x, const T& y) {
  Interval<B, Info> z;
  z.div_assign(x, y);
  return z;
}

template <typename B, typename Info, typename T>
inline typename Enable_If<Is_Singleton<T>::value, Interval<B, Info> >::type
operator/(const T& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.div_assign(x, y);
  return z;
}

template <typename B, typename Info>
inline Interval<B, Info>
operator/(const Interval<B, Info>& x, const Interval<B, Info>& y) {
  Interval<B, Info> z;
  z.div_assign(x, y);
  return z;
}

template <typename Boundary, typename Info>
inline std::ostream&
operator<<(std::ostream& os, const Interval<Boundary, Info>& x) {
  if (check_empty_arg(x))
    return os << "[]";
  if (x.is_singleton()) {
    output(os, x.lower(), Numeric_Format(), ROUND_NOT_NEEDED);
    return os;
  }
  os << (x.lower_is_open() ? "(" : "[");
  if (x.info().get_boundary_property(LOWER, SPECIAL))
    os << "-inf";
  else
    output(os, x.lower(), Numeric_Format(), ROUND_NOT_NEEDED);
  os << ", ";
  if (x.info().get_boundary_property(UPPER, SPECIAL))
    os << "+inf";
  else
    output(os, x.upper(), Numeric_Format(), ROUND_NOT_NEEDED);
  os << (x.upper_is_open() ? ")" : "]");
  return os;
}

template <typename Boundary, typename Info>
inline void
Interval<Boundary, Info>::ascii_dump(std::ostream& s) const {
  using Parma_Polyhedra_Library::ascii_dump;
  s << "info ";
  info().ascii_dump(s);
  s << " lower ";
  ascii_dump(s, lower());
  s << " upper ";
  ascii_dump(s, upper());
  s << '\n';
}

template <typename Boundary, typename Info>
inline bool
Interval<Boundary, Info>::ascii_load(std::istream& s) {
  using Parma_Polyhedra_Library::ascii_load;
  std::string str;
  if (!(s >> str) || str != "info")
    return false;
  if (!info().ascii_load(s))
    return false;
  if (!(s >> str) || str != "lower")
    return false;
  if (!ascii_load(s, lower()))
    return false;
  if (!(s >> str) || str != "upper")
    return false;
  if (!ascii_load(s, upper()))
    return false;
  ((void) 0);
  return true;
}






template <typename Interval_Boundary_Type> struct Select_Temp_Boundary_Type;

template <typename Interval_Boundary_Type>
struct Select_Temp_Boundary_Type {
  typedef Interval_Boundary_Type type;
};


template <>
struct Select_Temp_Boundary_Type<float> {
  typedef double type;
};


template <>
struct Select_Temp_Boundary_Type<char> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<signed char> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<unsigned char> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<signed short> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<unsigned short> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<signed int> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<unsigned int> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<signed long> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<unsigned long> {
  typedef signed long long type;
};

template <>
struct Select_Temp_Boundary_Type<unsigned long long> {
  typedef signed long long type;
};


template <typename Boundary, typename Info>
inline void
swap(Interval<Boundary, Info>& x, Interval<Boundary, Info>& y) {
  x.m_swap(y);
}

}
# 761 "Interval_defs.hh" 2
# 1 "Interval_templates.hh" 1
# 29 "Interval_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename Boundary, typename Info>
template <typename C>
typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
Interval<Boundary, Info>::lower_extend(const C& c) {
  ((void) 0);
  bool open;
  switch (c.rel()) {
  case V_LGE:
    return lower_extend();
  case V_NAN:
    return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
  case V_GT:
    open = true;
    break;
  case V_GE:
  case V_EQ:
    open = false;
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
  }
  min_assign(LOWER, lower(), info(), LOWER, c.value(), f_info(c.value(), open));
  ((void) 0);
  return I_ANY;
}

template <typename Boundary, typename Info>
template <typename C>
typename Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type
Interval<Boundary, Info>::upper_extend(const C& c) {
  ((void) 0);
  bool open;
  switch (c.rel()) {
  case V_LGE:
    return lower_extend();
  case V_NAN:
    return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
  case V_LT:
    open = true;
    break;
  case V_LE:
  case V_EQ:
    open = false;
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return I_NOT_EMPTY | I_EXACT | I_UNCHANGED;
  }
  max_assign(UPPER, upper(), info(), UPPER, c.value(), f_info(c.value(), open));
  ((void) 0);
  return I_ANY;
}

template <typename Boundary, typename Info>
template <typename From, typename Iterator>
typename Enable_If<Is_Interval<From>::value, void>::type
Interval<Boundary, Info>::CC76_widening_assign(const From& y,
                                               Iterator first,
                                               Iterator last) {

  ((void) 0);
  Interval<Boundary, Info>& x = *this;


  if (!x.upper_is_boundary_infinity()) {
    Boundary& x_ub = x.upper();
    const Boundary& y_ub = y.upper();
    ((void) 0);
    if (y_ub < x_ub) {
      Iterator k = std::lower_bound(first, last, x_ub);
      if (k != last) {
        if (x_ub < *k)
          x_ub = *k;
      }
      else
        x.upper_extend();
    }
  }


  if (!x.lower_is_boundary_infinity()) {
    Boundary& x_lb = x.lower();
    const Boundary& y_lb = y.lower();
    ((void) 0);
    if (y_lb > x_lb) {
      Iterator k = std::lower_bound(first, last, x_lb);
      if (k != last) {
        if (x_lb < *k) {
          if (k != first)
            x_lb = *--k;
          else
            x.lower_extend();
        }
      }
      else {
        if (k != first)
          x_lb = *--k;
        else
          x.lower_extend();
      }
    }
  }
}

template <typename Boundary, typename Info>
Interval<Boundary, Info>::Interval(const char* s) {

  Boundary lower_bound;
  Result lower_r = assign_r(lower_bound, s, ROUND_DOWN);
  if (lower_r == V_CVT_STR_UNK || lower_r == V_NAN) {
    throw std::invalid_argument("PPL::Interval(const char* s)"
                                " with s invalid");
  }
  lower_r = result_relation_class(lower_r);


  Boundary upper_bound;
  Result upper_r = assign_r(upper_bound, s, ROUND_UP);
  ((void) 0);
  upper_r = result_relation_class(upper_r);


  bool lower_open = false;
  bool upper_open = false;
  bool lower_boundary_infinity = false;
  bool upper_boundary_infinity = false;
  switch (lower_r) {
  case V_EQ:
  case V_GE:
    break;
  case V_GT:
    lower_open = true;
    break;
  case V_GT_MINUS_INFINITY:
    lower_open = true;

  case V_EQ_MINUS_INFINITY:
    lower_boundary_infinity = true;
    break;
  case V_EQ_PLUS_INFINITY:
  case V_LT_PLUS_INFINITY:
    if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY)
      assign(UNIVERSE);
    else
      assign(EMPTY);
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
  switch (upper_r) {
  case V_EQ:
  case V_LE:
    break;
  case V_LT:
    upper_open = true;
    break;
  case V_EQ_MINUS_INFINITY:
  case V_GT_MINUS_INFINITY:
    if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY)
      assign(UNIVERSE);
    else
      assign(EMPTY);
    break;
  case V_LT_PLUS_INFINITY:
    upper_open = true;

  case V_EQ_PLUS_INFINITY:
    upper_boundary_infinity = true;
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }

  if (!lower_boundary_infinity
      && !upper_boundary_infinity
      && (lower_bound > upper_bound
          || (lower_open && lower_bound == upper_bound)))
    assign(EMPTY);
  else {
    if (lower_boundary_infinity)
      set_minus_infinity(LOWER, lower(), info(), lower_open);
    else
      Boundary_NS::assign(LOWER, lower(), info(),
                          LOWER, lower_bound, SCALAR_INFO, lower_open);
    if (upper_boundary_infinity)
      set_plus_infinity(UPPER, upper(), info(), upper_open);
    else
      Boundary_NS::assign(UPPER, upper(), info(),
                          UPPER, upper_bound, SCALAR_INFO, upper_open);
  }
}


template <typename Boundary, typename Info>
inline std::istream&
operator>>(std::istream& is, Interval<Boundary, Info>& x) {
  Boundary lower_bound;
  Boundary upper_bound;
  bool lower_boundary_infinity = false;
  bool upper_boundary_infinity = false;
  bool lower_open = false;
  bool upper_open = false;
  Result lower_r;
  Result upper_r;


  char c;
  do {
    if (!is.get(c))
      goto fail;
  } while (is_space(c));


  if (c == '(')
    lower_open = true;
  else if (c == '[') {
    if (!is.get(c))
      goto fail;
    if (c == ']') {

      x.assign(EMPTY);
      return is;
    }
    else
      is.unget();
  }
  else
    goto unexpected;


  lower_r = input(lower_bound, is, ROUND_DOWN);
  if (lower_r == V_CVT_STR_UNK || lower_r == V_NAN)
    goto fail;
  lower_r = result_relation_class(lower_r);


  do {
    if (!is.get(c))
      goto fail;
  } while (is_space(c));
  if (c != ',')
    goto unexpected;


  upper_r = input(upper_bound, is, ROUND_UP);
  if (upper_r == V_CVT_STR_UNK || upper_r == V_NAN)
    goto fail;
  upper_r = result_relation_class(upper_r);


  do {
    if (!is.get(c))
      goto fail;
  } while (is_space(c));
  if (c == ')')
    upper_open = true;
  else if (c != ']') {
  unexpected:
    is.unget();
  fail:
    is.setstate(std::ios::failbit);
    return is;
  }


  switch (lower_r) {
  case V_EQ:
  case V_GE:
    break;
  case V_GT:
    lower_open = true;
    break;
  case V_GT_MINUS_INFINITY:
    lower_open = true;

  case V_EQ_MINUS_INFINITY:
    lower_boundary_infinity = true;
    break;
  case V_EQ_PLUS_INFINITY:
  case V_LT_PLUS_INFINITY:
    if (upper_r == V_EQ_PLUS_INFINITY || upper_r == V_LT_PLUS_INFINITY)
      x.assign(UNIVERSE);
    else
      x.assign(EMPTY);
    return is;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
  switch (upper_r) {
  case V_EQ:
  case V_LE:
    break;
  case V_LT:
    upper_open = true;
    break;
  case V_GT_MINUS_INFINITY:
    upper_open = true;

  case V_EQ_MINUS_INFINITY:
    if (lower_r == V_EQ_MINUS_INFINITY || lower_r == V_GT_MINUS_INFINITY)
      x.assign(UNIVERSE);
    else
      x.assign(EMPTY);
    return is;
  case V_EQ_PLUS_INFINITY:
  case V_LT_PLUS_INFINITY:
    upper_boundary_infinity = true;
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }

  if (!lower_boundary_infinity
      && !upper_boundary_infinity
      && (lower_bound > upper_bound
          || (lower_open && lower_bound == upper_bound)))
    x.assign(EMPTY);
  else {
    if (lower_boundary_infinity)
      set_minus_infinity(LOWER, x.lower(), x.info(), lower_open);
    else
      assign(LOWER, x.lower(), x.info(),
             LOWER, lower_bound, SCALAR_INFO, lower_open);
    if (upper_boundary_infinity)
      set_plus_infinity(UPPER, x.upper(), x.info(), upper_open);
    else
      assign(UPPER, x.upper(), x.info(),
             UPPER, upper_bound, SCALAR_INFO, upper_open);
  }
  return is;
}

template <typename Boundary, typename Info>
template <typename From>
typename Enable_If<Is_Interval<From>::value, bool>::type
Interval<Boundary, Info>::simplify_using_context_assign(const From& y) {

  if (lt(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y))) {
    lower_extend();
    return false;
  }
  if (gt(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y))) {
    upper_extend();
    return false;
  }

  if (!upper_is_boundary_infinity() && !y.upper_is_boundary_infinity()
      && y.upper() <= upper())
    upper_extend();

  if (!lower_is_boundary_infinity() && !y.lower_is_boundary_infinity()
      && y.lower() >= lower())
    lower_extend();
  return true;
}

template <typename Boundary, typename Info>
template <typename From>
typename Enable_If<Is_Interval<From>::value, void>::type
Interval<Boundary, Info>::empty_intersection_assign(const From&) {

  assign(EMPTY);
}

}
# 762 "Interval_defs.hh" 2
# 30 "Polyhedron_templates.hh" 2


# 1 "Floating_Point_Expression_defs.hh" 1
# 28 "Floating_Point_Expression_defs.hh"
# 1 "Floating_Point_Expression_types.hh" 1
# 16 "Floating_Point_Expression_types.hh"
namespace Parma_Polyhedra_Library {

template <typename FP_Interval_Type, typename FP_Format>
class Floating_Point_Expression;

}
# 29 "Floating_Point_Expression_defs.hh" 2





namespace Parma_Polyhedra_Library {
# 54 "Floating_Point_Expression_defs.hh"
template <typename FP_Interval_Type, typename FP_Format>
class Floating_Point_Expression {

public:


  typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;
# 70 "Floating_Point_Expression_defs.hh"
  typedef Box<FP_Interval_Type> FP_Interval_Abstract_Store;






  typedef std::map<dimension_type, FP_Linear_Form>
          FP_Linear_Form_Abstract_Store;


  typedef typename FP_Interval_Type::boundary_type boundary_type;


  typedef typename FP_Interval_Type::info_type info_type;


  virtual ~Floating_Point_Expression();
# 114 "Floating_Point_Expression_defs.hh"
  virtual bool linearize(const FP_Interval_Abstract_Store& int_store,
                         const FP_Linear_Form_Abstract_Store& lf_store,
                         FP_Linear_Form& result) const = 0;
# 126 "Floating_Point_Expression_defs.hh"
  static FP_Interval_Type absolute_error;
# 136 "Floating_Point_Expression_defs.hh"
  static bool overflows(const FP_Linear_Form& lf);
# 163 "Floating_Point_Expression_defs.hh"
  static void relative_error(const FP_Linear_Form& lf,
                             FP_Linear_Form& result);
# 183 "Floating_Point_Expression_defs.hh"
  static void intervalize(const FP_Linear_Form& lf,
                          const FP_Interval_Abstract_Store& store,
                          FP_Interval_Type& result);

private:
# 198 "Floating_Point_Expression_defs.hh"
  static FP_Interval_Type compute_absolute_error();

};


template <typename FP_Interval_Type, typename FP_Format>
FP_Interval_Type Floating_Point_Expression<FP_Interval_Type, FP_Format>
  ::absolute_error = compute_absolute_error();

}

# 1 "Floating_Point_Expression_inlines.hh" 1
# 30 "Floating_Point_Expression_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename FP_Interval_Type, typename FP_Format>
inline
Floating_Point_Expression<FP_Interval_Type, FP_Format>
::~Floating_Point_Expression() {}

template <typename FP_Interval_Type, typename FP_Format>
inline bool
Floating_Point_Expression<FP_Interval_Type, FP_Format>
::overflows(const FP_Linear_Form& lf) {
  if (!lf.inhomogeneous_term().is_bounded())
    return true;

  dimension_type dimension = lf.space_dimension();
  for (dimension_type i = 0; i < dimension; ++i) {
    if (!lf.coefficient(Variable(i)).is_bounded())
      return true;
  }

  return false;
}

}
# 210 "Floating_Point_Expression_defs.hh" 2
# 1 "Floating_Point_Expression_templates.hh" 1
# 31 "Floating_Point_Expression_templates.hh"
namespace Parma_Polyhedra_Library {

template<typename FP_Interval_Type, typename FP_Format>
void
Floating_Point_Expression<FP_Interval_Type, FP_Format>
::relative_error(const FP_Linear_Form& lf, FP_Linear_Form& result) {

  FP_Interval_Type error_propagator;
  boundary_type lb = -pow(FP_Format::BASE,
  -static_cast<typename Floating_Point_Expression<FP_Interval_Type, FP_Format>
  ::boundary_type>(FP_Format::MANTISSA_BITS));
  error_propagator.build(i_constraint(GREATER_OR_EQUAL, lb),
                         i_constraint(LESS_OR_EQUAL, -lb));


  const FP_Interval_Type* current_term = &lf.inhomogeneous_term();
  (static_cast<void> (0));

  FP_Interval_Type
    current_multiplier(std::max(std::abs(current_term->lower()),
                                std::abs(current_term->upper())));
  FP_Linear_Form current_result_term(current_multiplier);
  current_result_term *= error_propagator;
  result = FP_Linear_Form(current_result_term);


  dimension_type dimension = lf.space_dimension();
  for (dimension_type i = 0; i < dimension; ++i) {
    current_term = &lf.coefficient(Variable(i));
    (static_cast<void> (0));
    current_multiplier
      = FP_Interval_Type(std::max(std::abs(current_term->lower()),
                                  std::abs(current_term->upper())));
    current_result_term = FP_Linear_Form(Variable(i));
    current_result_term *= current_multiplier;
    current_result_term *= error_propagator;
    result += current_result_term;
  }

  return;
}

template<typename FP_Interval_Type, typename FP_Format>
void
Floating_Point_Expression<FP_Interval_Type, FP_Format>
::intervalize(const FP_Linear_Form& lf,
              const FP_Interval_Abstract_Store& store,
              FP_Interval_Type& result) {
  result = FP_Interval_Type(lf.inhomogeneous_term());
  dimension_type dimension = lf.space_dimension();
  (static_cast<void> (0));
  for (dimension_type i = 0; i < dimension; ++i) {
    FP_Interval_Type current_addend = lf.coefficient(Variable(i));
    const FP_Interval_Type& curr_int = store.get_interval(Variable(i));
    current_addend *= curr_int;
    result += current_addend;
  }

  return;
}

template<typename FP_Interval_Type, typename FP_Format>
FP_Interval_Type
Floating_Point_Expression<FP_Interval_Type, FP_Format>
::compute_absolute_error() {
  typedef typename Floating_Point_Expression<FP_Interval_Type, FP_Format>
    ::boundary_type Boundary;
  boundary_type omega;
  omega = std::max(pow(static_cast<Boundary>(FP_Format::BASE),
                       static_cast<Boundary>(1 - FP_Format::EXPONENT_BIAS
                                             - FP_Format::MANTISSA_BITS)),
                   std::numeric_limits<Boundary>::denorm_min());
  FP_Interval_Type result;
  result.build(i_constraint(GREATER_OR_EQUAL, -omega),
               i_constraint(LESS_OR_EQUAL, omega));
  return result;
}

}
# 211 "Floating_Point_Expression_defs.hh" 2
# 33 "Polyhedron_templates.hh" 2



namespace Parma_Polyhedra_Library {

template <typename Interval>
Polyhedron::Polyhedron(Topology topol,
                       const Box<Interval>& box,
                       Complexity_Class)
  : con_sys(topol, default_con_sys_repr),
    gen_sys(topol, default_gen_sys_repr),
    sat_c(),
    sat_g() {

  space_dim = box.space_dimension();


  if (box.is_empty()) {
    set_empty();
    return;
  }


  if (space_dim == 0) {
    set_zero_dim_univ();
    return;
  }


  con_sys.set_space_dimension(space_dim);

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_l_n; Parma_Polyhedra_Library::Coefficient& l_n = holder_l_n.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_l_d; Parma_Polyhedra_Library::Coefficient& l_d = holder_l_d.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_u_n; Parma_Polyhedra_Library::Coefficient& u_n = holder_u_n.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_u_d; Parma_Polyhedra_Library::Coefficient& u_d = holder_u_d.item();

  if (topol == NECESSARILY_CLOSED) {
    for (dimension_type k = space_dim; k-- > 0; ) {
      const Variable v_k = Variable(k);

      bool l_closed = false;
      bool l_bounded = box.has_lower_bound(v_k, l_n, l_d, l_closed);

      bool u_closed = false;
      bool u_bounded = box.has_upper_bound(v_k, u_n, u_d, u_closed);


      if (l_bounded && u_bounded
          && l_closed && u_closed
          && l_n == u_n && l_d == u_d) {

        con_sys.insert(l_d * v_k == l_n);
      }
      else {
        if (l_bounded)

          con_sys.insert(l_d * v_k >= l_n);
        if (u_bounded)

          con_sys.insert(u_d * v_k <= u_n);
      }
    }
  }
  else {

    for (dimension_type k = space_dim; k-- > 0; ) {
      const Variable v_k = Variable(k);

      bool l_closed = false;
      bool l_bounded = box.has_lower_bound(v_k, l_n, l_d, l_closed);

      bool u_closed = false;
      bool u_bounded = box.has_upper_bound(v_k, u_n, u_d, u_closed);


      if (l_bounded && u_bounded
          && l_closed && u_closed
          && l_n == u_n && l_d == u_d) {

        con_sys.insert(l_d * v_k == l_n);
      }
      else {

        if (l_bounded) {
          if (l_closed)

            con_sys.insert(l_d * v_k >= l_n);
          else

            con_sys.insert(l_d * v_k > l_n);
        }

        if (u_bounded) {
          if (u_closed)

            con_sys.insert(u_d * v_k <= u_n);
          else

            con_sys.insert(u_d * v_k < u_n);
        }
      }
    }
  }


  con_sys.add_low_level_constraints();


  set_constraints_up_to_date();
  ((void) 0);
}

template <typename Partial_Function>
void
Polyhedron::map_space_dimensions(const Partial_Function& pfunc) {
  if (space_dim == 0)
    return;

  if (pfunc.has_empty_codomain()) {

    if (marked_empty()
        || (has_pending_constraints()
            && !remove_pending_to_obtain_generators())
        || (!generators_are_up_to_date() && !update_generators())) {

      space_dim = 0;
      con_sys.clear();
    }
    else

      set_zero_dim_univ();

    ((void) 0);
    return;
  }

  const dimension_type new_space_dimension = pfunc.max_in_codomain() + 1;

  if (new_space_dimension == space_dim) {





    std::vector<Variable> cycle;
    cycle.reserve(space_dim);


    std::deque<bool> visited(space_dim);

    for (dimension_type i = space_dim; i-- > 0; ) {
      if (visited[i])
        continue;

      dimension_type j = i;
      do {
        visited[j] = true;

        dimension_type k = 0;
        if (!pfunc.maps(j, k))
          throw_invalid_argument("map_space_dimensions(pfunc)",
                                 " pfunc is inconsistent");
        if (k == j)
          break;

        cycle.push_back(Variable(j));

        j = k;
      } while (!visited[j]);






      if (constraints_are_up_to_date())
        con_sys.permute_space_dimensions(cycle);

      if (generators_are_up_to_date())
        gen_sys.permute_space_dimensions(cycle);

      cycle.clear();
    }

    ((void) 0);
    return;
  }





  const Generator_System& old_gensys = generators();

  if (old_gensys.has_no_rows()) {

    Polyhedron new_polyhedron(topology(), new_space_dimension, EMPTY);
    m_swap(new_polyhedron);
    ((void) 0);
    return;
  }


  std::vector<dimension_type> pfunc_maps(space_dim, not_a_dimension());
  for (dimension_type j = space_dim; j-- > 0; ) {
    dimension_type pfunc_j;
    if (pfunc.maps(j, pfunc_j))
      pfunc_maps[j] = pfunc_j;
  }

  Generator_System new_gensys;
  for (Generator_System::const_iterator i = old_gensys.begin(),
         old_gensys_end = old_gensys.end(); i != old_gensys_end; ++i) {
    const Generator& old_g = *i;
    const Generator::expr_type old_e = old_g.expression();
    Linear_Expression expr;
    expr.set_space_dimension(new_space_dimension);
    bool all_zeroes = true;
    for (Generator::expr_type::const_iterator j = old_e.begin(),
          j_end = old_e.end(); j != j_end; ++j) {
      const dimension_type mapped_id = pfunc_maps[j.variable().id()];
      if (mapped_id != not_a_dimension()) {
        add_mul_assign(expr, *j, Variable(mapped_id));
        all_zeroes = false;
      }
    }
    switch (old_g.type()) {
    case Generator::LINE:
      if (!all_zeroes)
        new_gensys.insert(line(expr));
      break;
    case Generator::RAY:
      if (!all_zeroes)
        new_gensys.insert(ray(expr));
      break;
    case Generator::POINT:

      new_gensys.insert(point(expr, old_g.divisor()));
      break;
    case Generator::CLOSURE_POINT:

      new_gensys.insert(closure_point(expr, old_g.divisor()));
      break;
    }
  }
  Polyhedron new_polyhedron(topology(), new_gensys);
  m_swap(new_polyhedron);
  ((void) 0);
}

template <typename FP_Format, typename Interval_Info>
void
Polyhedron::refine_with_linear_form_inequality(
  const Linear_Form< Interval<FP_Format, Interval_Info> >& left,
  const Linear_Form< Interval<FP_Format, Interval_Info> >& right,
  const bool is_strict) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_293 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<FP_Format>::is_exact)>) };






  const dimension_type left_space_dim = left.space_dimension();
  if (space_dim < left_space_dim)
    throw_dimension_incompatible(
          "refine_with_linear_form_inequality(l1, l2, s)", "l1", left);

  const dimension_type right_space_dim = right.space_dimension();
  if (space_dim < right_space_dim)
    throw_dimension_incompatible(
          "refine_with_linear_form_inequality(l1, l2, s)", "l2", right);


  ((void) 0);

  typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
  typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;

  if (Floating_Point_Expression<FP_Interval_Type, float_ieee754_single>::
      overflows(left))
    return;

  if (Floating_Point_Expression<FP_Interval_Type, float_ieee754_single>::
      overflows(right))
    return;


  FP_Linear_Form left_minus_right(left);
  left_minus_right -= right;
  if (Floating_Point_Expression<FP_Interval_Type, float_ieee754_single>::
      overflows(left_minus_right))
    return;

  dimension_type lf_space_dim = left_minus_right.space_dimension();
  FP_Linear_Form lf_approx;
  overapproximate_linear_form(left_minus_right, lf_space_dim, lf_approx);
  if (Floating_Point_Expression<FP_Interval_Type, float_ieee754_single>::
      overflows(lf_approx))
    return;


  Linear_Expression lf_approx_le;
  convert_to_integer_expression(lf_approx, lf_space_dim, lf_approx_le);


  if (!is_strict || is_necessarily_closed())
    refine_with_constraint(lf_approx_le <= 0);
  else
    refine_with_constraint(lf_approx_le < 0);
}

template <typename FP_Format, typename Interval_Info>
void
Polyhedron::affine_form_image(const Variable var,
const Linear_Form<Interval <FP_Format, Interval_Info> >& lf) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_355 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<FP_Format>::is_exact)>) };





  const dimension_type lf_space_dim = lf.space_dimension();
  if (space_dim < lf_space_dim)
    throw_dimension_incompatible("affine_form_image(v, l, s)", "l", lf);


  const dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("affine_form_image(v, l, s)", "v", var);


  ((void) 0);

  typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
  typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;

  if (Floating_Point_Expression<FP_Interval_Type, float_ieee754_single>::
      overflows(lf)) {
    *this = Polyhedron(topology(), space_dim, UNIVERSE);
    return;
  }


  FP_Linear_Form lf_approx;
  overapproximate_linear_form(lf, lf_space_dim, lf_approx);

  if (Floating_Point_Expression<FP_Interval_Type, float_ieee754_single>::
      overflows(lf_approx)) {
    *this = Polyhedron(topology(), space_dim, UNIVERSE);
    return;
  }


  Linear_Expression lf_approx_le;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_lo_coeff; Parma_Polyhedra_Library::Coefficient& lo_coeff = holder_lo_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_hi_coeff; Parma_Polyhedra_Library::Coefficient& hi_coeff = holder_hi_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denominator; Parma_Polyhedra_Library::Coefficient& denominator = holder_denominator.item();
  convert_to_integer_expressions(lf_approx, lf_space_dim, lf_approx_le,
                                 lo_coeff, hi_coeff, denominator);


  bounded_affine_image(var, lf_approx_le + lo_coeff, lf_approx_le + hi_coeff,
                       denominator);
}

template <typename FP_Format, typename Interval_Info>
void
Polyhedron::overapproximate_linear_form
(const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
 const dimension_type lf_dimension,
 Linear_Form<Interval <FP_Format, Interval_Info> >& result) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_413 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<FP_Format>::is_exact)>) };



  typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
  typedef Linear_Form<FP_Interval_Type> FP_Linear_Form;



  Box<FP_Interval_Type> box(*this);

  result = FP_Linear_Form(lf.inhomogeneous_term());

  const FP_Interval_Type aux_divisor1(static_cast<FP_Format>(0.5));
  FP_Interval_Type aux_divisor2(aux_divisor1);
  aux_divisor2.lower() = static_cast<FP_Format>(-0.5);

  for (dimension_type i = 0; i < lf_dimension; ++i) {
    Variable curr_var(i);
    const FP_Interval_Type& curr_coeff = lf.coefficient(curr_var);
    ((void) 0);
    FP_Format curr_lb = curr_coeff.lower();
    FP_Format curr_ub = curr_coeff.upper();
    if (curr_lb != 0 || curr_ub != 0) {
      const FP_Interval_Type& curr_int = box.get_interval(curr_var);
      FP_Interval_Type curr_addend(curr_ub - curr_lb);
      curr_addend *= aux_divisor2;
      curr_addend *= curr_int;
      result += curr_addend;
      curr_addend = FP_Interval_Type(curr_lb + curr_ub);
      curr_addend *= aux_divisor1;
      FP_Linear_Form curr_addend_lf(curr_var);
      curr_addend_lf *= curr_addend;
      result += curr_addend_lf;
    }
  }
}

template <typename FP_Format, typename Interval_Info>
void
Polyhedron::convert_to_integer_expression(
                const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
                const dimension_type lf_dimension,
                Linear_Expression& result) {
  result = Linear_Expression();

  typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
  std::vector<Coefficient> numerators(lf_dimension+1);
  std::vector<Coefficient> denominators(lf_dimension+1);



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_lcm; Parma_Polyhedra_Library::Coefficient& lcm = holder_lcm.item();
  lcm = 1;
  const FP_Interval_Type& b = lf.inhomogeneous_term();

  numer_denom(b.lower(), numerators[lf_dimension],
                         denominators[lf_dimension]);
  if (numerators[lf_dimension] != 0)
      lcm_assign(lcm, lcm, denominators[lf_dimension]);

  for (dimension_type i = 0; i < lf_dimension; ++i) {
    const FP_Interval_Type& curr_int = lf.coefficient(Variable(i));
    numer_denom(curr_int.lower(), numerators[i], denominators[i]);
    if (numerators[i] != 0)
      lcm_assign(lcm, lcm, denominators[i]);
  }

  for (dimension_type i = 0; i < lf_dimension; ++i) {
    if (numerators[i] != 0) {
      exact_div_assign(denominators[i], lcm, denominators[i]);
      numerators[i] *= denominators[i];
      result += numerators[i] * Variable(i);
    }
  }

  if (numerators[lf_dimension] != 0) {
    exact_div_assign(denominators[lf_dimension],
                     lcm, denominators[lf_dimension]);
    numerators[lf_dimension] *= denominators[lf_dimension];
    result += numerators[lf_dimension];
  }
}

template <typename FP_Format, typename Interval_Info>
void
Polyhedron::convert_to_integer_expressions(
                const Linear_Form<Interval <FP_Format, Interval_Info> >& lf,
                const dimension_type lf_dimension, Linear_Expression& res,
                Coefficient& res_low_coeff, Coefficient& res_hi_coeff,
                Coefficient& denominator) {
  res = Linear_Expression();

  typedef Interval<FP_Format, Interval_Info> FP_Interval_Type;
  std::vector<Coefficient> numerators(lf_dimension+2);
  std::vector<Coefficient> denominators(lf_dimension+2);



  Coefficient& lcm = denominator;
  lcm = 1;
  const FP_Interval_Type& b = lf.inhomogeneous_term();
  numer_denom(b.lower(), numerators[lf_dimension], denominators[lf_dimension]);

  if (numerators[lf_dimension] != 0)
      lcm_assign(lcm, lcm, denominators[lf_dimension]);

  numer_denom(b.upper(), numerators[lf_dimension+1],
                         denominators[lf_dimension+1]);
  if (numerators[lf_dimension+1] != 0)
      lcm_assign(lcm, lcm, denominators[lf_dimension+1]);

  for (dimension_type i = 0; i < lf_dimension; ++i) {
    const FP_Interval_Type& curr_int = lf.coefficient(Variable(i));
    numer_denom(curr_int.lower(), numerators[i], denominators[i]);
    if (numerators[i] != 0)
      lcm_assign(lcm, lcm, denominators[i]);
  }

  for (dimension_type i = 0; i < lf_dimension; ++i) {
    if (numerators[i] != 0) {
      exact_div_assign(denominators[i], lcm, denominators[i]);
      numerators[i] *= denominators[i];
      res += numerators[i] * Variable(i);
    }
  }

  if (numerators[lf_dimension] != 0) {
    exact_div_assign(denominators[lf_dimension],
                     lcm, denominators[lf_dimension]);
    numerators[lf_dimension] *= denominators[lf_dimension];
    res_low_coeff = numerators[lf_dimension];
  }
  else
    res_low_coeff = Coefficient(0);

  if (numerators[lf_dimension+1] != 0) {
    exact_div_assign(denominators[lf_dimension+1],
                     lcm, denominators[lf_dimension+1]);
    numerators[lf_dimension+1] *= denominators[lf_dimension+1];
    res_hi_coeff = numerators[lf_dimension+1];
  }
  else
    res_hi_coeff = Coefficient(0);
}

template <typename C>
void
Polyhedron::throw_dimension_incompatible(const char* method,
                                         const char* lf_name,
                                         const Linear_Form<C>& lf) const {
  throw_dimension_incompatible(method, lf_name, lf.space_dimension());
}

template <typename Input>
Input&
Polyhedron::check_obj_space_dimension_overflow(Input& input,
                                               const Topology topol,
                                               const char* method,
                                               const char* reason) {
  check_space_dimension_overflow(input.space_dimension(),
                                 max_space_dimension(),
                                 topol, method, reason);
  return input;
}

}
# 2838 "Polyhedron_defs.hh" 2
# 1 "Polyhedron_chdims_templates.hh" 1
# 28 "Polyhedron_chdims_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename Linear_System1, typename Linear_System2>
void
Polyhedron::add_space_dimensions(Linear_System1& sys1,
                                 Linear_System2& sys2,
                                 Bit_Matrix& sat1,
                                 Bit_Matrix& sat2,
                                 dimension_type add_dim) {

  typedef typename Linear_System2::row_type sys2_row_type;

  ((void) 0);
  ((void) 0);
  ((void) 0);

  sys1.set_space_dimension(sys1.space_dimension() + add_dim);
  sys2.add_universe_rows_and_space_dimensions(add_dim);







  sat1.resize(sat1.num_rows() + add_dim, sat1.num_columns());

  for (dimension_type i = sat1.num_rows() - add_dim; i-- > 0; )
    swap(sat1[i], sat1[i+add_dim]);

  sat2.transpose_assign(sat1);
}

}
# 2839 "Polyhedron_defs.hh" 2
# 1 "Polyhedron_conversion_templates.hh" 1
# 29 "Polyhedron_conversion_templates.hh"
# 1 "Polyhedron_defs.hh" 1
# 30 "Polyhedron_conversion_templates.hh" 2



# 1 "math_utilities_defs.hh" 1
# 31 "math_utilities_defs.hh"
namespace Parma_Polyhedra_Library {




template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, void>::type
numer_denom(const T& from,
            Coefficient& numer, Coefficient& denom);




template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, void>::type
div_round_up(T& to,
             Coefficient_traits::const_reference x,
             Coefficient_traits::const_reference y);




template <typename N>
void
min_assign(N& x, const N& y);




template <typename N>
void
max_assign(N& x, const N& y);




template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_even(const T& x);




template <typename T>
typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_additive_inverse(const T& x, const T& y);
# 88 "math_utilities_defs.hh"
void
normalize2(Coefficient_traits::const_reference x,
           Coefficient_traits::const_reference y,
           Coefficient& n_x, Coefficient& n_y);




bool
is_canonical(const mpq_class& x);




template <typename T>
T
low_bits_mask(unsigned n);

}

# 1 "math_utilities_inlines.hh" 1
# 31 "math_utilities_inlines.hh"
namespace Parma_Polyhedra_Library {

inline void
normalize2(Coefficient_traits::const_reference x,
           Coefficient_traits::const_reference y,
           Coefficient& n_x, Coefficient& n_y) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_gcd; Parma_Polyhedra_Library::Coefficient& gcd = holder_gcd.item();
  gcd_assign(gcd, x, y);
  exact_div_assign(n_x, x, gcd);
  exact_div_assign(n_y, y, gcd);
}

template <typename T>
inline T
low_bits_mask(const unsigned n) {
  ((void) 0);
  return ~((~static_cast<T>(0)) << n);
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, void>::type
numer_denom(const T& from,
            Coefficient& numer, Coefficient& denom) {
  ((void) 0);


  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  assign_r(q, from, ROUND_NOT_NEEDED);
  numer = q.get_num();
  denom = q.get_den();
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, void>::type
div_round_up(T& to,
             Coefficient_traits::const_reference x,
             Coefficient_traits::const_reference y) {
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_x; mpq_class& q_x = holder_q_x.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_y; mpq_class& q_y = holder_q_y.item();


  assign_r(q_x, x, ROUND_NOT_NEEDED);
  assign_r(q_y, y, ROUND_NOT_NEEDED);
  div_assign_r(q_x, q_x, q_y, ROUND_NOT_NEEDED);
  assign_r(to, q_x, ROUND_UP);
}

template <typename N>
inline void
min_assign(N& x, const N& y) {
  if (x > y)
    x = y;
}

template <typename N>
inline void
max_assign(N& x, const N& y) {
  if (x < y)
    x = y;
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_even(const T& x) {
  T mod;
  return umod_2exp_assign_r(mod, x, 1, ROUND_DIRECT | ROUND_STRICT_RELATION) == V_EQ
    && mod == 0;
}

template <typename T>
inline typename Enable_If<Is_Native_Or_Checked<T>::value, bool>::type
is_additive_inverse(const T& x, const T& y) {
  T negated_x;
  return neg_assign_r(negated_x, x, ROUND_DIRECT | ROUND_STRICT_RELATION) == V_EQ
    && negated_x == y;
}

inline bool
is_canonical(const mpq_class& x) {
  if (x.get_den() <= 0)
    return false;
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_temp; mpq_class& temp = holder_temp.item();
  temp = x;
  temp.canonicalize();
  return temp.get_num() == x.get_num();
}

}
# 109 "math_utilities_defs.hh" 2
# 34 "Polyhedron_conversion_templates.hh" 2




namespace Parma_Polyhedra_Library {
# 349 "Polyhedron_conversion_templates.hh"
template <typename Source_Linear_System, typename Dest_Linear_System>
dimension_type
Polyhedron::conversion(Source_Linear_System& source,
                       const dimension_type start,
                       Dest_Linear_System& dest,
                       Bit_Matrix& sat,
                       dimension_type num_lines_or_equalities) {
  typedef typename Dest_Linear_System::row_type dest_row_type;
  typedef typename Source_Linear_System::row_type source_row_type;



  ((void) 0);
  const dimension_type source_space_dim = source.space_dimension();
  const dimension_type source_num_rows = source.num_rows();
  const dimension_type source_num_columns = source_space_dim
    + (source.is_necessarily_closed() ? 1U : 2U);


  dimension_type dest_num_rows = dest.num_rows();


  std::vector<dest_row_type> recyclable_dest_rows;

  using std::swap;




  ((void) 0);
  ((void) 0);


  ((void) 0);

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_normalized_sp_i; Parma_Polyhedra_Library::Coefficient& normalized_sp_i = holder_normalized_sp_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_normalized_sp_o; Parma_Polyhedra_Library::Coefficient& normalized_sp_o = holder_normalized_sp_o.item();

  bool dest_sorted = dest.is_sorted();
  const dimension_type dest_first_pending_row = dest.first_pending_row();


  std::vector<dimension_type> redundant_source_rows;



  for (dimension_type k = start; k < source_num_rows; ++k) {
    const source_row_type& source_k = source[k];





    Parma_Polyhedra_Library::Dirty_Temp<std::vector<Coefficient> > holder_scalar_prod; std::vector<Coefficient>& scalar_prod = holder_scalar_prod.item();
    if (dest_num_rows > scalar_prod.size()) {
      scalar_prod.insert(scalar_prod.end(),
                         dest_num_rows - scalar_prod.size(),
                         Coefficient_zero());
    }


    dimension_type index_non_zero = 0;
    for ( ; index_non_zero < dest_num_rows; ++index_non_zero) {
      do { } while (false);
      Scalar_Products::assign(scalar_prod[index_non_zero],
                              source_k,
                              dest.sys.rows[index_non_zero]);
      do { Weightwatch_Traits::weight += (17)*(source_space_dim); } while (false);
      if (scalar_prod[index_non_zero] != 0)

        break;



      maybe_abandon();
    }
    for (dimension_type i = index_non_zero + 1; i < dest_num_rows; ++i) {
      do { } while (false);
      Scalar_Products::assign(scalar_prod[i], source_k, dest.sys.rows[i]);
      do { Weightwatch_Traits::weight += (25)*(source_space_dim); } while (false);



      maybe_abandon();
    }
# 442 "Polyhedron_conversion_templates.hh"
    if (index_non_zero < num_lines_or_equalities) {




      dest.sys.rows[index_non_zero].set_is_ray_or_point_or_inequality();



      if (scalar_prod[index_non_zero] < 0) {


        neg_assign(scalar_prod[index_non_zero]);
        neg_assign(dest.sys.rows[index_non_zero].expr);


      }



      dest_sorted = false;
      --num_lines_or_equalities;
      if (index_non_zero != num_lines_or_equalities) {
        swap(dest.sys.rows[index_non_zero],
             dest.sys.rows[num_lines_or_equalities]);
        swap(scalar_prod[index_non_zero],
             scalar_prod[num_lines_or_equalities]);
      }
      const dest_row_type& dest_nle = dest.sys.rows[num_lines_or_equalities];
# 487 "Polyhedron_conversion_templates.hh"
      Coefficient& scalar_prod_nle = scalar_prod[num_lines_or_equalities];
      ((void) 0);
      for (dimension_type
             i = index_non_zero; i < num_lines_or_equalities; ++i) {
        if (scalar_prod[i] != 0) {
# 504 "Polyhedron_conversion_templates.hh"
          normalize2(scalar_prod[i],
                     scalar_prod_nle,
                     normalized_sp_i,
                     normalized_sp_o);
          dest_row_type& dest_i = dest.sys.rows[i];
          neg_assign(normalized_sp_i);
          dest_i.expr.linear_combine(dest_nle.expr,
                                     normalized_sp_o, normalized_sp_i);
          dest_i.strong_normalize();


          scalar_prod[i] = 0;

        }
      }
# 527 "Polyhedron_conversion_templates.hh"
      for (dimension_type
             i = num_lines_or_equalities + 1; i < dest_num_rows; ++i) {
        if (scalar_prod[i] != 0) {
# 542 "Polyhedron_conversion_templates.hh"
          normalize2(scalar_prod[i],
                     scalar_prod_nle,
                     normalized_sp_i,
                     normalized_sp_o);
          dest_row_type& dest_i = dest.sys.rows[i];
          do { } while (false);
          neg_assign(normalized_sp_i);
          dest_i.expr.linear_combine(dest_nle.expr,
                                     normalized_sp_o, normalized_sp_i);
          dest_i.strong_normalize();


          scalar_prod[i] = 0;

          do { Weightwatch_Traits::weight += (41)*(source_space_dim); } while (false);
        }



        maybe_abandon();
      }




      Bit_Row& sat_nle = sat[num_lines_or_equalities];
      if (source_k.is_ray_or_point_or_inequality())
        sat_nle.set(k - redundant_source_rows.size());



      else {
        --dest_num_rows;
        swap(dest.sys.rows[num_lines_or_equalities],
             dest.sys.rows[dest_num_rows]);
        recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1);
        swap(dest.sys.rows.back(), recyclable_dest_rows.back());
        dest.sys.rows.pop_back();
        ((void) 0);

        swap(scalar_prod_nle, scalar_prod[dest_num_rows]);
        swap(sat_nle, sat[dest_num_rows]);

      }
    }


    else {
# 602 "Polyhedron_conversion_templates.hh"
      dimension_type lines_or_equal_bound = num_lines_or_equalities;
      dimension_type inf_bound = dest_num_rows;


      while (inf_bound > lines_or_equal_bound
             && scalar_prod[lines_or_equal_bound] == 0)
        ++lines_or_equal_bound;
      dimension_type sup_bound = lines_or_equal_bound;
      while (inf_bound > sup_bound) {
        const int sp_sign = sgn(scalar_prod[sup_bound]);
        if (sp_sign == 0) {

          swap(dest.sys.rows[sup_bound], dest.sys.rows[lines_or_equal_bound]);
          swap(scalar_prod[sup_bound], scalar_prod[lines_or_equal_bound]);
          swap(sat[sup_bound], sat[lines_or_equal_bound]);
          ++lines_or_equal_bound;
          ++sup_bound;
          dest_sorted = false;
        }
        else if (sp_sign < 0) {

          --inf_bound;
          swap(dest.sys.rows[sup_bound], dest.sys.rows[inf_bound]);
          swap(sat[sup_bound], sat[inf_bound]);
          swap(scalar_prod[sup_bound], scalar_prod[inf_bound]);
          dest_sorted = false;
        }
        else

          ++sup_bound;
      }

      if (sup_bound == dest_num_rows) {





        if (source_k.is_ray_or_point_or_inequality()) {
          redundant_source_rows.push_back(k);
        }
        else {



          ((void) 0);
          while (dest_num_rows != lines_or_equal_bound) {
            recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1);
            swap(dest.sys.rows.back(), recyclable_dest_rows.back());
            dest.sys.rows.pop_back();
            --dest_num_rows;
          }
          ((void) 0);
        }
      }
      else {



        if (sup_bound == num_lines_or_equalities) {



          ((void) 0);
          while (dest_num_rows != sup_bound) {
            recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1);
            swap(dest.sys.rows.back(), recyclable_dest_rows.back());
            dest.sys.rows.pop_back();
            --dest_num_rows;
          }
          ((void) 0);
        }
        else {
# 686 "Polyhedron_conversion_templates.hh"
          const dimension_type bound = dest_num_rows;




          for (dimension_type i = lines_or_equal_bound; i < sup_bound; ++i) {
            for(dimension_type j = sup_bound; j < bound; ++j) {





              ((void) 0);

              ((void) 0);






              Bit_Row new_satrow(sat[i], sat[j]);




              const dimension_type num_common_satur
                = k - redundant_source_rows.size() - new_satrow.count_ones();
# 729 "Polyhedron_conversion_templates.hh"
              if (num_common_satur
                  >= source_num_columns - num_lines_or_equalities - 2) {



                bool redundant = false;
                do { } while (false);
                for (dimension_type
                       l = num_lines_or_equalities; l < bound; ++l)
                  if (l != i && l != j
                      && subset_or_equal(sat[l], new_satrow)) {



                    redundant = true;
                    break;
                  }
                ((void) 0);
                do { Weightwatch_Traits::weight += (15)*(bound - num_lines_or_equalities); } while (false);
                if (!redundant) {


                  dest_row_type new_row;
                  if (recyclable_dest_rows.empty()) {
                    sat.add_recycled_row(new_satrow);
                  }
                  else {
                    swap(new_row, recyclable_dest_rows.back());
                    recyclable_dest_rows.pop_back();
                    new_row.set_space_dimension_no_ok(source_space_dim);
                    swap(sat[dest_num_rows], new_satrow);
                  }
# 774 "Polyhedron_conversion_templates.hh"
                  normalize2(scalar_prod[i],
                             scalar_prod[j],
                             normalized_sp_i,
                             normalized_sp_o);
                  do { } while (false);

                  neg_assign(normalized_sp_o);
                  new_row = dest.sys.rows[j];

                  ((void) 0);
                  ((void) 0);
                  new_row.expr.linear_combine(dest.sys.rows[i].expr,
                                              normalized_sp_i, normalized_sp_o);

                  do { Weightwatch_Traits::weight += (86)*(source_space_dim); } while (false);
                  new_row.strong_normalize();







                  ((void) 0);
                  if (scalar_prod.size() <= dest_num_rows)
                    scalar_prod.push_back(Coefficient_zero());
                  else
                    scalar_prod[dest_num_rows] = Coefficient_zero();

                  dest.sys.rows.resize(dest.sys.rows.size() + 1);
                  swap(dest.sys.rows.back(), new_row);

                  ++dest_num_rows;
                }
              }
            }



            maybe_abandon();
          }


          dimension_type j;
          if (source_k.is_ray_or_point_or_inequality()) {


            j = sup_bound;





            const dimension_type new_k = k - redundant_source_rows.size();
            for (dimension_type l = lines_or_equal_bound; l < sup_bound; ++l)
              sat[l].set(new_k);
          }
          else


            j = lines_or_equal_bound;





          dimension_type i = dest_num_rows;
          while (j < bound && i > bound) {
            --i;
            swap(dest.sys.rows[i], dest.sys.rows[j]);
            swap(scalar_prod[i], scalar_prod[j]);
            swap(sat[i], sat[j]);
            ++j;
            dest_sorted = false;
          }







          const dimension_type new_num_rows = (j == bound) ? i : j;
          ((void) 0);
          while (dest_num_rows != new_num_rows) {
            recyclable_dest_rows.resize(recyclable_dest_rows.size() + 1);
            swap(dest.sys.rows.back(), recyclable_dest_rows.back());
            dest.sys.rows.pop_back();
            --dest_num_rows;
          }
          ((void) 0);
        }
      }
    }
  }



  if (redundant_source_rows.size() > 0) {
    source.remove_rows(redundant_source_rows);
    sat.remove_trailing_columns(redundant_source_rows.size());
  }
# 884 "Polyhedron_conversion_templates.hh"
  if (start > 0 && start < source.num_rows())
    source.set_sorted(compare(source[start - 1], source[start]) <= 0);

  source.unset_pending_rows();



  if (!recyclable_dest_rows.empty()) {
    const dimension_type num_removed_rows = recyclable_dest_rows.size();
    sat.remove_trailing_rows(num_removed_rows);
  }
  if (dest_sorted)



    for (dimension_type i = dest_first_pending_row; i < dest_num_rows; ++i)
      if (compare(dest.sys.rows[i - 1], dest.sys.rows[i]) > 0) {
        dest_sorted = false;
        break;
      }
# 912 "Polyhedron_conversion_templates.hh"
  dest.sys.index_first_pending = dest.num_rows();
  dest.set_sorted(dest_sorted);
  ((void) 0);

  return num_lines_or_equalities;
}

}
# 2840 "Polyhedron_defs.hh" 2
# 1 "Polyhedron_minimize_templates.hh" 1
# 31 "Polyhedron_minimize_templates.hh"
namespace Parma_Polyhedra_Library {
# 69 "Polyhedron_minimize_templates.hh"
template <typename Source_Linear_System, typename Dest_Linear_System>
bool
Polyhedron::minimize(const bool con_to_gen,
                     Source_Linear_System& source,
                     Dest_Linear_System& dest,
                     Bit_Matrix& sat) {

  typedef typename Dest_Linear_System::row_type dest_row_type;


  ((void) 0);





  ((void) 0);


  if (!source.is_sorted())
    source.sort_rows();
# 98 "Polyhedron_minimize_templates.hh"
  dimension_type dest_num_rows
    = source.topology() == NECESSARILY_CLOSED ? source.space_dimension() + 1
                                              : source.space_dimension() + 2;

  dest.clear();
  dest.set_space_dimension(source.space_dimension());


  for (dimension_type i = 0; i < dest_num_rows; ++i) {
    Linear_Expression expr;
    expr.set_space_dimension(dest_num_rows - 1);
    if (i == 0)
      expr += 1;
    else
      expr += Variable(i - 1);
    dest_row_type dest_i(expr, dest_row_type::LINE_OR_EQUALITY, NECESSARILY_CLOSED);
    if (dest.topology() == NOT_NECESSARILY_CLOSED)
      dest_i.mark_as_not_necessarily_closed();
    dest.sys.insert_no_ok(dest_i, Recycle_Input());
  }


  dest.set_sorted(false);
# 138 "Polyhedron_minimize_templates.hh"
  Bit_Matrix tmp_sat(dest_num_rows, source.num_rows());







  const dimension_type num_lines_or_equalities
    = conversion(source, 0U, dest, tmp_sat, dest_num_rows);

  dest_num_rows = dest.num_rows();
# 162 "Polyhedron_minimize_templates.hh"
  dimension_type first_point;
  if (dest.is_necessarily_closed()) {
    for (first_point = num_lines_or_equalities;
        first_point < dest_num_rows;
        ++first_point)
      if (dest[first_point].expr.inhomogeneous_term() > 0)
        break;
  }
  else {
    for (first_point = num_lines_or_equalities;
        first_point < dest_num_rows;
        ++first_point)
      if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0)
        break;
  }

  if (first_point == dest_num_rows)
    if (con_to_gen)

      return true;
    else {
# 191 "Polyhedron_minimize_templates.hh"
      Parma_Polyhedra_Library::ppl_unreachable();
      return false;
    }
  else {







    sat.transpose_assign(tmp_sat);
    simplify(source, sat);
    return false;
  }
}
# 254 "Polyhedron_minimize_templates.hh"
template <typename Source_Linear_System1, typename Source_Linear_System2,
          typename Dest_Linear_System>
bool
Polyhedron::add_and_minimize(const bool con_to_gen,
                             Source_Linear_System1& source1,
                             Dest_Linear_System& dest,
                             Bit_Matrix& sat,
                             const Source_Linear_System2& source2) {

  ((void) 0);


  ((void) 0);

  ((void) 0);
  ((void) 0);
  ((void) 0);

  const dimension_type old_source1_num_rows = source1.num_rows();

  dimension_type k1 = 0;
  dimension_type k2 = 0;
  dimension_type source2_num_rows = source2.num_rows();
  while (k1 < old_source1_num_rows && k2 < source2_num_rows) {






    const int cmp = compare(source1[k1], source2[k2]);
    if (cmp == 0) {

      ++k2;


      ++k1;
    }
    else if (cmp < 0)

      ++k1;
    else {



      source1.add_pending_row(source2[k2]);

      ++k2;
    }
  }

  if (k2 < source2_num_rows)



    for ( ; k2 < source2_num_rows; ++k2)
      source1.add_pending_row(source2[k2]);

  if (source1.num_pending_rows() == 0)



    return false;

  return add_and_minimize(con_to_gen, source1, dest, sat);
}
# 357 "Polyhedron_minimize_templates.hh"
template <typename Source_Linear_System, typename Dest_Linear_System>
bool
Polyhedron::add_and_minimize(const bool con_to_gen,
                             Source_Linear_System& source,
                             Dest_Linear_System& dest,
                             Bit_Matrix& sat) {
  ((void) 0);
  ((void) 0);
  ((void) 0);



  sat.resize(dest.num_rows(), source.num_rows());



  const dimension_type num_lines_or_equalities
    = conversion(source, source.first_pending_row(),
                 dest, sat,
                 dest.num_lines_or_equalities());


  const dimension_type dest_num_rows = dest.num_rows();







  dimension_type first_point;
  if (dest.is_necessarily_closed()) {
    for (first_point = num_lines_or_equalities;
        first_point < dest_num_rows;
        ++first_point)
      if (dest[first_point].expr.inhomogeneous_term() > 0)
        break;
  }
  else {
    for (first_point = num_lines_or_equalities;
        first_point < dest_num_rows;
        ++first_point)
      if (dest[first_point].expr.get(Variable(dest.space_dimension())) > 0)
        break;
  }

  if (first_point == dest_num_rows)
    if (con_to_gen)

      return true;
    else {
# 416 "Polyhedron_minimize_templates.hh"
      Parma_Polyhedra_Library::ppl_unreachable();
      return false;
    }
  else {







    sat.transpose();
    simplify(source, sat);

    sat.transpose();
    return false;
  }
}

}
# 2841 "Polyhedron_defs.hh" 2
# 1 "Polyhedron_simplify_templates.hh" 1
# 32 "Polyhedron_simplify_templates.hh"
namespace Parma_Polyhedra_Library {
# 82 "Polyhedron_simplify_templates.hh"
template <typename Linear_System1>
dimension_type
Polyhedron::simplify(Linear_System1& sys, Bit_Matrix& sat) {

  typedef typename Linear_System1::row_type sys_row_type;

  dimension_type num_rows = sys.num_rows();
  const dimension_type num_cols_sat = sat.num_columns();

  using std::swap;


  dimension_type num_lines_or_equalities = 0;
  while (num_lines_or_equalities < num_rows
         && sys[num_lines_or_equalities].is_line_or_equality())
    ++num_lines_or_equalities;



  if (num_rows > simplify_num_saturators_size) {
    delete [] simplify_num_saturators_p;
    simplify_num_saturators_p = 0;
    simplify_num_saturators_size = 0;
    const size_t max_size
      = std::numeric_limits<size_t>::max() / sizeof(dimension_type);
    const size_t new_size = compute_capacity(num_rows, max_size);
    simplify_num_saturators_p = new dimension_type[new_size];
    simplify_num_saturators_size = new_size;
  }
  dimension_type* const num_saturators = simplify_num_saturators_p;

  bool sys_sorted = sys.is_sorted();




  for (dimension_type i = num_lines_or_equalities; i < num_rows; ++i) {
    if (sat[i].empty()) {



      sys.sys.rows[i].set_is_line_or_equality();

      sys.sys.rows[i].sign_normalize();


      if (i != num_lines_or_equalities) {
        sys.sys.rows[i].m_swap(sys.sys.rows[num_lines_or_equalities]);
        swap(sat[i], sat[num_lines_or_equalities]);
        swap(num_saturators[i], num_saturators[num_lines_or_equalities]);
      }
      ++num_lines_or_equalities;

      sys_sorted = false;
    }
    else



      num_saturators[i] = num_cols_sat - sat[i].count_ones();
  }

  sys.set_sorted(sys_sorted);
  ((void) 0);







  const dimension_type rank = sys.gauss(num_lines_or_equalities);







  if (rank < num_lines_or_equalities) {
# 170 "Polyhedron_simplify_templates.hh"
    for (dimension_type redundant = rank,
           erasing = num_rows;
         redundant < num_lines_or_equalities
           && erasing > num_lines_or_equalities;
         ) {
      --erasing;
      sys.remove_row(redundant);
      swap(sat[redundant], sat[erasing]);
      swap(num_saturators[redundant], num_saturators[erasing]);
      ++redundant;
    }




    num_rows -= num_lines_or_equalities - rank;



    sys.remove_trailing_rows(sys.num_rows() - num_rows);

    ((void) 0);

    sat.remove_trailing_rows(num_lines_or_equalities - rank);


    num_lines_or_equalities = rank;
  }

  const dimension_type old_num_rows = sys.num_rows();
# 231 "Polyhedron_simplify_templates.hh"
  const dimension_type sys_num_columns
    = sys.topology() == NECESSARILY_CLOSED ? sys.space_dimension() + 1
                                           : sys.space_dimension() + 2;
  const dimension_type min_saturators
    = sys_num_columns - num_lines_or_equalities - 1;
  for (dimension_type i = num_lines_or_equalities; i < num_rows; ) {
    if (num_saturators[i] < min_saturators) {

      --num_rows;
      sys.remove_row(i);
      swap(sat[i], sat[num_rows]);
      swap(num_saturators[i], num_saturators[num_rows]);
    }
    else
      ++i;
  }


  for (dimension_type i = num_lines_or_equalities; i < num_rows; ) {
    bool redundant = false;






    for (dimension_type j = num_lines_or_equalities; j < num_rows; ) {
      if (i == j)

        ++j;
      else {
# 270 "Polyhedron_simplify_templates.hh"
        bool strict_subset;
        if (subset_or_equal(sat[j], sat[i], strict_subset))
          if (strict_subset) {





            redundant = true;
            break;
          }
          else {




            --num_rows;
            sys.remove_row(j);
            ((void) 0);
            swap(sat[j], sat[num_rows]);
            swap(num_saturators[j], num_saturators[num_rows]);
          }
        else



          ++j;
      }
    }
    if (redundant) {

      --num_rows;
      sys.remove_row(i);
      ((void) 0);
      swap(sat[i], sat[num_rows]);
      swap(num_saturators[i], num_saturators[num_rows]);
    }
    else

      ++i;
  }



  sat.remove_trailing_rows(old_num_rows - num_rows);
# 330 "Polyhedron_simplify_templates.hh"
  sys.back_substitute(num_lines_or_equalities);




  return num_lines_or_equalities;
}

}
# 2842 "Polyhedron_defs.hh" 2
# 35 "Box_templates.hh" 2
# 1 "Grid_defs.hh" 1
# 37 "Grid_defs.hh"
# 1 "Grid_Generator_System_defs.hh" 1
# 35 "Grid_Generator_System_defs.hh"
namespace Parma_Polyhedra_Library {

namespace IO_Operators {







std::ostream& operator<<(std::ostream& s, const Grid_Generator_System& gs);

}



void swap(Grid_Generator_System& x, Grid_Generator_System& y);



bool operator==(const Grid_Generator_System& x,
                const Grid_Generator_System& y);

}
# 174 "Grid_Generator_System_defs.hh"
class Parma_Polyhedra_Library::Grid_Generator_System {
public:
  typedef Grid_Generator row_type;

  static const Representation default_representation = SPARSE;


  explicit Grid_Generator_System(Representation r = default_representation);


  explicit Grid_Generator_System(const Grid_Generator& g,
                                 Representation r = default_representation);


  explicit Grid_Generator_System(dimension_type dim,
                                 Representation r = default_representation);



  Grid_Generator_System(const Grid_Generator_System& gs);


  Grid_Generator_System(const Grid_Generator_System& gs, Representation r);


  ~Grid_Generator_System();


  Grid_Generator_System& operator=(const Grid_Generator_System& y);


  Representation representation() const;


  void set_representation(Representation r);


  static dimension_type max_space_dimension();


  dimension_type space_dimension() const;





  void clear();
# 230 "Grid_Generator_System_defs.hh"
  void insert(const Grid_Generator& g);





  void insert(Grid_Generator& g, Recycle_Input);





  void insert(Grid_Generator_System& gs, Recycle_Input);


  static void initialize();


  static void finalize();





  static const Grid_Generator_System& zero_dim_univ();
# 277 "Grid_Generator_System_defs.hh"
  class const_iterator
    : public std::iterator<std::forward_iterator_tag,
                           Grid_Generator,
                           ptrdiff_t,
                           const Grid_Generator*,
                           const Grid_Generator&> {
  public:

    const_iterator();


    const_iterator(const const_iterator& y);


    ~const_iterator();


    const_iterator& operator=(const const_iterator& y);


    const Grid_Generator& operator*() const;


    const Grid_Generator* operator->() const;


    const_iterator& operator++();


    const_iterator operator++(int);





    bool operator==(const const_iterator& y) const;





    bool operator!=(const const_iterator& y) const;

  private:
    friend class Grid_Generator_System;

    Linear_System<Grid_Generator>::const_iterator i;


    const_iterator(const Linear_System<Grid_Generator>::const_iterator& y);
  };


  bool empty() const;






  const_iterator begin() const;


  const_iterator end() const;


  dimension_type num_rows() const;


  dimension_type num_parameters() const;


  dimension_type num_lines() const;





  bool has_points() const;


  bool is_equal_to(const Grid_Generator_System& y) const;


  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;
# 374 "Grid_Generator_System_defs.hh"
  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  void m_swap(Grid_Generator_System& y);

private:

  const Grid_Generator& operator[](dimension_type k) const;
# 418 "Grid_Generator_System_defs.hh"
  void affine_image(Variable v,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator);


  void set_sorted(bool b);
# 440 "Grid_Generator_System_defs.hh"
  void add_universe_rows_and_columns(dimension_type dims);


  void set_space_dimension(dimension_type space_dim);







  void remove_space_dimensions(const Variables_Set& vars);



  void shift_space_dimensions(Variable v, dimension_type n);


  void unset_pending_rows();
# 472 "Grid_Generator_System_defs.hh"
  void permute_space_dimensions(const std::vector<Variable>& cycle);

  bool has_no_rows() const;


  void remove_trailing_rows(dimension_type n);

  void insert_verbatim(const Grid_Generator& g);


  Topology topology() const;


  dimension_type first_pending_row() const;

  Linear_System<Grid_Generator> sys;





  static const Grid_Generator_System* zero_dim_univ_p;

  friend bool
  operator==(const Grid_Generator_System& x, const Grid_Generator_System& y);


  void set_index_first_pending_row(dimension_type i);






  void remove_invalid_lines_and_parameters();

  friend class Polyhedron;
  friend class Grid;
};
# 38 "Grid_defs.hh" 2
# 1 "Grid_Generator_System_inlines.hh" 1
# 29 "Grid_Generator_System_inlines.hh"
namespace Parma_Polyhedra_Library {

inline void
Grid_Generator_System::set_sorted(bool b) {
  sys.set_sorted(b);
}

inline void
Grid_Generator_System::unset_pending_rows() {
  sys.unset_pending_rows();
}

inline void
Grid_Generator_System::set_index_first_pending_row(const dimension_type i) {
  sys.set_index_first_pending_row(i);
}

inline void
Grid_Generator_System
::permute_space_dimensions(const std::vector<Variable>& cycle) {
  return sys.permute_space_dimensions(cycle);
}

inline bool
Grid_Generator_System::is_equal_to(const Grid_Generator_System& y) const {
  return (sys == y.sys);
}

inline
Grid_Generator_System::Grid_Generator_System(Representation r)
  : sys(NECESSARILY_CLOSED, r) {
  sys.set_sorted(false);
  ((void) 0);
}

inline
Grid_Generator_System::Grid_Generator_System(const Grid_Generator_System& gs)
  : sys(gs.sys) {
}

inline
Grid_Generator_System::Grid_Generator_System(const Grid_Generator_System& gs,
                                             Representation r)
  : sys(gs.sys, r) {
}

inline
Grid_Generator_System::Grid_Generator_System(dimension_type dim,
                                             Representation r)
  : sys(NECESSARILY_CLOSED, r) {
  sys.set_space_dimension(dim);
  sys.set_sorted(false);
  ((void) 0);
}

inline
Grid_Generator_System::Grid_Generator_System(const Grid_Generator& g,
                                             Representation r)
  : sys(NECESSARILY_CLOSED, r) {
  sys.insert(g);
  sys.set_sorted(false);
}

inline
Grid_Generator_System::~Grid_Generator_System() {
}

inline Grid_Generator_System&
Grid_Generator_System::operator=(const Grid_Generator_System& y) {
  Grid_Generator_System tmp = y;
  swap(*this, tmp);
  return *this;
}

inline Representation
Grid_Generator_System::representation() const {
  return sys.representation();
}

inline void
Grid_Generator_System::set_representation(Representation r) {
  sys.set_representation(r);
}

inline dimension_type
Grid_Generator_System::max_space_dimension() {

  return Linear_System<Grid_Generator>::max_space_dimension() - 1;
}

inline dimension_type
Grid_Generator_System::space_dimension() const {
  return sys.space_dimension();
}

inline const Grid_Generator_System&
Grid_Generator_System::zero_dim_univ() {
  ((void) 0);
  return *zero_dim_univ_p;
}

inline void
Grid_Generator_System::clear() {
  sys.clear();
  sys.set_sorted(false);
  sys.unset_pending_rows();
  ((void) 0);
}

inline void
Grid_Generator_System::m_swap(Grid_Generator_System& y) {
  swap(sys, y.sys);
}

inline memory_size_type
Grid_Generator_System::external_memory_in_bytes() const {
  return sys.external_memory_in_bytes();
}

inline memory_size_type
Grid_Generator_System::total_memory_in_bytes() const {
  return external_memory_in_bytes() + sizeof(*this);
}

inline dimension_type
Grid_Generator_System::num_rows() const {
  return sys.num_rows();
}

inline
Grid_Generator_System::const_iterator::const_iterator()
  : i() {
}

inline
Grid_Generator_System::const_iterator::const_iterator(const const_iterator& y)
  : i(y.i) {
}

inline
Grid_Generator_System::const_iterator::~const_iterator() {
}

inline Grid_Generator_System::const_iterator&
Grid_Generator_System::const_iterator::operator=(const const_iterator& y) {
  i = y.i;
  return *this;
}

inline const Grid_Generator&
Grid_Generator_System::const_iterator::operator*() const {
  return *i;
}

inline const Grid_Generator*
Grid_Generator_System::const_iterator::operator->() const {
  return i.operator->();
}

inline Grid_Generator_System::const_iterator&
Grid_Generator_System::const_iterator::operator++() {
  ++i;
  return *this;
}

inline Grid_Generator_System::const_iterator
Grid_Generator_System::const_iterator::operator++(int) {
  const const_iterator tmp = *this;
  operator++();
  return tmp;
}

inline bool
Grid_Generator_System
::const_iterator::operator==(const const_iterator& y) const {
  return i == y.i;
}

inline bool
Grid_Generator_System
::const_iterator::operator!=(const const_iterator& y) const {
  return i != y.i;
}

inline bool
Grid_Generator_System::empty() const {
  return sys.has_no_rows();
}

inline
Grid_Generator_System::const_iterator
::const_iterator(const Linear_System<Grid_Generator>::const_iterator& y)
  : i(y) {
}

inline Grid_Generator_System::const_iterator
Grid_Generator_System::begin() const {
  return static_cast<Grid_Generator_System::const_iterator>(sys.begin());
}

inline Grid_Generator_System::const_iterator
Grid_Generator_System::end() const {
  return static_cast<Grid_Generator_System::const_iterator>(sys.end());
}

inline const Grid_Generator&
Grid_Generator_System::operator[](const dimension_type k) const {
  return sys[k];
}

inline bool
Grid_Generator_System::has_no_rows() const {
  return sys.has_no_rows();
}

inline void
Grid_Generator_System::remove_trailing_rows(dimension_type n) {
  sys.remove_trailing_rows(n);
}

inline void
Grid_Generator_System::insert_verbatim(const Grid_Generator& g) {
  sys.insert(g);
}

inline Topology
Grid_Generator_System::topology() const {
  return sys.topology();
}

inline dimension_type
Grid_Generator_System::first_pending_row() const {
  return sys.first_pending_row();
}


inline bool
operator==(const Grid_Generator_System& x,
           const Grid_Generator_System& y) {
  return x.is_equal_to(y);
}


inline void
swap(Grid_Generator_System& x, Grid_Generator_System& y) {
  x.m_swap(y);
}

}
# 39 "Grid_defs.hh" 2



# 1 "Grid_Certificate_types.hh" 1
# 16 "Grid_Certificate_types.hh"
namespace Parma_Polyhedra_Library {

class Grid_Certificate;

}
# 43 "Grid_defs.hh" 2







namespace Parma_Polyhedra_Library {

namespace IO_Operators {
# 63 "Grid_defs.hh"
std::ostream&
operator<<(std::ostream& s, const Grid& gr);

}



void swap(Grid& x, Grid& y);
# 80 "Grid_defs.hh"
bool operator==(const Grid& x, const Grid& y);
# 90 "Grid_defs.hh"
bool operator!=(const Grid& x, const Grid& y);

}
# 363 "Grid_defs.hh"
class Parma_Polyhedra_Library::Grid {
public:

  typedef Coefficient coefficient_type;


  static dimension_type max_space_dimension();





  static bool can_recycle_congruence_systems();





  static bool can_recycle_constraint_systems();
# 395 "Grid_defs.hh"
  explicit Grid(dimension_type num_dimensions = 0,
                Degenerate_Element kind = UNIVERSE);
# 409 "Grid_defs.hh"
  explicit Grid(const Congruence_System& cgs);
# 427 "Grid_defs.hh"
  Grid(Congruence_System& cgs, Recycle_Input dummy);
# 443 "Grid_defs.hh"
  explicit Grid(const Constraint_System& cs);
# 464 "Grid_defs.hh"
  Grid(Constraint_System& cs, Recycle_Input dummy);
# 480 "Grid_defs.hh"
  explicit Grid(const Grid_Generator_System& ggs);
# 500 "Grid_defs.hh"
  Grid(Grid_Generator_System& ggs, Recycle_Input dummy);
# 518 "Grid_defs.hh"
  template <typename Interval>
  explicit Grid(const Box<Interval>& box,
                Complexity_Class complexity = ANY_COMPLEXITY);
# 538 "Grid_defs.hh"
  template <typename U>
  explicit Grid(const BD_Shape<U>& bd,
                Complexity_Class complexity = ANY_COMPLEXITY);
# 558 "Grid_defs.hh"
  template <typename U>
  explicit Grid(const Octagonal_Shape<U>& os,
                Complexity_Class complexity = ANY_COMPLEXITY);
# 580 "Grid_defs.hh"
  explicit Grid(const Polyhedron& ph,
                Complexity_Class complexity = ANY_COMPLEXITY);





  Grid(const Grid& y,
       Complexity_Class complexity = ANY_COMPLEXITY);





  Grid& operator=(const Grid& y);





  dimension_type space_dimension() const;





  dimension_type affine_dimension() const;





  Constraint_System constraints() const;





  Constraint_System minimized_constraints() const;


  const Congruence_System& congruences() const;


  const Congruence_System& minimized_congruences() const;


  const Grid_Generator_System& grid_generators() const;


  const Grid_Generator_System& minimized_grid_generators() const;
# 640 "Grid_defs.hh"
  Poly_Con_Relation relation_with(const Congruence& cg) const;







  Poly_Gen_Relation
  relation_with(const Grid_Generator& g) const;







  Poly_Gen_Relation
  relation_with(const Generator& g) const;
# 668 "Grid_defs.hh"
  Poly_Con_Relation relation_with(const Constraint& c) const;


  bool is_empty() const;


  bool is_universe() const;







  bool is_topologically_closed() const;
# 691 "Grid_defs.hh"
  bool is_disjoint_from(const Grid& y) const;







  bool is_discrete() const;


  bool is_bounded() const;





  bool contains_integer_point() const;
# 717 "Grid_defs.hh"
  bool constrains(Variable var) const;
# 726 "Grid_defs.hh"
  bool bounds_from_above(const Linear_Expression& expr) const;
# 735 "Grid_defs.hh"
  bool bounds_from_below(const Linear_Expression& expr) const;
# 764 "Grid_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum) const;
# 798 "Grid_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                Generator& point) const;
# 829 "Grid_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum) const;
# 863 "Grid_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                Generator& point) const;
# 897 "Grid_defs.hh"
  bool frequency(const Linear_Expression& expr,
                 Coefficient& freq_n, Coefficient& freq_d,
                 Coefficient& val_n, Coefficient& val_d) const;






  bool contains(const Grid& y) const;
# 915 "Grid_defs.hh"
  bool strictly_contains(const Grid& y) const;
# 934 "Grid_defs.hh"
  bool OK(bool check_not_empty = false) const;
# 947 "Grid_defs.hh"
  void add_congruence(const Congruence& cg);
# 957 "Grid_defs.hh"
  void add_grid_generator(const Grid_Generator& g);
# 968 "Grid_defs.hh"
  void add_congruences(const Congruence_System& cgs);
# 983 "Grid_defs.hh"
  void add_recycled_congruences(Congruence_System& cgs);
# 995 "Grid_defs.hh"
  void add_constraint(const Constraint& c);
# 1008 "Grid_defs.hh"
  void add_constraints(const Constraint_System& cs);
# 1025 "Grid_defs.hh"
  void add_recycled_constraints(Constraint_System& cs);
# 1035 "Grid_defs.hh"
  void refine_with_congruence(const Congruence& cg);
# 1045 "Grid_defs.hh"
  void refine_with_congruences(const Congruence_System& cgs);
# 1056 "Grid_defs.hh"
  void refine_with_constraint(const Constraint& c);
# 1066 "Grid_defs.hh"
  void refine_with_constraints(const Constraint_System& cs);
# 1081 "Grid_defs.hh"
  void add_grid_generators(const Grid_Generator_System& gs);
# 1098 "Grid_defs.hh"
  void add_recycled_grid_generators(Grid_Generator_System& gs);
# 1110 "Grid_defs.hh"
  void unconstrain(Variable var);
# 1124 "Grid_defs.hh"
  void unconstrain(const Variables_Set& vars);







  void intersection_assign(const Grid& y);







  void upper_bound_assign(const Grid& y);
# 1150 "Grid_defs.hh"
  bool upper_bound_assign_if_exact(const Grid& y);
# 1162 "Grid_defs.hh"
  void difference_assign(const Grid& y);
# 1173 "Grid_defs.hh"
  bool simplify_using_context_assign(const Grid& y);
# 1236 "Grid_defs.hh"
  void affine_image(Variable var,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator
                    = Coefficient_one());
# 1300 "Grid_defs.hh"
  void affine_preimage(Variable var,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator
                         = Coefficient_one());
# 1335 "Grid_defs.hh"
  void
  generalized_affine_image(Variable var,
                           Relation_Symbol relsym,
                           const Linear_Expression& expr,
                           Coefficient_traits::const_reference denominator
                           = Coefficient_one(),
                           Coefficient_traits::const_reference modulus
                           = Coefficient_zero());
# 1374 "Grid_defs.hh"
  void
  generalized_affine_preimage(Variable var,
                              Relation_Symbol relsym,
                              const Linear_Expression& expr,
                              Coefficient_traits::const_reference denominator
                              = Coefficient_one(),
                              Coefficient_traits::const_reference modulus
                              = Coefficient_zero());
# 1407 "Grid_defs.hh"
  void
  generalized_affine_image(const Linear_Expression& lhs,
                           Relation_Symbol relsym,
                           const Linear_Expression& rhs,
                           Coefficient_traits::const_reference modulus
                           = Coefficient_zero());
# 1438 "Grid_defs.hh"
  void
  generalized_affine_preimage(const Linear_Expression& lhs,
                              Relation_Symbol relsym,
                              const Linear_Expression& rhs,
                              Coefficient_traits::const_reference modulus
                              = Coefficient_zero());
# 1471 "Grid_defs.hh"
  void bounded_affine_image(Variable var,
                            const Linear_Expression& lb_expr,
                            const Linear_Expression& ub_expr,
                            Coefficient_traits::const_reference denominator
                            = Coefficient_one());
# 1503 "Grid_defs.hh"
  void bounded_affine_preimage(Variable var,
                               const Linear_Expression& lb_expr,
                               const Linear_Expression& ub_expr,
                               Coefficient_traits::const_reference denominator
                               = Coefficient_one());
# 1516 "Grid_defs.hh"
  void time_elapse_assign(const Grid& y);
# 1563 "Grid_defs.hh"
  void wrap_assign(const Variables_Set& vars,
                   Bounded_Integer_Type_Width w,
                   Bounded_Integer_Type_Representation r,
                   Bounded_Integer_Type_Overflow o,
                   const Constraint_System* cs_p = 0,
                   unsigned complexity_threshold = 16,
                   bool wrap_individually = true);
# 1579 "Grid_defs.hh"
  void drop_some_non_integer_points(Complexity_Class complexity
                                    = ANY_COMPLEXITY);
# 1594 "Grid_defs.hh"
  void drop_some_non_integer_points(const Variables_Set& vars,
                                    Complexity_Class complexity
                                    = ANY_COMPLEXITY);


  void topological_closure_assign();
# 1616 "Grid_defs.hh"
  void congruence_widening_assign(const Grid& y, unsigned* tp = __null);
# 1633 "Grid_defs.hh"
  void generator_widening_assign(const Grid& y, unsigned* tp = __null);
# 1654 "Grid_defs.hh"
  void widening_assign(const Grid& y, unsigned* tp = __null);
# 1676 "Grid_defs.hh"
  void limited_congruence_extrapolation_assign(const Grid& y,
                                               const Congruence_System& cgs,
                                               unsigned* tp = __null);
# 1700 "Grid_defs.hh"
  void limited_generator_extrapolation_assign(const Grid& y,
                                              const Congruence_System& cgs,
                                              unsigned* tp = __null);
# 1723 "Grid_defs.hh"
  void limited_extrapolation_assign(const Grid& y,
                                    const Congruence_System& cgs,
                                    unsigned* tp = __null);
# 1758 "Grid_defs.hh"
  void add_space_dimensions_and_embed(dimension_type m);
# 1786 "Grid_defs.hh"
  void add_space_dimensions_and_project(dimension_type m);
# 1796 "Grid_defs.hh"
  void concatenate_assign(const Grid& y);
# 1808 "Grid_defs.hh"
  void remove_space_dimensions(const Variables_Set& vars);
# 1819 "Grid_defs.hh"
  void remove_higher_space_dimensions(dimension_type new_dimension);
# 1868 "Grid_defs.hh"
  template <typename Partial_Function>
  void map_space_dimensions(const Partial_Function& pfunc);
# 1894 "Grid_defs.hh"
  void expand_space_dimension(Variable var, dimension_type m);
# 1920 "Grid_defs.hh"
  void fold_space_dimensions(const Variables_Set& vars, Variable dest);



  friend bool operator==(const Grid& x, const Grid& y);

  friend class Parma_Polyhedra_Library::Grid_Certificate;

  template <typename Interval> friend class Parma_Polyhedra_Library::Box;





  ~Grid();





  void m_swap(Grid& y);

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  int32_t hash_code() const;



private:


  Congruence_System con_sys;


  Grid_Generator_System gen_sys;


# 1 "Grid_Status_idefs.hh" 1
# 71 "Grid_Status_idefs.hh"
class Status {
public:

  Status();



  bool test_zero_dim_univ() const;
  void reset_zero_dim_univ();
  void set_zero_dim_univ();

  bool test_empty() const;
  void reset_empty();
  void set_empty();

  bool test_c_up_to_date() const;
  void reset_c_up_to_date();
  void set_c_up_to_date();

  bool test_g_up_to_date() const;
  void reset_g_up_to_date();
  void set_g_up_to_date();

  bool test_c_minimized() const;
  void reset_c_minimized();
  void set_c_minimized();

  bool test_g_minimized() const;
  void reset_g_minimized();
  void set_g_minimized();

  bool test_sat_c_up_to_date() const;
  void reset_sat_c_up_to_date();
  void set_sat_c_up_to_date();

  bool test_sat_g_up_to_date() const;
  void reset_sat_g_up_to_date();
  void set_sat_g_up_to_date();

  bool test_c_pending() const;
  void reset_c_pending();
  void set_c_pending();

  bool test_g_pending() const;
  void reset_g_pending();
  void set_g_pending();



  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);

private:

  typedef unsigned int flags_t;



  static const flags_t ZERO_DIM_UNIV = 0U;
  static const flags_t EMPTY = 1U << 0;
  static const flags_t C_UP_TO_DATE = 1U << 1;
  static const flags_t G_UP_TO_DATE = 1U << 2;
  static const flags_t C_MINIMIZED = 1U << 3;
  static const flags_t G_MINIMIZED = 1U << 4;
  static const flags_t SAT_C_UP_TO_DATE = 1U << 5;
  static const flags_t SAT_G_UP_TO_DATE = 1U << 6;
  static const flags_t CS_PENDING = 1U << 7;
  static const flags_t GS_PENDING = 1U << 8;



  flags_t flags;


  Status(flags_t mask);


  bool test_all(flags_t mask) const;


  bool test_any(flags_t mask) const;


  void set(flags_t mask);


  void reset(flags_t mask);
};
# 1977 "Grid_defs.hh" 2



  Status status;


  dimension_type space_dim;

  enum Dimension_Kind {
    PARAMETER = 0,
    LINE = 1,
    GEN_VIRTUAL = 2,
    PROPER_CONGRUENCE = PARAMETER,
    CON_VIRTUAL = LINE,
    EQUALITY = GEN_VIRTUAL
  };

  typedef std::vector<Dimension_Kind> Dimension_Kinds;







  Dimension_Kinds dim_kinds;
# 2012 "Grid_defs.hh"
  void construct(dimension_type num_dimensions, Degenerate_Element kind);
# 2022 "Grid_defs.hh"
  void construct(Congruence_System& cgs);
# 2032 "Grid_defs.hh"
  void construct(Grid_Generator_System& ggs);
# 2042 "Grid_defs.hh"
  bool marked_empty() const;


  bool congruences_are_up_to_date() const;


  bool generators_are_up_to_date() const;


  bool congruences_are_minimized() const;


  bool generators_are_minimized() const;
# 2065 "Grid_defs.hh"
  void set_zero_dim_univ();





  void set_empty();


  void set_congruences_up_to_date();


  void set_generators_up_to_date();


  void set_congruences_minimized();


  void set_generators_minimized();







  void clear_empty();


  void clear_congruences_up_to_date();


  void clear_generators_up_to_date();


  void clear_congruences_minimized();


  void clear_generators_minimized();







  void update_congruences() const;
# 2122 "Grid_defs.hh"
  bool update_generators() const;
# 2138 "Grid_defs.hh"
  bool minimize() const;



  enum Three_Valued_Boolean {
    TVB_TRUE,
    TVB_FALSE,
    TVB_DONT_KNOW
  };


  Three_Valued_Boolean quick_equivalence_test(const Grid& y) const;


  bool is_included_in(const Grid& y) const;
# 2172 "Grid_defs.hh"
  bool bounds(const Linear_Expression& expr, const char* method_call) const;
# 2206 "Grid_defs.hh"
  bool max_min(const Linear_Expression& expr,
               const char* method_call,
               Coefficient& ext_n, Coefficient& ext_d, bool& included,
               Generator* point = __null) const;
# 2243 "Grid_defs.hh"
  bool frequency_no_check(const Linear_Expression& expr,
                Coefficient& freq_n, Coefficient& freq_d,
                Coefficient& val_n, Coefficient& val_d) const;
# 2257 "Grid_defs.hh"
  bool bounds_no_check(const Linear_Expression& expr) const;
# 2267 "Grid_defs.hh"
  void add_congruence_no_check(const Congruence& cg);
# 2282 "Grid_defs.hh"
  void add_constraint_no_check(const Constraint& c);
# 2295 "Grid_defs.hh"
  void refine_no_check(const Constraint& c);





  void select_wider_congruences(const Grid& y,
                                Congruence_System& selected_cgs) const;


  void select_wider_generators(const Grid& y,
                               Grid_Generator_System& widened_ggs) const;
# 2324 "Grid_defs.hh"
  void add_space_dimensions(Congruence_System& cgs,
                            Grid_Generator_System& gs,
                            dimension_type dims);
# 2342 "Grid_defs.hh"
  void add_space_dimensions(Grid_Generator_System& gs,
                            Congruence_System& cgs,
                            dimension_type dims);
# 2367 "Grid_defs.hh"
  static void
  normalize_divisors(Grid_Generator_System& sys,
                     Coefficient& divisor,
                     const Grid_Generator* first_point = __null);
# 2381 "Grid_defs.hh"
  static void
  normalize_divisors(Grid_Generator_System& sys);
# 2401 "Grid_defs.hh"
  static void normalize_divisors(Grid_Generator_System& sys,
                                 Grid_Generator_System& gen_sys);





  static void conversion(Congruence_System& source,
                         Grid_Generator_System& dest,
                         Dimension_Kinds& dim_kinds);





  static void conversion(Grid_Generator_System& source,
                         Congruence_System& dest,
                         Dimension_Kinds& dim_kinds);






  static bool simplify(Congruence_System& cgs,
                       Dimension_Kinds& dim_kinds);





  static void simplify(Grid_Generator_System& ggs,
                       Dimension_Kinds& dim_kinds);







  static void reduce_line_with_line(Grid_Generator& row,
                                    Grid_Generator& pivot,
                                    dimension_type column);
# 2452 "Grid_defs.hh"
  static void reduce_equality_with_equality(Congruence& row,
                                            const Congruence& pivot,
                                            dimension_type column);
# 2469 "Grid_defs.hh"
  template <typename R>
  static void reduce_pc_with_pc(R& row,
                                R& pivot,
                                dimension_type column,
                                dimension_type start,
                                dimension_type end);
# 2486 "Grid_defs.hh"
  static void reduce_parameter_with_line(Grid_Generator& row,
                                         const Grid_Generator& pivot,
                                         dimension_type column,
                                         Swapping_Vector<Grid_Generator>& sys,
                                         dimension_type num_columns);
# 2501 "Grid_defs.hh"
  static void reduce_congruence_with_equality(Congruence& row,
                                              const Congruence& pivot,
                                              dimension_type column,
                                              Swapping_Vector<Congruence>& sys);
# 2539 "Grid_defs.hh"
  template <typename M>




  static void reduce_reduced(Swapping_Vector<typename M::row_type>& sys,
                             dimension_type dim,
                             dimension_type pivot_index,
                             dimension_type start, dimension_type end,
                             const Dimension_Kinds& sys_dim_kinds,
                             bool generators = true);





  static void multiply_grid(const Coefficient& multiplier,
                            Congruence& cg,
                            Swapping_Vector<Congruence>& dest,
                            dimension_type num_rows);







  static void multiply_grid(const Coefficient& multiplier,
                            Grid_Generator& gen,
                            Swapping_Vector<Grid_Generator>& dest,
                            dimension_type num_rows);





  static bool lower_triangular(const Congruence_System& sys,
                               const Dimension_Kinds& dim_kinds);





  static bool upper_triangular(const Grid_Generator_System& sys,
                               const Dimension_Kinds& dim_kinds);
# 2608 "Grid_defs.hh"
protected:
  void throw_dimension_incompatible(const char* method,
                                    const char* other_name,
                                    dimension_type other_dim) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* gr_name,
                                    const Grid& gr) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* le_name,
                                    const Linear_Expression& le) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* cg_name,
                                    const Congruence& cg) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* c_name,
                                    const Constraint& c) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* g_name,
                                    const Grid_Generator& g) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* g_name,
                                    const Generator& g) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* cgs_name,
                                    const Congruence_System& cgs) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* cs_name,
                                    const Constraint_System& cs) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* gs_name,
                                    const Grid_Generator_System& gs) const;
  void throw_dimension_incompatible(const char* method,
                                    const char* var_name,
                                    Variable var) const;
  void throw_dimension_incompatible(const char* method,
                                    dimension_type required_space_dim) const;

  static void throw_invalid_argument(const char* method,
                                     const char* reason);
  static void throw_invalid_constraint(const char* method,
                                       const char* c_name);
  static void throw_invalid_constraints(const char* method,
                                        const char* cs_name);
  static void throw_invalid_generator(const char* method,
                                      const char* g_name);
  static void throw_invalid_generators(const char* method,
                                       const char* gs_name);




};

# 1 "Grid_Status_inlines.hh" 1
# 27 "Grid_Status_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
Grid::Status::Status(flags_t mask)
  : flags(mask) {
}

inline
Grid::Status::Status()
  : flags(ZERO_DIM_UNIV) {
}

inline bool
Grid::Status::test_all(flags_t mask) const {
  return (flags & mask) == mask;
}

inline bool
Grid::Status::test_any(flags_t mask) const {
  return (flags & mask) != 0;
}

inline void
Grid::Status::set(flags_t mask) {
  flags |= mask;
}

inline void
Grid::Status::reset(flags_t mask) {
  flags &= ~mask;
}

inline bool
Grid::Status::test_zero_dim_univ() const {
  return flags == ZERO_DIM_UNIV;
}

inline void
Grid::Status::reset_zero_dim_univ() {

  if (flags == ZERO_DIM_UNIV)

    flags = EMPTY;
}

inline void
Grid::Status::set_zero_dim_univ() {

  flags = ZERO_DIM_UNIV;
}

inline bool
Grid::Status::test_empty() const {
  return test_any(EMPTY);
}

inline void
Grid::Status::reset_empty() {
  reset(EMPTY);
}

inline void
Grid::Status::set_empty() {
  flags = EMPTY;
}

inline bool
Grid::Status::test_c_up_to_date() const {
  return test_any(C_UP_TO_DATE);
}

inline void
Grid::Status::reset_c_up_to_date() {
  reset(C_UP_TO_DATE);
}

inline void
Grid::Status::set_c_up_to_date() {
  set(C_UP_TO_DATE);
}

inline bool
Grid::Status::test_g_up_to_date() const {
  return test_any(G_UP_TO_DATE);
}

inline void
Grid::Status::reset_g_up_to_date() {
  reset(G_UP_TO_DATE);
}

inline void
Grid::Status::set_g_up_to_date() {
  set(G_UP_TO_DATE);
}

inline bool
Grid::Status::test_c_minimized() const {
  return test_any(C_MINIMIZED);
}

inline void
Grid::Status::reset_c_minimized() {
  reset(C_MINIMIZED);
}

inline void
Grid::Status::set_c_minimized() {
  set(C_MINIMIZED);
}

inline bool
Grid::Status::test_g_minimized() const {
  return test_any(G_MINIMIZED);
}

inline void
Grid::Status::reset_g_minimized() {
  reset(G_MINIMIZED);
}

inline void
Grid::Status::set_g_minimized() {
  set(G_MINIMIZED);
}


inline bool
Grid::Status::test_c_pending() const {
  return test_any(CS_PENDING);
}

inline void
Grid::Status::reset_c_pending() {
  reset(CS_PENDING);
}

inline void
Grid::Status::set_c_pending() {
  set(CS_PENDING);
}

inline bool
Grid::Status::test_g_pending() const {
  return test_any(GS_PENDING);
}

inline void
Grid::Status::reset_g_pending() {
  reset(GS_PENDING);
}

inline void
Grid::Status::set_g_pending() {
  set(GS_PENDING);
}


inline bool
Grid::Status::test_sat_c_up_to_date() const {
  return test_any(SAT_C_UP_TO_DATE);
}

inline void
Grid::Status::reset_sat_c_up_to_date() {
  reset(SAT_C_UP_TO_DATE);
}

inline void
Grid::Status::set_sat_c_up_to_date() {
  set(SAT_C_UP_TO_DATE);
}

inline bool
Grid::Status::test_sat_g_up_to_date() const {
  return test_any(SAT_G_UP_TO_DATE);
}

inline void
Grid::Status::reset_sat_g_up_to_date() {
  reset(SAT_G_UP_TO_DATE);
}

inline void
Grid::Status::set_sat_g_up_to_date() {
  set(SAT_G_UP_TO_DATE);
}

}
# 2662 "Grid_defs.hh" 2
# 1 "Grid_inlines.hh" 1
# 32 "Grid_inlines.hh"
namespace Parma_Polyhedra_Library {

inline bool
Grid::marked_empty() const {
  return status.test_empty();
}

inline bool
Grid::congruences_are_up_to_date() const {
  return status.test_c_up_to_date();
}

inline bool
Grid::generators_are_up_to_date() const {
  return status.test_g_up_to_date();
}

inline bool
Grid::congruences_are_minimized() const {
  return status.test_c_minimized();
}

inline bool
Grid::generators_are_minimized() const {
  return status.test_g_minimized();
}

inline void
Grid::set_generators_up_to_date() {
  status.set_g_up_to_date();
}

inline void
Grid::set_congruences_up_to_date() {
  status.set_c_up_to_date();
}

inline void
Grid::set_congruences_minimized() {
  set_congruences_up_to_date();
  status.set_c_minimized();
}

inline void
Grid::set_generators_minimized() {
  set_generators_up_to_date();
  status.set_g_minimized();
}

inline void
Grid::clear_empty() {
  status.reset_empty();
}

inline void
Grid::clear_congruences_minimized() {
  status.reset_c_minimized();
}

inline void
Grid::clear_generators_minimized() {
  status.reset_g_minimized();
}

inline void
Grid::clear_congruences_up_to_date() {
  clear_congruences_minimized();
  status.reset_c_up_to_date();

}

inline void
Grid::clear_generators_up_to_date() {
  clear_generators_minimized();
  status.reset_g_up_to_date();

}

inline dimension_type
Grid::max_space_dimension() {


  return std::min(std::numeric_limits<dimension_type>::max() - 1,
                  std::min(Congruence_System::max_space_dimension(),
                           Grid_Generator_System::max_space_dimension()
                           )
                  );
}

inline
Grid::Grid(dimension_type num_dimensions,
           const Degenerate_Element kind)
  : con_sys(),
    gen_sys(check_space_dimension_overflow(num_dimensions,
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(n, k)",
                                           "n exceeds the maximum "
                                           "allowed space dimension")) {
  construct(num_dimensions, kind);
  ((void) 0);
}

inline
Grid::Grid(const Congruence_System& cgs)
  : con_sys(check_space_dimension_overflow(cgs.space_dimension(),
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(cgs)",
                                           "the space dimension of cgs "
                                           "exceeds the maximum allowed "
                                           "space dimension")),
    gen_sys(cgs.space_dimension()) {
  Congruence_System cgs_copy(cgs);
  construct(cgs_copy);
}

inline
Grid::Grid(Congruence_System& cgs, Recycle_Input)
  : con_sys(check_space_dimension_overflow(cgs.space_dimension(),
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(cgs, recycle)",
                                           "the space dimension of cgs "
                                           "exceeds the maximum allowed "
                                           "space dimension")),
    gen_sys(cgs.space_dimension()) {
  construct(cgs);
}

inline
Grid::Grid(const Grid_Generator_System& ggs)
  : con_sys(check_space_dimension_overflow(ggs.space_dimension(),
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(ggs)",
                                           "the space dimension of ggs "
                                           "exceeds the maximum allowed "
                                           "space dimension")),
    gen_sys(ggs.space_dimension()) {
  Grid_Generator_System ggs_copy(ggs);
  construct(ggs_copy);
}

inline
Grid::Grid(Grid_Generator_System& ggs, Recycle_Input)
  : con_sys(check_space_dimension_overflow(ggs.space_dimension(),
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(ggs, recycle)",
                                           "the space dimension of ggs "
                                           "exceeds the maximum allowed "
                                           "space dimension")),
    gen_sys(ggs.space_dimension()) {
  construct(ggs);
}

template <typename U>
inline
Grid::Grid(const BD_Shape<U>& bd, Complexity_Class)
  : con_sys(check_space_dimension_overflow(bd.space_dimension(),
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(bd)",
                                           "the space dimension of bd "
                                           "exceeds the maximum allowed "
                                           "space dimension")),
    gen_sys(bd.space_dimension()) {
  Congruence_System cgs = bd.congruences();
  construct(cgs);
}

template <typename U>
inline
Grid::Grid(const Octagonal_Shape<U>& os, Complexity_Class)
  : con_sys(check_space_dimension_overflow(os.space_dimension(),
                                           max_space_dimension(),
                                           "PPL::Grid::",
                                           "Grid(os)",
                                           "the space dimension of os "
                                           "exceeds the maximum allowed "
                                           "space dimension")),
    gen_sys(os.space_dimension()) {
  Congruence_System cgs = os.congruences();
  construct(cgs);
}

inline
Grid::~Grid() {
}

inline dimension_type
Grid::space_dimension() const {
  return space_dim;
}

inline memory_size_type
Grid::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

inline int32_t
Grid::hash_code() const {
  return hash_code_from_dimension(space_dimension());
}

inline Constraint_System
Grid::constraints() const {
  return Constraint_System(congruences());
}

inline Constraint_System
Grid::minimized_constraints() const {
  return Constraint_System(minimized_congruences());
}

inline void
Grid::m_swap(Grid& y) {
  using std::swap;
  swap(con_sys, y.con_sys);
  swap(gen_sys, y.gen_sys);
  swap(status, y.status);
  swap(space_dim, y.space_dim);
  swap(dim_kinds, y.dim_kinds);
}

inline void
Grid::add_congruence(const Congruence& cg) {

  if (space_dim < cg.space_dimension())
    throw_dimension_incompatible("add_congruence(cg)", "cg", cg);

  if (!marked_empty())
    add_congruence_no_check(cg);
}

inline void
Grid::add_congruences(const Congruence_System& cgs) {


  if (space_dim < cgs.space_dimension())
    throw_dimension_incompatible("add_congruences(cgs)", "cgs", cgs);

  if (!marked_empty()) {
    Congruence_System cgs_copy = cgs;
    add_recycled_congruences(cgs_copy);
  }
}

inline void
Grid::refine_with_congruence(const Congruence& cg) {
  add_congruence(cg);
}

inline void
Grid::refine_with_congruences(const Congruence_System& cgs) {
  add_congruences(cgs);
}

inline bool
Grid::can_recycle_constraint_systems() {
  return true;
}

inline bool
Grid::can_recycle_congruence_systems() {
  return true;
}

inline void
Grid::add_constraint(const Constraint& c) {

  if (space_dim < c.space_dimension())
    throw_dimension_incompatible("add_constraint(c)", "c", c);
  if (!marked_empty())
    add_constraint_no_check(c);
}

inline void
Grid::add_recycled_constraints(Constraint_System& cs) {

  add_constraints(cs);
}

inline bool
Grid::bounds_from_above(const Linear_Expression& expr) const {
  return bounds(expr, "bounds_from_above(e)");
}

inline bool
Grid::bounds_from_below(const Linear_Expression& expr) const {
  return bounds(expr, "bounds_from_below(e)");
}

inline bool
Grid::maximize(const Linear_Expression& expr,
               Coefficient& sup_n, Coefficient& sup_d, bool& maximum) const {
  return max_min(expr, "maximize(e, ...)", sup_n, sup_d, maximum);
}

inline bool
Grid::maximize(const Linear_Expression& expr,
               Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
               Generator& point) const {
  return max_min(expr, "maximize(e, ...)", sup_n, sup_d, maximum, &point);
}

inline bool
Grid::minimize(const Linear_Expression& expr,
               Coefficient& inf_n, Coefficient& inf_d, bool& minimum) const {
  return max_min(expr, "minimize(e, ...)", inf_n, inf_d, minimum);
}

inline bool
Grid::minimize(const Linear_Expression& expr,
               Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
               Generator& point) const {
  return max_min(expr, "minimize(e, ...)", inf_n, inf_d, minimum, &point);
}

inline void
Grid::normalize_divisors(Grid_Generator_System& sys) {
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_divisor; Parma_Polyhedra_Library::Coefficient& divisor = holder_divisor.item();
  divisor = 1;
  normalize_divisors(sys, divisor);
}


inline bool
operator!=(const Grid& x, const Grid& y) {
  return !(x == y);
}

inline bool
Grid::strictly_contains(const Grid& y) const {
  const Grid& x = *this;
  return x.contains(y) && !y.contains(x);
}

inline void
Grid::topological_closure_assign() {
}


inline void
swap(Grid& x, Grid& y) {
  x.m_swap(y);
}

}
# 2663 "Grid_defs.hh" 2
# 1 "Grid_templates.hh" 1
# 33 "Grid_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename Interval>
Grid::Grid(const Box<Interval>& box, Complexity_Class)
  : con_sys(),
    gen_sys() {
  space_dim = check_space_dimension_overflow(box.space_dimension(),
                                             max_space_dimension(),
                                             "PPL::Grid::",
                                             "Grid(box, from_bounding_box)",
                                             "the space dimension of box "
                                             "exceeds the maximum allowed "
                                             "space dimension");

  if (box.is_empty()) {

    set_empty();
    ((void) 0);
    return;
  }

  if (space_dim == 0)
    set_zero_dim_univ();
  else {

    con_sys.set_space_dimension(space_dim);
    gen_sys.set_space_dimension(space_dim);

    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_l_n; Parma_Polyhedra_Library::Coefficient& l_n = holder_l_n.item();
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_l_d; Parma_Polyhedra_Library::Coefficient& l_d = holder_l_d.item();
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_u_n; Parma_Polyhedra_Library::Coefficient& u_n = holder_u_n.item();
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_u_d; Parma_Polyhedra_Library::Coefficient& u_d = holder_u_d.item();
    gen_sys.insert(grid_point());
    for (dimension_type k = space_dim; k-- > 0; ) {
      const Variable v_k = Variable(k);
      bool closed = false;

      if (box.has_lower_bound(v_k, l_n, l_d, closed)) {
        if (box.has_upper_bound(v_k, u_n, u_d, closed))
          if (l_n * u_d == u_n * l_d) {


            con_sys.insert(l_d * v_k == l_n);



            Grid_Generator& point = gen_sys.sys.rows[0];



            const Coefficient& point_divisor = point.divisor();
            gcd_assign(u_n, l_d, point_divisor);

            exact_div_assign(u_n, point_divisor, u_n);
            if (l_d < 0)
              neg_assign(u_n);

            point.scale_to_divisor(l_d * u_n);

            if (l_d < 0)
              neg_assign(u_n);

            point.expr.set(Variable(k), l_n * u_n);
            ((void) 0);

            ((void) 0);

            continue;
          }
      }

      gen_sys.insert(grid_line(v_k));
    }
    set_congruences_up_to_date();
    set_generators_up_to_date();
  }

  ((void) 0);
}

template <typename Partial_Function>
void
Grid::map_space_dimensions(const Partial_Function& pfunc) {
  if (space_dim == 0)
    return;

  if (pfunc.has_empty_codomain()) {

    if (marked_empty()
        || (!generators_are_up_to_date() && !update_generators())) {

      space_dim = 0;
      set_empty();
    }
    else

      set_zero_dim_univ();

    ((void) 0);
    return;
  }

  dimension_type new_space_dimension = pfunc.max_in_codomain() + 1;

  if (new_space_dimension == space_dim) {





    std::vector<Variable> cycle;
    cycle.reserve(space_dim);


    std::deque<bool> visited(space_dim);

    for (dimension_type i = space_dim; i-- > 0; ) {
      if (!visited[i]) {
        dimension_type j = i;
        do {
          visited[j] = true;

          dimension_type k = 0;
          if (!pfunc.maps(j, k))
            throw_invalid_argument("map_space_dimensions(pfunc)",
                                   " pfunc is inconsistent");
          if (k == j)
            break;

          cycle.push_back(Variable(j));

          j = k;
        } while (!visited[j]);





        if (cycle.size() >= 2) {

          if (congruences_are_up_to_date()) {
            con_sys.permute_space_dimensions(cycle);
            clear_congruences_minimized();
          }

          if (generators_are_up_to_date()) {
            gen_sys.permute_space_dimensions(cycle);
            clear_generators_minimized();
          }
        }

        cycle.clear();
      }
    }

    ((void) 0);
    return;
  }




  const Grid_Generator_System& old_gensys = grid_generators();

  if (old_gensys.has_no_rows()) {

    Grid new_grid(new_space_dimension, EMPTY);
    m_swap(new_grid);
    ((void) 0);
    return;
  }


  std::vector<dimension_type> pfunc_maps(space_dim, not_a_dimension());
  for (dimension_type j = space_dim; j-- > 0; ) {
    dimension_type pfunc_j;
    if (pfunc.maps(j, pfunc_j))
      pfunc_maps[j] = pfunc_j;
  }

  Grid_Generator_System new_gensys;

  new_gensys.set_sorted(false);

  Grid_Generator_System::const_iterator i;
  Grid_Generator_System::const_iterator old_gensys_end = old_gensys.end();
  for (i = old_gensys.begin(); i != old_gensys_end; ++i)
    if (i->is_point())
      break;
  ((void) 0);
  const Coefficient& system_divisor = i->divisor();
  for (i = old_gensys.begin(); i != old_gensys_end; ++i) {
    const Grid_Generator& old_g = *i;
    const Grid_Generator::expr_type old_g_e = old_g.expression();
    Linear_Expression expr;
    expr.set_space_dimension(new_space_dimension);
    bool all_zeroes = true;
    for (Grid_Generator::expr_type::const_iterator j = old_g_e.begin(),
          j_end = old_g_e.end(); j != j_end; ++j) {
      const dimension_type mapped_id = pfunc_maps[j.variable().id()];
      if (mapped_id != not_a_dimension()) {
        add_mul_assign(expr, *j, Variable(mapped_id));
        all_zeroes = false;
      }
    }
    switch (old_g.type()) {
    case Grid_Generator::LINE:
      if (!all_zeroes)
        new_gensys.insert(grid_line(expr));
      break;
    case Grid_Generator::PARAMETER:
      if (!all_zeroes)
        new_gensys.insert(parameter(expr, system_divisor));
      break;
    case Grid_Generator::POINT:
      new_gensys.insert(grid_point(expr, old_g.divisor()));
      break;
    }
  }

  Grid new_grid(new_gensys);
  m_swap(new_grid);

  ((void) 0);
}



template <typename M>
void
Grid::reduce_reduced(Swapping_Vector<typename M::row_type>& rows,
                     const dimension_type dim,
                     const dimension_type pivot_index,
                     const dimension_type start,
                     const dimension_type end,
                     const Dimension_Kinds& sys_dim_kinds,
                     const bool generators) {

  typedef typename M::row_type M_row_type;

  const M_row_type& pivot = rows[pivot_index];
  const Coefficient& pivot_dim = pivot.expr.get(dim);

  if (pivot_dim == 0)
    return;

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_pivot_dim_half; Parma_Polyhedra_Library::Coefficient& pivot_dim_half = holder_pivot_dim_half.item();
  pivot_dim_half = (pivot_dim + 1) / 2;
  const Dimension_Kind row_kind = sys_dim_kinds[dim];
  const bool row_is_line_or_equality
    = (row_kind == (generators ? LINE : EQUALITY));

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_num_rows_to_subtract; Parma_Polyhedra_Library::Coefficient& num_rows_to_subtract = holder_num_rows_to_subtract.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_row_dim_remainder; Parma_Polyhedra_Library::Coefficient& row_dim_remainder = holder_row_dim_remainder.item();
  for (dimension_type kinds_index = dim,
         row_index = pivot_index; row_index-- > 0; ) {
    if (generators) {
      --kinds_index;

      while (sys_dim_kinds[kinds_index] == GEN_VIRTUAL)
        --kinds_index;
    }
    else {
      ++kinds_index;

      while (sys_dim_kinds[kinds_index] == CON_VIRTUAL)
        ++kinds_index;
    }


    if (row_is_line_or_equality
        || (row_kind == PARAMETER
            && sys_dim_kinds[kinds_index] == PARAMETER)) {
      M_row_type& row = rows[row_index];

      const Coefficient& row_dim = row.expr.get(dim);

      num_rows_to_subtract = row_dim / pivot_dim;





      row_dim_remainder = row_dim % pivot_dim;
      if (row_dim_remainder < 0) {
        if (row_dim_remainder <= -pivot_dim_half)
          --num_rows_to_subtract;
      }
      else if (row_dim_remainder > 0 && row_dim_remainder > pivot_dim_half)
        ++num_rows_to_subtract;






      if (num_rows_to_subtract != 0)
        row.expr.linear_combine(pivot.expr,
                                Coefficient_one(), -num_rows_to_subtract,
                                start, end + 1);
    }
  }
}

}
# 2664 "Grid_defs.hh" 2
# 36 "Box_templates.hh" 2


# 1 "BD_Shape_defs.hh" 1
# 44 "BD_Shape_defs.hh"
# 1 "DB_Matrix_defs.hh" 1
# 27 "DB_Matrix_defs.hh"
# 1 "DB_Matrix_types.hh" 1
# 16 "DB_Matrix_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class DB_Matrix;

}
# 28 "DB_Matrix_defs.hh" 2

# 1 "DB_Row_defs.hh" 1
# 27 "DB_Row_defs.hh"
# 1 "DB_Row_types.hh" 1
# 16 "DB_Row_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class DB_Row_Impl_Handler;

template <typename T>
class DB_Row;

}
# 28 "DB_Row_defs.hh" 2

# 1 "Ptr_Iterator_defs.hh" 1
# 27 "Ptr_Iterator_defs.hh"
# 1 "Ptr_Iterator_types.hh" 1
# 16 "Ptr_Iterator_types.hh"
namespace Parma_Polyhedra_Library {

namespace Implementation {

template <typename P>
class Ptr_Iterator;

}

}
# 28 "Ptr_Iterator_defs.hh" 2


namespace Parma_Polyhedra_Library {

namespace Implementation {

template<typename P, typename Q>
bool operator==(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P, typename Q>
bool operator!=(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P, typename Q>
bool operator<(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P, typename Q>
bool operator<=(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P, typename Q>
bool operator>(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P, typename Q>
bool operator>=(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P, typename Q>
typename Ptr_Iterator<P>::difference_type
operator-(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y);

template<typename P>
Ptr_Iterator<P> operator+(typename Ptr_Iterator<P>::difference_type m,
                          const Ptr_Iterator<P>& y);

}

}




template <typename P>
class Parma_Polyhedra_Library::Implementation::Ptr_Iterator
  : public std::iterator<typename std::iterator_traits<P>::iterator_category,
                         typename std::iterator_traits<P>::value_type,
                         typename std::iterator_traits<P>::difference_type,
                         typename std::iterator_traits<P>::pointer,
                         typename std::iterator_traits<P>::reference> {
public:
  typedef typename std::iterator_traits<P>::difference_type difference_type;
  typedef typename std::iterator_traits<P>::reference reference;
  typedef typename std::iterator_traits<P>::pointer pointer;


  Ptr_Iterator();


  explicit Ptr_Iterator(const P& q);





  template<typename Q>
  Ptr_Iterator(const Ptr_Iterator<Q>& q);


  reference operator*() const;


  pointer operator->() const;


  reference operator[](const difference_type m) const;


  Ptr_Iterator& operator++();


  Ptr_Iterator operator++(int);


  Ptr_Iterator& operator--();


  Ptr_Iterator operator--(int);


  Ptr_Iterator& operator+=(const difference_type m);


  Ptr_Iterator& operator-=(const difference_type m);


  difference_type operator-(const Ptr_Iterator& y) const;


  Ptr_Iterator operator+(const difference_type m) const;


  Ptr_Iterator operator-(const difference_type m) const;

private:

  P p;


  const P& base() const;

  template <typename Q, typename R>
  friend bool Parma_Polyhedra_Library::Implementation::
  operator==(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  template <typename Q, typename R>
  friend bool Parma_Polyhedra_Library::Implementation::
  operator!=(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  template<typename Q, typename R>
  friend bool Parma_Polyhedra_Library::Implementation::
  operator<(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  template<typename Q, typename R>
  friend bool Parma_Polyhedra_Library::Implementation::
  operator<=(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  template<typename Q, typename R>
  friend bool Parma_Polyhedra_Library::Implementation::
  operator>(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  template<typename Q, typename R>
  friend bool Parma_Polyhedra_Library::Implementation::
  operator>=(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  template<typename Q, typename R>
  friend typename Ptr_Iterator<Q>::difference_type
  Parma_Polyhedra_Library::Implementation::
  operator-(const Ptr_Iterator<Q>& x, const Ptr_Iterator<R>& y);

  friend Ptr_Iterator<P>
  Parma_Polyhedra_Library::Implementation::
  operator+<>(typename Ptr_Iterator<P>::difference_type m,
              const Ptr_Iterator<P>& y);
};

# 1 "Ptr_Iterator_inlines.hh" 1
# 30 "Ptr_Iterator_inlines.hh"
namespace Parma_Polyhedra_Library {

namespace Implementation {

template <typename P>
inline const P&
Ptr_Iterator<P>::base() const {
  return p;
}

template <typename P>
inline
Ptr_Iterator<P>::Ptr_Iterator()
  : p(P()) {
}

template <typename P>
inline
Ptr_Iterator<P>::Ptr_Iterator(const P& q)
  : p(q) {
}

template <typename P>
template <typename Q>
inline
Ptr_Iterator<P>::Ptr_Iterator(const Ptr_Iterator<Q>& q)
  : p(q.base()) {
}

template <typename P>
inline typename Ptr_Iterator<P>::reference
Ptr_Iterator<P>::operator*() const {
  return *p;
}

template <typename P>
inline typename Ptr_Iterator<P>::pointer
Ptr_Iterator<P>::operator->() const {
  return p;
}

template <typename P>
inline typename Ptr_Iterator<P>::reference
Ptr_Iterator<P>::operator[](const difference_type m) const {
  return p[m];
}

template <typename P>
inline Ptr_Iterator<P>&
Ptr_Iterator<P>::operator++() {
  ++p;
  return *this;
}

template <typename P>
inline Ptr_Iterator<P>
Ptr_Iterator<P>::operator++(int) {
  return Ptr_Iterator(p++);
}

template <typename P>
inline Ptr_Iterator<P>&
Ptr_Iterator<P>::operator--() {
  --p;
  return *this;
}

template <typename P>
inline Ptr_Iterator<P>
Ptr_Iterator<P>::operator--(int) {
  return Ptr_Iterator(p--);
}


template <typename P>
inline Ptr_Iterator<P>&
Ptr_Iterator<P>::operator+=(const difference_type m) {
  p += m;
  return *this;
}

template <typename P>
inline Ptr_Iterator<P>&
Ptr_Iterator<P>::operator-=(const difference_type m) {
  p -= m;
  return *this;
}

template <typename P>
inline typename Ptr_Iterator<P>::difference_type
Ptr_Iterator<P>::operator-(const Ptr_Iterator& y) const {
  return p - y.p;
}

template <typename P>
inline Ptr_Iterator<P>
Ptr_Iterator<P>::operator+(const difference_type m) const {
  return Ptr_Iterator(p + m);
}

template <typename P>
inline Ptr_Iterator<P>
Ptr_Iterator<P>::operator-(const difference_type m) const {
  return Ptr_Iterator(p - m);
}

template<typename P, typename Q>
inline bool
operator==(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() == y.base();
}

template<typename P, typename Q>
inline bool
operator!=(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() != y.base();
}

template<typename P, typename Q>
inline bool
operator<(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() < y.base();
}

template<typename P, typename Q>
inline bool
operator<=(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() <= y.base();
}

template<typename P, typename Q>
inline bool
operator>(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() > y.base();
}

template<typename P, typename Q>
inline bool
operator>=(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() >= y.base();
}

template<typename P, typename Q>
inline typename Ptr_Iterator<P>::difference_type
operator-(const Ptr_Iterator<P>& x, const Ptr_Iterator<Q>& y) {
  return x.base() - y.base();
}

template<typename P>
inline Ptr_Iterator<P>
operator+(typename Ptr_Iterator<P>::difference_type m,
          const Ptr_Iterator<P>& y) {
  return Ptr_Iterator<P>(m + y.base());
}

}

}
# 171 "Ptr_Iterator_defs.hh" 2
# 30 "DB_Row_defs.hh" 2
# 57 "DB_Row_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::DB_Row_Impl_Handler {
public:

  DB_Row_Impl_Handler();


  ~DB_Row_Impl_Handler();

  class Impl;


  Impl* impl;






private:

  DB_Row_Impl_Handler(const DB_Row_Impl_Handler&);


  DB_Row_Impl_Handler& operator=(const DB_Row_Impl_Handler&);
};
# 119 "DB_Row_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::DB_Row : private DB_Row_Impl_Handler<T> {
public:

  DB_Row();







  void construct(dimension_type sz);
# 145 "DB_Row_defs.hh"
  void construct(dimension_type sz, dimension_type capacity);
# 159 "DB_Row_defs.hh"
  template <typename U>
  void construct_upward_approximation(const DB_Row<U>& y,
                                      dimension_type capacity);




  DB_Row(dimension_type sz);


  DB_Row(dimension_type sz, dimension_type capacity);


  DB_Row(const DB_Row& y);





  DB_Row(const DB_Row& y, dimension_type capacity);







  DB_Row(const DB_Row& y, dimension_type sz, dimension_type capacity);


  ~DB_Row();


  DB_Row& operator=(const DB_Row& y);


  void m_swap(DB_Row& y);


  void assign(DB_Row& y);
# 208 "DB_Row_defs.hh"
  void allocate(dimension_type capacity);
# 218 "DB_Row_defs.hh"
  void expand_within_capacity(dimension_type new_size);







  void shrink(dimension_type new_size);


  static dimension_type max_size();


  dimension_type size() const;




  T& operator[](dimension_type k);


  const T& operator[](dimension_type k) const;



  typedef Implementation::Ptr_Iterator<T*> iterator;


  typedef Implementation::Ptr_Iterator<const T*> const_iterator;






  iterator begin();


  iterator end();






  const_iterator begin() const;


  const_iterator end() const;





  memory_size_type total_memory_in_bytes() const;





  memory_size_type external_memory_in_bytes() const;





  memory_size_type total_memory_in_bytes(dimension_type capacity) const;





  memory_size_type external_memory_in_bytes(dimension_type capacity) const;


  bool OK(dimension_type row_size, dimension_type row_capacity) const;

private:
  template <typename U> friend class Parma_Polyhedra_Library::DB_Row;


  void copy_construct_coefficients(const DB_Row& y);





};

namespace Parma_Polyhedra_Library {





template <typename T>
void swap(DB_Row<T>& x, DB_Row<T>& y);





template <typename T>
void iter_swap(typename std::vector<DB_Row<T> >::iterator x,
               typename std::vector<DB_Row<T> >::iterator y);






template <typename T>
bool operator==(const DB_Row<T>& x, const DB_Row<T>& y);


template <typename T>
bool operator!=(const DB_Row<T>& x, const DB_Row<T>& y);




}
# 351 "DB_Row_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::DB_Row_Impl_Handler<T>::Impl {
public:
# 362 "DB_Row_defs.hh"
  static void* operator new(size_t fixed_size, dimension_type capacity);


  static void operator delete(void* p);





  static void operator delete(void* p, dimension_type capacity);



  Impl();






  ~Impl();





  void expand_within_capacity(dimension_type new_size);





  void shrink(dimension_type new_size);


  void copy_construct_coefficients(const Impl& y);





  template <typename U>
  void construct_upward_approximation(const U& y);


  static dimension_type max_size();




  dimension_type size() const;


  void set_size(dimension_type new_sz);


  void bump_size();





  T& operator[](dimension_type k);


  const T& operator[](dimension_type k) const;






  memory_size_type total_memory_in_bytes() const;


  memory_size_type total_memory_in_bytes(dimension_type capacity) const;


  memory_size_type external_memory_in_bytes() const;

private:
  friend class DB_Row<T>;


  dimension_type size_;


  T vec_[

          0



  ];


  Impl(const Impl& y);


  Impl& operator=(const Impl&);


  void copy_construct(const Impl& y);
};

# 1 "DB_Row_inlines.hh" 1
# 34 "DB_Row_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline void*
DB_Row_Impl_Handler<T>::Impl::operator new(const size_t fixed_size,
                                           const dimension_type capacity) {

  return ::operator new(fixed_size + capacity*sizeof(T));




}

template <typename T>
inline void
DB_Row_Impl_Handler<T>::Impl::operator delete(void* p) {
  ::operator delete(p);
}

template <typename T>
inline void
DB_Row_Impl_Handler<T>::Impl::operator delete(void* p, dimension_type) {
  ::operator delete(p);
}

template <typename T>
inline memory_size_type
DB_Row_Impl_Handler<T>::Impl
::total_memory_in_bytes(dimension_type capacity) const {
  return
    sizeof(*this)
    + capacity*sizeof(T)



    + external_memory_in_bytes();
}

template <typename T>
inline memory_size_type
DB_Row_Impl_Handler<T>::Impl::total_memory_in_bytes() const {


  return total_memory_in_bytes(size_);
}

template <typename T>
inline dimension_type
DB_Row_Impl_Handler<T>::Impl::max_size() {
  return std::numeric_limits<size_t>::max() / sizeof(T);
}

template <typename T>
inline dimension_type
DB_Row_Impl_Handler<T>::Impl::size() const {
  return size_;
}

template <typename T>
inline void
DB_Row_Impl_Handler<T>::Impl::set_size(const dimension_type new_sz) {
  size_ = new_sz;
}

template <typename T>
inline void
DB_Row_Impl_Handler<T>::Impl::bump_size() {
  ++size_;
}

template <typename T>
inline
DB_Row_Impl_Handler<T>::Impl::Impl()
  : size_(0) {
}

template <typename T>
inline
DB_Row_Impl_Handler<T>::Impl::~Impl() {
  shrink(0);
}

template <typename T>
inline
DB_Row_Impl_Handler<T>::DB_Row_Impl_Handler()
  : impl(0) {



}

template <typename T>
inline
DB_Row_Impl_Handler<T>::~DB_Row_Impl_Handler() {
  delete impl;
}

template <typename T>
inline T&
DB_Row_Impl_Handler<T>::Impl::operator[](const dimension_type k) {
  ((void) 0);
  return vec_[k];
}

template <typename T>
inline const T&
DB_Row_Impl_Handler<T>::Impl::operator[](const dimension_type k) const {
  ((void) 0);
  return vec_[k];
}

template <typename T>
inline dimension_type
DB_Row<T>::max_size() {
  return DB_Row_Impl_Handler<T>::Impl::max_size();
}

template <typename T>
inline dimension_type
DB_Row<T>::size() const {
  return this->impl->size();
}
# 166 "DB_Row_inlines.hh"
template <typename T>
inline
DB_Row<T>::DB_Row()
  : DB_Row_Impl_Handler<T>() {
}

template <typename T>
inline void
DB_Row<T>::allocate(

               const

               dimension_type capacity) {
  DB_Row<T>& x = *this;
  ((void) 0);




  ((void) 0);
  x.impl = new (capacity) typename DB_Row_Impl_Handler<T>::Impl();




}

template <typename T>
inline void
DB_Row<T>::expand_within_capacity(const dimension_type new_size) {
  DB_Row<T>& x = *this;
  ((void) 0);



  x.impl->expand_within_capacity(new_size);
}

template <typename T>
inline void
DB_Row<T>::copy_construct_coefficients(const DB_Row& y) {
  DB_Row<T>& x = *this;
  ((void) 0);



  x.impl->copy_construct_coefficients(*(y.impl));
}

template <typename T>
template <typename U>
inline void
DB_Row<T>::construct_upward_approximation(const DB_Row<U>& y,
                                          const dimension_type capacity) {
  DB_Row<T>& x = *this;
  ((void) 0);
  allocate(capacity);
  ((void) 0);
  x.impl->construct_upward_approximation(*(y.impl));
}

template <typename T>
inline void
DB_Row<T>::construct(const dimension_type sz,
                     const dimension_type capacity) {
  ((void) 0);
  allocate(capacity);
  expand_within_capacity(sz);
}

template <typename T>
inline void
DB_Row<T>::construct(const dimension_type sz) {
  construct(sz, sz);
}

template <typename T>
inline
DB_Row<T>::DB_Row(const dimension_type sz,
                  const dimension_type capacity)
  : DB_Row_Impl_Handler<T>() {
  construct(sz, capacity);
}

template <typename T>
inline
DB_Row<T>::DB_Row(const dimension_type sz) {
  construct(sz);
}

template <typename T>
inline
DB_Row<T>::DB_Row(const DB_Row& y)
  : DB_Row_Impl_Handler<T>() {
  if (y.impl != 0) {
    allocate(compute_capacity(y.size(), max_size()));
    copy_construct_coefficients(y);
  }
}

template <typename T>
inline
DB_Row<T>::DB_Row(const DB_Row& y,
                  const dimension_type capacity)
  : DB_Row_Impl_Handler<T>() {
  ((void) 0);
  ((void) 0);
  allocate(capacity);
  copy_construct_coefficients(y);
}

template <typename T>
inline
DB_Row<T>::DB_Row(const DB_Row& y,
                  const dimension_type sz,
                  const dimension_type capacity)
  : DB_Row_Impl_Handler<T>() {
  ((void) 0);
  ((void) 0);
  allocate(capacity);
  copy_construct_coefficients(y);
  expand_within_capacity(sz);
}

template <typename T>
inline
DB_Row<T>::~DB_Row() {
}

template <typename T>
inline void
DB_Row<T>::shrink(const dimension_type new_size) {
  DB_Row<T>& x = *this;
  ((void) 0);
  x.impl->shrink(new_size);
}

template <typename T>
inline void
DB_Row<T>::m_swap(DB_Row& y) {
  using std::swap;
  DB_Row<T>& x = *this;
  swap(x.impl, y.impl);



}

template <typename T>
inline void
DB_Row<T>::assign(DB_Row& y) {
  DB_Row<T>& x = *this;
  x.impl = y.impl;



}

template <typename T>
inline DB_Row<T>&
DB_Row<T>::operator=(const DB_Row& y) {
  DB_Row tmp(y);
  m_swap(tmp);
  return *this;
}

template <typename T>
inline T&
DB_Row<T>::operator[](const dimension_type k) {
  DB_Row<T>& x = *this;
  return (*x.impl)[k];
}

template <typename T>
inline const T&
DB_Row<T>::operator[](const dimension_type k) const {
  const DB_Row<T>& x = *this;
  return (*x.impl)[k];
}

template <typename T>
inline typename DB_Row<T>::iterator
DB_Row<T>::begin() {
  DB_Row<T>& x = *this;
  return iterator(x.impl->vec_);
}

template <typename T>
inline typename DB_Row<T>::iterator
DB_Row<T>::end() {
  DB_Row<T>& x = *this;
  return iterator(x.impl->vec_ + x.impl->size_);
}

template <typename T>
inline typename DB_Row<T>::const_iterator
DB_Row<T>::begin() const {
  const DB_Row<T>& x = *this;
  return const_iterator(x.impl->vec_);
}

template <typename T>
inline typename DB_Row<T>::const_iterator
DB_Row<T>::end() const {
  const DB_Row<T>& x = *this;
  return const_iterator(x.impl->vec_ + x.impl->size_);
}

template <typename T>
inline memory_size_type
DB_Row<T>::external_memory_in_bytes(dimension_type capacity) const {
  const DB_Row<T>& x = *this;
  return x.impl->total_memory_in_bytes(capacity);
}

template <typename T>
inline memory_size_type
DB_Row<T>::total_memory_in_bytes(dimension_type capacity) const {
  return sizeof(*this) + external_memory_in_bytes(capacity);
}

template <typename T>
inline memory_size_type
DB_Row<T>::external_memory_in_bytes() const {
  const DB_Row<T>& x = *this;



  return x.impl->total_memory_in_bytes();

}

template <typename T>
inline memory_size_type
DB_Row<T>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}


template <typename T>
inline bool
operator!=(const DB_Row<T>& x, const DB_Row<T>& y) {
  return !(x == y);
}


template <typename T>
inline void
swap(DB_Row<T>& x, DB_Row<T>& y) {
  x.m_swap(y);
}


template <typename T>
inline void
iter_swap(typename std::vector<DB_Row<T> >::iterator x,
          typename std::vector<DB_Row<T> >::iterator y) {
  swap(*x, *y);
}

}
# 468 "DB_Row_defs.hh" 2
# 1 "DB_Row_templates.hh" 1
# 29 "DB_Row_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
template <typename U>
void
DB_Row_Impl_Handler<T>::Impl::construct_upward_approximation(const U& y) {
  const dimension_type y_size = y.size();


  for (dimension_type i = 0; i < y_size; ++i) {
    construct(vec_[i], y[i], ROUND_UP);
    bump_size();
  }
# 53 "DB_Row_templates.hh"
}

template <typename T>
void
DB_Row_Impl_Handler<T>::
Impl::expand_within_capacity(const dimension_type new_size) {
  ((void) 0);
# 68 "DB_Row_templates.hh"
  for (dimension_type i = size(); i < new_size; ++i) {
    new (&vec_[i]) T(PLUS_INFINITY, ROUND_NOT_NEEDED);
    bump_size();
  }
}

template <typename T>
void
DB_Row_Impl_Handler<T>::Impl::shrink(dimension_type new_size) {
  const dimension_type old_size = size();
  ((void) 0);

  set_size(new_size);







  for (dimension_type i = old_size; i-- > new_size; )
    vec_[i].~T();
}

template <typename T>
void
DB_Row_Impl_Handler<T>::Impl::copy_construct_coefficients(const Impl& y) {
  const dimension_type y_size = y.size();


  for (dimension_type i = 0; i < y_size; ++i) {
    new (&vec_[i]) T(y.vec_[i]);
    bump_size();
  }
# 113 "DB_Row_templates.hh"
}

template <typename T>
memory_size_type
DB_Row_Impl_Handler<T>::Impl::external_memory_in_bytes() const {
  memory_size_type n = 0;
  for (dimension_type i = size(); i-- > 0; )
    n += Parma_Polyhedra_Library::external_memory_in_bytes(vec_[i]);
  return n;
}

template <typename T>
bool
DB_Row<T>::OK(const dimension_type row_size,
              const dimension_type



              ) const {





  const DB_Row<T>& x = *this;
  bool is_broken = false;
# 160 "DB_Row_templates.hh"
  if (x.size() != row_size) {





    is_broken = true;
  }
# 180 "DB_Row_templates.hh"
  for (dimension_type i = x.size(); i-- > 0; ) {
    const T& element = x[i];

    if (!element.OK()) {
      is_broken = true;
      break;
    }

    if (is_not_a_number(element)) {




      is_broken = true;
      break;
    }
  }

  return !is_broken;
}


template <typename T>
bool
operator==(const DB_Row<T>& x, const DB_Row<T>& y) {
  if (x.size() != y.size())
    return false;
  for (dimension_type i = x.size(); i-- > 0; )
    if (x[i] != y[i])
      return false;
  return true;
}

}
# 469 "DB_Row_defs.hh" 2
# 30 "DB_Matrix_defs.hh" 2






namespace Parma_Polyhedra_Library {

namespace IO_Operators {





template <typename T>
std::ostream&
operator<<(std::ostream& s, const DB_Matrix<T>& c);

}

}
# 61 "DB_Matrix_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::DB_Matrix {
public:

  static dimension_type max_num_rows();


  static dimension_type max_num_columns();





  DB_Matrix();


  explicit DB_Matrix(dimension_type n_rows);


  DB_Matrix(const DB_Matrix& y);


  template <typename U>
  explicit DB_Matrix(const DB_Matrix<U>& y);


  ~DB_Matrix();


  DB_Matrix& operator=(const DB_Matrix& y);





  class const_iterator {
  private:
    typedef typename std::vector<DB_Row<T> >::const_iterator Iter;

    Iter i;

  public:
    typedef std::forward_iterator_tag iterator_category;
    typedef typename std::iterator_traits<Iter>::value_type value_type;
    typedef typename std::iterator_traits<Iter>::difference_type
    difference_type;
    typedef typename std::iterator_traits<Iter>::pointer pointer;
    typedef typename std::iterator_traits<Iter>::reference reference;


    const_iterator();





    explicit const_iterator(const Iter& b);


    const_iterator(const const_iterator& y);


    const_iterator& operator=(const const_iterator& y);


    reference operator*() const;


    pointer operator->() const;


    const_iterator& operator++();


    const_iterator operator++(int);





    bool operator==(const const_iterator& y) const;





    bool operator!=(const const_iterator& y) const;
  };






  const_iterator begin() const;


  const_iterator end() const;

private:
  template <typename U> friend class DB_Matrix;


  std::vector<DB_Row<T> > rows;


  dimension_type row_size;





  dimension_type row_capacity;

public:

  void m_swap(DB_Matrix& y);
# 188 "DB_Matrix_defs.hh"
  void grow(dimension_type new_n_rows);
# 198 "DB_Matrix_defs.hh"
  void resize_no_copy(dimension_type new_n_rows);


  dimension_type num_rows() const;




  DB_Row<T>& operator[](dimension_type k);


  const DB_Row<T>& operator[](dimension_type k) const;


  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;


  bool OK() const;
};

namespace Parma_Polyhedra_Library {





template <typename T>
void swap(DB_Matrix<T>& x, DB_Matrix<T>& y);





template <typename T>
bool operator==(const DB_Matrix<T>& x, const DB_Matrix<T>& y);





template <typename T>
bool operator!=(const DB_Matrix<T>& x, const DB_Matrix<T>& y);
# 267 "DB_Matrix_defs.hh"
template <typename Temp, typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const DB_Matrix<T>& x,
                                 const DB_Matrix<T>& y,
                                 Rounding_Dir dir,
                                 Temp& tmp0,
                                 Temp& tmp1,
                                 Temp& tmp2);
# 289 "DB_Matrix_defs.hh"
template <typename Temp, typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const DB_Matrix<T>& x,
                               const DB_Matrix<T>& y,
                               Rounding_Dir dir,
                               Temp& tmp0,
                               Temp& tmp1,
                               Temp& tmp2);
# 311 "DB_Matrix_defs.hh"
template <typename Temp, typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const DB_Matrix<T>& x,
                                const DB_Matrix<T>& y,
                                Rounding_Dir dir,
                                Temp& tmp0,
                                Temp& tmp1,
                                Temp& tmp2);

}

# 1 "DB_Matrix_inlines.hh" 1
# 33 "DB_Matrix_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline void
DB_Matrix<T>::m_swap(DB_Matrix& y) {
  using std::swap;
  swap(rows, y.rows);
  swap(row_size, y.row_size);
  swap(row_capacity, y.row_capacity);
}

template <typename T>
inline dimension_type
DB_Matrix<T>::max_num_rows() {
  return std::vector<DB_Row<T> >().max_size();
}

template <typename T>
inline dimension_type
DB_Matrix<T>::max_num_columns() {
  return DB_Row<T>::max_size();
}

template <typename T>
inline memory_size_type
DB_Matrix<T>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename T>
inline
DB_Matrix<T>::const_iterator::const_iterator()
  : i(Iter()) {
}

template <typename T>
inline
DB_Matrix<T>::const_iterator::const_iterator(const Iter& b)
  : i(b) {
}

template <typename T>
inline
DB_Matrix<T>::const_iterator::const_iterator(const const_iterator& y)
  : i(y.i) {
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator&
DB_Matrix<T>::const_iterator::operator=(const const_iterator& y) {
  i = y.i;
  return *this;
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator::reference
DB_Matrix<T>::const_iterator::operator*() const {
  return *i;
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator::pointer
DB_Matrix<T>::const_iterator::operator->() const {
  return &*i;
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator&
DB_Matrix<T>::const_iterator::operator++() {
  ++i;
  return *this;
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator
DB_Matrix<T>::const_iterator::operator++(int) {
  return const_iterator(i++);
}

template <typename T>
inline bool
DB_Matrix<T>::const_iterator::operator==(const const_iterator& y) const {
  return i == y.i;
}

template <typename T>
inline bool
DB_Matrix<T>::const_iterator::operator!=(const const_iterator& y) const {
  return !operator==(y);
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator
DB_Matrix<T>::begin() const {
  return const_iterator(rows.begin());
}

template <typename T>
inline typename DB_Matrix<T>::const_iterator
DB_Matrix<T>::end() const {
  return const_iterator(rows.end());
}

template <typename T>
inline
DB_Matrix<T>::DB_Matrix()
  : rows(),
    row_size(0),
    row_capacity(0) {
}

template <typename T>
inline
DB_Matrix<T>::~DB_Matrix() {
}

template <typename T>
inline DB_Row<T>&
DB_Matrix<T>::operator[](const dimension_type k) {
  ((void) 0);
  return rows[k];
}

template <typename T>
inline const DB_Row<T>&
DB_Matrix<T>::operator[](const dimension_type k) const {
  ((void) 0);
  return rows[k];
}

template <typename T>
inline dimension_type
DB_Matrix<T>::num_rows() const {
  return rows.size();
}




template <typename T>
inline bool
operator!=(const DB_Matrix<T>& x, const DB_Matrix<T>& y) {
  return !(x == y);
}

template <typename T>
inline
DB_Matrix<T>::DB_Matrix(const DB_Matrix& y)
  : rows(y.rows),
    row_size(y.row_size),
    row_capacity(compute_capacity(y.row_size, max_num_columns())) {
}

template <typename T>
inline DB_Matrix<T>&
DB_Matrix<T>::operator=(const DB_Matrix& y) {




  if (this != &y) {

    rows = y.rows;
    row_size = y.row_size;


    row_capacity = compute_capacity(y.row_size, max_num_columns());
  }
  return *this;
}




template <typename Specialization, typename Temp, typename To, typename T>
inline bool
l_m_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                    const DB_Matrix<T>& x,
                    const DB_Matrix<T>& y,
                    const Rounding_Dir dir,
                    Temp& tmp0,
                    Temp& tmp1,
                    Temp& tmp2) {
  const dimension_type x_num_rows = x.num_rows();
  if (x_num_rows != y.num_rows())
    return false;
  assign_r(tmp0, 0, ROUND_NOT_NEEDED);
  for (dimension_type i = x_num_rows; i-- > 0; ) {
    const DB_Row<T>& x_i = x[i];
    const DB_Row<T>& y_i = y[i];
    for (dimension_type j = x_num_rows; j-- > 0; ) {
      const T& x_i_j = x_i[j];
      const T& y_i_j = y_i[j];
      if (is_plus_infinity(x_i_j)) {
        if (is_plus_infinity(y_i_j))
          continue;
        else {
        pinf:
          assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
          return true;
        }
      }
      else if (is_plus_infinity(y_i_j))
        goto pinf;

      const Temp* tmp1p;
      const Temp* tmp2p;
      if (x_i_j > y_i_j) {
        maybe_assign(tmp1p, tmp1, x_i_j, dir);
        maybe_assign(tmp2p, tmp2, y_i_j, inverse(dir));
      }
      else {
        maybe_assign(tmp1p, tmp1, y_i_j, dir);
        maybe_assign(tmp2p, tmp2, x_i_j, inverse(dir));
      }
      sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
      ((void) 0);
      Specialization::combine(tmp0, tmp1, dir);
    }
  }
  Specialization::finalize(tmp0, dir);
  assign_r(r, tmp0, dir);
  return true;
}




template <typename Temp, typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const DB_Matrix<T>& x,
                            const DB_Matrix<T>& y,
                            const Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2) {
  return
    l_m_distance_assign<Rectilinear_Distance_Specialization<Temp> >(r, x, y,
                                                                    dir,
                                                                    tmp0,
                                                                    tmp1,
                                                                    tmp2);
}





template <typename Temp, typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const DB_Matrix<T>& x,
                          const DB_Matrix<T>& y,
                          const Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2) {
  return
    l_m_distance_assign<Euclidean_Distance_Specialization<Temp> >(r, x, y,
                                                                  dir,
                                                                  tmp0,
                                                                  tmp1,
                                                                  tmp2);
}




template <typename Temp, typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const DB_Matrix<T>& x,
                           const DB_Matrix<T>& y,
                           const Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2) {
  return
    l_m_distance_assign<L_Infinity_Distance_Specialization<Temp> >(r, x, y,
                                                                   dir,
                                                                   tmp0,
                                                                   tmp1,
                                                                   tmp2);
}




template <typename T>
inline void
swap(DB_Matrix<T>& x, DB_Matrix<T>& y) {
  x.m_swap(y);
}

}
# 323 "DB_Matrix_defs.hh" 2
# 1 "DB_Matrix_templates.hh" 1
# 27 "DB_Matrix_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
DB_Matrix<T>::DB_Matrix(const dimension_type n_rows)
  : rows(n_rows),
    row_size(n_rows),
    row_capacity(compute_capacity(n_rows, max_num_columns())) {

  for (dimension_type i = 0; i < n_rows; ++i)
    rows[i].construct(n_rows, row_capacity);
  ((void) 0);
}

template <typename T>
template <typename U>
DB_Matrix<T>::DB_Matrix(const DB_Matrix<U>& y)
  : rows(y.rows.size()),
    row_size(y.row_size),
    row_capacity(compute_capacity(y.row_size, max_num_columns())) {

  for (dimension_type i = 0, n_rows = rows.size(); i < n_rows; ++i)
    rows[i].construct_upward_approximation(y[i], row_capacity);
  ((void) 0);
}

template <typename T>
void
DB_Matrix<T>::grow(const dimension_type new_n_rows) {
  const dimension_type old_n_rows = rows.size();
  ((void) 0);

  if (new_n_rows > old_n_rows) {
    if (new_n_rows <= row_capacity) {

      if (rows.capacity() < new_n_rows) {

        std::vector<DB_Row<T> > new_rows;
        new_rows.reserve(compute_capacity(new_n_rows, max_num_rows()));
        new_rows.insert(new_rows.end(), new_n_rows, DB_Row<T>());

        dimension_type i = new_n_rows;
        while (i-- > old_n_rows)
          new_rows[i].construct(new_n_rows, row_capacity);

        ++i;
        while (i-- > 0)
          swap(new_rows[i], rows[i]);

        using std::swap;
        swap(rows, new_rows);
      }
      else {

        rows.insert(rows.end(), new_n_rows - old_n_rows, DB_Row<T>());
        for (dimension_type i = new_n_rows; i-- > old_n_rows; )
          rows[i].construct(new_n_rows, row_capacity);
      }
    }
    else {

      DB_Matrix new_matrix;
      new_matrix.rows.reserve(compute_capacity(new_n_rows, max_num_rows()));
      new_matrix.rows.insert(new_matrix.rows.end(), new_n_rows, DB_Row<T>());

      new_matrix.row_size = new_n_rows;
      new_matrix.row_capacity = compute_capacity(new_n_rows,
                                                 max_num_columns());
      dimension_type i = new_n_rows;
      while (i-- > old_n_rows)
        new_matrix.rows[i].construct(new_matrix.row_size,
                                     new_matrix.row_capacity);

      ++i;
      while (i-- > 0) {

        DB_Row<T> new_row(rows[i],
                          new_matrix.row_size,
                          new_matrix.row_capacity);
        swap(new_matrix.rows[i], new_row);
      }

      m_swap(new_matrix);
      return;
    }
  }

  if (new_n_rows > row_size) {

    if (new_n_rows <= row_capacity)

      for (dimension_type i = old_n_rows; i-- > 0; )
        rows[i].expand_within_capacity(new_n_rows);
    else {


      const dimension_type new_row_capacity
        = compute_capacity(new_n_rows, max_num_columns());
      for (dimension_type i = old_n_rows; i-- > 0; ) {

        DB_Row<T> new_row(rows[i], new_n_rows, new_row_capacity);
        swap(rows[i], new_row);
      }
      row_capacity = new_row_capacity;
    }

    row_size = new_n_rows;
  }
}

template <typename T>
void
DB_Matrix<T>::resize_no_copy(const dimension_type new_n_rows) {
  dimension_type old_n_rows = rows.size();

  if (new_n_rows > old_n_rows) {

    if (new_n_rows <= row_capacity) {

      if (rows.capacity() < new_n_rows) {

        std::vector<DB_Row<T> > new_rows;
        new_rows.reserve(compute_capacity(new_n_rows, max_num_rows()));
        new_rows.insert(new_rows.end(), new_n_rows, DB_Row<T>());


        dimension_type i = new_n_rows;
        while (i-- > old_n_rows)
          new_rows[i].construct(new_n_rows, row_capacity);

        ++i;
        while (i-- > 0)
          swap(new_rows[i], rows[i]);

        using std::swap;
        swap(rows, new_rows);
      }
      else {

        rows.insert(rows.end(), new_n_rows - old_n_rows, DB_Row<T>());


        for (dimension_type i = new_n_rows; i-- > old_n_rows; )
          rows[i].construct(new_n_rows, row_capacity);
      }
    }
    else {

      DB_Matrix new_matrix(new_n_rows);
      m_swap(new_matrix);
      return;
    }
  }
  else if (new_n_rows < old_n_rows) {

    rows.resize(new_n_rows);

    for (dimension_type i = new_n_rows; i-- > 0; )
      rows[i].shrink(new_n_rows);
    old_n_rows = new_n_rows;
  }

  if (new_n_rows > row_size) {

    if (new_n_rows <= row_capacity)

      for (dimension_type i = old_n_rows; i-- > 0; )
        rows[i].expand_within_capacity(new_n_rows);
    else {


      const dimension_type new_row_capacity
        = compute_capacity(new_n_rows, max_num_columns());
      for (dimension_type i = old_n_rows; i-- > 0; ) {
        DB_Row<T> new_row(new_n_rows, new_row_capacity);
        swap(rows[i], new_row);
      }
      row_capacity = new_row_capacity;
    }
  }

  row_size = new_n_rows;
}

template <typename T>
void
DB_Matrix<T>::ascii_dump(std::ostream& s) const {
  const DB_Matrix<T>& x = *this;
  const char separator = ' ';
  const dimension_type nrows = x.num_rows();
  s << nrows << separator << "\n";
  for (dimension_type i = 0; i < nrows; ++i) {
    for (dimension_type j = 0; j < nrows; ++j) {
      using namespace IO_Operators;
      s << x[i][j] << separator;
    }
    s << "\n";
  }
}

template <typename T> void DB_Matrix<T>::ascii_dump() const { ascii_dump(std::cerr); } template <typename T> void DB_Matrix<T>::print() const { using IO_Operators::operator<<; std::cerr << *this; }

template <typename T>
bool
DB_Matrix<T>::ascii_load(std::istream& s) {
  dimension_type nrows;
  if (!(s >> nrows))
    return false;
  resize_no_copy(nrows);
  DB_Matrix& x = *this;
  for (dimension_type i = 0; i < nrows; ++i)
    for (dimension_type j = 0; j < nrows; ++j) {
      Result r = input(x[i][j], s, ROUND_CHECK);
      if (result_relation(r) != VR_EQ || is_minus_infinity(x[i][j]))
        return false;
    }


  ((void) 0);
  return true;
}




template <typename T>
bool
operator==(const DB_Matrix<T>& x, const DB_Matrix<T>& y) {
  const dimension_type x_num_rows = x.num_rows();
  if (x_num_rows != y.num_rows())
    return false;
  for (dimension_type i = x_num_rows; i-- > 0; )
    if (x[i] != y[i])
      return false;
  return true;
}

template <typename T>
memory_size_type
DB_Matrix<T>::external_memory_in_bytes() const {
  memory_size_type n = rows.capacity() * sizeof(DB_Row<T>);
  for (dimension_type i = num_rows(); i-- > 0; )
    n += rows[i].external_memory_in_bytes(row_capacity);
  return n;
}

template <typename T>
bool
DB_Matrix<T>::OK() const {






  if (num_rows() != row_size) {






    return false;
  }

  const DB_Matrix& x = *this;
  const dimension_type n_rows = x.num_rows();
  for (dimension_type i = 0; i < n_rows; ++i) {
    if (!x[i].OK(row_size, row_capacity))
      return false;
  }


  return true;
}




template <typename T>
std::ostream&
IO_Operators::operator<<(std::ostream& s, const DB_Matrix<T>& c) {
  const dimension_type n = c.num_rows();
  for (dimension_type i = 0; i < n; ++i) {
    for (dimension_type j = 0; j < n; ++j)
      s << c[i][j] << " ";
    s << "\n";
  }
  return s;
}

}
# 324 "DB_Matrix_defs.hh" 2
# 45 "BD_Shape_defs.hh" 2


# 1 "WRD_coefficient_types_defs.hh" 1
# 29 "WRD_coefficient_types_defs.hh"
namespace Parma_Polyhedra_Library {







struct WRD_Extended_Number_Policy {

  enum const_bool_value_check_overflow { check_overflow = (true) };


  enum const_bool_value_check_inf_add_inf { check_inf_add_inf = (false) };


  enum const_bool_value_check_inf_sub_inf { check_inf_sub_inf = (false) };


  enum const_bool_value_check_inf_mul_zero { check_inf_mul_zero = (false) };


  enum const_bool_value_check_div_zero { check_div_zero = (false) };


  enum const_bool_value_check_inf_div_inf { check_inf_div_inf = (false) };


  enum const_bool_value_check_inf_mod { check_inf_mod = (false) };


  enum const_bool_value_check_sqrt_neg { check_sqrt_neg = (false) };


  enum const_bool_value_has_nan { has_nan = (true) };


  enum const_bool_value_has_infinity { has_infinity = (true) };





  enum const_bool_value_fpu_check_inexact { fpu_check_inexact = (true) };


  enum const_bool_value_fpu_check_nan_result { fpu_check_nan_result = (false) };
# 87 "WRD_coefficient_types_defs.hh"
  static void handle_result(Result r);
};







struct Debug_WRD_Extended_Number_Policy {

  enum const_bool_value_check_overflow { check_overflow = (true) };


  enum const_bool_value_check_inf_add_inf { check_inf_add_inf = (true) };


  enum const_bool_value_check_inf_sub_inf { check_inf_sub_inf = (true) };


  enum const_bool_value_check_inf_mul_zero { check_inf_mul_zero = (true) };


  enum const_bool_value_check_div_zero { check_div_zero = (true) };


  enum const_bool_value_check_inf_div_inf { check_inf_div_inf = (true) };


  enum const_bool_value_check_inf_mod { check_inf_mod = (true) };


  enum const_bool_value_check_sqrt_neg { check_sqrt_neg = (true) };


  enum const_bool_value_has_nan { has_nan = (true) };


  enum const_bool_value_has_infinity { has_infinity = (true) };





  enum const_bool_value_fpu_check_inexact { fpu_check_inexact = (true) };


  enum const_bool_value_fpu_check_nan_result { fpu_check_nan_result = (true) };
# 146 "WRD_coefficient_types_defs.hh"
  static void handle_result(Result r);
};

}

# 1 "WRD_coefficient_types_inlines.hh" 1
# 27 "WRD_coefficient_types_inlines.hh"
namespace Parma_Polyhedra_Library {

inline void
WRD_Extended_Number_Policy::handle_result(Result r) {
  if (result_class(r) == VC_NAN)
    throw_result_exception(r);
}

inline void
Debug_WRD_Extended_Number_Policy::handle_result(Result r) {
  if (result_class(r) == VC_NAN)
    throw_result_exception(r);
}

}
# 152 "WRD_coefficient_types_defs.hh" 2
# 48 "BD_Shape_defs.hh" 2
# 56 "BD_Shape_defs.hh"
namespace Parma_Polyhedra_Library {

namespace IO_Operators {
# 68 "BD_Shape_defs.hh"
template <typename T>
std::ostream&
operator<<(std::ostream& s, const BD_Shape<T>& bds);

}



template <typename T>
void swap(BD_Shape<T>& x, BD_Shape<T>& y);






template <typename T>
bool operator==(const BD_Shape<T>& x, const BD_Shape<T>& y);






template <typename T>
bool operator!=(const BD_Shape<T>& x, const BD_Shape<T>& y);
# 106 "BD_Shape_defs.hh"
template <typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const BD_Shape<T>& x,
                                 const BD_Shape<T>& y,
                                 Rounding_Dir dir);
# 123 "BD_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const BD_Shape<T>& x,
                                 const BD_Shape<T>& y,
                                 Rounding_Dir dir);
# 140 "BD_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const BD_Shape<T>& x,
                                 const BD_Shape<T>& y,
                                 Rounding_Dir dir,
                                 Temp& tmp0,
                                 Temp& tmp1,
                                 Temp& tmp2);
# 160 "BD_Shape_defs.hh"
template <typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const BD_Shape<T>& x,
                               const BD_Shape<T>& y,
                               Rounding_Dir dir);
# 177 "BD_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const BD_Shape<T>& x,
                               const BD_Shape<T>& y,
                               Rounding_Dir dir);
# 194 "BD_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const BD_Shape<T>& x,
                               const BD_Shape<T>& y,
                               Rounding_Dir dir,
                               Temp& tmp0,
                               Temp& tmp1,
                               Temp& tmp2);
# 214 "BD_Shape_defs.hh"
template <typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const BD_Shape<T>& x,
                                const BD_Shape<T>& y,
                                Rounding_Dir dir);
# 231 "BD_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const BD_Shape<T>& x,
                                const BD_Shape<T>& y,
                                Rounding_Dir dir);
# 248 "BD_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const BD_Shape<T>& x,
                                const BD_Shape<T>& y,
                                Rounding_Dir dir,
                                Temp& tmp0,
                                Temp& tmp1,
                                Temp& tmp2);



class BD_Shape_Helpers {
public:
# 294 "BD_Shape_defs.hh"
  static bool extract_bounded_difference(const Constraint& c,
                                         dimension_type& c_num_vars,
                                         dimension_type& c_first_var,
                                         dimension_type& c_second_var,
                                         Coefficient& c_coeff);
};





void compute_leader_indices(const std::vector<dimension_type>& predecessor,
                            std::vector<dimension_type>& indices);

}
# 411 "BD_Shape_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::BD_Shape {
private:







  typedef Checked_Number<T, WRD_Extended_Number_Policy> N;


public:

  typedef T coefficient_type_base;





  typedef N coefficient_type;


  static dimension_type max_space_dimension();




  static bool can_recycle_constraint_systems();




  static bool can_recycle_congruence_systems();
# 458 "BD_Shape_defs.hh"
  explicit BD_Shape(dimension_type num_dimensions = 0,
                    Degenerate_Element kind = UNIVERSE);





  BD_Shape(const BD_Shape& y,
           Complexity_Class complexity = ANY_COMPLEXITY);





  template <typename U>
  explicit BD_Shape(const BD_Shape<U>& y,
                    Complexity_Class complexity = ANY_COMPLEXITY);
# 487 "BD_Shape_defs.hh"
  explicit BD_Shape(const Constraint_System& cs);
# 500 "BD_Shape_defs.hh"
  explicit BD_Shape(const Congruence_System& cgs);
# 510 "BD_Shape_defs.hh"
  explicit BD_Shape(const Generator_System& gs);
# 519 "BD_Shape_defs.hh"
  explicit BD_Shape(const Polyhedron& ph,
                    Complexity_Class complexity = ANY_COMPLEXITY);
# 538 "BD_Shape_defs.hh"
  template <typename Interval>
  explicit BD_Shape(const Box<Interval>& box,
                    Complexity_Class complexity = ANY_COMPLEXITY);
# 558 "BD_Shape_defs.hh"
  explicit BD_Shape(const Grid& grid,
                    Complexity_Class complexity = ANY_COMPLEXITY);
# 577 "BD_Shape_defs.hh"
  template <typename U>
  explicit BD_Shape(const Octagonal_Shape<U>& os,
                    Complexity_Class complexity = ANY_COMPLEXITY);





  BD_Shape& operator=(const BD_Shape& y);





  void m_swap(BD_Shape& y);


  ~BD_Shape();







  dimension_type space_dimension() const;






  dimension_type affine_dimension() const;


  Constraint_System constraints() const;


  Constraint_System minimized_constraints() const;


  Congruence_System congruences() const;





  Congruence_System minimized_congruences() const;
# 633 "BD_Shape_defs.hh"
  bool bounds_from_above(const Linear_Expression& expr) const;
# 642 "BD_Shape_defs.hh"
  bool bounds_from_below(const Linear_Expression& expr) const;
# 668 "BD_Shape_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum) const;
# 699 "BD_Shape_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                Generator& g) const;
# 727 "BD_Shape_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum) const;
# 758 "BD_Shape_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                Generator& g) const;
# 790 "BD_Shape_defs.hh"
  bool frequency(const Linear_Expression& expr,
                 Coefficient& freq_n, Coefficient& freq_d,
                 Coefficient& val_n, Coefficient& val_d) const;






  bool contains(const BD_Shape& y) const;






  bool strictly_contains(const BD_Shape& y) const;







  bool is_disjoint_from(const BD_Shape& y) const;






  Poly_Con_Relation relation_with(const Constraint& c) const;






  Poly_Con_Relation relation_with(const Congruence& cg) const;






  Poly_Gen_Relation relation_with(const Generator& g) const;


  bool is_empty() const;


  bool is_universe() const;


  bool is_discrete() const;





  bool is_topologically_closed() const;


  bool is_bounded() const;





  bool contains_integer_point() const;
# 868 "BD_Shape_defs.hh"
  bool constrains(Variable var) const;





  bool OK() const;
# 892 "BD_Shape_defs.hh"
  void add_constraint(const Constraint& c);
# 904 "BD_Shape_defs.hh"
  void add_congruence(const Congruence& cg);
# 918 "BD_Shape_defs.hh"
  void add_constraints(const Constraint_System& cs);
# 937 "BD_Shape_defs.hh"
  void add_recycled_constraints(Constraint_System& cs);
# 951 "BD_Shape_defs.hh"
  void add_congruences(const Congruence_System& cgs);
# 969 "BD_Shape_defs.hh"
  void add_recycled_congruences(Congruence_System& cgs);
# 981 "BD_Shape_defs.hh"
  void refine_with_constraint(const Constraint& c);
# 994 "BD_Shape_defs.hh"
  void refine_with_congruence(const Congruence& cg);
# 1007 "BD_Shape_defs.hh"
  void refine_with_constraints(const Constraint_System& cs);
# 1020 "BD_Shape_defs.hh"
  void refine_with_congruences(const Congruence_System& cgs);
# 1043 "BD_Shape_defs.hh"
  template <typename Interval_Info>
  void refine_with_linear_form_inequality(
                   const Linear_Form<Interval<T, Interval_Info> >& left,
                   const Linear_Form<Interval<T, Interval_Info> >& right);
# 1076 "BD_Shape_defs.hh"
  template <typename Interval_Info>
  void generalized_refine_with_linear_form_inequality(
                   const Linear_Form<Interval<T, Interval_Info> >& left,
                   const Linear_Form<Interval<T, Interval_Info> >& right,
                   Relation_Symbol relsym);
# 1112 "BD_Shape_defs.hh"
  template <typename U>
  void export_interval_constraints(U& dest) const;
# 1125 "BD_Shape_defs.hh"
  void unconstrain(Variable var);
# 1139 "BD_Shape_defs.hh"
  void unconstrain(const Variables_Set& vars);






  void intersection_assign(const BD_Shape& y);
# 1155 "BD_Shape_defs.hh"
  void upper_bound_assign(const BD_Shape& y);
# 1165 "BD_Shape_defs.hh"
  bool upper_bound_assign_if_exact(const BD_Shape& y);
# 1181 "BD_Shape_defs.hh"
  bool integer_upper_bound_assign_if_exact(const BD_Shape& y);
# 1190 "BD_Shape_defs.hh"
  void difference_assign(const BD_Shape& y);
# 1201 "BD_Shape_defs.hh"
  bool simplify_using_context_assign(const BD_Shape& y);
# 1222 "BD_Shape_defs.hh"
  void affine_image(Variable var,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator
                    = Coefficient_one());
# 1244 "BD_Shape_defs.hh"
  template <typename Interval_Info>
  void affine_form_image(Variable var,
                        const Linear_Form<Interval<T, Interval_Info> >& lf);
# 1267 "BD_Shape_defs.hh"
  void affine_preimage(Variable var,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator
                       = Coefficient_one());
# 1296 "BD_Shape_defs.hh"
  void generalized_affine_image(Variable var,
                                Relation_Symbol relsym,
                                const Linear_Expression& expr,
                                Coefficient_traits::const_reference denominator
                                = Coefficient_one());
# 1321 "BD_Shape_defs.hh"
  void generalized_affine_image(const Linear_Expression& lhs,
                                Relation_Symbol relsym,
                                const Linear_Expression& rhs);
# 1349 "BD_Shape_defs.hh"
  void generalized_affine_preimage(Variable var,
                                   Relation_Symbol relsym,
                                   const Linear_Expression& expr,
                                   Coefficient_traits::const_reference
                                   denominator = Coefficient_one());
# 1374 "BD_Shape_defs.hh"
  void generalized_affine_preimage(const Linear_Expression& lhs,
                                   Relation_Symbol relsym,
                                   const Linear_Expression& rhs);
# 1404 "BD_Shape_defs.hh"
  void bounded_affine_image(Variable var,
                            const Linear_Expression& lb_expr,
                            const Linear_Expression& ub_expr,
                            Coefficient_traits::const_reference denominator
                            = Coefficient_one());
# 1436 "BD_Shape_defs.hh"
  void bounded_affine_preimage(Variable var,
                               const Linear_Expression& lb_expr,
                               const Linear_Expression& ub_expr,
                               Coefficient_traits::const_reference denominator
                               = Coefficient_one());







  void time_elapse_assign(const BD_Shape& y);
# 1496 "BD_Shape_defs.hh"
  void wrap_assign(const Variables_Set& vars,
                   Bounded_Integer_Type_Width w,
                   Bounded_Integer_Type_Representation r,
                   Bounded_Integer_Type_Overflow o,
                   const Constraint_System* cs_p = 0,
                   unsigned complexity_threshold = 16,
                   bool wrap_individually = true);
# 1515 "BD_Shape_defs.hh"
  void drop_some_non_integer_points(Complexity_Class complexity
                                    = ANY_COMPLEXITY);
# 1533 "BD_Shape_defs.hh"
  void drop_some_non_integer_points(const Variables_Set& vars,
                                    Complexity_Class complexity
                                    = ANY_COMPLEXITY);


  void topological_closure_assign();
# 1555 "BD_Shape_defs.hh"
  void CC76_extrapolation_assign(const BD_Shape& y, unsigned* tp = 0);
# 1578 "BD_Shape_defs.hh"
  template <typename Iterator>
  void CC76_extrapolation_assign(const BD_Shape& y,
                                 Iterator first, Iterator last,
                                 unsigned* tp = 0);
# 1598 "BD_Shape_defs.hh"
  void BHMZ05_widening_assign(const BD_Shape& y, unsigned* tp = 0);
# 1620 "BD_Shape_defs.hh"
  void limited_BHMZ05_extrapolation_assign(const BD_Shape& y,
                                           const Constraint_System& cs,
                                           unsigned* tp = 0);
# 1643 "BD_Shape_defs.hh"
  void CC76_narrowing_assign(const BD_Shape& y);
# 1665 "BD_Shape_defs.hh"
  void limited_CC76_extrapolation_assign(const BD_Shape& y,
                                         const Constraint_System& cs,
                                         unsigned* tp = 0);
# 1684 "BD_Shape_defs.hh"
  void H79_widening_assign(const BD_Shape& y, unsigned* tp = 0);


  void widening_assign(const BD_Shape& y, unsigned* tp = 0);
# 1708 "BD_Shape_defs.hh"
  void limited_H79_extrapolation_assign(const BD_Shape& y,
                                        const Constraint_System& cs,
                                        unsigned* tp = 0);
# 1735 "BD_Shape_defs.hh"
  void add_space_dimensions_and_embed(dimension_type m);
# 1758 "BD_Shape_defs.hh"
  void add_space_dimensions_and_project(dimension_type m);
# 1768 "BD_Shape_defs.hh"
  void concatenate_assign(const BD_Shape& y);
# 1779 "BD_Shape_defs.hh"
  void remove_space_dimensions(const Variables_Set& vars);
# 1789 "BD_Shape_defs.hh"
  void remove_higher_space_dimensions(dimension_type new_dimension);
# 1828 "BD_Shape_defs.hh"
  template <typename Partial_Function>
  void map_space_dimensions(const Partial_Function& pfunc);
# 1852 "BD_Shape_defs.hh"
  void expand_space_dimension(Variable var, dimension_type m);
# 1877 "BD_Shape_defs.hh"
  void fold_space_dimensions(const Variables_Set& vars, Variable dest);






  template <typename Interval_Info>
  void refine_fp_interval_abstract_store(Box<Interval<T, Interval_Info> >&
                                         store) const;




  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  int32_t hash_code() const;

  friend bool operator==<T>(const BD_Shape<T>& x, const BD_Shape<T>& y);

  template <typename Temp, typename To, typename U>
  friend bool Parma_Polyhedra_Library::rectilinear_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const BD_Shape<U>& x, const BD_Shape<U>& y, const Rounding_Dir dir,
   Temp& tmp0, Temp& tmp1, Temp& tmp2);
  template <typename Temp, typename To, typename U>
  friend bool Parma_Polyhedra_Library::euclidean_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const BD_Shape<U>& x, const BD_Shape<U>& y, const Rounding_Dir dir,
   Temp& tmp0, Temp& tmp1, Temp& tmp2);
  template <typename Temp, typename To, typename U>
  friend bool Parma_Polyhedra_Library::l_infinity_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const BD_Shape<U>& x, const BD_Shape<U>& y, const Rounding_Dir dir,
   Temp& tmp0, Temp& tmp1, Temp& tmp2);

private:
  template <typename U> friend class Parma_Polyhedra_Library::BD_Shape;
  template <typename Interval> friend class Parma_Polyhedra_Library::Box;


  DB_Matrix<N> dbm;


# 1 "BDS_Status_idefs.hh" 1
# 50 "BDS_Status_idefs.hh"
class Status {
public:

  Status();



  bool test_zero_dim_univ() const;
  void reset_zero_dim_univ();
  void set_zero_dim_univ();

  bool test_empty() const;
  void reset_empty();
  void set_empty();

  bool test_shortest_path_closed() const;
  void reset_shortest_path_closed();
  void set_shortest_path_closed();

  bool test_shortest_path_reduced() const;
  void reset_shortest_path_reduced();
  void set_shortest_path_reduced();



  bool OK() const;

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);

private:

  typedef unsigned int flags_t;



  static const flags_t ZERO_DIM_UNIV = 0U;
  static const flags_t EMPTY = 1U << 0;
  static const flags_t SHORTEST_PATH_CLOSED = 1U << 1;
  static const flags_t SHORTEST_PATH_REDUCED = 1U << 2;



  flags_t flags;


  Status(flags_t mask);


  bool test_all(flags_t mask) const;


  bool test_any(flags_t mask) const;


  void set(flags_t mask);


  void reset(flags_t mask);
};
# 1941 "BD_Shape_defs.hh" 2



  Status status;


  Bit_Matrix redundancy_dbm;


  bool marked_zero_dim_univ() const;







  bool marked_empty() const;
# 1967 "BD_Shape_defs.hh"
  bool marked_shortest_path_closed() const;
# 1976 "BD_Shape_defs.hh"
  bool marked_shortest_path_reduced() const;


  void set_empty();


  void set_zero_dim_univ();


  void set_shortest_path_closed();


  void set_shortest_path_reduced();


  void reset_shortest_path_closed();


  void reset_shortest_path_reduced();


  void shortest_path_closure_assign() const;






  void shortest_path_reduction_assign() const;






  bool is_shortest_path_reduced() const;
# 2024 "BD_Shape_defs.hh"
  void incremental_shortest_path_closure_assign(Variable var) const;
# 2043 "BD_Shape_defs.hh"
  bool bounds(const Linear_Expression& expr, bool from_above) const;
# 2076 "BD_Shape_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included,
               Generator& g) const;
# 2107 "BD_Shape_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included) const;
# 2125 "BD_Shape_defs.hh"
  bool BFT00_upper_bound_assign_if_exact(const BD_Shape& y);
# 2143 "BD_Shape_defs.hh"
  template <bool integer_upper_bound>
  bool BHZ09_upper_bound_assign_if_exact(const BD_Shape& y);
# 2156 "BD_Shape_defs.hh"
  void refine_no_check(const Constraint& c);
# 2170 "BD_Shape_defs.hh"
  void refine_no_check(const Congruence& cg);


  void add_dbm_constraint(dimension_type i, dimension_type j, const N& k);


  void add_dbm_constraint(dimension_type i, dimension_type j,
                          Coefficient_traits::const_reference numer,
                          Coefficient_traits::const_reference denom);







  void refine(Variable var, Relation_Symbol relsym,
              const Linear_Expression& expr,
              Coefficient_traits::const_reference denominator
              = Coefficient_one());


  void forget_all_dbm_constraints(dimension_type v);

  void forget_binary_dbm_constraints(dimension_type v);
# 2211 "BD_Shape_defs.hh"
  void deduce_v_minus_u_bounds(dimension_type v,
                               dimension_type last_v,
                               const Linear_Expression& sc_expr,
                               Coefficient_traits::const_reference sc_denom,
                               const N& ub_v);





  template <typename Interval_Info>
  void inhomogeneous_affine_form_image(const dimension_type& var_id,
                                       const Interval<T, Interval_Info>& b);





  template <typename Interval_Info>
  void one_variable_affine_form_image
  (const dimension_type& var_id,
   const Interval<T, Interval_Info>& b,
   const Interval<T, Interval_Info>& w_coeff,
   const dimension_type& w_id,
   const dimension_type& space_dim);





  template <typename Interval_Info>
  void two_variables_affine_form_image
  (const dimension_type& var_id,
   const Linear_Form<Interval<T,Interval_Info> >& lf,
   const dimension_type& space_dim);





  template <typename Interval_Info>
  void left_inhomogeneous_refine
  (const dimension_type& right_t,
   const dimension_type& right_w_id,
   const Linear_Form<Interval<T, Interval_Info> >& left,
   const Linear_Form<Interval<T, Interval_Info> >& right);





  template <typename Interval_Info>
  void left_one_var_refine
  (const dimension_type& left_w_id,
   const dimension_type& right_t,
   const dimension_type& right_w_id,
   const Linear_Form<Interval<T, Interval_Info> >& left,
   const Linear_Form<Interval<T, Interval_Info> >& right);





  template <typename Interval_Info>
  void general_refine(const dimension_type& left_w_id,
                      const dimension_type& right_w_id,
                      const Linear_Form<Interval<T, Interval_Info> >& left,
                      const Linear_Form<Interval<T, Interval_Info> >& right);

  template <typename Interval_Info>
  void linear_form_upper_bound(const Linear_Form<Interval<T, Interval_Info> >&
                               lf,
                               N& result) const;
# 2301 "BD_Shape_defs.hh"
  void deduce_u_minus_v_bounds(dimension_type v,
                               dimension_type last_v,
                               const Linear_Expression& sc_expr,
                               Coefficient_traits::const_reference sc_denom,
                               const N& minus_lb_v);





  void get_limiting_shape(const Constraint_System& cs,
                          BD_Shape& limiting_shape) const;





  void compute_predecessors(std::vector<dimension_type>& predecessor) const;





  void compute_leaders(std::vector<dimension_type>& leaders) const;

  void drop_some_non_integer_points_helper(N& elem);

  friend std::ostream&
  Parma_Polyhedra_Library::IO_Operators
  ::operator<<<>(std::ostream& s, const BD_Shape<T>& c);



  void throw_dimension_incompatible(const char* method,
                                    const BD_Shape& y) const;

  void throw_dimension_incompatible(const char* method,
                                    dimension_type required_dim) const;

  void throw_dimension_incompatible(const char* method,
                                    const Constraint& c) const;

  void throw_dimension_incompatible(const char* method,
                                    const Congruence& cg) const;

  void throw_dimension_incompatible(const char* method,
                                    const Generator& g) const;

  void throw_dimension_incompatible(const char* method,
                                    const char* le_name,
                                    const Linear_Expression& le) const;

  template<typename Interval_Info>
  void
  throw_dimension_incompatible(const char* method,
                               const char* lf_name,
                               const Linear_Form<Interval<T, Interval_Info> >&
                               lf) const;

  static void throw_expression_too_complex(const char* method,
                                           const Linear_Expression& le);

  static void throw_invalid_argument(const char* method, const char* reason);

};

# 1 "BDS_Status_inlines.hh" 1
# 27 "BDS_Status_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline
BD_Shape<T>::Status::Status(flags_t mask)
  : flags(mask) {
}

template <typename T>
inline
BD_Shape<T>::Status::Status()
  : flags(ZERO_DIM_UNIV) {
}

template <typename T>
inline bool
BD_Shape<T>::Status::test_all(flags_t mask) const {
  return (flags & mask) == mask;
}

template <typename T>
inline bool
BD_Shape<T>::Status::test_any(flags_t mask) const {
  return (flags & mask) != 0;
}

template <typename T>
inline void
BD_Shape<T>::Status::set(flags_t mask) {
  flags |= mask;
}

template <typename T>
inline void
BD_Shape<T>::Status::reset(flags_t mask) {
  flags &= ~mask;
}

template <typename T>
inline bool
BD_Shape<T>::Status::test_zero_dim_univ() const {
  return flags == ZERO_DIM_UNIV;
}

template <typename T>
inline void
BD_Shape<T>::Status::reset_zero_dim_univ() {

  if (flags == ZERO_DIM_UNIV)

    flags = EMPTY;
}

template <typename T>
inline void
BD_Shape<T>::Status::set_zero_dim_univ() {

  flags = ZERO_DIM_UNIV;
}

template <typename T>
inline bool
BD_Shape<T>::Status::test_empty() const {
  return test_any(EMPTY);
}

template <typename T>
inline void
BD_Shape<T>::Status::reset_empty() {
  reset(EMPTY);
}

template <typename T>
inline void
BD_Shape<T>::Status::set_empty() {
  flags = EMPTY;
}

template <typename T>
inline bool
BD_Shape<T>::Status::test_shortest_path_closed() const {
  return test_any(SHORTEST_PATH_CLOSED);
}

template <typename T>
inline void
BD_Shape<T>::Status::reset_shortest_path_closed() {

  reset(SHORTEST_PATH_CLOSED | SHORTEST_PATH_REDUCED);
}

template <typename T>
inline void
BD_Shape<T>::Status::set_shortest_path_closed() {
  set(SHORTEST_PATH_CLOSED);
}

template <typename T>
inline bool
BD_Shape<T>::Status::test_shortest_path_reduced() const {
  return test_any(SHORTEST_PATH_REDUCED);
}

template <typename T>
inline void
BD_Shape<T>::Status::reset_shortest_path_reduced() {
  reset(SHORTEST_PATH_REDUCED);
}

template <typename T>
inline void
BD_Shape<T>::Status::set_shortest_path_reduced() {
  ((void) 0);
  set(SHORTEST_PATH_REDUCED);
}

template <typename T>
bool
BD_Shape<T>::Status::OK() const {
  if (test_zero_dim_univ())

    return true;

  if (test_empty()) {
    Status copy = *this;
    copy.reset_empty();
    if (copy.test_zero_dim_univ())
      return true;
    else {




      return false;
    }
  }


  if (test_shortest_path_reduced()) {
    if (test_shortest_path_closed())
      return true;
    else {





      return false;
    }
  }


  return true;
}


namespace Implementation {

namespace BD_Shapes {


const std::string zero_dim_univ = "ZE";
const std::string empty = "EM";
const std::string sp_closed = "SPC";
const std::string sp_reduced = "SPR";
const char yes = '+';
const char no = '-';
const char separator = ' ';
# 203 "BDS_Status_inlines.hh"
inline bool
get_field(std::istream& s, const std::string& keyword, bool& positive) {
  std::string str;
  if (!(s >> str)
      || (str[0] != yes && str[0] != no)
      || str.substr(1) != keyword)
    return false;
  positive = (str[0] == yes);
  return true;
}

}

}

template <typename T>
void
BD_Shape<T>::Status::ascii_dump(std::ostream& s) const {
  using namespace Implementation::BD_Shapes;
  s << (test_zero_dim_univ() ? yes : no) << zero_dim_univ << separator
    << (test_empty() ? yes : no) << empty << separator
    << separator
    << (test_shortest_path_closed() ? yes : no) << sp_closed << separator
    << (test_shortest_path_reduced() ? yes : no) << sp_reduced << separator;
}

template <typename T> void BD_Shape<T>::Status::ascii_dump() const { ascii_dump(std::cerr); } template <typename T> void BD_Shape<T>::Status::print() const { std::cerr << "No user level output operator defined " << "for " "BD_Shape<T>::Status" << "." << std::endl; }

template <typename T>
bool
BD_Shape<T>::Status::ascii_load(std::istream& s) {
  using namespace Implementation::BD_Shapes;
  bool positive = Suppress_Uninitialized_Warnings_Type<bool>::synonym ();

  if (!get_field(s, zero_dim_univ, positive))
    return false;
  if (positive)
    set_zero_dim_univ();

  if (!get_field(s, empty, positive))
    return false;
  if (positive)
    set_empty();

  if (!get_field(s, sp_closed, positive))
    return false;
  if (positive)
    set_shortest_path_closed();
  else
    reset_shortest_path_closed();

  if (!get_field(s, sp_reduced, positive))
    return false;
  if (positive)
    set_shortest_path_reduced();
  else
    reset_shortest_path_reduced();


  ((void) 0);
  return true;
}

}
# 2368 "BD_Shape_defs.hh" 2
# 1 "BD_Shape_inlines.hh" 1
# 29 "BD_Shape_inlines.hh"
# 1 "C_Polyhedron_defs.hh" 1
# 27 "C_Polyhedron_defs.hh"
# 1 "C_Polyhedron_types.hh" 1
# 16 "C_Polyhedron_types.hh"
namespace Parma_Polyhedra_Library {

class C_Polyhedron;

}
# 28 "C_Polyhedron_defs.hh" 2
# 1 "NNC_Polyhedron_types.hh" 1
# 16 "NNC_Polyhedron_types.hh"
namespace Parma_Polyhedra_Library {

class NNC_Polyhedron;

}
# 29 "C_Polyhedron_defs.hh" 2
# 59 "C_Polyhedron_defs.hh"
class Parma_Polyhedra_Library::C_Polyhedron : public Polyhedron {
public:
# 75 "C_Polyhedron_defs.hh"
  explicit C_Polyhedron(dimension_type num_dimensions = 0,
                        Degenerate_Element kind = UNIVERSE);
# 88 "C_Polyhedron_defs.hh"
  explicit C_Polyhedron(const Constraint_System& cs);
# 106 "C_Polyhedron_defs.hh"
  C_Polyhedron(Constraint_System& cs, Recycle_Input dummy);
# 119 "C_Polyhedron_defs.hh"
  explicit C_Polyhedron(const Generator_System& gs);
# 138 "C_Polyhedron_defs.hh"
  C_Polyhedron(Generator_System& gs, Recycle_Input dummy);
# 147 "C_Polyhedron_defs.hh"
  explicit C_Polyhedron(const Congruence_System& cgs);
# 163 "C_Polyhedron_defs.hh"
  C_Polyhedron(Congruence_System& cgs, Recycle_Input dummy);
# 175 "C_Polyhedron_defs.hh"
  explicit C_Polyhedron(const NNC_Polyhedron& y,
                        Complexity_Class complexity = ANY_COMPLEXITY);
# 194 "C_Polyhedron_defs.hh"
  template <typename Interval>
  explicit C_Polyhedron(const Box<Interval>& box,
                        Complexity_Class complexity = ANY_COMPLEXITY);
# 210 "C_Polyhedron_defs.hh"
  template <typename U>
  explicit C_Polyhedron(const BD_Shape<U>& bd,
                        Complexity_Class complexity = ANY_COMPLEXITY);
# 226 "C_Polyhedron_defs.hh"
  template <typename U>
  explicit C_Polyhedron(const Octagonal_Shape<U>& os,
                        Complexity_Class complexity = ANY_COMPLEXITY);
# 242 "C_Polyhedron_defs.hh"
  explicit C_Polyhedron(const Grid& grid,
                        Complexity_Class complexity = ANY_COMPLEXITY);





  C_Polyhedron(const C_Polyhedron& y,
               Complexity_Class complexity = ANY_COMPLEXITY);





  C_Polyhedron& operator=(const C_Polyhedron& y);


  C_Polyhedron& operator=(const NNC_Polyhedron& y);


  ~C_Polyhedron();
# 272 "C_Polyhedron_defs.hh"
  bool poly_hull_assign_if_exact(const C_Polyhedron& y);


  bool upper_bound_assign_if_exact(const C_Polyhedron& y);
};

# 1 "C_Polyhedron_inlines.hh" 1
# 30 "C_Polyhedron_inlines.hh"
namespace Parma_Polyhedra_Library {

inline
C_Polyhedron::~C_Polyhedron() {
}

inline
C_Polyhedron::C_Polyhedron(dimension_type num_dimensions,
                           Degenerate_Element kind)
  : Polyhedron(NECESSARILY_CLOSED,
               check_space_dimension_overflow(num_dimensions,
                                              NECESSARILY_CLOSED,
                                              "C_Polyhedron(n, k)",
                                              "n exceeds the maximum "
                                              "allowed space dimension"),
               kind) {
}

inline
C_Polyhedron::C_Polyhedron(const Constraint_System& cs)
  : Polyhedron(NECESSARILY_CLOSED,
               check_obj_space_dimension_overflow(cs, NECESSARILY_CLOSED,
                                                  "C_Polyhedron(cs)",
                                                  "the space dimension of cs "
                                                  "exceeds the maximum allowed "
                                                  "space dimension")) {
}

inline
C_Polyhedron::C_Polyhedron(Constraint_System& cs, Recycle_Input)
  : Polyhedron(NECESSARILY_CLOSED,
               check_obj_space_dimension_overflow(cs, NECESSARILY_CLOSED,
                                                  "C_Polyhedron(cs, recycle)",
                                                  "the space dimension of cs "
                                                  "exceeds the maximum allowed "
                                                  "space dimension"),
               Recycle_Input()) {
}

inline
C_Polyhedron::C_Polyhedron(const Generator_System& gs)
  : Polyhedron(NECESSARILY_CLOSED,
               check_obj_space_dimension_overflow(gs, NECESSARILY_CLOSED,
                                                  "C_Polyhedron(gs)",
                                                  "the space dimension of gs "
                                                  "exceeds the maximum allowed "
                                                  "space dimension")) {
}

inline
C_Polyhedron::C_Polyhedron(Generator_System& gs, Recycle_Input)
  : Polyhedron(NECESSARILY_CLOSED,
               check_obj_space_dimension_overflow(gs, NECESSARILY_CLOSED,
                                                  "C_Polyhedron(gs, recycle)",
                                                  "the space dimension of gs "
                                                  "exceeds the maximum allowed "
                                                  "space dimension"),
               Recycle_Input()) {
}

template <typename Interval>
inline
C_Polyhedron::C_Polyhedron(const Box<Interval>& box, Complexity_Class)
  : Polyhedron(NECESSARILY_CLOSED,
               check_obj_space_dimension_overflow(box, NECESSARILY_CLOSED,
                                                  "C_Polyhedron(box)",
                                                  "the space dimension of box "
                                                  "exceeds the maximum allowed "
                                                  "space dimension")) {
}

template <typename U>
inline
C_Polyhedron::C_Polyhedron(const BD_Shape<U>& bd, Complexity_Class)
  : Polyhedron(NECESSARILY_CLOSED,
               check_space_dimension_overflow(bd.space_dimension(),
                                              NECESSARILY_CLOSED,
                                              "C_Polyhedron(bd)",
                                              "the space dimension of bd "
                                              "exceeds the maximum allowed "
                                              "space dimension"),
               UNIVERSE) {
  add_constraints(bd.constraints());
}

template <typename U>
inline
C_Polyhedron::C_Polyhedron(const Octagonal_Shape<U>& os, Complexity_Class)
  : Polyhedron(NECESSARILY_CLOSED,
               check_space_dimension_overflow(os.space_dimension(),
                                              NECESSARILY_CLOSED,
                                              "C_Polyhedron(os)",
                                              "the space dimension of os "
                                              "exceeds the maximum allowed "
                                              "space dimension"),
               UNIVERSE) {
  add_constraints(os.constraints());
}

inline
C_Polyhedron::C_Polyhedron(const C_Polyhedron& y, Complexity_Class)
  : Polyhedron(y) {
}

inline C_Polyhedron&
C_Polyhedron::operator=(const C_Polyhedron& y) {
  Polyhedron::operator=(y);
  return *this;
}

inline C_Polyhedron&
C_Polyhedron::operator=(const NNC_Polyhedron& y) {
  C_Polyhedron c_y(y);
  m_swap(c_y);
  return *this;
}

inline bool
C_Polyhedron::upper_bound_assign_if_exact(const C_Polyhedron& y) {
  return poly_hull_assign_if_exact(y);
}

}
# 279 "C_Polyhedron_defs.hh" 2
# 30 "BD_Shape_inlines.hh" 2

# 1 "Octagonal_Shape_defs.hh" 1
# 36 "Octagonal_Shape_defs.hh"
# 1 "OR_Matrix_defs.hh" 1
# 28 "OR_Matrix_defs.hh"
# 1 "OR_Matrix_types.hh" 1
# 16 "OR_Matrix_types.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
class OR_Matrix;

}
# 29 "OR_Matrix_defs.hh" 2
# 50 "OR_Matrix_defs.hh"
namespace Parma_Polyhedra_Library {





template <typename T>
bool operator==(const OR_Matrix<T>& x, const OR_Matrix<T>& y);

namespace IO_Operators {





template <typename T>
std::ostream&
operator<<(std::ostream& s, const OR_Matrix<T>& m);

}

}
# 104 "OR_Matrix_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::OR_Matrix {
private:




  template <typename U>
  class Pseudo_Row {
  public:





    template <typename V>
    Pseudo_Row(const Pseudo_Row<V>& y);


    ~Pseudo_Row();


    U& operator[](dimension_type k) const;


    Pseudo_Row();


    Pseudo_Row& operator=(const Pseudo_Row& y);





  public:
# 149 "OR_Matrix_defs.hh"
    explicit Pseudo_Row(U& y);




    U* first;




  private:
# 181 "OR_Matrix_defs.hh"
    template <typename V> friend class Pseudo_Row;
    template <typename V> friend class any_row_iterator;


    friend class OR_Matrix;
  };

public:

  typedef Pseudo_Row<T> row_reference_type;


  typedef Pseudo_Row<const T> const_row_reference_type;

private:




  template <typename U>
  class any_row_iterator {
  public:
    typedef std::random_access_iterator_tag iterator_category;
    typedef Pseudo_Row<U> value_type;
    typedef long difference_type;
    typedef const Pseudo_Row<U>* pointer;
    typedef const Pseudo_Row<U>& reference;


    any_row_iterator(dimension_type n_rows);





    explicit any_row_iterator(U& base);





    template <typename V>
    any_row_iterator(const any_row_iterator<V>& y);





    template <typename V>
    any_row_iterator& operator=(const any_row_iterator<V>& y);


    reference operator*() const;


    pointer operator->() const;


    any_row_iterator& operator++();


    any_row_iterator operator++(int);


    any_row_iterator& operator--();


    any_row_iterator operator--(int);


    reference operator[](difference_type m) const;


    any_row_iterator& operator+=(difference_type m);


    template <typename Unsigned>
    typename Enable_If<(static_cast<Unsigned>(-1) > 0), any_row_iterator&>::type
    operator+=(Unsigned m);


    any_row_iterator& operator-=(difference_type m);


    difference_type operator-(const any_row_iterator& y) const;


    any_row_iterator operator+(difference_type m) const;


    template <typename Unsigned>
    typename Enable_If<(static_cast<Unsigned>(-1) > 0), any_row_iterator>::type
    operator+(Unsigned m) const;


    any_row_iterator operator-(difference_type m) const;


    bool operator==(const any_row_iterator& y) const;





    bool operator!=(const any_row_iterator& y) const;


    bool operator<(const any_row_iterator& y) const;





    bool operator<=(const any_row_iterator& y) const;


    bool operator>(const any_row_iterator& y) const;





    bool operator>=(const any_row_iterator& y) const;

    dimension_type row_size() const;

    dimension_type index() const;

  private:

    Pseudo_Row<U> value;


    dimension_type e;


    dimension_type i;
# 326 "OR_Matrix_defs.hh"
    template <typename V> friend class any_row_iterator;

  };

public:

  typedef any_row_iterator<T> row_iterator;


  typedef any_row_iterator<const T> const_row_iterator;


  typedef typename DB_Row<T>::iterator element_iterator;


  typedef typename DB_Row<T>::const_iterator const_element_iterator;

public:

  static dimension_type max_num_rows();
# 355 "OR_Matrix_defs.hh"
  OR_Matrix(dimension_type num_dimensions);


  OR_Matrix(const OR_Matrix& y);


  template <typename U>
  explicit OR_Matrix(const OR_Matrix<U>& y);


  ~OR_Matrix();


  OR_Matrix& operator=(const OR_Matrix& y);

private:
  template <typename U> friend class OR_Matrix;
# 381 "OR_Matrix_defs.hh"
  DB_Row<T> vec;


  dimension_type space_dim;


  dimension_type vec_capacity;


  OR_Matrix();





  static dimension_type row_first_element_index(dimension_type k);

public:

  static dimension_type row_size(dimension_type k);


  void m_swap(OR_Matrix& y);
# 417 "OR_Matrix_defs.hh"
  void grow(dimension_type new_dim);
# 427 "OR_Matrix_defs.hh"
  void shrink(dimension_type new_dim);
# 441 "OR_Matrix_defs.hh"
  void resize_no_copy(dimension_type new_dim);


  dimension_type space_dimension() const;


  dimension_type num_rows() const;




  row_reference_type operator[](dimension_type k);


  const_row_reference_type operator[](dimension_type k) const;
# 464 "OR_Matrix_defs.hh"
  row_iterator row_begin();


  row_iterator row_end();






  const_row_iterator row_begin() const;


  const_row_iterator row_end() const;






  element_iterator element_begin();


  element_iterator element_end();






  const_element_iterator element_begin() const;


  const_element_iterator element_end() const;


  void clear();

  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;

  friend bool operator==<T>(const OR_Matrix<T>& x, const OR_Matrix<T>& y);


  bool OK() const;
};

namespace Parma_Polyhedra_Library {





template <typename T>
void swap(OR_Matrix<T>& x, OR_Matrix<T>& y);





template <typename T>
bool operator!=(const OR_Matrix<T>& x, const OR_Matrix<T>& y);
# 552 "OR_Matrix_defs.hh"
template <typename Temp, typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const OR_Matrix<T>& x,
                                 const OR_Matrix<T>& y,
                                 Rounding_Dir dir,
                                 Temp& tmp0,
                                 Temp& tmp1,
                                 Temp& tmp2);
# 574 "OR_Matrix_defs.hh"
template <typename Temp, typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const OR_Matrix<T>& x,
                               const OR_Matrix<T>& y,
                               Rounding_Dir dir,
                               Temp& tmp0,
                               Temp& tmp1,
                               Temp& tmp2);
# 596 "OR_Matrix_defs.hh"
template <typename Temp, typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const OR_Matrix<T>& x,
                                 const OR_Matrix<T>& y,
                                 Rounding_Dir dir,
                                 Temp& tmp0,
                                 Temp& tmp1,
                                 Temp& tmp2);

}

# 1 "OR_Matrix_inlines.hh" 1
# 35 "OR_Matrix_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline dimension_type
OR_Matrix<T>::row_first_element_index(const dimension_type k) {
  return ((k + 1)*(k + 1))/2;
}

template <typename T>
inline dimension_type
OR_Matrix<T>::row_size(const dimension_type k) {
  return k + 2 - k % 2;
}
# 60 "OR_Matrix_inlines.hh"
template <typename T>
template <typename U>
inline
OR_Matrix<T>::Pseudo_Row<U>::Pseudo_Row()
  : first(0)



{
}

template <typename T>
template <typename U>
inline
OR_Matrix<T>::Pseudo_Row<U>::Pseudo_Row(U& y



                )
  : first(&y)



{
}

template <typename T>
template <typename U>
template <typename V>
inline
OR_Matrix<T>::Pseudo_Row<U>::Pseudo_Row(const Pseudo_Row<V>& y)
  : first(y.first)



{
}

template <typename T>
template <typename U>
inline OR_Matrix<T>::Pseudo_Row<U>&
OR_Matrix<T>::Pseudo_Row<U>::operator=(const Pseudo_Row& y) {
  first = y.first;



  return *this;
}

template <typename T>
template <typename U>
inline
OR_Matrix<T>::Pseudo_Row<U>::~Pseudo_Row() {
}

template <typename T>
template <typename U>
inline U&
OR_Matrix<T>::Pseudo_Row<U>::operator[](const dimension_type k) const {



  return *(first + k);
}

template <typename T>
template <typename U>
inline
OR_Matrix<T>::any_row_iterator<U>
::any_row_iterator(const dimension_type n_rows)
  : value(),
    e(n_rows)

{




}

template <typename T>
template <typename U>
inline
OR_Matrix<T>::any_row_iterator<U>::any_row_iterator(U& base)
  : value(base



           ),
     e(0),
     i(0) {
}

template <typename T>
template <typename U>
template <typename V>
inline
OR_Matrix<T>::any_row_iterator<U>
::any_row_iterator(const any_row_iterator<V>& y)
  : value(y.value),
    e(y.e),
    i(y.i) {
}

template <typename T>
template <typename U>
template <typename V>
inline typename OR_Matrix<T>::template any_row_iterator<U>&
OR_Matrix<T>::any_row_iterator<U>::operator=(const any_row_iterator<V>& y) {
  value = y.value;
  e = y.e;
  i = y.i;
  return *this;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>::reference
OR_Matrix<T>::any_row_iterator<U>::operator*() const {
  return value;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>::pointer
OR_Matrix<T>::any_row_iterator<U>::operator->() const {
  return &value;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>&
OR_Matrix<T>::any_row_iterator<U>::operator++() {
  ++e;
  dimension_type increment = e;
  if (e % 2 != 0)
    ++increment;





  i += increment;
  value.first += increment;
  return *this;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>
OR_Matrix<T>::any_row_iterator<U>::operator++(int) {
  any_row_iterator old = *this;
  ++(*this);
  return old;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>&
OR_Matrix<T>::any_row_iterator<U>::operator--() {
  dimension_type decrement = e + 1;
  --e;
  if (e % 2 != 0) {
    ++decrement;



  }
  i -= decrement;
  value.first -= decrement;
  return *this;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>
OR_Matrix<T>::any_row_iterator<U>::operator--(int) {
  any_row_iterator old = *this;
  --(*this);
  return old;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>&
OR_Matrix<T>::any_row_iterator<U>::operator+=(const difference_type m) {
  difference_type e_dt = static_cast<difference_type>(e);
  difference_type i_dt = static_cast<difference_type>(i);
  difference_type increment = m + (m * m) / 2 + m * e_dt;
  if (e_dt % 2 == 0 && m % 2 != 0)
    ++increment;
  e_dt += m;
  i_dt += increment;
  e = static_cast<dimension_type>(e_dt);
  i = static_cast<dimension_type>(i_dt);
  value.first += increment;





  return *this;
}

template <typename T>
template <typename U>
template <typename Unsigned>
inline typename
Enable_If<(static_cast<Unsigned>(-1) > 0),
            typename OR_Matrix<T>::template any_row_iterator<U>& >::type
OR_Matrix<T>::any_row_iterator<U>::operator+=(Unsigned m) {
  dimension_type n = m;
  dimension_type increment = n + (n*n)/2 + n*e;
  if (e % 2 == 0 && n % 2 != 0)
    ++increment;
  e += n;
  i += increment;
  value.first += increment;



  return *this;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>&
OR_Matrix<T>::any_row_iterator<U>::operator-=(difference_type m) {
  return *this += -m;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>::difference_type
OR_Matrix<T>::any_row_iterator<U>::operator-(const any_row_iterator& y) const {
  return e - y.e;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>
OR_Matrix<T>::any_row_iterator<U>::operator+(difference_type m) const {
  any_row_iterator r = *this;
  r += m;
  return r;
}

template <typename T>
template <typename U>
template <typename Unsigned>
inline typename
Enable_If<(static_cast<Unsigned>(-1) > 0),
            typename OR_Matrix<T>::template any_row_iterator<U> >::type
OR_Matrix<T>::any_row_iterator<U>::operator+(Unsigned m) const {
  any_row_iterator r = *this;
  r += m;
  return r;
}

template <typename T>
template <typename U>
inline typename OR_Matrix<T>::template any_row_iterator<U>
OR_Matrix<T>::any_row_iterator<U>::operator-(const difference_type m) const {
  any_row_iterator r = *this;
  r -= m;
  return r;
}

template <typename T>
template <typename U>
inline bool
OR_Matrix<T>::any_row_iterator<U>
::operator==(const any_row_iterator& y) const {
  return e == y.e;
}

template <typename T>
template <typename U>
inline bool
OR_Matrix<T>::any_row_iterator<U>
::operator!=(const any_row_iterator& y) const {
  return e != y.e;
}

template <typename T>
template <typename U>
inline bool
OR_Matrix<T>::any_row_iterator<U>::operator<(const any_row_iterator& y) const {
  return e < y.e;
}

template <typename T>
template <typename U>
inline bool
OR_Matrix<T>::any_row_iterator<U>
::operator<=(const any_row_iterator& y) const {
  return e <= y.e;
}

template <typename T>
template <typename U>
inline bool
OR_Matrix<T>::any_row_iterator<U>::operator>(const any_row_iterator& y) const {
  return e > y.e;
}

template <typename T>
template <typename U>
inline bool
OR_Matrix<T>::any_row_iterator<U>
::operator>=(const any_row_iterator& y) const {
  return e >= y.e;
}

template <typename T>
template <typename U>
inline dimension_type
OR_Matrix<T>::any_row_iterator<U>::row_size() const {
  return OR_Matrix::row_size(e);
}

template <typename T>
template <typename U>
inline dimension_type
OR_Matrix<T>::any_row_iterator<U>::index() const {
  return e;
}

template <typename T>
inline typename OR_Matrix<T>::row_iterator
OR_Matrix<T>::row_begin() {
  return num_rows() == 0 ? row_iterator(0) : row_iterator(vec[0]);
}

template <typename T>
inline typename OR_Matrix<T>::row_iterator
OR_Matrix<T>::row_end() {
  return row_iterator(num_rows());
}

template <typename T>
inline typename OR_Matrix<T>::const_row_iterator
OR_Matrix<T>::row_begin() const {
  return num_rows() == 0 ? const_row_iterator(0) : const_row_iterator(vec[0]);
}

template <typename T>
inline typename OR_Matrix<T>::const_row_iterator
OR_Matrix<T>::row_end() const {
  return const_row_iterator(num_rows());
}

template <typename T>
inline typename OR_Matrix<T>::element_iterator
OR_Matrix<T>::element_begin() {
  return vec.begin();
}

template <typename T>
inline typename OR_Matrix<T>::element_iterator
OR_Matrix<T>::element_end() {
  return vec.end();
}

template <typename T>
inline typename OR_Matrix<T>::const_element_iterator
OR_Matrix<T>::element_begin() const {
  return vec.begin();
}

template <typename T>
inline typename OR_Matrix<T>::const_element_iterator
OR_Matrix<T>::element_end() const {
  return vec.end();
}

template <typename T>
inline void
OR_Matrix<T>::m_swap(OR_Matrix& y) {
  using std::swap;
  swap(vec, y.vec);
  swap(space_dim, y.space_dim);
  swap(vec_capacity, y.vec_capacity);
}




inline dimension_type
isqrt(dimension_type x) {
  dimension_type r = 0;
  const dimension_type FIRST_BIT_MASK = 0x40000000U;
  for (dimension_type t = FIRST_BIT_MASK; t != 0; t >>= 2) {
    const dimension_type s = r + t;
    if (s <= x) {
      x -= s;
      r = s + t;
    }
    r >>= 1;
  }
  return r;
}

template <typename T>
inline dimension_type
OR_Matrix<T>::max_num_rows() {


  const dimension_type k = isqrt(2*DB_Row<T>::max_size() + 1);
  return (k - 1) - (k - 1) % 2;
}

template <typename T>
inline memory_size_type
OR_Matrix<T>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename T>
inline
OR_Matrix<T>::OR_Matrix(const dimension_type num_dimensions)
  : vec(2*num_dimensions*(num_dimensions + 1)),
    space_dim(num_dimensions),
    vec_capacity(vec.size()) {
}

template <typename T>
inline
OR_Matrix<T>::~OR_Matrix() {
}

template <typename T>
inline typename OR_Matrix<T>::row_reference_type
OR_Matrix<T>::operator[](dimension_type k) {
  return row_reference_type(vec[row_first_element_index(k)]



                            );
}

template <typename T>
inline typename OR_Matrix<T>::const_row_reference_type
OR_Matrix<T>::operator[](dimension_type k) const {
  return const_row_reference_type(vec[row_first_element_index(k)]



                                  );
}

template <typename T>
inline dimension_type
OR_Matrix<T>::space_dimension() const {
  return space_dim;
}

template <typename T>
inline dimension_type
OR_Matrix<T>::num_rows() const {
  return 2*space_dimension();
}

template <typename T>
inline void
OR_Matrix<T>::clear() {
  OR_Matrix<T>(0).m_swap(*this);
}




template <typename T>
inline bool
operator==(const OR_Matrix<T>& x, const OR_Matrix<T>& y) {
  return x.space_dim == y.space_dim && x.vec == y.vec;
}




template <typename T>
inline bool
operator!=(const OR_Matrix<T>& x, const OR_Matrix<T>& y) {
  return !(x == y);
}

template <typename T>
inline
OR_Matrix<T>::OR_Matrix(const OR_Matrix& y)
  : vec(y.vec),
    space_dim(y.space_dim),
    vec_capacity(compute_capacity(y.vec.size(),
                                  DB_Row<T>::max_size())) {
}

template <typename T>
template <typename U>
inline
OR_Matrix<T>::OR_Matrix(const OR_Matrix<U>& y)
  : vec(),
    space_dim(y.space_dim),
    vec_capacity(compute_capacity(y.vec.size(),
                                  DB_Row<T>::max_size())) {
  vec.construct_upward_approximation(y.vec, vec_capacity);
  ((void) 0);
}

template <typename T>
inline OR_Matrix<T>&
OR_Matrix<T>::operator=(const OR_Matrix& y) {
  vec = y.vec;
  space_dim = y.space_dim;
  vec_capacity = compute_capacity(y.vec.size(), DB_Row<T>::max_size());
  return *this;
}

template <typename T>
inline void
OR_Matrix<T>::grow(const dimension_type new_dim) {
  ((void) 0);
  if (new_dim > space_dim) {
    const dimension_type new_size = 2*new_dim*(new_dim + 1);
    if (new_size <= vec_capacity) {

      vec.expand_within_capacity(new_size);
      space_dim = new_dim;
    }
    else {

      OR_Matrix<T> new_matrix(new_dim);
      element_iterator j = new_matrix.element_begin();
      for (element_iterator i = element_begin(),
             mend = element_end(); i != mend; ++i, ++j)
        assign_or_swap(*j, *i);
      m_swap(new_matrix);
    }
  }
}

template <typename T>
inline void
OR_Matrix<T>::shrink(const dimension_type new_dim) {
  ((void) 0);
  const dimension_type new_size = 2*new_dim*(new_dim + 1);
  vec.shrink(new_size);
  space_dim = new_dim;
}

template <typename T>
inline void
OR_Matrix<T>::resize_no_copy(const dimension_type new_dim) {
  if (new_dim > space_dim) {
    const dimension_type new_size = 2*new_dim*(new_dim + 1);
    if (new_size <= vec_capacity) {

      vec.expand_within_capacity(new_size);
      space_dim = new_dim;
    }
    else {

      OR_Matrix<T> new_matrix(new_dim);
      m_swap(new_matrix);
    }
  }
  else if (new_dim < space_dim)
    shrink(new_dim);
}




template <typename Specialization, typename Temp, typename To, typename T>
inline bool
l_m_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                    const OR_Matrix<T>& x,
                    const OR_Matrix<T>& y,
                    const Rounding_Dir dir,
                    Temp& tmp0,
                    Temp& tmp1,
                    Temp& tmp2) {
  if (x.num_rows() != y.num_rows())
    return false;
  assign_r(tmp0, 0, ROUND_NOT_NEEDED);
  for (typename OR_Matrix<T>::const_element_iterator
         i = x.element_begin(), j = y.element_begin(),
         mat_end = x.element_end(); i != mat_end; ++i, ++j) {
    const T& x_i = *i;
    const T& y_i = *j;
    if (is_plus_infinity(x_i)) {
      if (is_plus_infinity(y_i))
        continue;
      else {
      pinf:
        assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
        return true;
      }
    }
    else if (is_plus_infinity(y_i))
      goto pinf;

    const Temp* tmp1p;
    const Temp* tmp2p;
    if (x_i > y_i) {
      maybe_assign(tmp1p, tmp1, x_i, dir);
      maybe_assign(tmp2p, tmp2, y_i, inverse(dir));
    }
    else {
      maybe_assign(tmp1p, tmp1, y_i, dir);
      maybe_assign(tmp2p, tmp2, x_i, inverse(dir));
    }
    sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
    ((void) 0);
    Specialization::combine(tmp0, tmp1, dir);
  }

  Specialization::finalize(tmp0, dir);
  assign_r(r, tmp0, dir);
  return true;
}





template <typename Temp, typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const OR_Matrix<T>& x,
                            const OR_Matrix<T>& y,
                            const Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2) {
  return
    l_m_distance_assign<Rectilinear_Distance_Specialization<Temp> >(r, x, y,
                                                                    dir,
                                                                    tmp0,
                                                                    tmp1,
                                                                    tmp2);
}




template <typename Temp, typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const OR_Matrix<T>& x,
                          const OR_Matrix<T>& y,
                          const Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2) {
  return
    l_m_distance_assign<Euclidean_Distance_Specialization<Temp> >(r, x, y,
                                                                  dir,
                                                                  tmp0,
                                                                  tmp1,
                                                                  tmp2);
}




template <typename Temp, typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const OR_Matrix<T>& x,
                           const OR_Matrix<T>& y,
                           const Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2) {
  return
    l_m_distance_assign<L_Infinity_Distance_Specialization<Temp> >(r, x, y,
                                                                   dir,
                                                                   tmp0,
                                                                   tmp1,
                                                                   tmp2);
}


template <typename T>
inline void
swap(OR_Matrix<T>& x, OR_Matrix<T>& y) {
  x.m_swap(y);
}

}
# 608 "OR_Matrix_defs.hh" 2
# 1 "OR_Matrix_templates.hh" 1
# 29 "OR_Matrix_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
memory_size_type
OR_Matrix<T>::external_memory_in_bytes() const{
  return vec.external_memory_in_bytes();
}

template <typename T>
bool
OR_Matrix<T>::OK() const {





  const dimension_type dim = space_dimension();
  if (vec.size() != 2*dim*(dim + 1)) {





    return false;
  }


  if (!vec.OK(vec.size(), vec_capacity))
    return false;


  return true;
}

template <typename T>
void
OR_Matrix<T>::ascii_dump(std::ostream& s) const {
  const OR_Matrix<T>& x = *this;
  const char separator = ' ';
  dimension_type space = x.space_dimension();
  s << space << separator << "\n";
  for (const_row_iterator i = x.row_begin(),
         x_row_end = x.row_end(); i != x_row_end; ++i) {
    const_row_reference_type r = *i;
    dimension_type rs = i.row_size();
    for (dimension_type j = 0; j < rs; ++j) {
      using namespace IO_Operators;
      s << r[j] << separator;
    }
    s << "\n";
  }
}

template <typename T> void OR_Matrix<T>::ascii_dump() const { ascii_dump(std::cerr); } template <typename T> void OR_Matrix<T>::print() const { using IO_Operators::operator<<; std::cerr << *this; }

template <typename T>
bool
OR_Matrix<T>::ascii_load(std::istream& s) {
  dimension_type space;
  if (!(s >> space))
    return false;
  resize_no_copy(space);
  for (row_iterator i = row_begin(),
         this_row_end = row_end(); i != this_row_end; ++i) {
    row_reference_type r_i = *i;
    const dimension_type rs = i.row_size();
    for (dimension_type j = 0; j < rs; ++j) {
      Result r = input(r_i[j], s, ROUND_CHECK);
      if (result_relation(r) != VR_EQ || is_minus_infinity(r_i[j]))
        return false;
    }
  }
  ((void) 0);
  return true;
}




template <typename T>
std::ostream&
IO_Operators::operator<<(std::ostream& s, const OR_Matrix<T>& m) {
  for (typename OR_Matrix<T>::const_row_iterator m_iter = m.row_begin(),
         m_end = m.row_end(); m_iter != m_end; ++m_iter) {
    typename OR_Matrix<T>::const_row_reference_type r_m = *m_iter;
    const dimension_type mr_size = m_iter.row_size();
    for (dimension_type j = 0; j < mr_size; ++j)
      s << r_m[j] << " ";
    s << "\n";
  }
  return s;
}

}
# 609 "OR_Matrix_defs.hh" 2
# 37 "Octagonal_Shape_defs.hh" 2
# 55 "Octagonal_Shape_defs.hh"
namespace Parma_Polyhedra_Library {

namespace IO_Operators {
# 67 "Octagonal_Shape_defs.hh"
template <typename T>
std::ostream&
operator<<(std::ostream& s, const Octagonal_Shape<T>& oct);

}



template <typename T>
void swap(Octagonal_Shape<T>& x, Octagonal_Shape<T>& y);
# 85 "Octagonal_Shape_defs.hh"
template <typename T>
bool operator==(const Octagonal_Shape<T>& x, const Octagonal_Shape<T>& y);
# 95 "Octagonal_Shape_defs.hh"
template <typename T>
bool operator!=(const Octagonal_Shape<T>& x, const Octagonal_Shape<T>& y);
# 109 "Octagonal_Shape_defs.hh"
template <typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Octagonal_Shape<T>& x,
                                 const Octagonal_Shape<T>& y,
                                 Rounding_Dir dir);
# 126 "Octagonal_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Octagonal_Shape<T>& x,
                                 const Octagonal_Shape<T>& y,
                                 Rounding_Dir dir);
# 143 "Octagonal_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                 const Octagonal_Shape<T>& x,
                                 const Octagonal_Shape<T>& y,
                                 Rounding_Dir dir,
                                 Temp& tmp0,
                                 Temp& tmp1,
                                 Temp& tmp2);
# 163 "Octagonal_Shape_defs.hh"
template <typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const Octagonal_Shape<T>& x,
                               const Octagonal_Shape<T>& y,
                               Rounding_Dir dir);
# 180 "Octagonal_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const Octagonal_Shape<T>& x,
                               const Octagonal_Shape<T>& y,
                               Rounding_Dir dir);
# 197 "Octagonal_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                               const Octagonal_Shape<T>& x,
                               const Octagonal_Shape<T>& y,
                               Rounding_Dir dir,
                               Temp& tmp0,
                               Temp& tmp1,
                               Temp& tmp2);
# 217 "Octagonal_Shape_defs.hh"
template <typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const Octagonal_Shape<T>& x,
                                const Octagonal_Shape<T>& y,
                                Rounding_Dir dir);
# 234 "Octagonal_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const Octagonal_Shape<T>& x,
                                const Octagonal_Shape<T>& y,
                                Rounding_Dir dir);
# 251 "Octagonal_Shape_defs.hh"
template <typename Temp, typename To, typename T>
bool l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                                const Octagonal_Shape<T>& x,
                                const Octagonal_Shape<T>& y,
                                Rounding_Dir dir,
                                Temp& tmp0,
                                Temp& tmp1,
                                Temp& tmp2);



class Octagonal_Shape_Helper {
public:
# 304 "Octagonal_Shape_defs.hh"
  static bool extract_octagonal_difference(const Constraint& c,
                                           dimension_type c_space_dim,
                                           dimension_type& c_num_vars,
                                           dimension_type& c_first_var,
                                           dimension_type& c_second_var,
                                           Coefficient& c_coeff,
                                           Coefficient& c_term);
};

}
# 419 "Octagonal_Shape_defs.hh"
template <typename T>
class Parma_Polyhedra_Library::Octagonal_Shape {
private:







  typedef Checked_Number<T, WRD_Extended_Number_Policy> N;


public:


  typedef T coefficient_type_base;





  typedef N coefficient_type;


  static dimension_type max_space_dimension();




  static bool can_recycle_constraint_systems();




  static bool can_recycle_congruence_systems();
# 467 "Octagonal_Shape_defs.hh"
  explicit Octagonal_Shape(dimension_type num_dimensions = 0,
                           Degenerate_Element kind = UNIVERSE);





  Octagonal_Shape(const Octagonal_Shape& y,
                  Complexity_Class complexity = ANY_COMPLEXITY);





  template <typename U>
  explicit Octagonal_Shape(const Octagonal_Shape<U>& y,
                           Complexity_Class complexity = ANY_COMPLEXITY);
# 496 "Octagonal_Shape_defs.hh"
  explicit Octagonal_Shape(const Constraint_System& cs);
# 509 "Octagonal_Shape_defs.hh"
  explicit Octagonal_Shape(const Congruence_System& cgs);
# 519 "Octagonal_Shape_defs.hh"
  explicit Octagonal_Shape(const Generator_System& gs);
# 528 "Octagonal_Shape_defs.hh"
  explicit Octagonal_Shape(const Polyhedron& ph,
                           Complexity_Class complexity = ANY_COMPLEXITY);
# 547 "Octagonal_Shape_defs.hh"
  template <typename Interval>
  explicit Octagonal_Shape(const Box<Interval>& box,
                           Complexity_Class complexity = ANY_COMPLEXITY);
# 567 "Octagonal_Shape_defs.hh"
  explicit Octagonal_Shape(const Grid& grid,
                           Complexity_Class complexity = ANY_COMPLEXITY);
# 586 "Octagonal_Shape_defs.hh"
  template <typename U>
  explicit Octagonal_Shape(const BD_Shape<U>& bd,
                           Complexity_Class complexity = ANY_COMPLEXITY);





  Octagonal_Shape& operator=(const Octagonal_Shape& y);





  void m_swap(Octagonal_Shape& y);


  ~Octagonal_Shape();







  dimension_type space_dimension() const;






  dimension_type affine_dimension() const;


  Constraint_System constraints() const;


  Constraint_System minimized_constraints() const;


  Congruence_System congruences() const;





  Congruence_System minimized_congruences() const;






  bool contains(const Octagonal_Shape& y) const;






  bool strictly_contains(const Octagonal_Shape& y) const;







  bool is_disjoint_from(const Octagonal_Shape& y) const;







  Poly_Con_Relation relation_with(const Constraint& c) const;







  Poly_Con_Relation relation_with(const Congruence& cg) const;







  Poly_Gen_Relation relation_with(const Generator& g) const;


  bool is_empty() const;


  bool is_universe() const;


  bool is_discrete() const;





  bool is_bounded() const;





  bool is_topologically_closed() const;





  bool contains_integer_point() const;
# 715 "Octagonal_Shape_defs.hh"
  bool constrains(Variable var) const;
# 724 "Octagonal_Shape_defs.hh"
  bool bounds_from_above(const Linear_Expression& expr) const;
# 733 "Octagonal_Shape_defs.hh"
  bool bounds_from_below(const Linear_Expression& expr) const;
# 759 "Octagonal_Shape_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum) const;
# 790 "Octagonal_Shape_defs.hh"
  bool maximize(const Linear_Expression& expr,
                Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                Generator& g) const;
# 818 "Octagonal_Shape_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum) const;
# 849 "Octagonal_Shape_defs.hh"
  bool minimize(const Linear_Expression& expr,
                Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                Generator& g) const;
# 881 "Octagonal_Shape_defs.hh"
  bool frequency(const Linear_Expression& expr,
                 Coefficient& freq_n, Coefficient& freq_d,
                 Coefficient& val_n, Coefficient& val_d) const;


  bool OK() const;
# 904 "Octagonal_Shape_defs.hh"
  void add_constraint(const Constraint& c);
# 918 "Octagonal_Shape_defs.hh"
  void add_constraints(const Constraint_System& cs);
# 937 "Octagonal_Shape_defs.hh"
  void add_recycled_constraints(Constraint_System& cs);
# 949 "Octagonal_Shape_defs.hh"
  void add_congruence(const Congruence& cg);
# 962 "Octagonal_Shape_defs.hh"
  void add_congruences(const Congruence_System& cgs);
# 980 "Octagonal_Shape_defs.hh"
  void add_recycled_congruences(Congruence_System& cgs);
# 992 "Octagonal_Shape_defs.hh"
  void refine_with_constraint(const Constraint& c);
# 1005 "Octagonal_Shape_defs.hh"
  void refine_with_congruence(const Congruence& cg);
# 1018 "Octagonal_Shape_defs.hh"
  void refine_with_constraints(const Constraint_System& cs);
# 1031 "Octagonal_Shape_defs.hh"
  void refine_with_congruences(const Congruence_System& cgs);
# 1054 "Octagonal_Shape_defs.hh"
  template <typename Interval_Info>
  void refine_with_linear_form_inequality(
                   const Linear_Form< Interval<T, Interval_Info> >& left,
                   const Linear_Form< Interval<T, Interval_Info> >& right);
# 1087 "Octagonal_Shape_defs.hh"
  template <typename Interval_Info>
  void generalized_refine_with_linear_form_inequality(
                   const Linear_Form< Interval<T, Interval_Info> >& left,
                   const Linear_Form< Interval<T, Interval_Info> >& right,
                   Relation_Symbol relsym);
# 1103 "Octagonal_Shape_defs.hh"
  void unconstrain(Variable var);
# 1117 "Octagonal_Shape_defs.hh"
  void unconstrain(const Variables_Set& vars);






  void intersection_assign(const Octagonal_Shape& y);
# 1133 "Octagonal_Shape_defs.hh"
  void upper_bound_assign(const Octagonal_Shape& y);
# 1145 "Octagonal_Shape_defs.hh"
  bool upper_bound_assign_if_exact(const Octagonal_Shape& y);
# 1168 "Octagonal_Shape_defs.hh"
  bool integer_upper_bound_assign_if_exact(const Octagonal_Shape& y);
# 1177 "Octagonal_Shape_defs.hh"
  void difference_assign(const Octagonal_Shape& y);
# 1188 "Octagonal_Shape_defs.hh"
  bool simplify_using_context_assign(const Octagonal_Shape& y);
# 1208 "Octagonal_Shape_defs.hh"
  void affine_image(Variable var,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator
                    = Coefficient_one());
# 1234 "Octagonal_Shape_defs.hh"
  template <typename Interval_Info>
  void affine_form_image(Variable var,
                        const Linear_Form< Interval<T, Interval_Info> >& lf);
# 1256 "Octagonal_Shape_defs.hh"
  void affine_preimage(Variable var,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator
                       = Coefficient_one());
# 1285 "Octagonal_Shape_defs.hh"
  void generalized_affine_image(Variable var,
                                Relation_Symbol relsym,
                                const Linear_Expression& expr,
                                Coefficient_traits::const_reference denominator
                                = Coefficient_one());
# 1310 "Octagonal_Shape_defs.hh"
  void generalized_affine_image(const Linear_Expression& lhs,
                                Relation_Symbol relsym,
                                const Linear_Expression& rhs);
# 1340 "Octagonal_Shape_defs.hh"
  void bounded_affine_image(Variable var,
                            const Linear_Expression& lb_expr,
                            const Linear_Expression& ub_expr,
                            Coefficient_traits::const_reference denominator
                            = Coefficient_one());
# 1370 "Octagonal_Shape_defs.hh"
  void generalized_affine_preimage(Variable var,
                                   Relation_Symbol relsym,
                                   const Linear_Expression& expr,
                                   Coefficient_traits::const_reference
                                   denominator = Coefficient_one());
# 1395 "Octagonal_Shape_defs.hh"
  void generalized_affine_preimage(const Linear_Expression& lhs,
                                   Relation_Symbol relsym,
                                   const Linear_Expression& rhs);
# 1425 "Octagonal_Shape_defs.hh"
  void bounded_affine_preimage(Variable var,
                               const Linear_Expression& lb_expr,
                               const Linear_Expression& ub_expr,
                               Coefficient_traits::const_reference denominator
                               = Coefficient_one());
# 1438 "Octagonal_Shape_defs.hh"
  void time_elapse_assign(const Octagonal_Shape& y);
# 1486 "Octagonal_Shape_defs.hh"
  void wrap_assign(const Variables_Set& vars,
                   Bounded_Integer_Type_Width w,
                   Bounded_Integer_Type_Representation r,
                   Bounded_Integer_Type_Overflow o,
                   const Constraint_System* cs_p = 0,
                   unsigned complexity_threshold = 16,
                   bool wrap_individually = true);
# 1505 "Octagonal_Shape_defs.hh"
  void drop_some_non_integer_points(Complexity_Class complexity
                                    = ANY_COMPLEXITY);
# 1523 "Octagonal_Shape_defs.hh"
  void drop_some_non_integer_points(const Variables_Set& vars,
                                    Complexity_Class complexity
                                    = ANY_COMPLEXITY);


  void topological_closure_assign();
# 1545 "Octagonal_Shape_defs.hh"
  void CC76_extrapolation_assign(const Octagonal_Shape& y, unsigned* tp = 0);
# 1568 "Octagonal_Shape_defs.hh"
  template <typename Iterator>
  void CC76_extrapolation_assign(const Octagonal_Shape& y,
                                 Iterator first, Iterator last,
                                 unsigned* tp = 0);
# 1588 "Octagonal_Shape_defs.hh"
  void BHMZ05_widening_assign(const Octagonal_Shape& y, unsigned* tp = 0);


  void widening_assign(const Octagonal_Shape& y, unsigned* tp = 0);
# 1613 "Octagonal_Shape_defs.hh"
  void limited_BHMZ05_extrapolation_assign(const Octagonal_Shape& y,
                                           const Constraint_System& cs,
                                           unsigned* tp = 0);
# 1627 "Octagonal_Shape_defs.hh"
  void CC76_narrowing_assign(const Octagonal_Shape& y);
# 1649 "Octagonal_Shape_defs.hh"
  void limited_CC76_extrapolation_assign(const Octagonal_Shape& y,
                                         const Constraint_System& cs,
                                         unsigned* tp = 0);
# 1676 "Octagonal_Shape_defs.hh"
  void add_space_dimensions_and_embed(dimension_type m);
# 1699 "Octagonal_Shape_defs.hh"
  void add_space_dimensions_and_project(dimension_type m);
# 1709 "Octagonal_Shape_defs.hh"
  void concatenate_assign(const Octagonal_Shape& y);
# 1720 "Octagonal_Shape_defs.hh"
  void remove_space_dimensions(const Variables_Set& vars);
# 1730 "Octagonal_Shape_defs.hh"
  void remove_higher_space_dimensions(dimension_type new_dimension);
# 1768 "Octagonal_Shape_defs.hh"
  template <typename Partial_Function>
  void map_space_dimensions(const Partial_Function& pfunc);
# 1792 "Octagonal_Shape_defs.hh"
  void expand_space_dimension(Variable var, dimension_type m);
# 1817 "Octagonal_Shape_defs.hh"
  void fold_space_dimensions(const Variables_Set& vars, Variable dest);
# 1849 "Octagonal_Shape_defs.hh"
  template <typename U>
  void export_interval_constraints(U& dest) const;






  template <typename Interval_Info>
  void refine_fp_interval_abstract_store(
                          Box< Interval<T, Interval_Info> >& store) const;



  void ascii_dump() const; void ascii_dump(std::ostream& s) const; void print() const;






  bool ascii_load(std::istream& s);


  memory_size_type total_memory_in_bytes() const;


  memory_size_type external_memory_in_bytes() const;







  int32_t hash_code() const;

  friend bool
  operator==<T>(const Octagonal_Shape<T>& x, const Octagonal_Shape<T>& y);

  template <typename Temp, typename To, typename U>
  friend bool Parma_Polyhedra_Library::rectilinear_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const Octagonal_Shape<U>& x, const Octagonal_Shape<U>& y,
   const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);
  template <typename Temp, typename To, typename U>
  friend bool Parma_Polyhedra_Library::euclidean_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const Octagonal_Shape<U>& x, const Octagonal_Shape<U>& y,
   const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);
  template <typename Temp, typename To, typename U>
  friend bool Parma_Polyhedra_Library::l_infinity_distance_assign
  (Checked_Number<To, Extended_Number_Policy>& r,
   const Octagonal_Shape<U>& x, const Octagonal_Shape<U>& y,
   const Rounding_Dir dir, Temp& tmp0, Temp& tmp1, Temp& tmp2);

private:
  template <typename U> friend class Parma_Polyhedra_Library::Octagonal_Shape;
  template <typename Interval> friend class Parma_Polyhedra_Library::Box;


  OR_Matrix<N> matrix;


  dimension_type space_dim;
# 1922 "Octagonal_Shape_defs.hh"
# 1 "Og_Status_idefs.hh" 1
# 45 "Og_Status_idefs.hh"
class Status {
public:

  Status();



  bool test_zero_dim_univ() const;
  void reset_zero_dim_univ();
  void set_zero_dim_univ();

  bool test_empty() const;
  void reset_empty();
  void set_empty();

  bool test_strongly_closed() const;
  void reset_strongly_closed();
  void set_strongly_closed();



  bool OK() const;





  void ascii_dump(std::ostream& s) const;






  bool ascii_load(std::istream& s);

private:

  typedef unsigned int flags_t;



  static const flags_t ZERO_DIM_UNIV = 0U;
  static const flags_t EMPTY = 1U << 0;
  static const flags_t STRONGLY_CLOSED = 1U << 1;



  flags_t flags;


  Status(flags_t mask);


  bool test_all(flags_t mask) const;


  bool test_any(flags_t mask) const;


  void set(flags_t mask);


  void reset(flags_t mask);

};
# 1923 "Octagonal_Shape_defs.hh" 2



  Status status;


  bool marked_zero_dim_univ() const;






  bool marked_empty() const;
# 1945 "Octagonal_Shape_defs.hh"
  bool marked_strongly_closed() const;


  void set_zero_dim_univ();


  void set_empty();


  void set_strongly_closed();


  void reset_strongly_closed();

  N& matrix_at(dimension_type i, dimension_type j);
  const N& matrix_at(dimension_type i, dimension_type j) const;
# 1972 "Octagonal_Shape_defs.hh"
  template <typename Interval_Info>
  void linear_form_upper_bound(
                   const Linear_Form< Interval<T, Interval_Info> >& lf,
                   N& result) const;


  static void interval_coefficient_upper_bound(const N& var_ub,
                                               const N& minus_var_ub,
                                               const N& int_ub, const N& int_lb,
                                               N& result);
# 1993 "Octagonal_Shape_defs.hh"
  void refine_no_check(const Constraint& c);
# 2007 "Octagonal_Shape_defs.hh"
  void refine_no_check(const Congruence& cg);


  void add_octagonal_constraint(dimension_type i,
                                dimension_type j,
                                const N& k);


  void add_octagonal_constraint(dimension_type i,
                                dimension_type j,
                                Coefficient_traits::const_reference numer,
                                Coefficient_traits::const_reference denom);







  void refine(Variable var,
              Relation_Symbol relsym,
              const Linear_Expression& expr,
              Coefficient_traits::const_reference denominator
              = Coefficient_one());


  void forget_all_octagonal_constraints(dimension_type v_id);


  void forget_binary_octagonal_constraints(dimension_type v_id);
# 2065 "Octagonal_Shape_defs.hh"
  void deduce_v_pm_u_bounds(dimension_type v_id,
                            dimension_type last_id,
                            const Linear_Expression& sc_expr,
                            Coefficient_traits::const_reference sc_denom,
                            const N& ub_v);
# 2099 "Octagonal_Shape_defs.hh"
  void deduce_minus_v_pm_u_bounds(dimension_type v_id,
                                  dimension_type last_id,
                                  const Linear_Expression& sc_expr,
                                  Coefficient_traits::const_reference sc_denom,
                                  const N& minus_lb_v);





  void get_limiting_octagon(const Constraint_System& cs,
                            Octagonal_Shape& limiting_octagon) const;




  void compute_successors(std::vector<dimension_type>& successor) const;





  void compute_leaders(std::vector<dimension_type>& successor,
                       std::vector<dimension_type>& no_sing_leaders,
                       bool& exist_sing_class,
                       dimension_type& sing_leader) const;





  void compute_leaders(std::vector<dimension_type>& leaders) const;
# 2140 "Octagonal_Shape_defs.hh"
  void non_redundant_matrix_entries(std::vector<Bit_Row>& non_redundant) const;


  void strong_reduction_assign() const;





  bool is_strongly_reduced() const;





  bool is_strong_coherent() const;

  bool tight_coherence_would_make_empty() const;
# 2166 "Octagonal_Shape_defs.hh"
  void strong_closure_assign() const;


  void strong_coherence_assign();
# 2179 "Octagonal_Shape_defs.hh"
  void tight_closure_assign();
# 2192 "Octagonal_Shape_defs.hh"
  void incremental_strong_closure_assign(Variable var) const;
# 2211 "Octagonal_Shape_defs.hh"
  bool bounds(const Linear_Expression& expr, bool from_above) const;
# 2239 "Octagonal_Shape_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included) const;
# 2274 "Octagonal_Shape_defs.hh"
  bool max_min(const Linear_Expression& expr,
               bool maximize,
               Coefficient& ext_n, Coefficient& ext_d, bool& included,
               Generator& g) const;

  void drop_some_non_integer_points_helper(N& elem);

  friend std::ostream&
  Parma_Polyhedra_Library::IO_Operators
  ::operator<<<>(std::ostream& s, const Octagonal_Shape<T>& c);



  void throw_dimension_incompatible(const char* method,
                                    const Octagonal_Shape& y) const;

  void throw_dimension_incompatible(const char* method,
                                    dimension_type required_dim) const;

  void throw_dimension_incompatible(const char* method,
                                    const Constraint& c) const;

  void throw_dimension_incompatible(const char* method,
                                    const Congruence& cg) const;

  void throw_dimension_incompatible(const char* method,
                                    const Generator& g) const;

  void throw_dimension_incompatible(const char* method,
                                    const char* le_name,
                                    const Linear_Expression& le) const;

  template <typename C>
  void throw_dimension_incompatible(const char* method,
                                    const char* lf_name,
                                    const Linear_Form<C>& lf) const;

  static void throw_constraint_incompatible(const char* method);

  static void throw_expression_too_complex(const char* method,
                                           const Linear_Expression& le);

  static void throw_invalid_argument(const char* method, const char* reason);

};

# 1 "Og_Status_inlines.hh" 1
# 27 "Og_Status_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline
Octagonal_Shape<T>::Status::Status(flags_t mask)
  : flags(mask) {
}

template <typename T>
inline
Octagonal_Shape<T>::Status::Status()
  : flags(ZERO_DIM_UNIV) {
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::test_all(flags_t mask) const {
  return (flags & mask) == mask;
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::test_any(flags_t mask) const {
  return (flags & mask) != 0;
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::set(flags_t mask) {
  flags |= mask;
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::reset(flags_t mask) {
  flags &= ~mask;
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::test_zero_dim_univ() const {
  return flags == ZERO_DIM_UNIV;
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::reset_zero_dim_univ() {

  if (flags == ZERO_DIM_UNIV)

    flags = EMPTY;
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::set_zero_dim_univ() {

  flags = ZERO_DIM_UNIV;
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::test_empty() const {
  return test_any(EMPTY);
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::reset_empty() {
  reset(EMPTY);
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::set_empty() {
  flags = EMPTY;
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::test_strongly_closed() const {
  return test_any(STRONGLY_CLOSED);
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::reset_strongly_closed() {
  reset(STRONGLY_CLOSED);
}

template <typename T>
inline void
Octagonal_Shape<T>::Status::set_strongly_closed() {
  set(STRONGLY_CLOSED);
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::OK() const {
  if (test_zero_dim_univ())

    return true;

  if (test_empty()) {
    Status copy = *this;
    copy.reset_empty();
    if (copy.test_zero_dim_univ())
      return true;
    else {




      return false;
    }
  }


  return true;
}


namespace Implementation {

namespace Octagonal_Shapes {

const std::string zero_dim_univ = "ZE";
const std::string empty = "EM";
const std::string strong_closed = "SC";
const char yes = '+';
const char no = '-';
const char separator = ' ';
# 167 "Og_Status_inlines.hh"
inline bool
get_field(std::istream& s, const std::string& keyword, bool& positive) {
  std::string str;
  if (!(s >> str)
      || (str[0] != yes && str[0] != no)
      || str.substr(1) != keyword)
    return false;
  positive = (str[0] == yes);
  return true;
}

}

}

template <typename T>
inline void
Octagonal_Shape<T>::Status::ascii_dump(std::ostream& s) const {
  using namespace Implementation::Octagonal_Shapes;
  s << (test_zero_dim_univ() ? yes : no) << zero_dim_univ
    << separator
    << (test_empty() ? yes : no) << empty
    << separator
    << separator
    << (test_strongly_closed() ? yes : no) << strong_closed
    << separator;
}

template <typename T>
inline bool
Octagonal_Shape<T>::Status::ascii_load(std::istream& s) {
  using namespace Implementation::Octagonal_Shapes;
  bool positive = Suppress_Uninitialized_Warnings_Type<bool>::synonym ();

  if (!get_field(s, zero_dim_univ, positive))
    return false;
  if (positive)
    set_zero_dim_univ();

  if (!get_field(s, empty, positive))
    return false;
  if (positive)
    set_empty();

  if (!get_field(s, strong_closed, positive))
    return false;
  if (positive)
    set_strongly_closed();
  else
    reset_strongly_closed();


  ((void) 0);
  return true;
}

}
# 2321 "Octagonal_Shape_defs.hh" 2
# 1 "Octagonal_Shape_inlines.hh" 1
# 31 "Octagonal_Shape_inlines.hh"
# 1 "BD_Shape_defs.hh" 1
# 32 "Octagonal_Shape_inlines.hh" 2


# 1 "wrap_assign.hh" 1
# 33 "wrap_assign.hh"
namespace Parma_Polyhedra_Library {

namespace Implementation {

struct Wrap_Dim_Translations {
  Variable var;
  Coefficient first_quadrant;
  Coefficient last_quadrant;
  Wrap_Dim_Translations(Variable v,
                        Coefficient_traits::const_reference f,
                        Coefficient_traits::const_reference l)
    : var(v), first_quadrant(f), last_quadrant(l) {
  }
};

typedef std::vector<Wrap_Dim_Translations> Wrap_Translations;

template <typename PSET>
void
wrap_assign_ind(PSET& pointset,
                Variables_Set& vars,
                Wrap_Translations::const_iterator first,
                Wrap_Translations::const_iterator end,
                Bounded_Integer_Type_Width w,
                Coefficient_traits::const_reference min_value,
                Coefficient_traits::const_reference max_value,
                const Constraint_System& cs,
                Coefficient& tmp1,
                Coefficient& tmp2) {
  const dimension_type space_dim = pointset.space_dimension();
  for (Wrap_Translations::const_iterator i = first; i != end; ++i) {
    const Wrap_Dim_Translations& wrap_dim_translations = *i;
    const Variable x(wrap_dim_translations.var);
    const Coefficient& first_quadrant = wrap_dim_translations.first_quadrant;
    const Coefficient& last_quadrant = wrap_dim_translations.last_quadrant;
    Coefficient& quadrant = tmp1;
    Coefficient& shift = tmp2;
    PSET hull(space_dim, EMPTY);
    for (quadrant = first_quadrant; quadrant <= last_quadrant; ++quadrant) {
      PSET p(pointset);
      if (quadrant != 0) {
        mul_2exp_assign(shift, quadrant, w);
        p.affine_image(x, x - shift, 1);
      }

      vars.erase(x.id());



      if (vars.empty())
        p.refine_with_constraints(cs);
      else {
        for (Constraint_System::const_iterator j = cs.begin(),
               cs_end = cs.end(); j != cs_end; ++j)
          if (j->expression().all_zeroes(vars))

            p.refine_with_constraint(*j);
      }
      p.refine_with_constraint(min_value <= x);
      p.refine_with_constraint(x <= max_value);
      hull.upper_bound_assign(p);
    }
    pointset.m_swap(hull);
  }
}

template <typename PSET>
void
wrap_assign_col(PSET& dest,
                const PSET& src,
                const Variables_Set& vars,
                Wrap_Translations::const_iterator first,
                Wrap_Translations::const_iterator end,
                Bounded_Integer_Type_Width w,
                Coefficient_traits::const_reference min_value,
                Coefficient_traits::const_reference max_value,
                const Constraint_System* cs_p,
                Coefficient& tmp) {
  if (first == end) {
    PSET p(src);
    if (cs_p != 0)
      p.refine_with_constraints(*cs_p);
    for (Variables_Set::const_iterator i = vars.begin(),
           vars_end = vars.end(); i != vars_end; ++i) {
      const Variable x(*i);
      p.refine_with_constraint(min_value <= x);
      p.refine_with_constraint(x <= max_value);
    }
    dest.upper_bound_assign(p);
  }
  else {
    const Wrap_Dim_Translations& wrap_dim_translations = *first;
    const Variable x(wrap_dim_translations.var);
    const Coefficient& first_quadrant = wrap_dim_translations.first_quadrant;
    const Coefficient& last_quadrant = wrap_dim_translations.last_quadrant;
    Coefficient& shift = tmp;
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_quadrant; Parma_Polyhedra_Library::Coefficient& quadrant = holder_quadrant.item();
    for (quadrant = first_quadrant; quadrant <= last_quadrant; ++quadrant) {
      if (quadrant != 0) {
        mul_2exp_assign(shift, quadrant, w);
        PSET p(src);
        p.affine_image(x, x - shift, 1);
        wrap_assign_col(dest, p, vars, first+1, end, w, min_value, max_value,
                        cs_p, tmp);
      }
      else
        wrap_assign_col(dest, src, vars, first+1, end, w, min_value, max_value,
                        cs_p, tmp);
    }
  }
}

template <typename PSET>
void
wrap_assign(PSET& pointset,
            const Variables_Set& vars,
            const Bounded_Integer_Type_Width w,
            const Bounded_Integer_Type_Representation r,
            const Bounded_Integer_Type_Overflow o,
            const Constraint_System* cs_p,
            const unsigned complexity_threshold,
            const bool wrap_individually,
            const char* class_name) {




  if (cs_p != 0) {
    const dimension_type vars_space_dim = vars.space_dimension();
    if (cs_p->space_dimension() > vars_space_dim) {
      std::ostringstream s;
      s << "PPL::" << class_name << "::wrap_assign(..., cs_p, ...):"
        << std::endl
        << "vars.space_dimension() == " << vars_space_dim
        << ", cs_p->space_dimension() == " << cs_p->space_dimension() << ".";
      throw std::invalid_argument(s.str());
    }
# 186 "wrap_assign.hh"
  }


  if (vars.empty()) {
    if (cs_p != 0)
      pointset.refine_with_constraints(*cs_p);
    return;
  }


  const dimension_type space_dim = pointset.space_dimension();
  if (vars.space_dimension() > space_dim) {
    std::ostringstream s;
    s << "PPL::" << class_name << "::wrap_assign(vs, ...):" << std::endl
      << "this->space_dimension() == " << space_dim
      << ", required space dimension == " << vars.space_dimension() << ".";
    throw std::invalid_argument(s.str());
  }


  if (pointset.is_empty())
    return;



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_value; Parma_Polyhedra_Library::Coefficient& min_value = holder_min_value.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_value; Parma_Polyhedra_Library::Coefficient& max_value = holder_max_value.item();
  if (r == UNSIGNED) {
    min_value = 0;
    mul_2exp_assign(max_value, Coefficient_one(), w);
    --max_value;
  }
  else {
    ((void) 0);
    mul_2exp_assign(max_value, Coefficient_one(), w-1);
    neg_assign(min_value, max_value);
    --max_value;
  }




  Wrap_Translations translations;



  Variables_Set dimensions_to_be_translated;






  unsigned collective_wrap_complexity = 1;



  bool collective_wrap_too_complex = false;

  if (!wrap_individually) {
    translations.reserve(space_dim);
  }



  Constraint_System full_range_bounds;

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_l_n; Parma_Polyhedra_Library::Coefficient& l_n = holder_l_n.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_l_d; Parma_Polyhedra_Library::Coefficient& l_d = holder_l_d.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_u_n; Parma_Polyhedra_Library::Coefficient& u_n = holder_u_n.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_u_d; Parma_Polyhedra_Library::Coefficient& u_d = holder_u_d.item();

  for (Variables_Set::const_iterator i = vars.begin(),
         vars_end = vars.end(); i != vars_end; ++i) {

    const Variable x(*i);

    bool extremum;

    if (!pointset.minimize(x, l_n, l_d, extremum)) {
    set_full_range:
      pointset.unconstrain(x);
      full_range_bounds.insert(min_value <= x);
      full_range_bounds.insert(x <= max_value);
      continue;
    }

    if (!pointset.maximize(x, u_n, u_d, extremum))
      goto set_full_range;

    div_assign_r(l_n, l_n, l_d, ROUND_DOWN);
    div_assign_r(u_n, u_n, u_d, ROUND_DOWN);
    l_n -= min_value;
    u_n -= min_value;
    div_2exp_assign_r(l_n, l_n, w, ROUND_DOWN);
    div_2exp_assign_r(u_n, u_n, w, ROUND_DOWN);
    Coefficient& first_quadrant = l_n;
    const Coefficient& last_quadrant = u_n;


    if (first_quadrant == 0 && last_quadrant == 0)
      continue;


    if (o == OVERFLOW_IMPOSSIBLE) {
      if (first_quadrant < 0)
        full_range_bounds.insert(min_value <= x);
      if (last_quadrant > 0)
        full_range_bounds.insert(x <= max_value);
      continue;
    }

    if (o == OVERFLOW_UNDEFINED || collective_wrap_too_complex)
      goto set_full_range;

    Coefficient& quadrants = u_d;
    quadrants = last_quadrant - first_quadrant + 1;

    unsigned extension = Suppress_Uninitialized_Warnings_Type<unsigned>::synonym ();
    Result res = assign_r(extension, quadrants, ROUND_IGNORE);
    if (result_overflow(res) != 0 || extension > complexity_threshold)
      goto set_full_range;

    if (!wrap_individually && !collective_wrap_too_complex) {
      res = mul_assign_r(collective_wrap_complexity,
                         collective_wrap_complexity, extension, ROUND_IGNORE);
      if (result_overflow(res) != 0
          || collective_wrap_complexity > complexity_threshold)
        collective_wrap_too_complex = true;
      if (collective_wrap_too_complex) {

        for (Wrap_Translations::const_iterator j = translations.begin(),
               translations_end = translations.end();
             j != translations_end;
             ++j) {
          const Variable y(j->var);
          pointset.unconstrain(y);
          full_range_bounds.insert(min_value <= y);
          full_range_bounds.insert(y <= max_value);
        }
      }
    }

    if (wrap_individually && cs_p == 0) {
      Coefficient& quadrant = first_quadrant;


      Coefficient& shift = l_d;
      PSET hull(space_dim, EMPTY);
      for ( ; quadrant <= last_quadrant; ++quadrant) {
        PSET p(pointset);
        if (quadrant != 0) {
          mul_2exp_assign(shift, quadrant, w);
          p.affine_image(x, x - shift, 1);
        }
        p.refine_with_constraint(min_value <= x);
        p.refine_with_constraint(x <= max_value);
        hull.upper_bound_assign(p);
      }
      pointset.m_swap(hull);
    }
    else if (wrap_individually || !collective_wrap_too_complex) {
      ((void) 0);
      dimensions_to_be_translated.insert(x);
      translations
        .push_back(Wrap_Dim_Translations(x, first_quadrant, last_quadrant));
    }
  }

  if (!translations.empty()) {
    if (wrap_individually) {
      ((void) 0);
      wrap_assign_ind(pointset, dimensions_to_be_translated,
                      translations.begin(), translations.end(),
                      w, min_value, max_value, *cs_p, l_n, l_d);
    }
    else {
      PSET hull(space_dim, EMPTY);
      wrap_assign_col(hull, pointset, dimensions_to_be_translated,
                      translations.begin(), translations.end(),
                      w, min_value, max_value, cs_p, l_n);
      pointset.m_swap(hull);
    }
  }

  if (cs_p != 0)
    pointset.refine_with_constraints(*cs_p);
  pointset.refine_with_constraints(full_range_bounds);
}

}

}
# 35 "Octagonal_Shape_inlines.hh" 2



namespace Parma_Polyhedra_Library {

namespace Implementation {

namespace Octagonal_Shapes {





inline dimension_type
coherent_index(const dimension_type i) {
  return (i % 2 != 0) ? (i-1) : (i+1);
}

}

}

template <typename T>
inline dimension_type
Octagonal_Shape<T>::max_space_dimension() {
  return OR_Matrix<N>::max_num_rows()/2;
}

template <typename T>
inline bool
Octagonal_Shape<T>::marked_zero_dim_univ() const {
  return status.test_zero_dim_univ();
}

template <typename T>
inline bool
Octagonal_Shape<T>::marked_strongly_closed() const {
  return status.test_strongly_closed();
}

template <typename T>
inline bool
Octagonal_Shape<T>::marked_empty() const {
  return status.test_empty();
}

template <typename T>
inline void
Octagonal_Shape<T>::set_zero_dim_univ() {
  status.set_zero_dim_univ();
}

template <typename T>
inline void
Octagonal_Shape<T>::set_empty() {
  status.set_empty();
}

template <typename T>
inline void
Octagonal_Shape<T>::set_strongly_closed() {
  status.set_strongly_closed();
}

template <typename T>
inline void
Octagonal_Shape<T>::reset_strongly_closed() {
  status.reset_strongly_closed();
}

template <typename T>
inline
Octagonal_Shape<T>::Octagonal_Shape(const dimension_type num_dimensions,
                                    const Degenerate_Element kind)
  : matrix(num_dimensions), space_dim(num_dimensions), status() {
  if (kind == EMPTY)
    set_empty();
  else if (num_dimensions > 0)

    set_strongly_closed();
  ((void) 0);
}

template <typename T>
inline
Octagonal_Shape<T>::Octagonal_Shape(const Octagonal_Shape& y, Complexity_Class)
  : matrix(y.matrix), space_dim(y.space_dim), status(y.status) {
}

template <typename T>
template <typename U>
inline
Octagonal_Shape<T>::Octagonal_Shape(const Octagonal_Shape<U>& y,
                                    Complexity_Class)


  : matrix((y.strong_closure_assign(), y.matrix)),
    space_dim(y.space_dim),
    status() {

  if (y.marked_empty())
    set_empty();
  else if (y.marked_zero_dim_univ())
    set_zero_dim_univ();
}

template <typename T>
inline
Octagonal_Shape<T>::Octagonal_Shape(const Constraint_System& cs)
  : matrix(cs.space_dimension()),
    space_dim(cs.space_dimension()),
    status() {
  if (cs.space_dimension() > 0)

    set_strongly_closed();
  add_constraints(cs);
}

template <typename T>
inline
Octagonal_Shape<T>::Octagonal_Shape(const Congruence_System& cgs)
  : matrix(cgs.space_dimension()),
    space_dim(cgs.space_dimension()),
    status() {
  if (cgs.space_dimension() > 0)

    set_strongly_closed();
  add_congruences(cgs);
}

template <typename T>
template <typename Interval>
inline
Octagonal_Shape<T>::Octagonal_Shape(const Box<Interval>& box,
                                    Complexity_Class)
  : matrix(box.space_dimension()),
    space_dim(box.space_dimension()),
    status() {

  if (box.is_empty())
    set_empty();
  else if (box.space_dimension() > 0) {

    set_strongly_closed();
    refine_with_constraints(box.constraints());
  }
}

template <typename T>
inline
Octagonal_Shape<T>::Octagonal_Shape(const Grid& grid,
                                    Complexity_Class)
  : matrix(grid.space_dimension()),
    space_dim(grid.space_dimension()),
    status() {
  if (grid.space_dimension() > 0)

    set_strongly_closed();

  refine_with_congruences(grid.minimized_congruences());
}

template <typename T>
template <typename U>
inline
Octagonal_Shape<T>::Octagonal_Shape(const BD_Shape<U>& bd,
                                    Complexity_Class)
  : matrix(bd.space_dimension()),
    space_dim(bd.space_dimension()),
    status() {

  if (bd.is_empty())
    set_empty();
  else if (bd.space_dimension() > 0) {

    set_strongly_closed();
    refine_with_constraints(bd.constraints());
  }
}

template <typename T>
inline Congruence_System
Octagonal_Shape<T>::congruences() const {
  return minimized_congruences();
}

template <typename T>
inline Octagonal_Shape<T>&
Octagonal_Shape<T>::operator=(const Octagonal_Shape& y) {
  matrix = y.matrix;
  space_dim = y.space_dim;
  status = y.status;
  return *this;
}

template <typename T>
inline
Octagonal_Shape<T>::~Octagonal_Shape() {
}

template <typename T>
inline void
Octagonal_Shape<T>::m_swap(Octagonal_Shape& y) {
  using std::swap;
  swap(matrix, y.matrix);
  swap(space_dim, y.space_dim);
  swap(status, y.status);
}

template <typename T>
inline dimension_type
Octagonal_Shape<T>::space_dimension() const {
  return space_dim;
}

template <typename T>
inline bool
Octagonal_Shape<T>::is_discrete() const {
  return affine_dimension() == 0;
}

template <typename T>
inline bool
Octagonal_Shape<T>::is_empty() const {
  strong_closure_assign();
  return marked_empty();
}

template <typename T>
inline bool
Octagonal_Shape<T>::bounds_from_above(const Linear_Expression& expr) const {
  return bounds(expr, true);
}

template <typename T>
inline bool
Octagonal_Shape<T>::bounds_from_below(const Linear_Expression& expr) const {
  return bounds(expr, false);
}

template <typename T>
inline bool
Octagonal_Shape<T>::maximize(const Linear_Expression& expr,
                             Coefficient& sup_n, Coefficient& sup_d,
                             bool& maximum) const {
  return max_min(expr, true, sup_n, sup_d, maximum);
}

template <typename T>
inline bool
Octagonal_Shape<T>::maximize(const Linear_Expression& expr,
                             Coefficient& sup_n, Coefficient& sup_d,
                             bool& maximum,
                             Generator& g) const {
  return max_min(expr, true, sup_n, sup_d, maximum, g);
}

template <typename T>
inline bool
Octagonal_Shape<T>::minimize(const Linear_Expression& expr,
                             Coefficient& inf_n, Coefficient& inf_d,
                             bool& minimum) const {
  return max_min(expr, false, inf_n, inf_d, minimum);
}

template <typename T>
inline bool
Octagonal_Shape<T>::minimize(const Linear_Expression& expr,
                             Coefficient& inf_n, Coefficient& inf_d,
                             bool& minimum,
                             Generator& g) const {
  return max_min(expr, false, inf_n, inf_d, minimum, g);
}

template <typename T>
inline bool
Octagonal_Shape<T>::is_topologically_closed() const {
  return true;
}

template <typename T>
inline void
Octagonal_Shape<T>::topological_closure_assign() {
}


template <typename T>
inline bool
operator==(const Octagonal_Shape<T>& x, const Octagonal_Shape<T>& y) {
  if (x.space_dim != y.space_dim)

    return false;


  if (x.space_dim == 0) {
    if (x.marked_empty())
      return y.marked_empty();
    else
      return !y.marked_empty();
  }

  x.strong_closure_assign();
  y.strong_closure_assign();


  if (x.marked_empty())
    return y.marked_empty();
  if (y.marked_empty())
    return false;

  return x.matrix == y.matrix;
}


template <typename T>
inline bool
operator!=(const Octagonal_Shape<T>& x, const Octagonal_Shape<T>& y) {
  return !(x == y);
}

template <typename T>
inline const typename Octagonal_Shape<T>::coefficient_type&
Octagonal_Shape<T>::matrix_at(const dimension_type i,
                              const dimension_type j) const {
  ((void) 0);
  using namespace Implementation::Octagonal_Shapes;
  return (j < matrix.row_size(i))
    ? matrix[i][j]
    : matrix[coherent_index(j)][coherent_index(i)];
}

template <typename T>
inline typename Octagonal_Shape<T>::coefficient_type&
Octagonal_Shape<T>::matrix_at(const dimension_type i,
                              const dimension_type j) {
  ((void) 0);
  using namespace Implementation::Octagonal_Shapes;
  return (j < matrix.row_size(i))
    ? matrix[i][j]
    : matrix[coherent_index(j)][coherent_index(i)];
}

template <typename T>
inline Constraint_System
Octagonal_Shape<T>::minimized_constraints() const {
  strong_reduction_assign();
  return constraints();
}

template <typename T>
inline void
Octagonal_Shape<T>::add_octagonal_constraint(const dimension_type i,
                                             const dimension_type j,
                                             const N& k) {






  N& r_i_j = matrix[i][j];
  if (r_i_j > k) {
    r_i_j = k;
    if (marked_strongly_closed())
      reset_strongly_closed();
  }
}

template <typename T>
inline void
Octagonal_Shape<T>
::add_octagonal_constraint(const dimension_type i,
                           const dimension_type j,
                           Coefficient_traits::const_reference numer,
                           Coefficient_traits::const_reference denom) {







  Parma_Polyhedra_Library::Dirty_Temp<N> holder_k; N& k = holder_k.item();
  div_round_up(k, numer, denom);
  add_octagonal_constraint(i, j, k);
}

template <typename T>
inline void
Octagonal_Shape<T>::add_constraints(const Constraint_System& cs) {
  for (Constraint_System::const_iterator i = cs.begin(),
         i_end = cs.end(); i != i_end; ++i)
    add_constraint(*i);
}

template <typename T>
inline void
Octagonal_Shape<T>::add_recycled_constraints(Constraint_System& cs) {
  add_constraints(cs);
}

template <typename T>
inline void
Octagonal_Shape<T>::add_recycled_congruences(Congruence_System& cgs) {
  add_congruences(cgs);
}

template <typename T>
inline void
Octagonal_Shape<T>::add_congruences(const Congruence_System& cgs) {
  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); i != cgs_end; ++i)
    add_congruence(*i);
}

template <typename T>
inline void
Octagonal_Shape<T>::refine_with_constraint(const Constraint& c) {

  if (c.space_dimension() > space_dimension())
    throw_dimension_incompatible("refine_with_constraint(c)", c);

  if (!marked_empty())
    refine_no_check(c);
}

template <typename T>
inline void
Octagonal_Shape<T>::refine_with_constraints(const Constraint_System& cs) {

  if (cs.space_dimension() > space_dimension())
    throw_invalid_argument("refine_with_constraints(cs)",
                           "cs and *this are space-dimension incompatible");

  for (Constraint_System::const_iterator i = cs.begin(),
         cs_end = cs.end(); !marked_empty() && i != cs_end; ++i)
    refine_no_check(*i);
}

template <typename T>
inline void
Octagonal_Shape<T>::refine_with_congruence(const Congruence& cg) {
  const dimension_type cg_space_dim = cg.space_dimension();

  if (cg_space_dim > space_dimension())
    throw_dimension_incompatible("refine_with_congruence(cg)", cg);

  if (!marked_empty())
    refine_no_check(cg);
}

template <typename T>
void
Octagonal_Shape<T>::refine_with_congruences(const Congruence_System& cgs) {

  if (cgs.space_dimension() > space_dimension())
    throw_invalid_argument("refine_with_congruences(cgs)",
                           "cgs and *this are space-dimension incompatible");

  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i)
    refine_no_check(*i);
}

template <typename T>
inline void
Octagonal_Shape<T>::refine_no_check(const Congruence& cg) {
  ((void) 0);
  ((void) 0);

  if (cg.is_proper_congruence()) {
    if (cg.is_inconsistent())
      set_empty();

    return;
  }

  ((void) 0);
  Constraint c(cg);
  refine_no_check(c);
}

template <typename T>
inline bool
Octagonal_Shape<T>::can_recycle_constraint_systems() {
  return false;
}

template <typename T>
inline bool
Octagonal_Shape<T>::can_recycle_congruence_systems() {
  return false;
}

template <typename T>
inline void
Octagonal_Shape<T>
::remove_higher_space_dimensions(const dimension_type new_dimension) {

  if (new_dimension > space_dim)
    throw_dimension_incompatible("remove_higher_space_dimension(nd)",
                                 new_dimension);



  if (new_dimension == space_dim) {
    ((void) 0);
    return;
  }

  strong_closure_assign();
  matrix.shrink(new_dimension);


  if (new_dimension == 0 && !marked_empty())
    set_zero_dim_univ();
  space_dim = new_dimension;
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::wrap_assign(const Variables_Set& vars,
                                Bounded_Integer_Type_Width w,
                                Bounded_Integer_Type_Representation r,
                                Bounded_Integer_Type_Overflow o,
                                const Constraint_System* cs_p,
                                unsigned complexity_threshold,
                                bool wrap_individually) {
  Implementation::wrap_assign(*this,
                              vars, w, r, o, cs_p,
                              complexity_threshold, wrap_individually,
                              "Octagonal_Shape");
}

template <typename T>
inline void
Octagonal_Shape<T>::widening_assign(const Octagonal_Shape& y, unsigned* tp) {
  BHMZ05_widening_assign(y, tp);
}

template <typename T>
inline void
Octagonal_Shape<T>::CC76_extrapolation_assign(const Octagonal_Shape& y,
                                              unsigned* tp) {
  static N stop_points[] = {
    N(-2, ROUND_UP),
    N(-1, ROUND_UP),
    N( 0, ROUND_UP),
    N( 1, ROUND_UP),
    N( 2, ROUND_UP)
  };
  CC76_extrapolation_assign(y,
                            stop_points,
                            stop_points
                            + sizeof(stop_points)/sizeof(stop_points[0]),
                            tp);
}

template <typename T>
inline void
Octagonal_Shape<T>::time_elapse_assign(const Octagonal_Shape& y) {

  if (space_dimension() != y.space_dimension())
    throw_dimension_incompatible("time_elapse_assign(y)", y);


  C_Polyhedron ph_x(constraints());
  C_Polyhedron ph_y(y.constraints());
  ph_x.time_elapse_assign(ph_y);
  Octagonal_Shape<T> x(ph_x);
  m_swap(x);
  ((void) 0);
}

template <typename T>
inline bool
Octagonal_Shape<T>::strictly_contains(const Octagonal_Shape& y) const {
  const Octagonal_Shape<T>& x = *this;
  return x.contains(y) && !y.contains(x);
}

template <typename T>
template <typename Interval_Info>
inline void
Octagonal_Shape<T>::generalized_refine_with_linear_form_inequality(
                    const Linear_Form< Interval<T, Interval_Info> >& left,
                    const Linear_Form< Interval<T, Interval_Info> >& right,
                    const Relation_Symbol relsym) {
  switch (relsym) {
  case EQUAL:

    refine_with_linear_form_inequality(left, right);
    refine_with_linear_form_inequality(right, left);
    break;
  case LESS_THAN:
  case LESS_OR_EQUAL:
    refine_with_linear_form_inequality(left, right);
    break;
  case GREATER_THAN:
  case GREATER_OR_EQUAL:
    refine_with_linear_form_inequality(right, left);
    break;
  case NOT_EQUAL:
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
}

template <typename T>
template <typename Interval_Info>
inline void
Octagonal_Shape<T>::
refine_fp_interval_abstract_store(
          Box< Interval<T, Interval_Info> >& store) const {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_656 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };



  typedef Interval<T, Interval_Info> FP_Interval_Type;
  store.intersection_assign(Box<FP_Interval_Type>(*this));

}


template <typename Temp, typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Octagonal_Shape<T>& x,
                            const Octagonal_Shape<T>& y,
                            const Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2) {

  if (x.space_dim != y.space_dim)
    return false;


  if (x.space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  x.strong_closure_assign();
  y.strong_closure_assign();



  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }

  return rectilinear_distance_assign(r, x.matrix, y.matrix, dir,
                                     tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Octagonal_Shape<T>& x,
                            const Octagonal_Shape<T>& y,
                            const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return rectilinear_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const Octagonal_Shape<T>& x,
                            const Octagonal_Shape<T>& y,
                            const Rounding_Dir dir) {
  return rectilinear_distance_assign<To, To, T>(r, x, y, dir);
}


template <typename Temp, typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Octagonal_Shape<T>& x,
                          const Octagonal_Shape<T>& y,
                          const Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2) {

  if (x.space_dim != y.space_dim)
    return false;


  if (x.space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  x.strong_closure_assign();
  y.strong_closure_assign();



  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }

  return euclidean_distance_assign(r, x.matrix, y.matrix, dir,
                                   tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Octagonal_Shape<T>& x,
                          const Octagonal_Shape<T>& y,
                          const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return euclidean_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const Octagonal_Shape<T>& x,
                          const Octagonal_Shape<T>& y,
                          const Rounding_Dir dir) {
  return euclidean_distance_assign<To, To, T>(r, x, y, dir);
}


template <typename Temp, typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Octagonal_Shape<T>& x,
                           const Octagonal_Shape<T>& y,
                           const Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2) {

  if (x.space_dim != y.space_dim)
    return false;


  if (x.space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  x.strong_closure_assign();
  y.strong_closure_assign();



  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }

  return l_infinity_distance_assign(r, x.matrix, y.matrix, dir,
                                    tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Octagonal_Shape<T>& x,
                           const Octagonal_Shape<T>& y,
                           const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return l_infinity_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const Octagonal_Shape<T>& x,
                           const Octagonal_Shape<T>& y,
                           const Rounding_Dir dir) {
  return l_infinity_distance_assign<To, To, T>(r, x, y, dir);
}

template <typename T>
inline memory_size_type
Octagonal_Shape<T>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename T>
inline int32_t
Octagonal_Shape<T>::hash_code() const {
  return hash_code_from_dimension(space_dimension());
}

template <typename T>
inline void
Octagonal_Shape<T>::drop_some_non_integer_points_helper(N& elem) {
  if (!is_integer(elem)) {



    floor_assign_r(elem, elem, ROUND_DOWN);
    ((void) 0);
    reset_strongly_closed();
  }
}


template <typename T>
inline void
swap(Octagonal_Shape<T>& x, Octagonal_Shape<T>& y) {
  x.m_swap(y);
}

}
# 2322 "Octagonal_Shape_defs.hh" 2
# 1 "Octagonal_Shape_templates.hh" 1
# 43 "Octagonal_Shape_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
Octagonal_Shape<T>::Octagonal_Shape(const Polyhedron& ph,
                                    const Complexity_Class complexity)
  : matrix(0), space_dim(0), status() {
  const dimension_type num_dimensions = ph.space_dimension();

  if (ph.marked_empty()) {
    *this = Octagonal_Shape(num_dimensions, EMPTY);
    return;
  }

  if (num_dimensions == 0) {
    *this = Octagonal_Shape(num_dimensions, UNIVERSE);
    return;
  }



  if (complexity == ANY_COMPLEXITY
      || (!ph.has_pending_constraints() && ph.generators_are_up_to_date())) {
    *this = Octagonal_Shape(ph.generators());
    return;
  }




  ((void) 0);

  if (!ph.has_something_pending() && ph.constraints_are_minimized()) {


    if (ph.is_universe()) {
      *this = Octagonal_Shape(num_dimensions, UNIVERSE);
      return;
    }
  }


  for (Constraint_System::const_iterator i = ph.con_sys.begin(),
         cs_end = ph.con_sys.end(); i != cs_end; ++i)
    if (i->is_inconsistent()) {
      *this = Octagonal_Shape(num_dimensions, EMPTY);
      return;
    }



  if (complexity == SIMPLEX_COMPLEXITY) {
    MIP_Problem lp(num_dimensions);
    lp.set_optimization_mode(MAXIMIZATION);

    const Constraint_System& ph_cs = ph.constraints();
    if (!ph_cs.has_strict_inequalities())
      lp.add_constraints(ph_cs);
    else

      for (Constraint_System::const_iterator i = ph_cs.begin(),
             ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) {
        const Constraint& c = *i;
        if (c.is_strict_inequality()) {
          Linear_Expression expr(c.expression());
          lp.add_constraint(expr >= 0);
        }
        else
          lp.add_constraint(c);
      }


    if (!lp.is_satisfiable()) {
      *this = Octagonal_Shape<T>(num_dimensions, EMPTY);
      return;
    }


    *this = Octagonal_Shape<T>(num_dimensions, UNIVERSE);

    Generator g(point());
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
    for (dimension_type i = 0; i < num_dimensions; ++i) {
      Variable x(i);

      lp.set_objective_function(x);
      if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
        g = lp.optimizing_point();
        lp.evaluate_objective_function(g, numer, denom);
        numer *= 2;
        div_round_up(matrix[2*i + 1][2*i], numer, denom);
      }

      for (dimension_type j = 0; j < i; ++j) {
        Variable y(j);
        lp.set_objective_function(x + y);
        if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
          g = lp.optimizing_point();
          lp.evaluate_objective_function(g, numer, denom);
          div_round_up(matrix[2*i + 1][2*j], numer, denom);
        }
      }

      for (dimension_type j = 0; j < num_dimensions; ++j) {
        if (i == j)
          continue;
        Variable y(j);
        lp.set_objective_function(x - y);
        if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
          g = lp.optimizing_point();
          lp.evaluate_objective_function(g, numer, denom);
          div_round_up(((i < j) ?
                        matrix[2*j][2*i]
                        : matrix[2*i + 1][2*j + 1]),
                       numer, denom);
        }
      }

      for (dimension_type j = 0; j < num_dimensions; ++j) {
        if (i == j)
          continue;
        Variable y(j);
        lp.set_objective_function(x - y);
        if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
          g = lp.optimizing_point();
          lp.evaluate_objective_function(g, numer, denom);
          div_round_up(((i < j)
                        ? matrix[2*j][2*i]
                        : matrix[2*i + 1][2*j + 1]),
                       numer, denom);
        }
      }

      for (dimension_type j = 0; j < i; ++j) {
        Variable y(j);
        lp.set_objective_function(-x - y);
        if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
          g = lp.optimizing_point();
          lp.evaluate_objective_function(g, numer, denom);
          div_round_up(matrix[2*i][2*j + 1], numer, denom);
        }
      }

      lp.set_objective_function(-x);
      if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
        g = lp.optimizing_point();
        lp.evaluate_objective_function(g, numer, denom);
        numer *= 2;
        div_round_up(matrix[2*i][2*i + 1], numer, denom);
      }
    }
    set_strongly_closed();
    ((void) 0);
    return;
  }


  ((void) 0);
  *this = Octagonal_Shape(num_dimensions, UNIVERSE);
  refine_with_constraints(ph.constraints());
}

template <typename T>
Octagonal_Shape<T>::Octagonal_Shape(const Generator_System& gs)
  : matrix(gs.space_dimension()),
    space_dim(gs.space_dimension()),
    status() {
  const Generator_System::const_iterator gs_begin = gs.begin();
  const Generator_System::const_iterator gs_end = gs.end();
  if (gs_begin == gs_end) {

    set_empty();
    return;
  }

  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typename OR_Matrix<N>::row_iterator mat_begin = matrix.row_begin();

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
  bool mat_initialized = false;
  bool point_seen = false;

  for (Generator_System::const_iterator k = gs_begin; k != gs_end; ++k) {
    const Generator& g = *k;
    switch (g.type()) {
    case Generator::POINT:
      point_seen = true;

    case Generator::CLOSURE_POINT:
      if (!mat_initialized) {

        mat_initialized = true;
        const Coefficient& d = g.divisor();



        for (dimension_type i = 0; i < space_dim; ++i) {
          const Coefficient& g_i = g.coefficient(Variable(i));
          const dimension_type di = 2*i;
          row_reference x_i = *(mat_begin + di);
          row_reference x_ii = *(mat_begin + (di + 1));
          for (dimension_type j = 0; j < i; ++j) {
            const Coefficient& g_j = g.coefficient(Variable(j));
            const dimension_type dj = 2*j;




            div_round_up(x_i[dj], g_j - g_i, d);
            div_round_up(x_ii[dj + 1], g_i - g_j, d);

            div_round_up(x_i[dj + 1], -g_j - g_i, d);
            div_round_up(x_ii[dj], g_i + g_j, d);
          }

          div_round_up(x_i[di + 1], -g_i - g_i, d);
          div_round_up(x_ii[di], g_i + g_i, d);
        }
      }
      else {


        const Coefficient& d = g.divisor();



        for (dimension_type i = 0; i < space_dim; ++i) {
          const Coefficient& g_i = g.coefficient(Variable(i));
          const dimension_type di = 2*i;
          row_reference x_i = *(mat_begin + di);
          row_reference x_ii = *(mat_begin + (di + 1));
          for (dimension_type j = 0; j < i; ++j) {
            const Coefficient& g_j = g.coefficient(Variable(j));
            const dimension_type dj = 2*j;




            div_round_up(tmp, g_j - g_i, d);
            max_assign(x_i[dj], tmp);
            div_round_up(tmp, g_i - g_j, d);
            max_assign(x_ii[dj + 1], tmp);

            div_round_up(tmp, -g_j - g_i, d);
            max_assign(x_i[dj + 1], tmp);
            div_round_up(tmp, g_i + g_j, d);
            max_assign(x_ii[dj], tmp);
          }

          div_round_up(tmp, -g_i - g_i, d);
          max_assign(x_i[di + 1], tmp);
          div_round_up(tmp, g_i + g_i, d);
          max_assign(x_ii[di], tmp);
        }
      }
      break;
    default:

      break;
    }
  }

  if (!point_seen)

    throw_invalid_argument("Octagonal_Shape(gs)",
                           "the non-empty generator system gs "
                           "contains no points.");


  for (Generator_System::const_iterator k = gs_begin; k != gs_end; ++k) {
    const Generator& g = *k;
    switch (g.type()) {
    case Generator::LINE:



        for (dimension_type i = 0; i < space_dim; ++i) {
          const Coefficient& g_i = g.coefficient(Variable(i));
          const dimension_type di = 2*i;
          row_reference x_i = *(mat_begin + di);
          row_reference x_ii = *(mat_begin + (di + 1));
          for (dimension_type j = 0; j < i; ++j) {
            const Coefficient& g_j = g.coefficient(Variable(j));
            const dimension_type dj = 2*j;

            if (g_i != g_j) {

              assign_r(x_i[dj], PLUS_INFINITY, ROUND_NOT_NEEDED);
              assign_r(x_ii[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
            }
            if (g_i != -g_j) {

              assign_r(x_i[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
              assign_r(x_ii[dj], PLUS_INFINITY, ROUND_NOT_NEEDED);
            }
          }
          if (g_i != 0) {

            assign_r(x_i[di + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
            assign_r(x_ii[di], PLUS_INFINITY, ROUND_NOT_NEEDED);
          }
        }
      break;
    case Generator::RAY:



        for (dimension_type i = 0; i < space_dim; ++i) {
          const Coefficient& g_i = g.coefficient(Variable(i));
          const dimension_type di = 2*i;
          row_reference x_i = *(mat_begin + di);
          row_reference x_ii = *(mat_begin + (di + 1));
          for (dimension_type j = 0; j < i; ++j) {
            const Coefficient& g_j = g.coefficient(Variable(j));
            const dimension_type dj = 2*j;


            if (g_i < g_j)

              assign_r(x_i[dj], PLUS_INFINITY, ROUND_NOT_NEEDED);
            if (g_i > g_j)

              assign_r(x_ii[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
            if (g_i < -g_j)

              assign_r(x_i[dj + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
            if (g_i > -g_j)

              assign_r(x_ii[dj], PLUS_INFINITY, ROUND_NOT_NEEDED);
          }

          if (g_i < 0)

            assign_r(x_i[di + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
          if (g_i > 0)

            assign_r(x_ii[di], PLUS_INFINITY, ROUND_NOT_NEEDED);
        }
      break;
    default:

      break;
    }
  }
  set_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::add_constraint(const Constraint& c) {
  const dimension_type c_space_dim = c.space_dimension();

  if (c_space_dim > space_dim)
    throw_dimension_incompatible("add_constraint(c)", c);


  if (c.is_strict_inequality()) {
    if (c.is_inconsistent()) {
      set_empty();
      return;
    }
    if (c.is_tautological())
      return;

    throw_invalid_argument("add_constraint(c)",
                           "strict inequalities are not allowed");
  }

  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_term; Parma_Polyhedra_Library::Coefficient& term = holder_term.item();

  if (!Octagonal_Shape_Helper
    ::extract_octagonal_difference(c, c_space_dim, num_vars,
                                   i, j, coeff, term))
    throw_invalid_argument("add_constraint(c)",
                           "c is not an octagonal constraint");

  if (num_vars == 0) {

    if (c.inhomogeneous_term() < 0
        || (c.is_equality() && c.inhomogeneous_term() != 0))
      set_empty();
    return;
  }


  typename OR_Matrix<N>::row_iterator i_iter = matrix.row_begin() + i;
  typename OR_Matrix<N>::row_reference_type m_i = *i_iter;
  N& m_i_j = m_i[j];

  if (coeff < 0)
    neg_assign(coeff);

  bool is_oct_changed = false;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
  div_round_up(d, term, coeff);
  if (m_i_j > d) {
    m_i_j = d;
    is_oct_changed = true;
  }

  if (c.is_equality()) {

    if (i % 2 == 0)
      ++i_iter;
    else
      --i_iter;

    typename OR_Matrix<N>::row_reference_type m_ci = *i_iter;
    using namespace Implementation::Octagonal_Shapes;
    dimension_type cj = coherent_index(j);
    N& m_ci_cj = m_ci[cj];

    neg_assign(term);
    div_round_up(d, term, coeff);
    if (m_ci_cj > d) {
      m_ci_cj = d;
      is_oct_changed = true;
    }
  }


  if (is_oct_changed && marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::add_congruence(const Congruence& cg) {
  const dimension_type cg_space_dim = cg.space_dimension();


  if (space_dimension() < cg_space_dim)
    throw_dimension_incompatible("add_congruence(cg)", cg);


  if (cg.is_proper_congruence()) {
    if (cg.is_tautological())
      return;
    if (cg.is_inconsistent()) {
      set_empty();
      return;
    }

    throw_invalid_argument("add_congruence(cg)",
                           "cg is a non-trivial, proper congruence");
  }

  ((void) 0);
  Constraint c(cg);
  add_constraint(c);
}

template <typename T>
template <typename Interval_Info>
void
Octagonal_Shape<T>::refine_with_linear_form_inequality(
                    const Linear_Form< Interval<T, Interval_Info> >& left,
                    const Linear_Form< Interval<T, Interval_Info> >& right) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_512 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };




  ((void) 0);




  const dimension_type left_space_dim = left.space_dimension();
  if (space_dim < left_space_dim)
    throw_dimension_incompatible(
          "refine_with_linear_form_inequality(left, right)", "left", left);

  const dimension_type right_space_dim = right.space_dimension();
  if (space_dim < right_space_dim)
    throw_dimension_incompatible(
          "refine_with_linear_form_inequality(left, right)", "right", right);



  dimension_type left_t = 0;

  dimension_type left_w_id = 0;


  dimension_type right_t = 0;

  dimension_type right_w_id = 0;


  for (dimension_type i = left_space_dim; i-- > 0; )
    if (left.coefficient(Variable(i)) != 0) {
      if (left_t++ == 1)
        break;
      else
        left_w_id = i;
    }


  for (dimension_type i = right_space_dim; i-- > 0; )
    if (right.coefficient(Variable(i)) != 0) {
      if (right_t++ == 1)
        break;
      else
        right_w_id = i;
    }

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;
  typedef Interval<T, Interval_Info> FP_Interval_Type;




  if (left_t == 0) {
    if (right_t == 0) {


      ((void) 0);
      return;
    }

    if (right_t == 1) {


      const FP_Interval_Type& right_w_coeff =
                              right.coefficient(Variable(right_w_id));
      if (right_w_coeff == 1) {
        const dimension_type n_right = right_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_plus_minus_a_minus; N& b_plus_minus_a_minus = holder_b_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_b = right.inhomogeneous_term();
        sub_assign_r(b_plus_minus_a_minus, right_b.upper(), left_a.lower(),
                     ROUND_UP);
        mul_2exp_assign_r(b_plus_minus_a_minus, b_plus_minus_a_minus, 1,
                          ROUND_UP);
        add_octagonal_constraint(n_right, n_right + 1, b_plus_minus_a_minus);
        ((void) 0);
        return;
      }

      if (right_w_coeff == -1) {
        const dimension_type n_right = right_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_plus_minus_a_minus; N& b_plus_minus_a_minus = holder_b_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_b = right.inhomogeneous_term();
        sub_assign_r(b_plus_minus_a_minus, right_b.upper(), left_a.lower(),
                     ROUND_UP);
        mul_2exp_assign_r(b_plus_minus_a_minus, b_plus_minus_a_minus, 1,
                          ROUND_UP);
        add_octagonal_constraint(n_right + 1, n_right, b_plus_minus_a_minus);
        ((void) 0);
        return;
      }
    }
  }
  else if (left_t == 1) {
    if (right_t == 0) {


      const FP_Interval_Type& left_w_coeff =
                              left.coefficient(Variable(left_w_id));
      if (left_w_coeff == 1) {
        const dimension_type n_left = left_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
        const FP_Interval_Type& left_b = left.inhomogeneous_term();
        const FP_Interval_Type& right_a = right.inhomogeneous_term();
        sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                     ROUND_UP);
        mul_2exp_assign_r(a_plus_minus_b_minus, a_plus_minus_b_minus, 1,
                          ROUND_UP);
        add_octagonal_constraint(n_left + 1, n_left, a_plus_minus_b_minus);
        ((void) 0);
        return;
      }

      if (left_w_coeff == -1) {
        const dimension_type n_left = left_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
        const FP_Interval_Type& left_b = left.inhomogeneous_term();
        const FP_Interval_Type& right_a = right.inhomogeneous_term();
        sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                     ROUND_UP);
        mul_2exp_assign_r(a_plus_minus_b_minus, a_plus_minus_b_minus, 1,
                          ROUND_UP);
        add_octagonal_constraint(n_left, n_left + 1, a_plus_minus_b_minus);
        ((void) 0);
        return;
      }
    }

    if (right_t == 1) {




      const FP_Interval_Type& left_w_coeff =
                              left.coefficient(Variable(left_w_id));
      const FP_Interval_Type& right_w_coeff =
                              right.coefficient(Variable(right_w_id));
      bool is_left_coeff_one = (left_w_coeff == 1);
      bool is_left_coeff_minus_one = (left_w_coeff == -1);
      bool is_right_coeff_one = (right_w_coeff == 1);
      bool is_right_coeff_minus_one = (right_w_coeff == -1);
      if (left_w_id == right_w_id) {
        if ((is_left_coeff_one && is_right_coeff_one)
            || (is_left_coeff_minus_one && is_right_coeff_minus_one)) {

          ((void) 0);
          return;
        }
        if (is_left_coeff_one && is_right_coeff_minus_one) {


          const dimension_type n_left = left_w_id * 2;
          Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
          const FP_Interval_Type& left_b = left.inhomogeneous_term();
          const FP_Interval_Type& right_a = right.inhomogeneous_term();
          sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                       ROUND_UP);
          add_octagonal_constraint(n_left + 1, n_left, a_plus_minus_b_minus);
          ((void) 0);
          return;
        }
        if (is_left_coeff_minus_one && is_right_coeff_one) {


          const dimension_type n_left = left_w_id * 2;
          Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
          const FP_Interval_Type& left_b = left.inhomogeneous_term();
          const FP_Interval_Type& right_a = right.inhomogeneous_term();
          sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                       ROUND_UP);
          add_octagonal_constraint(n_left, n_left + 1, a_plus_minus_b_minus);
          ((void) 0);
          return;
        }
      }
      else if (is_left_coeff_one && is_right_coeff_one) {
        const dimension_type n_left = left_w_id * 2;
        const dimension_type n_right = right_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_c_plus_minus_a_minus; N& c_plus_minus_a_minus = holder_c_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_c = right.inhomogeneous_term();
        sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(),
                     ROUND_UP);
        if (left_w_id < right_w_id)
          add_octagonal_constraint(n_right, n_left, c_plus_minus_a_minus);
        else
          add_octagonal_constraint(n_left + 1, n_right + 1,
                                   c_plus_minus_a_minus);
        ((void) 0);
        return;
      }
      if (is_left_coeff_one && is_right_coeff_minus_one) {
        const dimension_type n_left = left_w_id * 2;
        const dimension_type n_right = right_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_c_plus_minus_a_minus; N& c_plus_minus_a_minus = holder_c_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_c = right.inhomogeneous_term();
        sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(),
                     ROUND_UP);
        if (left_w_id < right_w_id)
          add_octagonal_constraint(n_right + 1, n_left, c_plus_minus_a_minus);
        else
          add_octagonal_constraint(n_left + 1, n_right, c_plus_minus_a_minus);
        ((void) 0);
        return;
      }
      if (is_left_coeff_minus_one && is_right_coeff_one) {
        const dimension_type n_left = left_w_id * 2;
        const dimension_type n_right = right_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_c_plus_minus_a_minus; N& c_plus_minus_a_minus = holder_c_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_c = right.inhomogeneous_term();
        sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(),
                     ROUND_UP);
        if (left_w_id < right_w_id)
          add_octagonal_constraint(n_right, n_left + 1, c_plus_minus_a_minus);
        else
          add_octagonal_constraint(n_left, n_right + 1, c_plus_minus_a_minus);
        ((void) 0);
        return;
      }
      if (is_left_coeff_minus_one && is_right_coeff_minus_one) {
        const dimension_type n_left = left_w_id * 2;
        const dimension_type n_right = right_w_id * 2;
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_c_plus_minus_a_minus; N& c_plus_minus_a_minus = holder_c_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_c = right.inhomogeneous_term();
        sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(),
                     ROUND_UP);
        if (left_w_id < right_w_id)
          add_octagonal_constraint(n_right + 1, n_left + 1,
                                   c_plus_minus_a_minus);
        else
          add_octagonal_constraint(n_left, n_right, c_plus_minus_a_minus);
        ((void) 0);
        return;
      }
    }
  }







  Parma_Polyhedra_Library::Dirty_Temp<N> holder_low_coeff; N& low_coeff = holder_low_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_high_coeff; N& high_coeff = holder_high_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_upper_bound; N& upper_bound = holder_upper_bound.item();

  Linear_Form<FP_Interval_Type> right_minus_left(right);
  right_minus_left -= left;

  dimension_type max_w_id = std::max(left_w_id, right_w_id);
  for (dimension_type first_v = 0; first_v < max_w_id; ++first_v) {
    for (dimension_type second_v = first_v + 1;
         second_v <= max_w_id; ++second_v) {
      const FP_Interval_Type& lfv_coefficient =
                        left.coefficient(Variable(first_v));
      const FP_Interval_Type& lsv_coefficient =
                        left.coefficient(Variable(second_v));
      const FP_Interval_Type& rfv_coefficient =
                        right.coefficient(Variable(first_v));
      const FP_Interval_Type& rsv_coefficient =
                        right.coefficient(Variable(second_v));


      bool do_update = false;
      assign_r(low_coeff, lfv_coefficient.lower(), ROUND_NOT_NEEDED);
      assign_r(high_coeff, lfv_coefficient.upper(), ROUND_NOT_NEEDED);
      if (low_coeff != 0 || high_coeff != 0) {
        assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED);
        assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED);
        if (low_coeff != 0 || high_coeff != 0)
          do_update = true;
        else {
          assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED);
          assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED);
          if (low_coeff != 0 || high_coeff != 0)
            do_update = true;
        }
      }
      else {
        assign_r(low_coeff, rfv_coefficient.lower(), ROUND_NOT_NEEDED);
        assign_r(high_coeff, rfv_coefficient.upper(), ROUND_NOT_NEEDED);
        if (low_coeff != 0 || high_coeff != 0) {
          assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED);
          assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED);
          if (low_coeff != 0 || high_coeff != 0)
            do_update = true;
          else {
            assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED);
            assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED);
            if (low_coeff != 0 || high_coeff != 0)
              do_update = true;
          }
        }
      }

      if (do_update) {
        Variable first(first_v);
        Variable second(second_v);
        dimension_type n_first_var = first_v * 2;
        dimension_type n_second_var = second_v * 2;
        linear_form_upper_bound(right_minus_left - first + second,
                                upper_bound);
        add_octagonal_constraint(n_second_var + 1, n_first_var + 1,
                                 upper_bound);
        linear_form_upper_bound(right_minus_left + first + second,
                                upper_bound);
        add_octagonal_constraint(n_second_var + 1, n_first_var, upper_bound);
        linear_form_upper_bound(right_minus_left - first - second,
                                upper_bound);
        add_octagonal_constraint(n_second_var, n_first_var + 1, upper_bound);
        linear_form_upper_bound(right_minus_left + first - second,
                                upper_bound);
        add_octagonal_constraint(n_second_var, n_first_var, upper_bound);
      }
    }
  }


  for (dimension_type v = 0; v <= max_w_id; ++v) {
    const FP_Interval_Type& lv_coefficient =
                        left.coefficient(Variable(v));
    const FP_Interval_Type& rv_coefficient =
                        right.coefficient(Variable(v));


    bool do_update = false;
    assign_r(low_coeff, lv_coefficient.lower(), ROUND_NOT_NEEDED);
    assign_r(high_coeff, lv_coefficient.upper(), ROUND_NOT_NEEDED);
    if (low_coeff != 0 || high_coeff != 0)
      do_update = true;
    else {
      assign_r(low_coeff, rv_coefficient.lower(), ROUND_NOT_NEEDED);
      assign_r(high_coeff, rv_coefficient.upper(), ROUND_NOT_NEEDED);
      if (low_coeff != 0 || high_coeff != 0)
        do_update = true;
    }

    if (do_update) {
      Variable var(v);
      dimension_type n_var = 2 * v;





      linear_form_upper_bound(right_minus_left + var, upper_bound);
      mul_2exp_assign_r(matrix[n_var + 1][n_var + 1], upper_bound, 1,
                        ROUND_UP);
      linear_form_upper_bound(right_minus_left - var, upper_bound);
      mul_2exp_assign_r(matrix[n_var][n_var], upper_bound, 1,
                        ROUND_UP);
    }
  }





  row_iterator m_ite = matrix.row_begin();
  row_iterator m_end = matrix.row_end();
  for (dimension_type i = 0; m_ite != m_end; i += 2) {
    row_reference upper = *m_ite;
    N& ul = upper[i];
    add_octagonal_constraint(i, i + 1, ul);
    assign_r(ul, PLUS_INFINITY, ROUND_NOT_NEEDED);
    ++m_ite;
    row_reference lower = *m_ite;
    N& lr = lower[i + 1];
    add_octagonal_constraint(i + 1, i, lr);
    assign_r(lr, PLUS_INFINITY, ROUND_NOT_NEEDED);
    ++m_ite;
  }
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::refine_no_check(const Constraint& c) {
  ((void) 0);
  const dimension_type c_space_dim = c.space_dimension();
  ((void) 0);

  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_term; Parma_Polyhedra_Library::Coefficient& term = holder_term.item();

  if (!Octagonal_Shape_Helper
    ::extract_octagonal_difference(c, c_space_dim, num_vars,
                                   i, j, coeff, term))
    return;

  if (num_vars == 0) {
    const Coefficient& c_inhomo = c.inhomogeneous_term();

    if (c_inhomo < 0
        || (c_inhomo != 0 && c.is_equality())
        || (c_inhomo == 0 && c.is_strict_inequality()))
      set_empty();
    return;
  }


  typename OR_Matrix<N>::row_iterator i_iter = matrix.row_begin() + i;
  typename OR_Matrix<N>::row_reference_type m_i = *i_iter;
  N& m_i_j = m_i[j];

  if (coeff < 0)
    neg_assign(coeff);

  bool is_oct_changed = false;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
  div_round_up(d, term, coeff);
  if (m_i_j > d) {
    m_i_j = d;
    is_oct_changed = true;
  }

  if (c.is_equality()) {

    if (i % 2 == 0)
      ++i_iter;
    else
      --i_iter;

    typename OR_Matrix<N>::row_reference_type m_ci = *i_iter;
    using namespace Implementation::Octagonal_Shapes;
    dimension_type cj = coherent_index(j);
    N& m_ci_cj = m_ci[cj];

    neg_assign(term);
    div_round_up(d, term, coeff);
    if (m_ci_cj > d) {
      m_ci_cj = d;
      is_oct_changed = true;
    }
  }


  if (is_oct_changed && marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
dimension_type
Octagonal_Shape<T>::affine_dimension() const {
  const dimension_type n_rows = matrix.num_rows();

  if (n_rows == 0)
    return 0;



  strong_closure_assign();
  if (marked_empty())
    return 0;





  std::vector<dimension_type> leaders;
  compute_leaders(leaders);



  dimension_type affine_dim = 0;
  for (dimension_type i = 0; i < n_rows; i += 2)

    if (leaders[i] == i && leaders[i + 1] == i + 1)
      ++affine_dim;

  return affine_dim;
}

template <typename T>
Congruence_System
Octagonal_Shape<T>::minimized_congruences() const {


  strong_closure_assign();
  const dimension_type space_dim = space_dimension();
  Congruence_System cgs(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cgs = Congruence_System::zero_dim_empty();
    return cgs;
  }

  if (marked_empty()) {
    cgs.insert(Congruence::zero_dim_false());
    return cgs;
  }




  std::vector<dimension_type> leaders;
  compute_leaders(leaders);

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  for (dimension_type i = 0, i_end = 2*space_dim; i != i_end; i += 2) {
    const dimension_type lead_i = leaders[i];
    if (i == lead_i) {
      if (leaders[i + 1] == i)

        goto singular;
      else

        continue;
    }
    else {

      if (leaders[i + 1] == lead_i)

        goto singular;
      else

        goto non_singular;
    }

  singular:


    {
      const Variable x(i/2);
      const N& c_ii_i = matrix[i + 1][i];




      numer_denom(c_ii_i, numer, denom);
      denom *= 2;
      cgs.insert(denom*x == numer);
    }
    continue;

  non_singular:


    {
      const N& c_i_li = matrix[i][lead_i];





      const Variable x(lead_i/2);
      const Variable y(i/2);
      numer_denom(c_i_li, numer, denom);
      if (lead_i % 2 == 0)
        cgs.insert(denom*x - denom*y == numer);
      else
        cgs.insert(denom*x + denom*y + numer == 0);
    }
    continue;
  }
  return cgs;
}

template <typename T>
void
Octagonal_Shape<T>::concatenate_assign(const Octagonal_Shape& y) {


  if (y.space_dim == 0) {
    if (y.marked_empty())
      set_empty();
    return;
  }



  if (space_dim == 0 && marked_empty()) {
    add_space_dimensions_and_embed(y.space_dim);
    return;
  }



  dimension_type old_num_rows = matrix.num_rows();






  add_space_dimensions_and_embed(y.space_dim);
  typename OR_Matrix<N>::const_element_iterator
    y_it = y.matrix.element_begin();
  for (typename OR_Matrix<N>::row_iterator
         i = matrix.row_begin() + old_num_rows,
         matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) {
    typename OR_Matrix<N>::row_reference_type r = *i;
    dimension_type rs_i = i.row_size();
    for (dimension_type j = old_num_rows; j < rs_i; ++j, ++y_it)
      r[j] = *y_it;
  }


  if (marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
bool
Octagonal_Shape<T>::contains(const Octagonal_Shape& y) const {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("contains(y)", y);

  if (space_dim == 0) {




    return marked_empty() ? y.marked_empty() : true;
  }


  y.strong_closure_assign();

  if (y.marked_empty())
    return true;


  if (is_empty())
    return false;



  for (typename OR_Matrix<N>::const_element_iterator
         i = matrix.element_begin(), j = y.matrix.element_begin(),
         matrix_element_end = matrix.element_end();
       i != matrix_element_end; ++i, ++j)
    if (*i < *j)
      return false;
  return true;
}

template <typename T>
bool
Octagonal_Shape<T>::is_disjoint_from(const Octagonal_Shape& y) const {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("is_disjoint_from(y)", y);


  strong_closure_assign();
  if (marked_empty())
    return true;
  y.strong_closure_assign();
  if (y.marked_empty())
    return true;
# 1189 "Octagonal_Shape_templates.hh"
  const dimension_type n_rows = matrix.num_rows();

  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const row_iterator m_end = matrix.row_end();

  const row_iterator y_begin = y.matrix.row_begin();

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_neg_y_ci_cj; N& neg_y_ci_cj = holder_neg_y_ci_cj.item();
  for (row_iterator i_iter = m_begin; i_iter != m_end; ++i_iter) {
    using namespace Implementation::Octagonal_Shapes;
    const dimension_type i = i_iter.index();
    const dimension_type ci = coherent_index(i);
    const dimension_type rs_i = i_iter.row_size();
    row_reference m_i = *i_iter;
    for (dimension_type j = 0; j < n_rows; ++j) {
      const dimension_type cj = coherent_index(j);
      row_reference m_cj = *(m_begin + cj);
      const N& m_i_j = (j < rs_i) ? m_i[j] : m_cj[ci];
      row_reference y_ci = *(y_begin + ci);
      row_reference y_j = *(y_begin + j);
      const N& y_ci_cj = (j < rs_i) ? y_ci[cj] : y_j[i];
      neg_assign_r(neg_y_ci_cj, y_ci_cj, ROUND_UP);
      if (m_i_j < neg_y_ci_cj)
        return true;
    }
  }
  return false;
}

template <typename T>
bool
Octagonal_Shape<T>::is_universe() const {

  if (marked_empty())
    return false;



  if (space_dim == 0)
    return true;


  for (typename OR_Matrix<N>::const_element_iterator
         i = matrix.element_begin(), matrix_element_end = matrix.element_end();
       i != matrix_element_end;
       ++i)
    if (!is_plus_infinity(*i))
      return false;

  return true;
}

template <typename T>
bool
Octagonal_Shape<T>::is_bounded() const {
  strong_closure_assign();

  if (marked_empty() || space_dim == 0)
    return true;


  for (typename OR_Matrix<N>::const_row_iterator i = matrix.row_begin(),
         matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) {
    typename OR_Matrix<N>::const_row_reference_type x_i = *i;
    const dimension_type i_index = i.index();
    for (dimension_type j = i.row_size(); j-- > 0; )
      if (i_index != j)
        if (is_plus_infinity(x_i[j]))
          return false;
  }

  return true;
}

template <typename T>
bool
Octagonal_Shape<T>::contains_integer_point() const {

  if (is_empty())
    return false;
  const dimension_type space_dim = space_dimension();
  if (space_dim == 0)
    return true;



  if (std::numeric_limits<T>::is_integer)
    return !tight_coherence_would_make_empty();




  Octagonal_Shape<mpz_class> oct_z(space_dim);
  oct_z.reset_strongly_closed();

  typedef Octagonal_Shape<mpz_class>::N Z;
  bool all_integers = true;
  typename OR_Matrix<N>::const_element_iterator x_i = matrix.element_begin();
  for (typename OR_Matrix<Z>::element_iterator
         z_i = oct_z.matrix.element_begin(),
         z_end = oct_z.matrix.element_end(); z_i != z_end; ++z_i, ++x_i) {
    const N& d = *x_i;
    if (is_plus_infinity(d))
      continue;
    if (is_integer(d))
      assign_r(*z_i, d, ROUND_NOT_NEEDED);
    else {
      all_integers = false;
      assign_r(*z_i, d, ROUND_DOWN);
    }
  }

  if (all_integers)

    oct_z.set_strongly_closed();
  else {

    oct_z.strong_closure_assign();
    if (oct_z.marked_empty())
      return false;
  }
  return !oct_z.tight_coherence_would_make_empty();
}

template <typename T>
bool
Octagonal_Shape<T>::frequency(const Linear_Expression& expr,
                              Coefficient& freq_n, Coefficient& freq_d,
                              Coefficient& val_n, Coefficient& val_d) const {
  dimension_type space_dim = space_dimension();

  if (space_dim < expr.space_dimension())
    throw_dimension_incompatible("frequency(e, ...)", "e", expr);
# 1333 "Octagonal_Shape_templates.hh"
  if (space_dim == 0) {
    if (is_empty())
      return false;
    freq_n = 0;
    freq_d = 1;
    val_n = expr.inhomogeneous_term();
    val_d = 1;
    return true;
  }

  strong_closure_assign();

  if (marked_empty())
    return false;


  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff_j; Parma_Polyhedra_Library::Coefficient& coeff_j = holder_coeff_j.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  Linear_Expression le = expr;



  bool constant_v = false;

  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const row_iterator m_end = matrix.row_end();

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_val_denom; Parma_Polyhedra_Library::Coefficient& val_denom = holder_val_denom.item();
  val_denom = 1;

  for (row_iterator i_iter = m_begin; i_iter != m_end; i_iter += 2) {
    constant_v = false;
    dimension_type i = i_iter.index();
    const Variable v(i/2);
    coeff = le.coefficient(v);
    if (coeff == 0) {
      constant_v = true;
      continue;
    }

    row_reference m_i = *i_iter;
    row_reference m_ii = *(i_iter + 1);
    const N& m_i_ii = m_i[i + 1];
    const N& m_ii_i = m_ii[i];
    if ((!is_plus_infinity(m_i_ii) && !is_plus_infinity(m_ii_i))
        && (is_additive_inverse(m_i_ii, m_ii_i))) {

      numer_denom(m_i_ii, numer, denom);
      denom *= 2;
      le -= coeff*v;
      le *= denom;
      le -= numer*coeff;
      val_denom *= denom;
      constant_v = true;
      continue;
    }


    else {
      ((void) 0);
      using namespace Implementation::Octagonal_Shapes;
      const dimension_type ci = coherent_index(i);
      for (row_iterator j_iter = i_iter; j_iter != m_end; j_iter += 2) {
        dimension_type j = j_iter.index();
        const Variable vj(j/2);
        coeff_j = le.coefficient(vj);
        if (coeff_j == 0)

          continue;
        const dimension_type cj = coherent_index(j);
        const dimension_type cjj = coherent_index(j + 1);

        row_reference m_j = *(m_begin + j);
        row_reference m_cj = *(m_begin + cj);
        const N& m_j_i = m_j[i];
        const N& m_i_j = m_cj[ci];
        if ((!is_plus_infinity(m_i_j) && !is_plus_infinity(m_j_i))
            && (is_additive_inverse(m_i_j, m_j_i))) {



          numer_denom(m_i_j, numer, denom);
          le -= coeff*v;
          le += coeff*vj;
          le *= denom;
          le -= numer*coeff;
          val_denom *= denom;
          constant_v = true;
          break;
        }

        m_j = *(m_begin + (j + 1));
        m_cj = *(m_begin + cjj);
        const N& m_j_i1 = m_j[i];
        const N& m_i_j1 = m_cj[ci];
        if ((!is_plus_infinity(m_i_j1) && !is_plus_infinity(m_j_i1))
            && (is_additive_inverse(m_i_j1, m_j_i1))) {



          numer_denom(m_i_j1, numer, denom);
          le -= coeff*v;
          le -= coeff*vj;
          le *= denom;
          le -= numer*coeff;
          val_denom *= denom;
          constant_v = true;
          break;
        }
      }
      if (!constant_v)

        return false;
    }
  }
  if (!constant_v)

    return false;


  freq_n = 0;
  freq_d = 1;


  normalize2(le.inhomogeneous_term(), val_denom, val_n, val_d);
  return true;
}

template <typename T>
bool
Octagonal_Shape<T>::constrains(const Variable var) const {

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dimension() < var_space_dim)
    throw_dimension_incompatible("constrains(v)", "v", var);



  if (marked_empty())
    return true;


  const dimension_type n_v = 2*(var_space_dim - 1);
  typename OR_Matrix<N>::const_row_iterator m_iter = matrix.row_begin() + n_v;
  typename OR_Matrix<N>::const_row_reference_type r_v = *m_iter;
  typename OR_Matrix<N>::const_row_reference_type r_cv = *(++m_iter);
  for (dimension_type h = m_iter.row_size(); h-- > 0; ) {
    if (!is_plus_infinity(r_v[h]) || !is_plus_infinity(r_cv[h]))
      return true;
  }
  ++m_iter;
  for (typename OR_Matrix<N>::const_row_iterator m_end = matrix.row_end();
       m_iter != m_end; ++m_iter) {
    typename OR_Matrix<N>::const_row_reference_type r = *m_iter;
    if (!is_plus_infinity(r[n_v]) || !is_plus_infinity(r[n_v + 1]))
      return true;
  }



  return is_empty();
}

template <typename T>
bool
Octagonal_Shape<T>::is_strong_coherent() const {


  const dimension_type num_rows = matrix.num_rows();


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_semi_sum; N& semi_sum = holder_semi_sum.item();





  for (dimension_type i = num_rows; i-- > 0; ) {
    typename OR_Matrix<N>::const_row_iterator iter = matrix.row_begin() + i;
    typename OR_Matrix<N>::const_row_reference_type m_i = *iter;
    using namespace Implementation::Octagonal_Shapes;
    const N& m_i_ci = m_i[coherent_index(i)];
    for (dimension_type j = matrix.row_size(i); j-- > 0; )

      if (i != j) {
        const N& m_cj_j = matrix[coherent_index(j)][j];
        if (!is_plus_infinity(m_i_ci)
            && !is_plus_infinity(m_cj_j)) {


          add_assign_r(semi_sum, m_i_ci, m_cj_j, ROUND_UP);
          div_2exp_assign_r(semi_sum, semi_sum, 1, ROUND_UP);
          if (m_i[j] > semi_sum)
            return false;
        }
      }
  }
  return true;
}

template <typename T>
bool
Octagonal_Shape<T>::is_strongly_reduced() const {



  if (marked_empty())
    return true;

  Octagonal_Shape x = *this;


  for (typename OR_Matrix<N>::const_row_iterator iter = matrix.row_begin(),
         matrix_row_end = matrix.row_end(); iter != matrix_row_end; ++iter) {
    typename OR_Matrix<N>::const_row_reference_type m_i = *iter;
    const dimension_type i = iter.index();
    for (dimension_type j = iter.row_size(); j-- > 0; ) {
      if (!is_plus_infinity(m_i[j])) {
        Octagonal_Shape x_copy = *this;
        assign_r(x_copy.matrix[i][j], PLUS_INFINITY, ROUND_NOT_NEEDED);
        if (x == x_copy)
          return false;
      }
    }
  }

  return true;
}

template <typename T>
bool
Octagonal_Shape<T>::bounds(const Linear_Expression& expr,
                           const bool from_above) const {


  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((from_above
                                  ? "bounds_from_above(e)"
                                  : "bounds_from_below(e)"), "e", expr);
  strong_closure_assign();


  if (space_dim == 0 || marked_empty())
    return true;



  const Constraint& c = (from_above) ? expr <= 0 : expr >= 0;
  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_term; Parma_Polyhedra_Library::Coefficient& term = holder_term.item();
  if (Octagonal_Shape_Helper
    ::extract_octagonal_difference(c, c.space_dimension(), num_vars,
                                   i, j, coeff, term)) {
    if (num_vars == 0)
      return true;

    typename OR_Matrix<N>::const_row_iterator i_iter = matrix.row_begin() + i;
    typename OR_Matrix<N>::const_row_reference_type m_i = *i_iter;
    return !is_plus_infinity(m_i[j]);
  }
  else {

    Optimization_Mode mode_bounds =
      from_above ? MAXIMIZATION : MINIMIZATION;
    MIP_Problem mip(space_dim, constraints(), expr, mode_bounds);
    return mip.solve() == OPTIMIZED_MIP_PROBLEM;
  }
}

template <typename T>
bool
Octagonal_Shape<T>::max_min(const Linear_Expression& expr,
                            const bool maximize,
                            Coefficient& ext_n, Coefficient& ext_d,
                            bool& included) const {


  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((maximize
                                  ? "maximize(e, ...)"
                                  : "minimize(e, ...)"), "e", expr);

  if (space_dim == 0) {
    if (marked_empty())
      return false;
    else {
      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      return true;
    }
  }

  strong_closure_assign();

  if (marked_empty())
    return false;



  const Constraint& c = (maximize) ? expr <= 0 : expr >= 0;
  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_term; Parma_Polyhedra_Library::Coefficient& term = holder_term.item();
  if (!Octagonal_Shape_Helper
    ::extract_octagonal_difference(c, c.space_dimension(), num_vars,
                                   i, j, coeff, term)) {

    Optimization_Mode max_min = (maximize) ? MAXIMIZATION : MINIMIZATION;
    MIP_Problem mip(space_dim, constraints(), expr, max_min);
    if (mip.solve() == OPTIMIZED_MIP_PROBLEM) {
      mip.optimal_value(ext_n, ext_d);
      included = true;
      return true;
    }
    else

      return false;
  }
  else {

    if (num_vars == 0) {
      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      return true;
    }


    typename OR_Matrix<N>::const_row_iterator i_iter = matrix.row_begin() + i;
    typename OR_Matrix<N>::const_row_reference_type m_i = *i_iter;
    Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
    if (!is_plus_infinity(m_i[j])) {
      const Coefficient& b = expr.inhomogeneous_term();
      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
      neg_assign(minus_b, b);
      const Coefficient& sc_b = maximize ? b : minus_b;
      assign_r(d, sc_b, ROUND_UP);


      Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_expr; N& coeff_expr = holder_coeff_expr.item();
      const Coefficient& coeff_i = expr.coefficient(Variable(i/2));
      const int sign_i = sgn(coeff_i);
      if (sign_i > 0)
        assign_r(coeff_expr, coeff_i, ROUND_UP);
      else {
        Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_coeff_i; Parma_Polyhedra_Library::Coefficient& minus_coeff_i = holder_minus_coeff_i.item();
        neg_assign(minus_coeff_i, coeff_i);
        assign_r(coeff_expr, minus_coeff_i, ROUND_UP);
      }

      if (num_vars == 1) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_m_i_j; N& m_i_j = holder_m_i_j.item();
        div_2exp_assign_r(m_i_j, m_i[j], 1, ROUND_UP);
        add_mul_assign_r(d, coeff_expr, m_i_j, ROUND_UP);
      }
      else
        add_mul_assign_r(d, coeff_expr, m_i[j], ROUND_UP);
      numer_denom(d, ext_n, ext_d);
      if (!maximize)
        neg_assign(ext_n);
      included = true;
      return true;
    }


    return false;
  }
}

template <typename T>
bool
Octagonal_Shape<T>::max_min(const Linear_Expression& expr,
                            const bool maximize,
                            Coefficient& ext_n, Coefficient& ext_d,
                            bool& included, Generator& g) const {


  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((maximize
                                  ? "maximize(e, ...)"
                                  : "minimize(e, ...)"), "e", expr);

  if (space_dim == 0) {
    if (marked_empty())
      return false;
    else {
      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      g = point();
      return true;
    }
  }

  strong_closure_assign();

  if (marked_empty())
    return false;
  if (!is_universe()) {


    Optimization_Mode max_min = (maximize) ? MAXIMIZATION : MINIMIZATION;
    MIP_Problem mip(space_dim, constraints(), expr, max_min);
    if (mip.solve() == OPTIMIZED_MIP_PROBLEM) {
      g = mip.optimizing_point();
      mip.evaluate_objective_function(g, ext_n, ext_d);
      included = true;
      return true;
    }
  }

  return false;
}

template <typename T>
Poly_Con_Relation
Octagonal_Shape<T>::relation_with(const Congruence& cg) const {
  dimension_type cg_space_dim = cg.space_dimension();


  if (cg_space_dim > space_dim)
    throw_dimension_incompatible("relation_with(cg)", cg);



  if (cg.is_equality()) {
    Constraint c(cg);
    return relation_with(c);
  }

  strong_closure_assign();

  if (marked_empty())
    return Poly_Con_Relation::saturates()
      && Poly_Con_Relation::is_included()
      && Poly_Con_Relation::is_disjoint();

  if (space_dim == 0) {
    if (cg.is_inconsistent())
      return Poly_Con_Relation::is_disjoint();
    else
      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_included();
  }



  Linear_Expression le(cg.expression());
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_numer; Parma_Polyhedra_Library::Coefficient& min_numer = holder_min_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_denom; Parma_Polyhedra_Library::Coefficient& min_denom = holder_min_denom.item();
  bool min_included;
  bool bounded_below = minimize(le, min_numer, min_denom, min_included);



  if (!bounded_below)
    return Poly_Con_Relation::strictly_intersects();







  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_numer; Parma_Polyhedra_Library::Coefficient& max_numer = holder_max_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_denom; Parma_Polyhedra_Library::Coefficient& max_denom = holder_max_denom.item();
  bool max_included;
  bool bounded_above = maximize(le, max_numer, max_denom, max_included);



  if (!bounded_above)
    return Poly_Con_Relation::strictly_intersects();

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_signed_distance; Parma_Polyhedra_Library::Coefficient& signed_distance = holder_signed_distance.item();



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_value; Parma_Polyhedra_Library::Coefficient& min_value = holder_min_value.item();
  min_value = min_numer / min_denom;
  const Coefficient& modulus = cg.modulus();
  signed_distance = min_value % modulus;
  min_value -= signed_distance;
  if (min_value * min_denom < min_numer)
    min_value += modulus;



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_value; Parma_Polyhedra_Library::Coefficient& max_value = holder_max_value.item();
  max_value = max_numer / max_denom;
  signed_distance = max_value % modulus;
  max_value += signed_distance;
  if (max_value * max_denom > max_numer)
    max_value -= modulus;




  if (max_value < min_value)
    return Poly_Con_Relation::is_disjoint();
  else
    return Poly_Con_Relation::strictly_intersects();
}

template <typename T>
Poly_Con_Relation
Octagonal_Shape<T>::relation_with(const Constraint& c) const {
  dimension_type c_space_dim = c.space_dimension();


  if (c_space_dim > space_dim)
    throw_dimension_incompatible("relation_with(c)", c);


  strong_closure_assign();

  if (marked_empty())
    return Poly_Con_Relation::saturates()
      && Poly_Con_Relation::is_included()
      && Poly_Con_Relation::is_disjoint();

  if (space_dim == 0) {

    if ((c.is_equality() && c.inhomogeneous_term() != 0)
        || (c.is_inequality() && c.inhomogeneous_term() < 0))
      return Poly_Con_Relation::is_disjoint();
    else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0)


      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_disjoint();


    else if (c.is_equality() || c.inhomogeneous_term() == 0)
      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_included();
    else



      return Poly_Con_Relation::is_included();
  }

  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_c_term; Parma_Polyhedra_Library::Coefficient& c_term = holder_c_term.item();
  if (!Octagonal_Shape_Helper
    ::extract_octagonal_difference(c, c_space_dim, num_vars,
                                   i, j, coeff, c_term)) {






    Linear_Expression le;
    le.set_space_dimension(c.space_dimension());
    le.linear_combine(c.expr, Coefficient_one(), Coefficient_one(),
                      1, c_space_dim + 1);

    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_numer; Coefficient& max_numer = holder_max_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_denom; Coefficient& max_denom = holder_max_denom.item();
    bool max_included;
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_numer; Coefficient& min_numer = holder_min_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_denom; Coefficient& min_denom = holder_min_denom.item();
    bool min_included;
    bool bounded_above = maximize(le, max_numer, max_denom, max_included);
    bool bounded_below = minimize(le, min_numer, min_denom, min_included);
    if (!bounded_above) {
      if (!bounded_below)
        return Poly_Con_Relation::strictly_intersects();
      min_numer += c.inhomogeneous_term() * min_denom;
      switch (sgn(min_numer)) {
      case 1:
        if (c.is_equality())
          return Poly_Con_Relation::is_disjoint();
        return Poly_Con_Relation::is_included();
      case 0:
        if (c.is_strict_inequality() || c.is_equality())
          return Poly_Con_Relation::strictly_intersects();
        return Poly_Con_Relation::is_included();
      case -1:
        return Poly_Con_Relation::strictly_intersects();
      }
    }
    if (!bounded_below) {
      max_numer += c.inhomogeneous_term() * max_denom;
      switch (sgn(max_numer)) {
      case 1:
        return Poly_Con_Relation::strictly_intersects();
      case 0:
        if (c.is_strict_inequality())
          return Poly_Con_Relation::is_disjoint();
        return Poly_Con_Relation::strictly_intersects();
      case -1:
        return Poly_Con_Relation::is_disjoint();
      }
    }
    else {
      max_numer += c.inhomogeneous_term() * max_denom;
      min_numer += c.inhomogeneous_term() * min_denom;
      switch (sgn(max_numer)) {
      case 1:
        switch (sgn(min_numer)) {
        case 1:
          if (c.is_equality())
            return Poly_Con_Relation::is_disjoint();
          return Poly_Con_Relation::is_included();
        case 0:
          if (c.is_equality())
            return Poly_Con_Relation::strictly_intersects();
          if (c.is_strict_inequality())
            return Poly_Con_Relation::strictly_intersects();
          return Poly_Con_Relation::is_included();
        case -1:
          return Poly_Con_Relation::strictly_intersects();
        }
        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      case 0:
        if (min_numer == 0) {
          if (c.is_strict_inequality())
            return Poly_Con_Relation::is_disjoint()
              && Poly_Con_Relation::saturates();
          return Poly_Con_Relation::is_included()
            && Poly_Con_Relation::saturates();
        }
        if (c.is_strict_inequality())
          return Poly_Con_Relation::is_disjoint();
        return Poly_Con_Relation::strictly_intersects();
      case -1:
        return Poly_Con_Relation::is_disjoint();
      }
    }
  }

  if (num_vars == 0) {

    switch (sgn(c.inhomogeneous_term())) {
    case -1:
      return Poly_Con_Relation::is_disjoint();
    case 0:
      if (c.is_strict_inequality())
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_disjoint();
      else
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_included();
    case 1:
      if (c.is_equality())
        return Poly_Con_Relation::is_disjoint();
      else
        return Poly_Con_Relation::is_included();
    }
  }


  typename OR_Matrix<N>::const_row_iterator i_iter = matrix.row_begin() + i;
  typename OR_Matrix<N>::const_row_reference_type m_i = *i_iter;
  const N& m_i_j = m_i[j];

  if (coeff < 0)
    neg_assign(coeff);



  if (i % 2 == 0)
    ++i_iter;
  else
    --i_iter;
  typename OR_Matrix<N>::const_row_reference_type m_ci = *i_iter;
  using namespace Implementation::Octagonal_Shapes;
  const N& m_ci_cj = m_ci[coherent_index(j)];
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();


  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_x; mpq_class& q_x = holder_q_x.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_y; mpq_class& q_y = holder_q_y.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_d; mpq_class& d = holder_d.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_d1; mpq_class& d1 = holder_d1.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_c_denom; mpq_class& c_denom = holder_c_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_denom; mpq_class& q_denom = holder_q_denom.item();
  assign_r(c_denom, coeff, ROUND_NOT_NEEDED);
  assign_r(d, c_term, ROUND_NOT_NEEDED);
  neg_assign_r(d1, d, ROUND_NOT_NEEDED);
  div_assign_r(d, d, c_denom, ROUND_NOT_NEEDED);
  div_assign_r(d1, d1, c_denom, ROUND_NOT_NEEDED);

  if (is_plus_infinity(m_i_j)) {
    if (!is_plus_infinity(m_ci_cj)) {






      numer_denom(m_ci_cj, numer, denom);
      assign_r(q_denom, denom, ROUND_NOT_NEEDED);
      assign_r(q_y, numer, ROUND_NOT_NEEDED);
      div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED);
      if (q_y < d1)
        return Poly_Con_Relation::is_disjoint();
      if (q_y == d1 && c.is_strict_inequality())
        return Poly_Con_Relation::is_disjoint();
    }


    return Poly_Con_Relation::strictly_intersects();
  }


  numer_denom(m_i_j, numer, denom);
  assign_r(q_denom, denom, ROUND_NOT_NEEDED);
  assign_r(q_x, numer, ROUND_NOT_NEEDED);
  div_assign_r(q_x, q_x, q_denom, ROUND_NOT_NEEDED);

  if (!is_plus_infinity(m_ci_cj)) {
    numer_denom(m_ci_cj, numer, denom);
    assign_r(q_denom, denom, ROUND_NOT_NEEDED);
    assign_r(q_y, numer, ROUND_NOT_NEEDED);
    div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED);
    if (q_x == d && q_y == d1) {
      if (c.is_strict_inequality())
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_disjoint();
      else
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_included();
    }


    if (q_y < d1)
      return Poly_Con_Relation::is_disjoint();
    if (q_y == d1 && c.is_strict_inequality())
      return Poly_Con_Relation::is_disjoint();
  }




  if (d > q_x) {
    if (c.is_equality())
      return Poly_Con_Relation::is_disjoint();
    else
      return Poly_Con_Relation::is_included();
  }

  if (d == q_x && c.is_nonstrict_inequality())
    return Poly_Con_Relation::is_included();


  return Poly_Con_Relation::strictly_intersects();
}

template <typename T>
Poly_Gen_Relation
Octagonal_Shape<T>::relation_with(const Generator& g) const {
  const dimension_type g_space_dim = g.space_dimension();


  if (space_dim < g_space_dim)
    throw_dimension_incompatible("relation_with(g)", g);



  strong_closure_assign();


  if (marked_empty())
    return Poly_Gen_Relation::nothing();



  if (space_dim == 0)
    return Poly_Gen_Relation::subsumes();

  const bool is_line = g.is_line();
  const bool is_line_or_ray = g.is_line_or_ray();







  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const row_iterator m_end = matrix.row_end();

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_product; Parma_Polyhedra_Library::Coefficient& product = holder_product.item();


  for (row_iterator i_iter = m_begin; i_iter != m_end; i_iter += 2) {
    dimension_type i = i_iter.index();
    row_reference m_i = *i_iter;
    row_reference m_ii = *(i_iter + 1);
    const N& m_i_ii = m_i[i + 1];
    const N& m_ii_i = m_ii[i];

    const Variable x(i/2);
    const Coefficient& g_coeff_x
      = (x.space_dimension() > g_space_dim)
      ? Coefficient_zero()
      : g.coefficient(x);
    if (is_additive_inverse(m_i_ii, m_ii_i)) {




      numer_denom(m_ii_i, numer, denom);
      denom *= 2;
      product = denom * g_coeff_x;


      if (!is_line_or_ray) {
        neg_assign(numer);
        add_mul_assign(product, numer, g.divisor());
      }
      if (product != 0)
        return Poly_Gen_Relation::nothing();
    }

    else {
      if (!is_plus_infinity(m_i_ii)) {



        numer_denom(m_i_ii, numer, denom);
        denom *= -2;
        product = denom * g_coeff_x;


        if (!is_line_or_ray) {
          neg_assign(numer);
          add_mul_assign(product, numer, g.divisor());
        }
        if (is_line && product != 0)
          return Poly_Gen_Relation::nothing();
        else




          if (product > 0)
            return Poly_Gen_Relation::nothing();
      }
      if (!is_plus_infinity(m_ii_i)) {

        numer_denom(m_ii_i, numer, denom);
        denom *= 2;
        product = denom * g_coeff_x;


        if (!is_line_or_ray) {
          neg_assign(numer);
          add_mul_assign(product, numer , g.divisor());
        }
        if (is_line && product != 0)
          return Poly_Gen_Relation::nothing();
        else




          if (product > 0)
            return Poly_Gen_Relation::nothing();
      }
    }
  }


  for (row_iterator i_iter = m_begin ; i_iter != m_end; i_iter += 2) {
    dimension_type i = i_iter.index();
    row_reference m_i = *i_iter;
    row_reference m_ii = *(i_iter + 1);
    for (dimension_type j = 0; j < i; j += 2) {
      const N& m_i_j = m_i[j];
      const N& m_ii_jj = m_ii[j + 1];
      const N& m_ii_j = m_ii[j];
      const N& m_i_jj = m_i[j + 1];
      const Variable x(j/2);
      const Variable y(i/2);
      const Coefficient& g_coeff_x
        = (x.space_dimension() > g_space_dim)
        ? Coefficient_zero()
        : g.coefficient(x);
      const Coefficient& g_coeff_y
        = (y.space_dimension() > g_space_dim)
        ? Coefficient_zero()
        : g.coefficient(y);

      const bool difference_is_equality = is_additive_inverse(m_ii_jj, m_i_j);
      if (difference_is_equality) {





        numer_denom(m_i_j, numer, denom);
        product = denom * g_coeff_x;
        neg_assign(denom);
        add_mul_assign(product, denom, g_coeff_y);


        if (!is_line_or_ray) {
          neg_assign(numer);
          add_mul_assign(product, numer, g.divisor());
        }
        if (product != 0)
          return Poly_Gen_Relation::nothing();
      }
      else {
        if (!is_plus_infinity(m_i_j)) {





          numer_denom(m_i_j, numer, denom);
          product = denom * g_coeff_x;
          neg_assign(denom);
          add_mul_assign(product, denom, g_coeff_y);


          if (!is_line_or_ray) {
            neg_assign(numer);
            add_mul_assign(product, numer, g.divisor());
          }
          if (is_line && product != 0)
            return Poly_Gen_Relation::nothing();
          else if (product > 0)
            return Poly_Gen_Relation::nothing();
        }
        if (!is_plus_infinity(m_ii_jj)) {





          numer_denom(m_ii_jj, numer, denom);
          product = denom * g_coeff_y;
          neg_assign(denom);
          add_mul_assign(product, denom, g_coeff_x);


          if (!is_line_or_ray) {
            neg_assign(numer);
            add_mul_assign(product, numer, g.divisor());
          }
          if (is_line && product != 0)
            return Poly_Gen_Relation::nothing();
          else if (product > 0)
            return Poly_Gen_Relation::nothing();
        }
      }

      const bool sum_is_equality = is_additive_inverse(m_i_jj, m_ii_j);
      if (sum_is_equality) {





        numer_denom(m_ii_j, numer, denom);
        product = denom * g_coeff_x;
        add_mul_assign(product, denom, g_coeff_y);


        if (!is_line_or_ray) {
          neg_assign(numer);
          add_mul_assign(product, numer, g.divisor());
        }
        if (product != 0)
          return Poly_Gen_Relation::nothing();
      }
      else {
        if (!is_plus_infinity(m_i_jj)) {





          numer_denom(m_i_jj, numer, denom);
          neg_assign(denom);
          product = denom * g_coeff_x;
          add_mul_assign(product, denom, g_coeff_y);


          if (!is_line_or_ray) {
            neg_assign(numer);
            add_mul_assign(product, numer, g.divisor());
          }
          if (is_line && product != 0)
            return Poly_Gen_Relation::nothing();
          else if (product > 0)
            return Poly_Gen_Relation::nothing();
        }
        if (!is_plus_infinity(m_ii_j)) {





          numer_denom(m_ii_j, numer, denom);
          product = denom * g_coeff_x;
          add_mul_assign(product, denom, g_coeff_y);


          if (!is_line_or_ray) {
            neg_assign(numer);
            add_mul_assign(product, numer, g.divisor());
          }
          if (is_line && product != 0)
            return Poly_Gen_Relation::nothing();
          else if (product > 0)
            return Poly_Gen_Relation::nothing();
        }
      }
    }
  }


  return Poly_Gen_Relation::subsumes();
}

template <typename T>
void
Octagonal_Shape<T>::strong_closure_assign() const {

  if (marked_empty() || marked_strongly_closed() || space_dim == 0)
    return;



  Octagonal_Shape& x = const_cast<Octagonal_Shape<T>&>(*this);

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;

  const dimension_type n_rows = x.matrix.num_rows();
  const row_iterator m_begin = x.matrix.row_begin();
  const row_iterator m_end = x.matrix.row_end();


  for (row_iterator i = m_begin; i != m_end; ++i) {
    ((void) 0);
    assign_r((*i)[i.index()], 0, ROUND_NOT_NEEDED);
  }
# 2414 "Octagonal_Shape_templates.hh"
  typename OR_Matrix<N>::element_iterator iter_ij;
  std::vector<N> vec_k(n_rows);
  std::vector<N> vec_ck(n_rows);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum1; N& sum1 = holder_sum1.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum2; N& sum2 = holder_sum2.item();
  row_reference x_k;
  row_reference x_ck;
  row_reference x_i;
  row_reference x_ci;



  for (int twice = 0; twice < 2; ++twice) {

    row_iterator x_k_iter = m_begin;
    row_iterator x_i_iter = m_begin;
    for (dimension_type k = 0; k < n_rows; k += 2) {
      const dimension_type ck = k + 1;

      iter_ij = x.matrix.element_begin();

      x_k = *x_k_iter;
      ++x_k_iter;
      x_ck = *x_k_iter;
      ++x_k_iter;

      for (dimension_type i = 0; i <= k; i += 2) {
        const dimension_type ci = i + 1;

        vec_k[i] = x_k[i];

        vec_k[ci] = x_k[ci];

        vec_ck[i] = x_ck[i];

        vec_ck[ci] = x_ck[ci];
      }
      x_i_iter = x_k_iter;
      for (dimension_type i = k + 2; i < n_rows; i += 2) {
        const dimension_type ci = i + 1;
        x_i = *x_i_iter;
        ++x_i_iter;
        x_ci = *x_i_iter;
        ++x_i_iter;

        vec_k[i] = x_ci[ck];

        vec_k[ci] = x_i[ck];

        vec_ck[i] = x_ci[k];

        vec_ck[ci] = x_i[k];
      }

      for (dimension_type i = 0; i < n_rows; ++i) {
        using namespace Implementation::Octagonal_Shapes;
        const dimension_type ci = coherent_index(i);
        const N& vec_k_ci = vec_k[ci];
        const N& vec_ck_ci = vec_ck[ci];


        for (dimension_type j = 0; j <= i; ) {






          add_assign_r(sum1, vec_ck_ci, vec_k[j], ROUND_UP);
          add_assign_r(sum2, vec_k_ci, vec_ck[j], ROUND_UP);
          min_assign(sum1, sum2);
          min_assign(*iter_ij, sum1);

          ++j;
          ++iter_ij;

          add_assign_r(sum1, vec_ck_ci, vec_k[j], ROUND_UP);
          add_assign_r(sum2, vec_k_ci, vec_ck[j], ROUND_UP);
          min_assign(sum1, sum2);
          min_assign(*iter_ij, sum1);

          ++j;
          ++iter_ij;
        }
      }
    }
  }



  for (row_iterator i = m_begin; i != m_end; ++i) {
    N& x_i_i = (*i)[i.index()];
    if (sgn(x_i_i) < 0) {
      x.set_empty();
      return;
    }
    else {
      ((void) 0);

      assign_r(x_i_i, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }


  x.strong_coherence_assign();

  x.set_strongly_closed();
}

template <typename T>
void
Octagonal_Shape<T>::strong_coherence_assign() {





  Parma_Polyhedra_Library::Dirty_Temp<N> holder_semi_sum; N& semi_sum = holder_semi_sum.item();
  for (typename OR_Matrix<N>::row_iterator i_iter = matrix.row_begin(),
         i_end = matrix.row_end(); i_iter != i_end; ++i_iter) {
    typename OR_Matrix<N>::row_reference_type x_i = *i_iter;
    const dimension_type i = i_iter.index();
    using namespace Implementation::Octagonal_Shapes;
    const N& x_i_ci = x_i[coherent_index(i)];

    if (!is_plus_infinity(x_i_ci))
      for (dimension_type j = 0, rs_i = i_iter.row_size(); j < rs_i; ++j)
        if (i != j) {
          const N& x_cj_j = matrix[coherent_index(j)][j];
          if (!is_plus_infinity(x_cj_j)) {
            add_assign_r(semi_sum, x_i_ci, x_cj_j, ROUND_UP);
            div_2exp_assign_r(semi_sum, semi_sum, 1, ROUND_UP);
            min_assign(x_i[j], semi_sum);
          }
        }
  }
}

template <typename T>
bool
Octagonal_Shape<T>::tight_coherence_would_make_empty() const {
  ((void) 0);
  ((void) 0);
  const dimension_type space_dim = space_dimension();
  for (dimension_type i = 0; i < 2*space_dim; i += 2) {
    const dimension_type ci = i + 1;
    const N& mat_i_ci = matrix[i][ci];
    if (!is_plus_infinity(mat_i_ci)

        && !is_even(mat_i_ci)

        && is_additive_inverse(mat_i_ci, matrix[ci][i]))
      return true;
  }
  return false;
}

template <typename T>
void
Octagonal_Shape<T>::tight_closure_assign() {
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_2576 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(std::numeric_limits<T>::is_integer)>) };




  strong_closure_assign();
  if (marked_empty())
    return;
  if (tight_coherence_would_make_empty())
    set_empty();
  else {

    Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_one; N& temp_one = holder_temp_one.item();
    assign_r(temp_one, 1, ROUND_NOT_NEEDED);
    const dimension_type space_dim = space_dimension();
    for (dimension_type i = 0; i < 2*space_dim; i += 2) {
      const dimension_type ci = i + 1;
      N& mat_i_ci = matrix[i][ci];
      if (!is_plus_infinity(mat_i_ci) && !is_even(mat_i_ci))
        sub_assign_r(mat_i_ci, mat_i_ci, temp_one, ROUND_UP);
      N& mat_ci_i = matrix[ci][i];
      if (!is_plus_infinity(mat_ci_i) && !is_even(mat_ci_i))
        sub_assign_r(mat_ci_i, mat_ci_i, temp_one, ROUND_UP);
    }

    strong_coherence_assign();
  }
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>
::incremental_strong_closure_assign(const Variable var) const {

  if (var.id() >= space_dim)
    throw_dimension_incompatible("incremental_strong_closure_assign(v)",
                                 var.id());


  if (marked_empty() || marked_strongly_closed())
    return;

  Octagonal_Shape& x = const_cast<Octagonal_Shape<T>&>(*this);

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;

  const row_iterator m_begin = x.matrix.row_begin();
  const row_iterator m_end = x.matrix.row_end();


  for (row_iterator i = m_begin; i != m_end; ++i) {
    ((void) 0);
    assign_r((*i)[i.index()], 0, ROUND_NOT_NEEDED);
  }



  const dimension_type v = 2*var.id();
  const dimension_type cv = v + 1;
  row_iterator v_iter = m_begin + v;
  row_iterator cv_iter = v_iter + 1;
  row_reference x_v = *v_iter;
  row_reference x_cv = *cv_iter;
  const dimension_type rs_v = v_iter.row_size();
  const dimension_type n_rows = x.matrix.num_rows();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();
  using namespace Implementation::Octagonal_Shapes;
  for (row_iterator k_iter = m_begin; k_iter != m_end; ++k_iter) {
    const dimension_type k = k_iter.index();
    const dimension_type ck = coherent_index(k);
    const dimension_type rs_k = k_iter.row_size();
    row_reference x_k = *k_iter;
    row_reference x_ck = (k % 2 != 0) ? *(k_iter-1) : *(k_iter + 1);

    for (row_iterator i_iter = m_begin; i_iter != m_end; ++i_iter) {
      const dimension_type i = i_iter.index();
      const dimension_type ci = coherent_index(i);
      const dimension_type rs_i = i_iter.row_size();
      row_reference x_i = *i_iter;
      row_reference x_ci = (i % 2 != 0) ? *(i_iter-1) : *(i_iter + 1);

      const N& x_i_k = (k < rs_i) ? x_i[k] : x_ck[ci];
      if (!is_plus_infinity(x_i_k)) {
        const N& x_k_v = (v < rs_k) ? x_k[v] : x_cv[ck];
        if (!is_plus_infinity(x_k_v)) {
          add_assign_r(sum, x_i_k, x_k_v, ROUND_UP);
          N& x_i_v = (v < rs_i) ? x_i[v] : x_cv[ci];
          min_assign(x_i_v, sum);
        }
        const N& x_k_cv = (cv < rs_k) ? x_k[cv] : x_v[ck];
        if (!is_plus_infinity(x_k_cv)) {
          add_assign_r(sum, x_i_k, x_k_cv, ROUND_UP);
          N& x_i_cv = (cv < rs_i) ? x_i[cv] : x_v[ci];
          min_assign(x_i_cv, sum);
        }
      }
      const N& x_k_i = (i < rs_k) ? x_k[i] : x_ci[ck];
      if (!is_plus_infinity(x_k_i)) {
        const N& x_v_k = (k < rs_v) ? x_v[k] : x_ck[cv];
        if (!is_plus_infinity(x_v_k)) {
          N& x_v_i = (i < rs_v) ? x_v[i] : x_ci[cv];
          add_assign_r(sum, x_v_k, x_k_i, ROUND_UP);
          min_assign(x_v_i, sum);
        }
        const N& x_cv_k = (k < rs_v) ? x_cv[k] : x_ck[v];
        if (!is_plus_infinity(x_cv_k)) {
          N& x_cv_i = (i < rs_v) ? x_cv[i] : x_ci[v];
          add_assign_r(sum, x_cv_k, x_k_i, ROUND_UP);
          min_assign(x_cv_i, sum);
        }
      }

    }
  }



  for (row_iterator i_iter = m_begin; i_iter != m_end; ++i_iter) {
    const dimension_type i = i_iter.index();
    const dimension_type ci = coherent_index(i);
    const dimension_type rs_i = i_iter.row_size();
    row_reference x_i = *i_iter;
    const N& x_i_v = (v < rs_i) ? x_i[v] : x_cv[ci];



    for (dimension_type j = 0; j < n_rows; ++j) {
      const dimension_type cj = coherent_index(j);
      row_reference x_cj = *(m_begin + cj);
      N& x_i_j = (j < rs_i) ? x_i[j] : x_cj[ci];
      if (!is_plus_infinity(x_i_v)) {
        const N& x_v_j = (j < rs_v) ? x_v[j] : x_cj[cv];
        if (!is_plus_infinity(x_v_j)) {
          add_assign_r(sum, x_i_v, x_v_j, ROUND_UP);
          min_assign(x_i_j, sum);
        }
      }
      const N& x_i_cv = (cv < rs_i) ? x_i[cv] : x_v[ci];
      if (!is_plus_infinity(x_i_cv)) {
        const N& x_cv_j = (j < rs_v) ? x_cv[j] : x_cj[v];
        if (!is_plus_infinity(x_cv_j)) {
          add_assign_r(sum, x_i_cv, x_cv_j, ROUND_UP);
          min_assign(x_i_j, sum);
        }
      }
    }
  }



  for (row_iterator i = m_begin; i != m_end; ++i) {
    N& x_i_i = (*i)[i.index()];
    if (sgn(x_i_i) < 0) {
      x.set_empty();
      return;
    }
    else {

      ((void) 0);
      assign_r(x_i_i, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }


  x.strong_coherence_assign();

  x.set_strongly_closed();
}

template <typename T>
void
Octagonal_Shape<T>
::compute_successors(std::vector<dimension_type>& successor) const {
  ((void) 0);
  ((void) 0);



  const dimension_type successor_size = matrix.num_rows();

  successor.reserve(successor_size);
  for (dimension_type i = 0; i < successor_size; ++i)
    successor.push_back(i);

  for (dimension_type i = successor_size; i-- > 0; ) {
    typename OR_Matrix<N>::const_row_iterator i_iter = matrix.row_begin() + i;
    typename OR_Matrix<N>::const_row_reference_type m_i = *i_iter;
    typename OR_Matrix<N>::const_row_reference_type m_ci
      = (i % 2 != 0) ? *(i_iter-1) : *(i_iter + 1);
    for (dimension_type j = 0; j < i; ++j) {


      using namespace Implementation::Octagonal_Shapes;
      dimension_type cj = coherent_index(j);
      if (is_additive_inverse(m_ci[cj], m_i[j]))

        successor[j] = i;
    }
  }
}

template <typename T>
void
Octagonal_Shape<T>
::compute_leaders(std::vector<dimension_type>& leaders) const {
  ((void) 0);
  ((void) 0);



  const dimension_type leader_size = matrix.num_rows();

  leaders.reserve(leader_size);
  for (dimension_type i = 0; i < leader_size; ++i)
    leaders.push_back(i);

  for (typename OR_Matrix<N>::const_row_iterator i_iter = matrix.row_begin(),
         matrix_row_end = matrix.row_end();
       i_iter != matrix_row_end; ++i_iter) {
    typename OR_Matrix<N>::const_row_reference_type m_i = *i_iter;
    dimension_type i = i_iter.index();
    typename OR_Matrix<N>::const_row_reference_type m_ci
      = (i % 2 != 0) ? *(i_iter-1) : *(i_iter + 1);
    for (dimension_type j = 0; j < i; ++j) {
      using namespace Implementation::Octagonal_Shapes;
      dimension_type cj = coherent_index(j);
      if (is_additive_inverse(m_ci[cj], m_i[j]))

        leaders[i] = leaders[j];
    }
  }
}

template <typename T>
void
Octagonal_Shape<T>
::compute_leaders(std::vector<dimension_type>& successor,
                  std::vector<dimension_type>& no_sing_leaders,
                  bool& exist_sing_class,
                  dimension_type& sing_leader) const {
  ((void) 0);
  ((void) 0);
  dimension_type successor_size = successor.size();
  std::deque<bool> dealt_with(successor_size, false);
  for (dimension_type i = 0; i < successor_size; ++i) {
    dimension_type next_i = successor[i];
    if (!dealt_with[i]) {


      using namespace Implementation::Octagonal_Shapes;
      if (next_i == coherent_index(i)) {
        exist_sing_class = true;
        sing_leader = i;
      }
      else
        no_sing_leaders.push_back(i);
    }

    dealt_with[next_i] = true;
  }
}

template <typename T>
void
Octagonal_Shape<T>::strong_reduction_assign() const {

  if (space_dim == 0)
    return;
  strong_closure_assign();

  if (marked_empty())
    return;


  std::vector<Bit_Row> non_red;
  non_redundant_matrix_entries(non_red);


  Octagonal_Shape<T>& x = const_cast<Octagonal_Shape<T>&>(*this);



  typename OR_Matrix<N>::element_iterator x_i = x.matrix.element_begin();
  for (dimension_type i = 0; i < 2 * space_dim; ++i) {
    const Bit_Row& non_red_i = non_red[i];
    for (dimension_type j = 0,
           j_end = OR_Matrix<N>::row_size(i); j < j_end; ++j, ++x_i) {
      if (!non_red_i[j])
        assign_r(*x_i, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }
  x.reset_strongly_closed();






}

template <typename T>
void
Octagonal_Shape<T>
::non_redundant_matrix_entries(std::vector<Bit_Row>& non_redundant) const {

  ((void) 0);
  ((void) 0);



  non_redundant.resize(2*space_dim);





  std::vector<dimension_type> no_sing_leaders;
  dimension_type sing_leader = 0;
  bool exist_sing_class = false;
  std::vector<dimension_type> successor;
  compute_successors(successor);
  compute_leaders(successor, no_sing_leaders, exist_sing_class, sing_leader);
  const dimension_type num_no_sing_leaders = no_sing_leaders.size();




  for (dimension_type li = 0; li < num_no_sing_leaders; ++li) {
    const dimension_type i = no_sing_leaders[li];
    using namespace Implementation::Octagonal_Shapes;
    const dimension_type ci = coherent_index(i);
    typename OR_Matrix<N>::const_row_reference_type
      m_i = *(matrix.row_begin() + i);
    if (i % 2 == 0) {





      if (i != successor[i]) {
        dimension_type j = i;
        dimension_type next_j = successor[j];
        while (j != next_j) {
          non_redundant[next_j].set(j);
          j = next_j;
          next_j = successor[j];
        }
        const dimension_type cj = coherent_index(j);
        non_redundant[cj].set(ci);
      }
    }

    dimension_type rs_li = (li % 2 != 0) ? li : (li + 1);

    Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
    for (dimension_type lj = 0 ; lj <= rs_li; ++lj) {
      const dimension_type j = no_sing_leaders[lj];
      const dimension_type cj = coherent_index(j);
      const N& m_i_j = m_i[j];
      const N& m_i_ci = m_i[ci];
      bool to_add = true;



      if (j != ci) {
        add_assign_r(tmp, m_i_ci, matrix[cj][j], ROUND_UP);
        div_2exp_assign_r(tmp, tmp, 1, ROUND_UP);
        if (m_i_j >= tmp)

          continue;
      }
# 2957 "Octagonal_Shape_templates.hh"
      for (dimension_type lk = 0; lk < num_no_sing_leaders; ++lk) {
        const dimension_type k = no_sing_leaders[lk];
        if (k != i && k != j) {
          dimension_type ck = coherent_index(k);
          if (k < j)

            add_assign_r(tmp, m_i[k], matrix[cj][ck], ROUND_UP);
          else if (k < i)

            add_assign_r(tmp, m_i[k], matrix[k][j], ROUND_UP);
          else

            add_assign_r(tmp, matrix[ck][ci], matrix[k][j], ROUND_UP);


          if (m_i_j >= tmp) {
            to_add = false;
            break;
          }
        }
      }

      if (to_add)

        non_redundant[i].set(j);
    }
  }





  if (exist_sing_class) {
    non_redundant[sing_leader].set(sing_leader + 1);
    if (successor[sing_leader + 1] != sing_leader + 1) {
      dimension_type j = sing_leader;
      dimension_type next_j = successor[j + 1];
      while (next_j != j + 1) {
        non_redundant[next_j].set(j);
        j = next_j;
        next_j = successor[j + 1];
      }
      non_redundant[j + 1].set(j);
    }
    else
      non_redundant[sing_leader + 1].set(sing_leader);
  }
}

template <typename T>
void
Octagonal_Shape<T>::upper_bound_assign(const Octagonal_Shape& y) {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("upper_bound_assign(y)", y);


  y.strong_closure_assign();
  if (y.marked_empty())
    return;
  strong_closure_assign();
  if (marked_empty()) {
    *this = y;
    return;
  }


  typename OR_Matrix<N>::const_element_iterator j = y.matrix.element_begin();
  for (typename OR_Matrix<N>::element_iterator i = matrix.element_begin(),
         matrix_element_end = matrix.element_end();
       i != matrix_element_end; ++i, ++j)
    max_assign(*i, *j);


  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::difference_assign(const Octagonal_Shape& y) {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("difference_assign(y)", y);

  Octagonal_Shape& x = *this;



  x.strong_closure_assign();

  if (x.marked_empty())
    return;

  if (y.marked_empty())
    return;




  if (x.space_dim == 0) {
    x.set_empty();
    return;
  }



  if (y.contains(x)) {
    x.set_empty();
    return;
  }

  Octagonal_Shape new_oct(space_dim, EMPTY);



  const Constraint_System& y_cs = y.constraints();
  for (Constraint_System::const_iterator i = y_cs.begin(),
         y_cs_end = y_cs.end(); i != y_cs_end; ++i) {
    const Constraint& c = *i;




    if (x.relation_with(c).implies(Poly_Con_Relation::is_included()))
      continue;
    Octagonal_Shape z = x;
    const Linear_Expression e(c.expression());
    z.add_constraint(e <= 0);
    if (!z.is_empty())
      new_oct.upper_bound_assign(z);
    if (c.is_equality()) {
      z = x;
      z.add_constraint(e >= 0);
      if (!z.is_empty())
        new_oct.upper_bound_assign(z);
    }
  }
  *this = new_oct;
  ((void) 0);
}

template <typename T>
bool
Octagonal_Shape<T>::simplify_using_context_assign(const Octagonal_Shape& y) {
  Octagonal_Shape& x = *this;
  const dimension_type dim = x.space_dimension();

  if (dim != y.space_dimension())
    throw_dimension_incompatible("simplify_using_context_assign(y)", y);


  if (dim == 0) {
    if (y.marked_empty()) {
      x.set_zero_dim_univ();
      return false;
    }
    else
      return !x.marked_empty();
  }



  if (x.contains(y)) {
    Octagonal_Shape<T> res(dim, UNIVERSE);
    x.m_swap(res);
    return false;
  }

  typedef typename OR_Matrix<N>::row_iterator Row_Iter;
  typedef typename OR_Matrix<N>::const_row_iterator Row_CIter;
  typedef typename OR_Matrix<N>::element_iterator Elem_Iter;
  typedef typename OR_Matrix<N>::const_element_iterator Elem_CIter;


  x.strong_closure_assign();
  if (x.marked_empty()) {

    dimension_type i;
    dimension_type j;

    for (i = 0; i < 2*dim; i += 2) {




      if (!is_plus_infinity(y.matrix_at(i, i + 1))) {
        j = i + 1;
        goto found;
      }

      if (!is_plus_infinity(y.matrix_at(i + 1, i))) {
        j = i;
        ++i;
        goto found;
      }
    }


    for (i = 2; i < 2*dim; ++i)
      for (j = 0; j < i; ++j) {

        if (!is_plus_infinity(y.matrix_at(i, j)))
          goto found;
      }



    return false;

  found:

    ((void) 0);
    Octagonal_Shape<T> res(dim, UNIVERSE);

    Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
    assign_r(tmp, 1, ROUND_UP);
    add_assign_r(tmp, tmp, y.matrix_at(i, j), ROUND_UP);

    neg_assign_r(res.matrix_at(j, i), tmp, ROUND_DOWN);
    ((void) 0);
    x.m_swap(res);
    return false;
  }




  Octagonal_Shape<T> target = x;
  target.intersection_assign(y);
  const bool bool_result = !target.is_empty();



  std::vector<Bit_Row> x_non_redundant;
  x.non_redundant_matrix_entries(x_non_redundant);

  dimension_type x_num_non_redundant = 0;
  for (size_t i = x_non_redundant.size(); i-- > 0 ; )
    x_num_non_redundant += x_non_redundant[i].count_ones();
  ((void) 0);




  Octagonal_Shape<T> yy = y;


  Octagonal_Shape<T> res(dim, UNIVERSE);

  dimension_type res_num_non_redundant = 0;


  std::vector<dimension_type> x_leaders;
  x.compute_leaders(x_leaders);



  dimension_type sing_leader;
  for (sing_leader = 0; sing_leader < 2*dim; sing_leader += 2) {
    if (sing_leader == x_leaders[sing_leader]) {
      const N& x_s_ss = x.matrix_at(sing_leader, sing_leader + 1);
      const N& x_ss_s = x.matrix_at(sing_leader + 1, sing_leader);
      if (is_additive_inverse(x_s_ss, x_ss_s))

        break;
    }
  }


  for (dimension_type i = sing_leader; i < 2*dim; i += 2) {
    if (x_leaders[i] != sing_leader)
      continue;


    const N& x_i_ii = x.matrix_at(i, i + 1);
    N& yy_i_ii = yy.matrix_at(i, i + 1);
    if (x_i_ii < yy_i_ii) {

      res.matrix_at(i, i + 1) = x_i_ii;
      ++res_num_non_redundant;

      yy_i_ii = x_i_ii;
      yy.reset_strongly_closed();
    }
    const N& x_ii_i = x.matrix_at(i + 1, i);
    N& yy_ii_i = yy.matrix_at(i + 1, i);
    if (x_ii_i < yy_ii_i) {

      res.matrix_at(i + 1, i) = x_ii_i;
      ++res_num_non_redundant;

      yy_ii_i = x_ii_i;
      yy.reset_strongly_closed();
    }

    if (!yy.marked_strongly_closed()) {
      Variable var_i(i/2);
      yy.incremental_strong_closure_assign(var_i);
      if (target.contains(yy)) {

        if (res_num_non_redundant < x_num_non_redundant) {
          res.reset_strongly_closed();
          x.m_swap(res);
        }
        return bool_result;
      }
    }
  }


  for (dimension_type i = 0; i < 2*dim; ++i) {
    const dimension_type j = x_leaders[i];
    if (j == i || j == sing_leader)
      continue;
    const N& x_i_j = x.matrix_at(i, j);
    ((void) 0);
    N& yy_i_j = yy.matrix_at(i, j);
    if (x_i_j < yy_i_j) {
      res.matrix_at(i, j) = x_i_j;
      ++res_num_non_redundant;

      yy_i_j = x_i_j;
      yy.reset_strongly_closed();
    }
    const N& x_j_i = x.matrix_at(j, i);
    N& yy_j_i = yy.matrix_at(j, i);
    ((void) 0);
    if (x_j_i < yy_j_i) {
      res.matrix_at(j, i) = x_j_i;
      ++res_num_non_redundant;

      yy_j_i = x_j_i;
      yy.reset_strongly_closed();
    }

    if (!yy.marked_strongly_closed()) {
      Variable var_j(j/2);
      yy.incremental_strong_closure_assign(var_j);
      if (target.contains(yy)) {

        if (res_num_non_redundant < x_num_non_redundant) {
          res.reset_strongly_closed();
          x.m_swap(res);
        }
        return bool_result;
      }
    }
  }




  for (dimension_type i = 0; i < 2*dim; ++i) {
    if (i != x_leaders[i])
      continue;
    const Bit_Row& x_non_redundant_i = x_non_redundant[i];
    for (dimension_type j = 0; j < 2*dim; ++j) {
      if (j != x_leaders[j])
        continue;
      if (i >= j) {
        if (!x_non_redundant_i[j])
          continue;
      }
      else if (!x_non_redundant[j][i])
        continue;
      N& yy_i_j = yy.matrix_at(i, j);
      const N& x_i_j = x.matrix_at(i, j);
      if (x_i_j < yy_i_j) {
        res.matrix_at(i, j) = x_i_j;
        ++res_num_non_redundant;

        yy_i_j = x_i_j;
        yy.reset_strongly_closed();
        Variable var(i/2);
        yy.incremental_strong_closure_assign(var);
        if (target.contains(yy)) {

          if (res_num_non_redundant < x_num_non_redundant) {
            res.reset_strongly_closed();
            x.m_swap(res);
          }
          return bool_result;
        }
      }
    }
  }

  Parma_Polyhedra_Library::ppl_unreachable();
  return false;
}

template <typename T>
void
Octagonal_Shape<T>::add_space_dimensions_and_embed(dimension_type m) {

  if (m == 0)
    return;

  const dimension_type new_dim = space_dim + m;
  const bool was_zero_dim_univ = !marked_empty() && space_dim == 0;



  matrix.grow(new_dim);
  space_dim = new_dim;


  if (was_zero_dim_univ)
    set_strongly_closed();

  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::add_space_dimensions_and_project(dimension_type m) {

  if (m == 0)
    return;

  const dimension_type n = matrix.num_rows();



  add_space_dimensions_and_embed(m);


  for (typename OR_Matrix<N>::row_iterator i = matrix.row_begin() + n,
         matrix_row_end = matrix.row_end(); i != matrix_row_end; i += 2) {
    typename OR_Matrix<N>::row_reference_type x_i = *i;
    typename OR_Matrix<N>::row_reference_type x_ci = *(i + 1);
    const dimension_type ind = i.index();
    assign_r(x_i[ind + 1], 0, ROUND_NOT_NEEDED);
    assign_r(x_ci[ind], 0, ROUND_NOT_NEEDED);
  }

  if (marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::remove_space_dimensions(const Variables_Set& vars) {



  if (vars.empty()) {
    ((void) 0);
    return;
  }


  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dim < min_space_dim)
    throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim);

  const dimension_type new_space_dim = space_dim - vars.size();

  strong_closure_assign();


  if (new_space_dim == 0) {
    matrix.shrink(0);
    if (!marked_empty())

      set_zero_dim_univ();
    space_dim = 0;
    ((void) 0);
    return;
  }




  typedef typename OR_Matrix<N>::element_iterator Elem_Iter;
  typedef typename std::iterator_traits<Elem_Iter>::difference_type diff_t;

  dimension_type first = *vars.begin();
  const dimension_type first_size = 2 * first * (first + 1);
  Elem_Iter iter = matrix.element_begin() + static_cast<diff_t>(first_size);

  for (dimension_type i = first + 1; i < space_dim; ++i) {
    if (vars.count(i) == 0) {
      typename OR_Matrix<N>::row_iterator row_iter = matrix.row_begin() + 2*i;
      typename OR_Matrix<N>::row_reference_type row_ref = *row_iter;
      typename OR_Matrix<N>::row_reference_type row_ref1 = *(++row_iter);




      for (dimension_type j = 0; j <= i; ++j)
        if (vars.count(j) == 0) {
          assign_or_swap(*(iter++), row_ref[2*j]);
          assign_or_swap(*(iter++), row_ref[2*j + 1]);
        }
      for (dimension_type j = 0; j <= i; ++j)
        if (vars.count(j) == 0) {
          assign_or_swap(*(iter++), row_ref1[2*j]);
          assign_or_swap(*(iter++), row_ref1[2*j + 1]);
        }
    }
  }

  matrix.shrink(new_space_dim);
  space_dim = new_space_dim;
  ((void) 0);
}

template <typename T>
template <typename Partial_Function>
void
Octagonal_Shape<T>::map_space_dimensions(const Partial_Function& pfunc) {
  if (space_dim == 0)
    return;

  if (pfunc.has_empty_codomain()) {

    remove_higher_space_dimensions(0);
    return;
  }

  const dimension_type new_space_dim = pfunc.max_in_codomain() + 1;


  if (new_space_dim < space_dim)
    strong_closure_assign();



  if (marked_empty()) {
    remove_higher_space_dimensions(new_space_dim);
    return;
  }


  OR_Matrix<N> x(new_space_dim);

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;

  row_iterator m_begin = x.row_begin();

  for (row_iterator i_iter = matrix.row_begin(), i_end = matrix.row_end();
       i_iter != i_end; i_iter += 2) {
    dimension_type new_i;
    dimension_type i = i_iter.index()/2;



    if (pfunc.maps(i, new_i)) {
      row_reference r_i = *i_iter;
      row_reference r_ii = *(i_iter + 1);
      dimension_type double_new_i = 2*new_i;
      row_iterator x_iter = m_begin + double_new_i;
      row_reference x_i = *x_iter;
      row_reference x_ii = *(x_iter + 1);
      for (dimension_type j = 0; j <= i; ++j) {
        dimension_type new_j;

        if (pfunc.maps(j, new_j)) {
          dimension_type dj = 2*j;
          dimension_type double_new_j = 2*new_j;




          if (new_i >= new_j) {
            assign_or_swap(x_i[double_new_j], r_i[dj]);
            assign_or_swap(x_ii[double_new_j], r_ii[dj]);
            assign_or_swap(x_ii[double_new_j + 1], r_ii[dj + 1]);
            assign_or_swap(x_i[double_new_j + 1], r_i[dj + 1]);
          }
          else {
            row_iterator x_j_iter = m_begin + double_new_j;
            row_reference x_j = *x_j_iter;
            row_reference x_jj = *(x_j_iter + 1);
            assign_or_swap(x_jj[double_new_i + 1], r_i[dj]);
            assign_or_swap(x_jj[double_new_i], r_ii[dj]);
            assign_or_swap(x_j[double_new_i + 1], r_i[dj + 1]);
            assign_or_swap(x_j[double_new_i], r_ii[dj + 1]);
          }

        }
      }
    }
  }

  using std::swap;
  swap(matrix, x);
  space_dim = new_space_dim;
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::intersection_assign(const Octagonal_Shape& y) {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("intersection_assign(y)", y);


  if (marked_empty())
    return;
  if (y.marked_empty()) {
    set_empty();
    return;
  }



  if (space_dim == 0)
    return;



  bool changed = false;

  typename OR_Matrix<N>::const_element_iterator j = y.matrix.element_begin();
  for (typename OR_Matrix<N>::element_iterator i = matrix.element_begin(),
         matrix_element_end = matrix.element_end();
       i != matrix_element_end;
       ++i, ++j) {
    N& elem = *i;
    const N& y_elem = *j;
    if (y_elem < elem) {
      elem = y_elem;
      changed = true;
    }
  }


  if (changed && marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
template <typename Iterator>
void
Octagonal_Shape<T>::CC76_extrapolation_assign(const Octagonal_Shape& y,
                                              Iterator first, Iterator last,
                                              unsigned* tp) {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("CC76_extrapolation_assign(y)", y);


  ((void) 0);



  if (space_dim == 0)
    return;

  strong_closure_assign();

  if (marked_empty())
    return;
  y.strong_closure_assign();

  if (y.marked_empty())
    return;


  if (tp != 0 && *tp > 0) {
    Octagonal_Shape x_tmp(*this);
    x_tmp.CC76_extrapolation_assign(y, first, last, 0);

    if (!contains(x_tmp))
      --(*tp);
    return;
  }
# 3639 "Octagonal_Shape_templates.hh"
  typename OR_Matrix<N>::const_element_iterator j = y.matrix.element_begin();
  for (typename OR_Matrix<N>::element_iterator i = matrix.element_begin(),
         matrix_element_end = matrix.element_end();
       i != matrix_element_end;
       ++i, ++j) {
    const N& y_elem = *j;
    N& elem = *i;
    if (y_elem < elem) {
      Iterator k = std::lower_bound(first, last, elem);
      if (k != last) {
        if (elem < *k)
          assign_r(elem, *k, ROUND_UP);
      }
      else
        assign_r(elem, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }

  reset_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>
::get_limiting_octagon(const Constraint_System& cs,
                       Octagonal_Shape& limiting_octagon) const {
  const dimension_type cs_space_dim = cs.space_dimension();

  ((void) 0);

  strong_closure_assign();
  bool is_oct_changed = false;


  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_term; Parma_Polyhedra_Library::Coefficient& term = holder_term.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();

  for (Constraint_System::const_iterator cs_i = cs.begin(),
         cs_end = cs.end(); cs_i != cs_end; ++cs_i) {
    const Constraint& c = *cs_i;
    dimension_type num_vars = 0;
    dimension_type i = 0;
    dimension_type j = 0;

    if (!Octagonal_Shape_Helper
      ::extract_octagonal_difference(c, cs_space_dim, num_vars, i, j,
                                     coeff, term))
      continue;

    typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
    typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;
    typedef typename OR_Matrix<N>::row_iterator row_iterator;
    typedef typename OR_Matrix<N>::row_reference_type row_reference;
    Row_iterator m_begin = matrix.row_begin();

    Row_iterator i_iter = m_begin + i;
    Row_reference m_i = *i_iter;
    OR_Matrix<N>& lo_mat = limiting_octagon.matrix;
    row_iterator lo_iter = lo_mat.row_begin() + i;
    row_reference lo_m_i = *lo_iter;
    N& lo_m_i_j = lo_m_i[j];
    if (coeff < 0)
      neg_assign(coeff);

    div_round_up(d, term, coeff);
    if (m_i[j] <= d)
      if (c.is_inequality()) {
        if (lo_m_i_j > d) {
          lo_m_i_j = d;
          is_oct_changed = true;
        }
        else {

          if (i % 2 == 0) {
            ++i_iter;
            ++lo_iter;
          }
          else {
            --i_iter;
            --lo_iter;
          }
          Row_reference m_ci = *i_iter;
          row_reference lo_m_ci = *lo_iter;

          using namespace Implementation::Octagonal_Shapes;
          dimension_type cj = coherent_index(j);
          N& lo_m_ci_cj = lo_m_ci[cj];
          neg_assign(term);
          div_round_up(d, term, coeff);
          if (m_ci[cj] <= d && lo_m_ci_cj > d) {
            lo_m_ci_cj = d;
            is_oct_changed = true;
          }
        }
      }
  }


  if (is_oct_changed && limiting_octagon.marked_strongly_closed())
    limiting_octagon.reset_strongly_closed();
}

template <typename T>
void
Octagonal_Shape<T>
::limited_CC76_extrapolation_assign(const Octagonal_Shape& y,
                                    const Constraint_System& cs,
                                    unsigned* tp) {


  if (space_dim != y.space_dim)
    throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)",
                                 y);

  const dimension_type cs_space_dim = cs.space_dimension();
  if (space_dim < cs_space_dim)
    throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)");


  if (cs.has_strict_inequalities())
    throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)");




  if (space_dim == 0)
    return;


  ((void) 0);


  if (marked_empty())
    return;

  if (y.marked_empty())
    return;

  Octagonal_Shape limiting_octagon(space_dim, UNIVERSE);
  get_limiting_octagon(cs, limiting_octagon);
  CC76_extrapolation_assign(y, tp);
  intersection_assign(limiting_octagon);
}

template <typename T>
void
Octagonal_Shape<T>::BHMZ05_widening_assign(const Octagonal_Shape& y,
                                           unsigned* tp) {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("BHMZ05_widening_assign(y)", y);


  ((void) 0);


  const dimension_type y_affine_dim = y.affine_dimension();



  if (y_affine_dim == 0)
    return;



  const dimension_type x_affine_dim = affine_dimension();
  ((void) 0);
  if (x_affine_dim != y_affine_dim)
    return;


  if (tp != 0 && *tp > 0) {
    Octagonal_Shape x_tmp(*this);
    x_tmp.BHMZ05_widening_assign(y, 0);

    if (!contains(x_tmp))
      --(*tp);
    return;
  }


  ((void) 0);

  y.strong_reduction_assign();


  typename OR_Matrix<N>::const_element_iterator j = y.matrix.element_begin();
  for (typename OR_Matrix<N>::element_iterator i = matrix.element_begin(),
       matrix_element_end = matrix.element_end();
       i != matrix_element_end;
       ++i, ++j) {
    N& elem = *i;



    if (*j != elem)
      assign_r(elem, PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
  reset_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>
::limited_BHMZ05_extrapolation_assign(const Octagonal_Shape& y,
                                      const Constraint_System& cs,
                                      unsigned* tp) {


  if (space_dim != y.space_dim)
    throw_dimension_incompatible("limited_BHMZ05_extrapolation_assign(y, cs)",
                                 y);

  const dimension_type cs_space_dim = cs.space_dimension();
  if (space_dim < cs_space_dim)
    throw_constraint_incompatible("limited_CH78_extrapolation_assign(y, cs)");


  if (cs.has_strict_inequalities())
    throw_constraint_incompatible("limited_CH78_extrapolation_assign(y, cs)");




  if (space_dim == 0)
    return;


  ((void) 0);


  if (marked_empty())
    return;

  if (y.marked_empty())
    return;

  Octagonal_Shape limiting_octagon(space_dim, UNIVERSE);
  get_limiting_octagon(cs, limiting_octagon);
  BHMZ05_widening_assign(y, tp);
  intersection_assign(limiting_octagon);
}

template <typename T>
void
Octagonal_Shape<T>::CC76_narrowing_assign(const Octagonal_Shape& y) {

  if (space_dim != y.space_dim)
    throw_dimension_incompatible("CC76_narrowing_assign(y)", y);


  ((void) 0);



  if (space_dim == 0)
    return;

  y.strong_closure_assign();

  if (y.marked_empty())
    return;
  strong_closure_assign();

  if (marked_empty())
    return;



  bool is_oct_changed = false;
  typename OR_Matrix<N>::const_element_iterator j = y.matrix.element_begin();
  for (typename OR_Matrix<N>::element_iterator i = matrix.element_begin(),
         matrix_element_end = matrix.element_end();
       i != matrix_element_end;
       ++i, ++j) {
    if (!is_plus_infinity(*i)
        && !is_plus_infinity(*j)
        && *i != *j) {
      *i = *j;
      is_oct_changed = true;
    }
  }

  if (is_oct_changed && marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>
::deduce_v_pm_u_bounds(const dimension_type v_id,
                       const dimension_type last_id,
                       const Linear_Expression& sc_expr,
                       Coefficient_traits::const_reference sc_denom,
                       const N& ub_v) {

  ((void) 0);
  ((void) 0);

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_mpq_sc_denom; mpq_class& mpq_sc_denom = holder_mpq_sc_denom.item();
  assign_r(mpq_sc_denom, sc_denom, ROUND_NOT_NEEDED);


  const dimension_type n_v = 2*v_id;
  typename OR_Matrix<N>::row_reference_type m_cv = matrix[n_v + 1];


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_half; N& half = holder_half.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_minus_lb_u; mpq_class& minus_lb_u = holder_minus_lb_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_minus_q; mpq_class& minus_q = holder_minus_q.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_ub_u; mpq_class& ub_u = holder_ub_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_lb_u; mpq_class& lb_u = holder_lb_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_up_approx; N& up_approx = holder_up_approx.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_expr_u; Parma_Polyhedra_Library::Coefficient& minus_expr_u = holder_minus_expr_u.item();

  for (Linear_Expression::const_iterator u = sc_expr.begin(),
      u_end = sc_expr.lower_bound(Variable(last_id + 1)); u != u_end; ++u) {
    const dimension_type u_id = u.variable().id();

    if (u_id == v_id)
      continue;
    const Coefficient& expr_u = *u;

    const dimension_type n_u = u_id*2;

    if (expr_u > 0) {
      if (expr_u >= sc_denom) {




        div_2exp_assign_r(half, matrix[n_u + 1][n_u], 1, ROUND_UP);
        N& m_v_minus_u = (n_v < n_u) ? matrix[n_u][n_v] : m_cv[n_u + 1];
        sub_assign_r(m_v_minus_u, ub_v, half, ROUND_UP);
      }
      else {

        typename OR_Matrix<N>::row_reference_type m_u = matrix[n_u];
        const N& m_u_cu = m_u[n_u + 1];
        if (!is_plus_infinity(m_u_cu)) {




          assign_r(minus_lb_u, m_u_cu, ROUND_NOT_NEEDED);
          div_2exp_assign_r(minus_lb_u, minus_lb_u, 1, ROUND_NOT_NEEDED);
          assign_r(q, expr_u, ROUND_NOT_NEEDED);
          div_assign_r(q, q, mpq_sc_denom, ROUND_NOT_NEEDED);
          assign_r(ub_u, matrix[n_u + 1][n_u], ROUND_NOT_NEEDED);
          div_2exp_assign_r(ub_u, ub_u, 1, ROUND_NOT_NEEDED);

          add_assign_r(ub_u, ub_u, minus_lb_u, ROUND_NOT_NEEDED);

          sub_mul_assign_r(minus_lb_u, q, ub_u, ROUND_NOT_NEEDED);
          assign_r(up_approx, minus_lb_u, ROUND_UP);

          N& m_v_minus_u = (n_v < n_u) ? m_u[n_v] : m_cv[n_u + 1];
          add_assign_r(m_v_minus_u, ub_v, up_approx, ROUND_UP);
        }
      }
    }
    else {
      ((void) 0);

      neg_assign(minus_expr_u, expr_u);
      if (minus_expr_u >= sc_denom) {




        div_2exp_assign_r(half, matrix[n_u][n_u + 1], 1, ROUND_UP);
        N& m_v_plus_u = (n_v < n_u) ? matrix[n_u + 1][n_v] : m_cv[n_u];
        sub_assign_r(m_v_plus_u, ub_v, half, ROUND_UP);
      }
      else {

        typename OR_Matrix<N>::row_reference_type m_cu = matrix[n_u + 1];
        const N& m_cu_u = m_cu[n_u];
        if (!is_plus_infinity(m_cu_u)) {




          assign_r(ub_u, m_cu[n_u], ROUND_NOT_NEEDED);
          div_2exp_assign_r(ub_u, ub_u, 1, ROUND_NOT_NEEDED);
          assign_r(minus_q, minus_expr_u, ROUND_NOT_NEEDED);
          div_assign_r(minus_q, minus_q, mpq_sc_denom, ROUND_NOT_NEEDED);
          assign_r(lb_u, matrix[n_u][n_u + 1], ROUND_NOT_NEEDED);
          div_2exp_assign_r(lb_u, lb_u, 1, ROUND_NOT_NEEDED);
          neg_assign_r(lb_u, lb_u, ROUND_NOT_NEEDED);

          sub_assign_r(lb_u, lb_u, ub_u, ROUND_NOT_NEEDED);

          add_mul_assign_r(ub_u, minus_q, lb_u, ROUND_NOT_NEEDED);
          assign_r(up_approx, ub_u, ROUND_UP);

          N& m_v_plus_u = (n_v < n_u) ? m_cu[n_v] : m_cv[n_u];
          add_assign_r(m_v_plus_u, ub_v, up_approx, ROUND_UP);
        }
      }
    }
  }
}

template <typename T>
void
Octagonal_Shape<T>
::deduce_minus_v_pm_u_bounds(const dimension_type v_id,
                             const dimension_type last_id,
                             const Linear_Expression& sc_expr,
                             Coefficient_traits::const_reference sc_denom,
                             const N& minus_lb_v) {

  ((void) 0);
  ((void) 0);

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_mpq_sc_denom; mpq_class& mpq_sc_denom = holder_mpq_sc_denom.item();
  assign_r(mpq_sc_denom, sc_denom, ROUND_NOT_NEEDED);


  const dimension_type n_v = 2*v_id;
  typename OR_Matrix<N>::row_reference_type m_v = matrix[n_v];


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_half; N& half = holder_half.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_ub_u; mpq_class& ub_u = holder_ub_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_minus_lb_u; mpq_class& minus_lb_u = holder_minus_lb_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_up_approx; N& up_approx = holder_up_approx.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_expr_u; Parma_Polyhedra_Library::Coefficient& minus_expr_u = holder_minus_expr_u.item();

  for (Linear_Expression::const_iterator u = sc_expr.begin(),
      u_end = sc_expr.lower_bound(Variable(last_id + 1)); u != u_end; ++u) {
    const dimension_type u_id = u.variable().id();

    if (u_id == v_id)
      continue;
    const Coefficient& expr_u = *u;

    const dimension_type n_u = u_id*2;

    if (expr_u > 0) {
      if (expr_u >= sc_denom) {





        div_2exp_assign_r(half, matrix[n_u][n_u + 1], 1, ROUND_UP);
        N& m_u_minus_v = (n_v < n_u) ? matrix[n_u + 1][n_v + 1] : m_v[n_u];
        sub_assign_r(m_u_minus_v, minus_lb_v, half, ROUND_UP);
      }
      else {

        typename OR_Matrix<N>::row_reference_type m_cu = matrix[n_u + 1];
        const N& m_cu_u = m_cu[n_u];
        if (!is_plus_infinity(m_cu_u)) {




          assign_r(ub_u, m_cu[n_u], ROUND_NOT_NEEDED);
          div_2exp_assign_r(ub_u, ub_u, 1, ROUND_NOT_NEEDED);
          assign_r(q, expr_u, ROUND_NOT_NEEDED);
          div_assign_r(q, q, mpq_sc_denom, ROUND_NOT_NEEDED);
          assign_r(minus_lb_u, matrix[n_u][n_u + 1], ROUND_NOT_NEEDED);
          div_2exp_assign_r(minus_lb_u, minus_lb_u, 1, ROUND_NOT_NEEDED);

          add_assign_r(minus_lb_u, ub_u, minus_lb_u, ROUND_NOT_NEEDED);

          sub_mul_assign_r(ub_u, q, minus_lb_u, ROUND_NOT_NEEDED);
          assign_r(up_approx, ub_u, ROUND_UP);

          N& m_u_minus_v = (n_v < n_u) ? m_cu[n_v + 1] : m_v[n_u];
          add_assign_r(m_u_minus_v, minus_lb_v, up_approx, ROUND_UP);
        }
      }
    }
    else {
      ((void) 0);

      neg_assign(minus_expr_u, expr_u);
      if (minus_expr_u >= sc_denom) {




        div_2exp_assign_r(half, matrix[n_u + 1][n_u], 1, ROUND_UP);
        N& m_minus_v_minus_u = (n_v < n_u)
          ? matrix[n_u][n_v + 1]
          : m_v[n_u + 1];
        sub_assign_r(m_minus_v_minus_u, minus_lb_v, half, ROUND_UP);
      }
      else {

        typename OR_Matrix<N>::row_reference_type m_u = matrix[n_u];
        const N& m_u_cu = m_u[n_u + 1];
        if (!is_plus_infinity(m_u_cu)) {




          assign_r(ub_u, matrix[n_u + 1][n_u], ROUND_NOT_NEEDED);
          div_2exp_assign_r(ub_u, ub_u, 1, ROUND_NOT_NEEDED);
          assign_r(q, expr_u, ROUND_NOT_NEEDED);
          div_assign_r(q, q, mpq_sc_denom, ROUND_NOT_NEEDED);
          assign_r(minus_lb_u, m_u[n_u + 1], ROUND_NOT_NEEDED);
          div_2exp_assign_r(minus_lb_u, minus_lb_u, 1, ROUND_NOT_NEEDED);

          add_assign_r(ub_u, ub_u, minus_lb_u, ROUND_NOT_NEEDED);

          add_mul_assign_r(minus_lb_u, q, ub_u, ROUND_NOT_NEEDED);
          assign_r(up_approx, minus_lb_u, ROUND_UP);

          N& m_minus_v_minus_u = (n_v < n_u) ? m_u[n_v + 1] : m_v[n_u + 1];
          add_assign_r(m_minus_v_minus_u, minus_lb_v, up_approx, ROUND_UP);
        }
      }
    }
  }
}

template <typename T>
void
Octagonal_Shape<T>
::forget_all_octagonal_constraints(const dimension_type v_id) {
  ((void) 0);
  const dimension_type n_v = 2*v_id;
  typename OR_Matrix<N>::row_iterator m_iter = matrix.row_begin() + n_v;
  typename OR_Matrix<N>::row_reference_type r_v = *m_iter;
  typename OR_Matrix<N>::row_reference_type r_cv = *(++m_iter);
  for (dimension_type h = m_iter.row_size(); h-- > 0; ) {
    assign_r(r_v[h], PLUS_INFINITY, ROUND_NOT_NEEDED);
    assign_r(r_cv[h], PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
  ++m_iter;
  for (typename OR_Matrix<N>::row_iterator m_end = matrix.row_end();
       m_iter != m_end; ++m_iter) {
    typename OR_Matrix<N>::row_reference_type r = *m_iter;
    assign_r(r[n_v], PLUS_INFINITY, ROUND_NOT_NEEDED);
    assign_r(r[n_v + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
}

template <typename T>
void
Octagonal_Shape<T>
::forget_binary_octagonal_constraints(const dimension_type v_id) {
  ((void) 0);
  const dimension_type n_v = 2*v_id;
  typename OR_Matrix<N>::row_iterator m_iter = matrix.row_begin() + n_v;
  typename OR_Matrix<N>::row_reference_type r_v = *m_iter;
  typename OR_Matrix<N>::row_reference_type r_cv = *(++m_iter);
  for (dimension_type k = n_v; k-- > 0; ) {
    assign_r(r_v[k], PLUS_INFINITY, ROUND_NOT_NEEDED);
    assign_r(r_cv[k], PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
  ++m_iter;
  for (typename OR_Matrix<N>::row_iterator m_end = matrix.row_end();
       m_iter != m_end; ++m_iter) {
    typename OR_Matrix<N>::row_reference_type r = *m_iter;
    assign_r(r[n_v], PLUS_INFINITY, ROUND_NOT_NEEDED);
    assign_r(r[n_v + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
}

template <typename T>
void
Octagonal_Shape<T>::unconstrain(const Variable var) {

  const dimension_type var_id = var.id();
  if (space_dimension() < var_id + 1)
    throw_dimension_incompatible("unconstrain(var)", var_id + 1);


  strong_closure_assign();


  if (marked_empty())
    return;

  forget_all_octagonal_constraints(var_id);

  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::unconstrain(const Variables_Set& vars) {


  if (vars.empty())
    return;


  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dimension() < min_space_dim)
    throw_dimension_incompatible("unconstrain(vs)", min_space_dim);


  strong_closure_assign();


  if (marked_empty())
    return;

  for (Variables_Set::const_iterator vsi = vars.begin(),
         vsi_end = vars.end(); vsi != vsi_end; ++vsi)
    forget_all_octagonal_constraints(*vsi);

  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::refine(const Variable var,
                           const Relation_Symbol relsym,
                           const Linear_Expression& expr,
                           Coefficient_traits::const_reference denominator) {
  ((void) 0);
  ((void) 0);
  const dimension_type var_id = var.id();
  ((void) 0);
  ((void) 0);
  ((void) 0);

  const Coefficient& b = expr.inhomogeneous_term();


  dimension_type t = 0;


  dimension_type w_id = expr.last_nonzero();

  if (w_id != 0) {
    ++t;
    if (!expr.all_zeroes(1, w_id))
      ++t;
    --w_id;
  }





  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const dimension_type n_var = 2*var_id;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign(minus_denom, denominator);






  if (t == 1 && expr.coefficient(Variable(w_id)) != denominator
      && expr.coefficient(Variable(w_id)) != minus_denom)
    t = 2;

  if (t == 0) {

    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_two_b; Parma_Polyhedra_Library::Coefficient& two_b = holder_two_b.item();
    two_b = 2*b;
    switch (relsym) {
    case EQUAL:

      add_octagonal_constraint(n_var + 1, n_var, two_b, denominator);
      add_octagonal_constraint(n_var, n_var + 1, two_b, minus_denom);
      break;
    case LESS_OR_EQUAL:

      add_octagonal_constraint(n_var + 1, n_var, two_b, denominator);
      break;
    case GREATER_OR_EQUAL:


      add_octagonal_constraint(n_var, n_var + 1, two_b, minus_denom);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
  }
  else if (t == 1) {

    const Coefficient& w_coeff = expr.coefficient(Variable(w_id));
    const dimension_type n_w = 2*w_id;
    switch (relsym) {
    case EQUAL:
      if (w_coeff == denominator)

        if (var_id < w_id) {
          add_octagonal_constraint(n_w, n_var, b, denominator);
          add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom);
        }
        else {
          add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator);
          add_octagonal_constraint(n_var, n_w, b, minus_denom);
        }
      else

        if (var_id < w_id) {
          add_octagonal_constraint(n_w + 1, n_var, b, denominator);
          add_octagonal_constraint(n_w, n_var + 1, b, minus_denom);
        }
        else {
          add_octagonal_constraint(n_var + 1, n_w, b, denominator);
          add_octagonal_constraint(n_var, n_w + 1, b, minus_denom);
        }
      break;
    case LESS_OR_EQUAL:
      {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
        div_round_up(d, b, denominator);


        if (w_coeff == denominator) {

          if (var_id < w_id)
            add_octagonal_constraint(n_w, n_var, d);
          else
            add_octagonal_constraint(n_var + 1, n_w + 1, d);
        }
        else if (w_coeff == minus_denom) {

          if (var_id < w_id)
            add_octagonal_constraint(n_w + 1, n_var, d);
          else
            add_octagonal_constraint(n_var + 1, n_w, d);
        }
        break;
      }

    case GREATER_OR_EQUAL:
      {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
        div_round_up(d, b, minus_denom);


        if (w_coeff == denominator) {


          if (var_id < w_id)
            add_octagonal_constraint(n_w + 1, n_var + 1, d);
          else
            add_octagonal_constraint(n_var, n_w, d);
        }
        else if (w_coeff == minus_denom) {


          if (var_id < w_id)
            add_octagonal_constraint(n_w, n_var + 1, d);
          else
            add_octagonal_constraint(n_var, n_w + 1, d);
        }
        break;
      }

    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
  }
  else {


    const bool is_sc = (denominator > 0);
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
    neg_assign(minus_b, b);
    const Coefficient& sc_b = is_sc ? b : minus_b;
    const Coefficient& minus_sc_b = is_sc ? minus_b : b;
    const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
    const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



    Linear_Expression minus_expr;
    if (!is_sc)
      minus_expr = -expr;
    const Linear_Expression& sc_expr = is_sc ? expr : minus_expr;

    Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();

    dimension_type pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

    dimension_type pinf_count = 0;

    switch (relsym) {
    case EQUAL:
      {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_neg_sum; N& neg_sum = holder_neg_sum.item();

        dimension_type neg_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

        dimension_type neg_pinf_count = 0;


        assign_r(sum, sc_b, ROUND_UP);
        assign_r(neg_sum, minus_sc_b, ROUND_UP);


        Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_half; N& half = holder_half.item();
        Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_minus_coeff_i; N& minus_coeff_i = holder_minus_coeff_i.item();


        for (Row_iterator m_iter = m_begin,
               m_iter_end = m_begin + (2 * w_id + 2);
             m_iter != m_iter_end; ) {
          const dimension_type n_i = m_iter.index();
          const dimension_type id = n_i/2;
          Row_reference m_i = *m_iter;
          ++m_iter;
          Row_reference m_ci = *m_iter;
          ++m_iter;
          const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
          const int sign_i = sgn(sc_i);
          if (sign_i > 0) {
            assign_r(coeff_i, sc_i, ROUND_UP);

            if (pinf_count <= 1) {
              const N& double_approx_i = m_ci[n_i];
              if (!is_plus_infinity(double_approx_i)) {

                div_2exp_assign_r(half, double_approx_i, 1, ROUND_UP);
                add_mul_assign_r(sum, coeff_i, half, ROUND_UP);
              }
              else {
                ++pinf_count;
                pinf_index = id;
              }
            }

            if (neg_pinf_count <= 1) {
              const N& double_approx_minus_i = m_i[n_i + 1];
              if (!is_plus_infinity(double_approx_minus_i)) {

                div_2exp_assign_r(half, double_approx_minus_i, 1, ROUND_UP);
                add_mul_assign_r(neg_sum, coeff_i, half, ROUND_UP);
              }
              else {
                ++neg_pinf_count;
                neg_pinf_index = id;
              }
            }
          }
          else if (sign_i < 0) {
            neg_assign_r(minus_sc_i, sc_i, ROUND_NOT_NEEDED);
            assign_r(minus_coeff_i, minus_sc_i, ROUND_UP);

            if (pinf_count <= 1) {
              const N& double_approx_minus_i = m_i[n_i + 1];
              if (!is_plus_infinity(double_approx_minus_i)) {

                div_2exp_assign_r(half, double_approx_minus_i, 1, ROUND_UP);
                add_mul_assign_r(sum, minus_coeff_i, half, ROUND_UP);
              }
              else {
                ++pinf_count;
                pinf_index = id;
              }
            }

            if (neg_pinf_count <= 1) {
              const N& double_approx_i = m_ci[n_i];
              if (!is_plus_infinity(double_approx_i)) {

                div_2exp_assign_r(half, double_approx_i, 1, ROUND_UP);
                add_mul_assign_r(neg_sum, minus_coeff_i, half, ROUND_UP);
              }
              else {
                ++neg_pinf_count;
                neg_pinf_index = id;
              }
            }
          }
        }

        if (pinf_count > 1 && neg_pinf_count > 1) {
          ((void) 0);
          return;
        }


        reset_strongly_closed();


        if (pinf_count <= 1) {

          if (sc_denom != 1) {





            Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
            assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
            neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
            div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
          }

          if (pinf_count == 0) {

            Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_sum; N& double_sum = holder_double_sum.item();
            mul_2exp_assign_r(double_sum, sum, 1, ROUND_UP);
            matrix[n_var + 1][n_var] = double_sum;

            deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum);
          }
          else

            if (pinf_index != var_id) {
              const Coefficient& ppi
                = sc_expr.coefficient(Variable(pinf_index));
              if (ppi == sc_denom)

                if (var_id < pinf_index)
                  matrix[2*pinf_index][n_var] = sum;
                else
                  matrix[n_var + 1][2*pinf_index + 1] = sum;
              else
                if (ppi == minus_sc_denom) {

                  if (var_id < pinf_index)
                    matrix[2*pinf_index + 1][n_var] = sum;
                  else
                    matrix[n_var + 1][2*pinf_index] = sum;
                }
            }
        }


        if (neg_pinf_count <= 1) {

          if (sc_denom != 1) {





            Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
            assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
            neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
            div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP);
          }

          if (neg_pinf_count == 0) {

            Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_neg_sum; N& double_neg_sum = holder_double_neg_sum.item();
            mul_2exp_assign_r(double_neg_sum, neg_sum, 1, ROUND_UP);
            matrix[n_var][n_var + 1] = double_neg_sum;

            deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom,
                                       neg_sum);
          }
          else

            if (neg_pinf_index != var_id) {
              const Coefficient& npi
                = sc_expr.coefficient(Variable(neg_pinf_index));
              if (npi == sc_denom)


                if (neg_pinf_index < var_id)
                  matrix[n_var][2*neg_pinf_index] = neg_sum;
                else
                  matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum;
              else
                if (npi == minus_sc_denom) {


                  if (neg_pinf_index < var_id)
                    matrix[n_var][2*neg_pinf_index + 1] = neg_sum;
                  else
                    matrix[2*neg_pinf_index][n_var + 1] = neg_sum;
                }
            }
        }
        break;
      }

    case LESS_OR_EQUAL:
      {




        assign_r(sum, sc_b, ROUND_UP);


        Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_approx_i; N& approx_i = holder_approx_i.item();
        Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();


        for (row_iterator m_iter = m_begin,
               m_iter_end = m_begin + (2 * w_id + 2);
             m_iter != m_iter_end; ) {
          const dimension_type n_i = m_iter.index();
          const dimension_type id = n_i/2;
          row_reference m_i = *m_iter;
          ++m_iter;
          row_reference m_ci = *m_iter;
          ++m_iter;
          const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
          const int sign_i = sgn(sc_i);
          if (sign_i == 0)
            continue;

          const N& double_approx_i = (sign_i > 0) ? m_ci[n_i] : m_i[n_i + 1];
          if (is_plus_infinity(double_approx_i)) {
            if (++pinf_count > 1)
              break;
            pinf_index = id;
            continue;
          }
          if (sign_i > 0)
            assign_r(coeff_i, sc_i, ROUND_UP);
          else {
            neg_assign(minus_sc_i, sc_i);
            assign_r(coeff_i, minus_sc_i, ROUND_UP);
          }
          div_2exp_assign_r(approx_i, double_approx_i, 1, ROUND_UP);
          add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
        }

        if (sc_denom != 1) {




          Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
          assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
          neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
          div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
        }

        if (pinf_count == 0) {

          Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_sum; N& double_sum = holder_double_sum.item();
          mul_2exp_assign_r(double_sum, sum, 1, ROUND_UP);
          add_octagonal_constraint(n_var + 1, n_var, double_sum);

          deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum);
        }
        else if (pinf_count == 1) {
          dimension_type pinf_ind = 2*pinf_index;
          if (expr.coefficient(Variable(pinf_index)) == denominator ) {

            if (var_id < pinf_index)
              add_octagonal_constraint(pinf_ind, n_var, sum);
            else
              add_octagonal_constraint(n_var + 1, pinf_ind + 1, sum);
          }
          else {
            if (expr.coefficient(Variable(pinf_index)) == minus_denom) {

              if (var_id < pinf_index)
                add_octagonal_constraint(pinf_ind + 1, n_var, sum);
              else
                add_octagonal_constraint(n_var + 1, pinf_ind, sum);
            }
          }
        }
        break;
      }

    case GREATER_OR_EQUAL:
      {





        assign_r(sum, minus_sc_b, ROUND_UP);


        Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_approx_i; N& approx_i = holder_approx_i.item();
        Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();
        for (row_iterator m_iter = m_begin,
               m_iter_end = m_begin + (2 * w_id + 2);
             m_iter != m_iter_end; ) {
          const dimension_type n_i = m_iter.index();
          const dimension_type id = n_i/2;
          row_reference m_i = *m_iter;
          ++m_iter;
          row_reference m_ci = *m_iter;
          ++m_iter;
          const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
          const int sign_i = sgn(sc_i);
          if (sign_i == 0)
            continue;

          const N& double_approx_i = (sign_i > 0) ? m_i[n_i + 1] : m_ci[n_i];
          if (is_plus_infinity(double_approx_i)) {
            if (++pinf_count > 1)
              break;
            pinf_index = id;
            continue;
          }
          if (sign_i > 0)
            assign_r(coeff_i, sc_i, ROUND_UP);
          else {
            neg_assign(minus_sc_i, sc_i);
            assign_r(coeff_i, minus_sc_i, ROUND_UP);
          }
          div_2exp_assign_r(approx_i, double_approx_i, 1, ROUND_UP);
          add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
        }


        if (sc_denom != 1) {





          Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
          assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
          neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
          div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
        }

        if (pinf_count == 0) {

          Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_sum; N& double_sum = holder_double_sum.item();
          mul_2exp_assign_r(double_sum, sum, 1, ROUND_UP);
          add_octagonal_constraint(n_var, n_var + 1, double_sum);

          deduce_minus_v_pm_u_bounds(var_id, pinf_index, sc_expr, sc_denom,
                                     sum);
        }
        else if (pinf_count == 1) {
          dimension_type pinf_ind = 2*pinf_index;
          if (expr.coefficient(Variable(pinf_index)) == denominator) {


            if (pinf_index < var_id)
              add_octagonal_constraint(n_var, pinf_ind, sum);
            else
              add_octagonal_constraint(pinf_ind + 1, n_var, sum);
          }
          else {
            if (expr.coefficient(Variable(pinf_index)) == minus_denom) {


              if (pinf_index < var_id)
                add_octagonal_constraint(n_var, pinf_ind + 1, sum);
              else
                add_octagonal_constraint(pinf_ind, n_var + 1, sum);
            }
          }
        }
        break;
      }

    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
  }
}

template <typename T>
void
Octagonal_Shape<T>::affine_image(const Variable var,
                                 const Linear_Expression& expr,
                                 Coefficient_traits::const_reference
                                 denominator) {

  if (denominator == 0)
    throw_invalid_argument("affine_image(v, e, d)", "d == 0");




  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("affine_image(v, e, d)", "e", expr);


  const dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("affine_image(v, e, d)", var_id + 1);

  strong_closure_assign();

  if (marked_empty())
    return;



  dimension_type t = 0;

  dimension_type w_id = expr.last_nonzero();

  if (w_id != 0) {
    ++t;
    if (!expr.all_zeroes(1, w_id))
      ++t;
    --w_id;
  }

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;
  using std::swap;

  const dimension_type n_var = 2*var_id;
  const Coefficient& b = expr.inhomogeneous_term();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign_r(minus_denom, denominator, ROUND_NOT_NEEDED);
# 4877 "Octagonal_Shape_templates.hh"
  if (t == 0) {


    forget_all_octagonal_constraints(var_id);
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_two_b; Parma_Polyhedra_Library::Coefficient& two_b = holder_two_b.item();
    two_b = 2*b;

    add_octagonal_constraint(n_var + 1, n_var, two_b, denominator);
    add_octagonal_constraint(n_var, n_var + 1, two_b, minus_denom);
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& w_coeff = expr.coefficient(Variable(w_id));
    if (w_coeff == denominator || w_coeff == minus_denom) {

      if (w_id == var_id) {

        const bool sign_symmetry = (w_coeff != denominator);
        if (!sign_symmetry && b == 0)

          return;


        Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
        div_round_up(d, b, denominator);
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_minus_d; N& minus_d = holder_minus_d.item();
        div_round_up(minus_d, b, minus_denom);
        if (sign_symmetry)
          swap(d, minus_d);
        const row_iterator m_begin = matrix.row_begin();
        const row_iterator m_end = matrix.row_end();
        row_iterator m_iter = m_begin + n_var;
        row_reference m_v = *m_iter;
        ++m_iter;
        row_reference m_cv = *m_iter;
        ++m_iter;

        for (dimension_type j = n_var; j-- > 0; ) {
          N& m_v_j = m_v[j];
          add_assign_r(m_v_j, m_v_j, minus_d, ROUND_UP);
          N& m_cv_j = m_cv[j];
          add_assign_r(m_cv_j, m_cv_j, d, ROUND_UP);
          if (sign_symmetry)
            swap(m_v_j, m_cv_j);
        }
        for ( ; m_iter != m_end; ++m_iter) {
          row_reference m_i = *m_iter;
          N& m_i_v = m_i[n_var];
          add_assign_r(m_i_v, m_i_v, d, ROUND_UP);
          N& m_i_cv = m_i[n_var + 1];
          add_assign_r(m_i_cv, m_i_cv, minus_d, ROUND_UP);
          if (sign_symmetry)
            swap(m_i_v, m_i_cv);
        }

        mul_2exp_assign_r(d, d, 1, ROUND_UP);
        N& m_cv_v = m_cv[n_var];
        add_assign_r(m_cv_v, m_cv_v, d, ROUND_UP);
        mul_2exp_assign_r(minus_d, minus_d, 1, ROUND_UP);
        N& m_v_cv = m_v[n_var + 1];
        add_assign_r(m_v_cv, m_v_cv, minus_d, ROUND_UP);
        if (sign_symmetry)
          swap(m_cv_v, m_v_cv);

      }
      else {



        forget_all_octagonal_constraints(var_id);
        const dimension_type n_w = 2*w_id;

        if (w_coeff == denominator) {
          if (var_id < w_id) {
            add_octagonal_constraint(n_w, n_var, b, denominator);
            add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom);
          }
          else {
            add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator);
            add_octagonal_constraint(n_var, n_w, b, minus_denom);
          }
        }
        else {

          if (var_id < w_id) {
            add_octagonal_constraint(n_w + 1, n_var, b, denominator);
            add_octagonal_constraint(n_w, n_var + 1, b, minus_denom);
          }
          else {
            add_octagonal_constraint(n_var + 1, n_w, b, denominator);
            add_octagonal_constraint(n_var, n_w + 1, b, minus_denom);
          }
        }
        incremental_strong_closure_assign(var);
      }
      ((void) 0);
      return;
    }
  }
# 4992 "Octagonal_Shape_templates.hh"
  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign_r(minus_b, b, ROUND_NOT_NEEDED);

  const Coefficient& sc_b = is_sc ? b : minus_b;
  const Coefficient& minus_sc_b = is_sc ? minus_b : b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -expr;
  const Linear_Expression& sc_expr = is_sc ? expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_pos_sum; N& pos_sum = holder_pos_sum.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_neg_sum; N& neg_sum = holder_neg_sum.item();

  dimension_type pos_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();
  dimension_type neg_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type pos_pinf_count = 0;
  dimension_type neg_pinf_count = 0;


  assign_r(pos_sum, sc_b, ROUND_UP);
  assign_r(neg_sum, minus_sc_b, ROUND_UP);


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_minus_coeff_i; N& minus_coeff_i = holder_minus_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_half; N& half = holder_half.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();


  const row_iterator m_begin = matrix.row_begin();
  for (Row_iterator m_iter = m_begin, m_iter_end = m_begin + (2 * w_id + 2);
       m_iter != m_iter_end; ) {
    const dimension_type n_i = m_iter.index();
    const dimension_type id = n_i/2;
    Row_reference m_i = *m_iter;
    ++m_iter;
    Row_reference m_ci = *m_iter;
    ++m_iter;
    const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
    const int sign_i = sgn(sc_i);
    if (sign_i > 0) {
      assign_r(coeff_i, sc_i, ROUND_UP);

      if (pos_pinf_count <= 1) {
        const N& double_up_approx_i = m_ci[n_i];
        if (!is_plus_infinity(double_up_approx_i)) {

          div_2exp_assign_r(half, double_up_approx_i, 1, ROUND_UP);
          add_mul_assign_r(pos_sum, coeff_i, half, ROUND_UP);
        }
        else {
          ++pos_pinf_count;
          pos_pinf_index = id;
        }
      }

      if (neg_pinf_count <= 1) {
        const N& double_up_approx_minus_i = m_i[n_i + 1];
        if (!is_plus_infinity(double_up_approx_minus_i)) {

          div_2exp_assign_r(half, double_up_approx_minus_i, 1, ROUND_UP);
          add_mul_assign_r(neg_sum, coeff_i, half, ROUND_UP);
        }
        else {
          ++neg_pinf_count;
          neg_pinf_index = id;
        }
      }
    }
    else if (sign_i < 0) {
      neg_assign_r(minus_sc_i, sc_i, ROUND_NOT_NEEDED);
      assign_r(minus_coeff_i, minus_sc_i, ROUND_UP);

      if (pos_pinf_count <= 1) {
        const N& double_up_approx_minus_i = m_i[n_i + 1];
        if (!is_plus_infinity(double_up_approx_minus_i)) {

          div_2exp_assign_r(half, double_up_approx_minus_i, 1, ROUND_UP);
          add_mul_assign_r(pos_sum, minus_coeff_i, half, ROUND_UP);
        }
        else {
          ++pos_pinf_count;
          pos_pinf_index = id;
        }
      }

      if (neg_pinf_count <= 1) {
        const N& double_up_approx_i = m_ci[n_i];
        if (!is_plus_infinity(double_up_approx_i)) {

          div_2exp_assign_r(half, double_up_approx_i, 1, ROUND_UP);
          add_mul_assign_r(neg_sum, minus_coeff_i, half, ROUND_UP);
        }
        else {
          ++neg_pinf_count;
          neg_pinf_index = id;
        }
      }
    }
  }


  forget_all_octagonal_constraints(var_id);

  if (pos_pinf_count > 1 && neg_pinf_count > 1) {
    ((void) 0);
    return;
  }


  reset_strongly_closed();


  if (pos_pinf_count <= 1) {

    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(pos_sum, pos_sum, down_sc_denom, ROUND_UP);
    }

    if (pos_pinf_count == 0) {

      Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_pos_sum; N& double_pos_sum = holder_double_pos_sum.item();
      mul_2exp_assign_r(double_pos_sum, pos_sum, 1, ROUND_UP);
      matrix[n_var + 1][n_var] = double_pos_sum;

      deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, pos_sum);
    }
    else

      if (pos_pinf_index != var_id) {
        const Coefficient& ppi = sc_expr.coefficient(Variable(pos_pinf_index));
        if (ppi == sc_denom)

          if (var_id < pos_pinf_index)
            matrix[2*pos_pinf_index][n_var] = pos_sum;
          else
            matrix[n_var + 1][2*pos_pinf_index + 1] = pos_sum;
        else
          if (ppi == minus_sc_denom) {

            if (var_id < pos_pinf_index)
              matrix[2*pos_pinf_index + 1][n_var] = pos_sum;
            else
              matrix[n_var + 1][2*pos_pinf_index] = pos_sum;
          }
      }
  }


  if (neg_pinf_count <= 1) {

    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP);
    }

    if (neg_pinf_count == 0) {

      Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_neg_sum; N& double_neg_sum = holder_double_neg_sum.item();
      mul_2exp_assign_r(double_neg_sum, neg_sum, 1, ROUND_UP);
      matrix[n_var][n_var + 1] = double_neg_sum;

      deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, neg_sum);
    }
    else

      if (neg_pinf_index != var_id) {
        const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index));
        if (npi == sc_denom)


          if (neg_pinf_index < var_id)
            matrix[n_var][2*neg_pinf_index] = neg_sum;
          else
            matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum;
        else
          if (npi == minus_sc_denom) {


            if (neg_pinf_index < var_id)
              matrix[n_var][2*neg_pinf_index + 1] = neg_sum;
            else
              matrix[2*neg_pinf_index][n_var + 1] = neg_sum;
          }
      }
  }

  incremental_strong_closure_assign(var);
  ((void) 0);
}

template <typename T>
template <typename Interval_Info>
void
Octagonal_Shape<T>::affine_form_image(const Variable var,
                    const Linear_Form< Interval<T, Interval_Info> >& lf) {

  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_5211 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };






  const dimension_type lf_space_dim = lf.space_dimension();
  if (space_dim < lf_space_dim)
    throw_dimension_incompatible("affine_form_image(v, l)", "l", lf);


  const dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("affine_form_image(v, l)", var.id() + 1);

  strong_closure_assign();

  if (marked_empty())
    return;



  dimension_type t = 0;

  dimension_type w_id = 0;


  for (dimension_type i = lf_space_dim; i-- > 0; )
    if (lf.coefficient(Variable(i)) != 0) {
      if (t++ == 1)
        break;
      else
        w_id = i;
    }

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;
  typedef Interval<T, Interval_Info> FP_Interval_Type;
  using std::swap;

  const dimension_type n_var = 2*var_id;
  const FP_Interval_Type& b = lf.inhomogeneous_term();
# 5262 "Octagonal_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_ub; N& b_ub = holder_b_ub.item();
  assign_r(b_ub, b.upper(), ROUND_NOT_NEEDED);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_mlb; N& b_mlb = holder_b_mlb.item();
  neg_assign_r(b_mlb, b.lower(), ROUND_NOT_NEEDED);

  if (t == 0) {

    forget_all_octagonal_constraints(var_id);
    mul_2exp_assign_r(b_mlb, b_mlb, 1, ROUND_UP);
    mul_2exp_assign_r(b_ub, b_ub, 1, ROUND_UP);

    add_octagonal_constraint(n_var + 1, n_var, b_ub);
    add_octagonal_constraint(n_var, n_var + 1, b_mlb);
    ((void) 0);
    return;
  }


  bool is_b_zero = (b_mlb == 0 && b_ub == 0);

  if (t == 1) {

    const FP_Interval_Type& w_coeff = lf.coefficient(Variable(w_id));

    bool is_w_coeff_one = (w_coeff == 1);

    bool is_w_coeff_minus_one = (w_coeff == -1);
    if (is_w_coeff_one || is_w_coeff_minus_one) {

      if (w_id == var_id) {

        if (is_w_coeff_one && is_b_zero)

          return;


        if (is_w_coeff_minus_one)
          swap(b_ub, b_mlb);
        const row_iterator m_begin = matrix.row_begin();
        const row_iterator m_end = matrix.row_end();
        row_iterator m_iter = m_begin + n_var;
        row_reference m_v = *m_iter;
        ++m_iter;
        row_reference m_cv = *m_iter;
        ++m_iter;

        for (dimension_type j = n_var; j-- > 0; ) {
          N& m_v_j = m_v[j];
          add_assign_r(m_v_j, m_v_j, b_mlb, ROUND_UP);
          N& m_cv_j = m_cv[j];
          add_assign_r(m_cv_j, m_cv_j, b_ub, ROUND_UP);
          if (is_w_coeff_minus_one)
            swap(m_v_j, m_cv_j);
        }
        for ( ; m_iter != m_end; ++m_iter) {
          row_reference m_i = *m_iter;
          N& m_i_v = m_i[n_var];
          add_assign_r(m_i_v, m_i_v, b_ub, ROUND_UP);
          N& m_i_cv = m_i[n_var + 1];
          add_assign_r(m_i_cv, m_i_cv, b_mlb, ROUND_UP);
          if (is_w_coeff_minus_one)
            swap(m_i_v, m_i_cv);
        }

        mul_2exp_assign_r(b_ub, b_ub, 1, ROUND_UP);
        N& m_cv_v = m_cv[n_var];
        add_assign_r(m_cv_v, m_cv_v, b_ub, ROUND_UP);
        mul_2exp_assign_r(b_mlb, b_mlb, 1, ROUND_UP);
        N& m_v_cv = m_v[n_var + 1];
        add_assign_r(m_v_cv, m_v_cv, b_mlb, ROUND_UP);
        if (is_w_coeff_minus_one)
          swap(m_cv_v, m_v_cv);

      }
      else {



        forget_all_octagonal_constraints(var_id);
        const dimension_type n_w = 2*w_id;
        if (is_w_coeff_one)


          if (var_id < w_id) {
            add_octagonal_constraint(n_w, n_var, b_ub);
            add_octagonal_constraint(n_w + 1, n_var + 1, b_mlb);
          }
          else {
            add_octagonal_constraint(n_var + 1, n_w + 1, b_ub);
            add_octagonal_constraint(n_var, n_w, b_mlb);
          }
        else


          if (var_id < w_id) {
            add_octagonal_constraint(n_w + 1, n_var, b_ub);
            add_octagonal_constraint(n_w, n_var + 1, b_mlb);
          }
          else {
            add_octagonal_constraint(n_var + 1, n_w, b_ub);
            add_octagonal_constraint(n_var, n_w + 1, b_mlb);
          }
        incremental_strong_closure_assign(var);
      }
      ((void) 0);
      return;
    }
  }







  reset_strongly_closed();

  Linear_Form<FP_Interval_Type> minus_lf(lf);
  minus_lf.negate();


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_upper_bound; N& upper_bound = holder_upper_bound.item();

  row_iterator m_iter = matrix.row_begin();
  m_iter += n_var;
  row_reference var_ite = *m_iter;
  ++m_iter;
  row_reference var_cv_ite = *m_iter;
  ++m_iter;
  row_iterator m_end = matrix.row_end();


  for (dimension_type curr_var = var_id,
         n_curr_var = n_var - 2; curr_var-- > 0; ) {
    Variable current(curr_var);
    linear_form_upper_bound(lf + current, upper_bound);
    assign_r(var_cv_ite[n_curr_var], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(lf - current, upper_bound);
    assign_r(var_cv_ite[n_curr_var + 1], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(minus_lf + current, upper_bound);
    assign_r(var_ite[n_curr_var], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(minus_lf - current, upper_bound);
    assign_r(var_ite[n_curr_var + 1], upper_bound, ROUND_NOT_NEEDED);
    n_curr_var -= 2;
  }
  for (dimension_type curr_var = var_id + 1; m_iter != m_end; ++m_iter) {
    row_reference m_v_ite = *m_iter;
    ++m_iter;
    row_reference m_cv_ite = *m_iter;
    Variable current(curr_var);
    linear_form_upper_bound(lf + current, upper_bound);
    assign_r(m_cv_ite[n_var], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(lf - current, upper_bound);
    assign_r(m_v_ite[n_var], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(minus_lf + current, upper_bound);
    assign_r(m_cv_ite[n_var + 1], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(minus_lf - current, upper_bound);
    assign_r(m_v_ite[n_var + 1], upper_bound, ROUND_NOT_NEEDED);
    ++curr_var;
  }


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lf_ub; N& lf_ub = holder_lf_ub.item();
  linear_form_upper_bound(lf, lf_ub);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_minus_lf_ub; N& minus_lf_ub = holder_minus_lf_ub.item();
  linear_form_upper_bound(minus_lf, minus_lf_ub);
  mul_2exp_assign_r(lf_ub, lf_ub, 1, ROUND_UP);
  assign_r(matrix[n_var + 1][n_var], lf_ub, ROUND_NOT_NEEDED);
  mul_2exp_assign_r(minus_lf_ub, minus_lf_ub, 1, ROUND_UP);
  assign_r(matrix[n_var][n_var + 1], minus_lf_ub, ROUND_NOT_NEEDED);

  ((void) 0);
}

template <typename T>
template <typename Interval_Info>
void
Octagonal_Shape<T>::
linear_form_upper_bound(const Linear_Form< Interval<T, Interval_Info> >& lf,
                        N& result) const {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_5446 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };



  const dimension_type lf_space_dimension = lf.space_dimension();
  ((void) 0);

  typedef Interval<T, Interval_Info> FP_Interval_Type;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_lb; N& curr_lb = holder_curr_lb.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_ub; N& curr_ub = holder_curr_ub.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_var_ub; N& curr_var_ub = holder_curr_var_ub.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_minus_var_ub; N& curr_minus_var_ub = holder_curr_minus_var_ub.item();

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_first_comparison_term; N& first_comparison_term = holder_first_comparison_term.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_second_comparison_term; N& second_comparison_term = holder_second_comparison_term.item();

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_negator; N& negator = holder_negator.item();

  assign_r(result, lf.inhomogeneous_term().upper(), ROUND_NOT_NEEDED);

  for (dimension_type curr_var = 0, n_var = 0; curr_var < lf_space_dimension;
       ++curr_var) {
    const FP_Interval_Type& curr_coefficient =
                            lf.coefficient(Variable(curr_var));
    assign_r(curr_lb, curr_coefficient.lower(), ROUND_NOT_NEEDED);
    assign_r(curr_ub, curr_coefficient.upper(), ROUND_NOT_NEEDED);
    if (curr_lb != 0 || curr_ub != 0) {
      assign_r(curr_var_ub, matrix[n_var + 1][n_var], ROUND_NOT_NEEDED);
      div_2exp_assign_r(curr_var_ub, curr_var_ub, 1, ROUND_UP);
      neg_assign_r(curr_minus_var_ub, matrix[n_var][n_var + 1],
                   ROUND_NOT_NEEDED);
      div_2exp_assign_r(curr_minus_var_ub, curr_minus_var_ub, 1, ROUND_DOWN);

      if (curr_lb == 1 && curr_ub == 1) {
        add_assign_r(result, result, std::max(curr_var_ub, curr_minus_var_ub),
                     ROUND_UP);
      }
      else if (curr_lb == -1 && curr_ub == -1) {
        neg_assign_r(negator, std::min(curr_var_ub, curr_minus_var_ub),
                     ROUND_NOT_NEEDED);
        add_assign_r(result, result, negator, ROUND_UP);
      }
      else {

        assign_r(first_comparison_term, 0, ROUND_NOT_NEEDED);
        assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
        add_mul_assign_r(first_comparison_term, curr_var_ub, curr_ub,
                         ROUND_UP);
        add_mul_assign_r(second_comparison_term, curr_var_ub, curr_lb,
                         ROUND_UP);
        assign_r(first_comparison_term, std::max(first_comparison_term,
                                                 second_comparison_term),
                 ROUND_NOT_NEEDED);
        assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
        add_mul_assign_r(second_comparison_term, curr_minus_var_ub, curr_ub,
                         ROUND_UP);
        assign_r(first_comparison_term, std::max(first_comparison_term,
                                                 second_comparison_term),
                 ROUND_NOT_NEEDED);
        assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
        add_mul_assign_r(second_comparison_term, curr_minus_var_ub, curr_lb,
                         ROUND_UP);
        assign_r(first_comparison_term, std::max(first_comparison_term,
                                                 second_comparison_term),
                 ROUND_NOT_NEEDED);

        add_assign_r(result, result, first_comparison_term, ROUND_UP);
      }
    }

    n_var += 2;
  }
}

template <typename T>
void
Octagonal_Shape<T>::
interval_coefficient_upper_bound(const N& var_ub, const N& minus_var_ub,
                                 const N& int_ub, const N& int_lb,
                                 N& result) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_5529 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };




  Parma_Polyhedra_Library::Dirty_Temp<N> holder_second_comparison_term; N& second_comparison_term = holder_second_comparison_term.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_third_comparison_term; N& third_comparison_term = holder_third_comparison_term.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_fourth_comparison_term; N& fourth_comparison_term = holder_fourth_comparison_term.item();

  assign_r(result, 0, ROUND_NOT_NEEDED);
  assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
  assign_r(third_comparison_term, 0, ROUND_NOT_NEEDED);
  assign_r(fourth_comparison_term, 0, ROUND_NOT_NEEDED);

  add_mul_assign_r(result, var_ub, int_ub, ROUND_UP);
  add_mul_assign_r(second_comparison_term, minus_var_ub, int_ub, ROUND_UP);
  add_mul_assign_r(third_comparison_term, var_ub, int_lb, ROUND_UP);
  add_mul_assign_r(fourth_comparison_term, minus_var_ub, int_lb, ROUND_UP);

  assign_r(result, std::max(result, second_comparison_term), ROUND_NOT_NEEDED);
  assign_r(result, std::max(result, third_comparison_term), ROUND_NOT_NEEDED);
  assign_r(result, std::max(result, fourth_comparison_term), ROUND_NOT_NEEDED);
}

template <typename T>
void
Octagonal_Shape<T>::affine_preimage(const Variable var,
                                    const Linear_Expression& expr,
                                    Coefficient_traits::const_reference
                                    denominator) {


  if (denominator == 0)
    throw_invalid_argument("affine_preimage(v, e, d)", "d == 0");




  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr);


  dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("affine_preimage(v, e, d)", var_id + 1);

  strong_closure_assign();

  if (marked_empty())
    return;

  const Coefficient& b = expr.inhomogeneous_term();



  dimension_type t = 0;


  dimension_type w_id = expr.last_nonzero();

  if (w_id != 0) {
    ++t;
    if (!expr.all_zeroes(1, w_id))
      ++t;
    --w_id;
  }
# 5604 "Octagonal_Shape_templates.hh"
  if (t == 0) {

    forget_all_octagonal_constraints(var_id);
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& w_coeff = expr.coefficient(Variable(w_id));
    if (w_coeff == denominator || w_coeff == -denominator) {

      if (w_id == var_id) {

        affine_image(var, denominator*var - b, w_coeff);
      }
      else {


        forget_all_octagonal_constraints(var_id);
        ((void) 0);
      }
      return;
    }
  }




  const Coefficient& coeff_v = expr.coefficient(var);
  if (coeff_v != 0) {
    if (coeff_v > 0) {

      Linear_Expression inverse = ((coeff_v + denominator)*var);
      inverse -= expr;
      affine_image(var, inverse, coeff_v);
    }
    else {

      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_coeff_v; Parma_Polyhedra_Library::Coefficient& minus_coeff_v = holder_minus_coeff_v.item();
      neg_assign(minus_coeff_v, coeff_v);
      Linear_Expression inverse = ((minus_coeff_v - denominator)*var);
      inverse += expr;
      affine_image(var, inverse, minus_coeff_v);
    }
  }
  else {

    forget_all_octagonal_constraints(var_id);
    ((void) 0);
  }
}

template <typename T>
void
Octagonal_Shape<T>
::generalized_affine_image(const Variable var,
                           const Relation_Symbol relsym,
                           const Linear_Expression& expr ,
                           Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0");




  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("generalized_affine_image(v, r, e, d)", "e",
                                 expr);


  dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("generalized_affine_image(v, r, e, d)",
                                 var_id + 1);


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)",
                           "r is the disequality relation symbol");

  if (relsym == EQUAL) {


    affine_image(var, expr, denominator);
    return;
  }

  strong_closure_assign();

  if (marked_empty())
    return;



  dimension_type t = 0;

  dimension_type w_id = expr.last_nonzero();

  if (w_id != 0) {
    ++t;
    if (!expr.all_zeroes(1, w_id))
      ++t;
    --w_id;
  }

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const row_iterator m_end = matrix.row_end();
  const dimension_type n_var = 2*var_id;
  const Coefficient& b = expr.inhomogeneous_term();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign_r(minus_denom, denominator, ROUND_NOT_NEEDED);
# 5737 "Octagonal_Shape_templates.hh"
  if (t == 0) {

    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_two_b; Parma_Polyhedra_Library::Coefficient& two_b = holder_two_b.item();
    two_b = 2*b;

    forget_all_octagonal_constraints(var_id);

    reset_strongly_closed();
    switch (relsym) {
    case LESS_OR_EQUAL:

      add_octagonal_constraint(n_var + 1, n_var, two_b, denominator);
      break;
    case GREATER_OR_EQUAL:


      add_octagonal_constraint(n_var, n_var + 1, two_b, minus_denom);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& w_coeff = expr.coefficient(Variable(w_id));
    if (w_coeff == denominator || w_coeff == minus_denom) {

      switch (relsym) {
      case LESS_OR_EQUAL:
        {
          Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
          div_round_up(d, b, denominator);
          if (w_id == var_id) {


            reset_strongly_closed();
            if (w_coeff == denominator) {



              row_iterator m_iter = m_begin + n_var;
              row_reference m_v = *m_iter;
              N& m_v_cv = m_v[n_var + 1];
              ++m_iter;
              row_reference m_cv = *m_iter;
              N& m_cv_v = m_cv[n_var];
              ++m_iter;

              for ( ; m_iter != m_end; ++m_iter) {
                row_reference m_i = *m_iter;
                N& m_i_v = m_i[n_var];
                add_assign_r(m_i_v, m_i_v, d, ROUND_UP);
                assign_r(m_i[n_var + 1], PLUS_INFINITY, ROUND_NOT_NEEDED);
              }
              for (dimension_type k = n_var; k-- > 0; ) {
                assign_r(m_v[k], PLUS_INFINITY, ROUND_NOT_NEEDED);
                add_assign_r(m_cv[k], m_cv[k], d, ROUND_UP);
              }
              mul_2exp_assign_r(d, d, 1, ROUND_UP);
              add_assign_r(m_cv_v, m_cv_v, d, ROUND_UP);
              assign_r(m_v_cv, PLUS_INFINITY, ROUND_NOT_NEEDED);
            }
            else {


              N& m_v_cv = matrix[n_var][n_var + 1];
              mul_2exp_assign_r(d, d, 1, ROUND_UP);
              add_assign_r(matrix[n_var + 1][n_var], m_v_cv, d, ROUND_UP);
              assign_r(m_v_cv, PLUS_INFINITY, ROUND_NOT_NEEDED);
              forget_binary_octagonal_constraints(var_id);
            }
          }
          else {



            forget_all_octagonal_constraints(var_id);
            const dimension_type n_w = 2*w_id;
            if (w_coeff == denominator) {

              if (var_id < w_id)
                add_octagonal_constraint(n_w, n_var, b, denominator);
              else
                add_octagonal_constraint(n_var + 1, n_w + 1, b, denominator);
            }
            else {

              if (var_id < w_id)
                add_octagonal_constraint(n_w + 1, n_var, b, denominator);
              else
                add_octagonal_constraint(n_var + 1, n_w, b, denominator);
            }
          }
          break;
        }

      case GREATER_OR_EQUAL:
        {
          Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
          div_round_up(d, b, minus_denom);
          if (w_id == var_id) {


            reset_strongly_closed();
            if (w_coeff == denominator) {



              row_iterator m_iter = m_begin + n_var;
              row_reference m_v = *m_iter;
              N& m_v_cv = m_v[n_var + 1];
              ++m_iter;
              row_reference m_cv = *m_iter;
              N& m_cv_v = m_cv[n_var];
              ++m_iter;

              for ( ; m_iter != m_end; ++m_iter) {
                row_reference m_i = *m_iter;
                assign_r(m_i[n_var], PLUS_INFINITY, ROUND_NOT_NEEDED);
                add_assign_r(m_i[n_var + 1], m_i[n_var + 1], d, ROUND_UP);
              }
              for (dimension_type k = n_var; k-- > 0; ) {
                add_assign_r(m_v[k], m_v[k], d, ROUND_UP);
                assign_r(m_cv[k], PLUS_INFINITY, ROUND_NOT_NEEDED);
              }
              mul_2exp_assign_r(d, d, 1, ROUND_UP);
              add_assign_r(m_v_cv, m_v_cv, d, ROUND_UP);
              assign_r(m_cv_v, PLUS_INFINITY, ROUND_NOT_NEEDED);
            }
            else {


              N& m_cv_v = matrix[n_var + 1][n_var];
              mul_2exp_assign_r(d, d, 1, ROUND_UP);
              add_assign_r(matrix[n_var][n_var + 1], m_cv_v, d, ROUND_UP);
              assign_r(m_cv_v, PLUS_INFINITY, ROUND_NOT_NEEDED);
              forget_binary_octagonal_constraints(var_id);
            }
          }
          else {



            forget_all_octagonal_constraints(var_id);
            const dimension_type n_w = 2*w_id;




            if (w_coeff == denominator) {


              if (var_id < w_id)
                add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom);
              else
                add_octagonal_constraint(n_var, n_w, b, minus_denom);
            }
            else {


              if (var_id < w_id)
                add_octagonal_constraint(n_w, n_var + 1, b, minus_denom);
              else
                add_octagonal_constraint(n_var, n_w + 1, b, minus_denom);
            }
          }
          break;
        }

      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }
      ((void) 0);
      return;
    }
  }
# 5928 "Octagonal_Shape_templates.hh"
  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign(minus_b, b);
  const Coefficient& sc_b = is_sc ? b : minus_b;
  const Coefficient& minus_sc_b = is_sc ? minus_b : b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -expr;
  const Linear_Expression& sc_expr = is_sc ? expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();

  dimension_type pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type pinf_count = 0;

  switch (relsym) {
  case LESS_OR_EQUAL:
    {



      assign_r(sum, sc_b, ROUND_UP);

      Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
      Parma_Polyhedra_Library::Dirty_Temp<N> holder_approx_i; N& approx_i = holder_approx_i.item();
      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();


      for (Row_iterator m_iter = m_begin, m_iter_end = m_begin + (2 * w_id + 2);
           m_iter != m_iter_end; ) {
        const dimension_type n_i = m_iter.index();
        const dimension_type id = n_i/2;
        Row_reference m_i = *m_iter;
        ++m_iter;
        Row_reference m_ci = *m_iter;
        ++m_iter;
        const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
        const int sign_i = sgn(sc_i);
        if (sign_i == 0)
          continue;

        const N& double_approx_i = (sign_i > 0) ? m_ci[n_i] : m_i[n_i + 1];
        if (is_plus_infinity(double_approx_i)) {
          if (++pinf_count > 1)
            break;
          pinf_index = id;
          continue;
        }
        if (sign_i > 0)
          assign_r(coeff_i, sc_i, ROUND_UP);
        else {
          neg_assign(minus_sc_i, sc_i);
          assign_r(coeff_i, minus_sc_i, ROUND_UP);
        }
        div_2exp_assign_r(approx_i, double_approx_i, 1, ROUND_UP);
        add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
      }

      forget_all_octagonal_constraints(var_id);
      reset_strongly_closed();

      if (pinf_count > 1) {
        ((void) 0);
        return;
      }


      if (sc_denom != 1) {





        Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
        assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
        neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
        div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
      }

      if (pinf_count == 0) {

        Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_sum; N& double_sum = holder_double_sum.item();
        mul_2exp_assign_r(double_sum, sum, 1, ROUND_UP);
        matrix[n_var + 1][n_var] = double_sum;

        deduce_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, sum);
      }
      else if (pinf_count == 1)
        if (pinf_index != var_id) {
          const Coefficient& pi = expr.coefficient(Variable(pinf_index));
          if (pi == denominator ) {

            if (var_id < pinf_index)
              matrix[2*pinf_index][n_var] = sum;
            else
              matrix[n_var + 1][2*pinf_index + 1] = sum;
          }
          else {
            if (pi == minus_denom) {

              if (var_id < pinf_index)
                matrix[2*pinf_index + 1][n_var] = sum;
              else
                matrix[n_var + 1][2*pinf_index] = sum;
            }
          }
        }
      break;
    }

  case GREATER_OR_EQUAL:
    {





      assign_r(sum, minus_sc_b, ROUND_UP);
      Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();
      Parma_Polyhedra_Library::Dirty_Temp<N> holder_approx_i; N& approx_i = holder_approx_i.item();

      for (Row_iterator m_iter = m_begin, m_iter_end = m_begin + (2 * w_id + 2);
           m_iter != m_iter_end; ) {
        const dimension_type n_i = m_iter.index();
        const dimension_type id = n_i/2;
        Row_reference m_i = *m_iter;
        ++m_iter;
        Row_reference m_ci = *m_iter;
        ++m_iter;
        const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
        const int sign_i = sgn(sc_i);
        if (sign_i == 0)
          continue;

        const N& double_approx_i = (sign_i > 0) ? m_i[n_i + 1] : m_ci[n_i];
        if (is_plus_infinity(double_approx_i)) {
          if (++pinf_count > 1)
            break;
          pinf_index = id;
          continue;
        }
        if (sign_i > 0)
          assign_r(coeff_i, sc_i, ROUND_UP);
        else {
          neg_assign(minus_sc_i, sc_i);
          assign_r(coeff_i, minus_sc_i, ROUND_UP);
        }
        div_2exp_assign_r(approx_i, double_approx_i, 1, ROUND_UP);
        add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
      }


      forget_all_octagonal_constraints(var_id);
      reset_strongly_closed();

      if (pinf_count > 1) {
        ((void) 0);
        return;
      }


      if (sc_denom != 1) {





        Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
        assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
        neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
        div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
      }

      if (pinf_count == 0) {

        Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_sum; N& double_sum = holder_double_sum.item();
        mul_2exp_assign_r(double_sum, sum, 1, ROUND_UP);
        matrix[n_var][n_var + 1] = double_sum;

        deduce_minus_v_pm_u_bounds(var_id, pinf_index, sc_expr, sc_denom, sum);
      }
      else if (pinf_count == 1)
        if (pinf_index != var_id) {
          const Coefficient& pi = expr.coefficient(Variable(pinf_index));
          if (pi == denominator) {


            if (pinf_index < var_id)
              matrix[n_var][2*pinf_index] = sum;
            else
              matrix[2*pinf_index + 1][n_var + 1] = sum;
          }
          else {
            if (pi == minus_denom) {


              if (pinf_index < var_id)
                matrix[n_var][2*pinf_index + 1] = sum;
              else
                matrix[2*pinf_index][n_var + 1] = sum;
            }
          }
        }
      break;
    }

  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
  incremental_strong_closure_assign(var);
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::generalized_affine_image(const Linear_Expression& lhs,
                                             const Relation_Symbol relsym,
                                             const Linear_Expression& rhs) {



  dimension_type lhs_space_dim = lhs.space_dimension();
  if (space_dim < lhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e1", lhs);



  const dimension_type rhs_space_dim = rhs.space_dimension();
  if (space_dim < rhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e2", rhs);


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_image(e1, r, e2)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(e1, r, e2)",
                           "r is the disequality relation symbol");

  strong_closure_assign();

  if (marked_empty())
    return;



  dimension_type t_lhs = 0;

  dimension_type j_lhs = lhs.last_nonzero();

  if (j_lhs != 0) {
    ++t_lhs;
    if (!lhs.all_zeroes(1, j_lhs))
      ++t_lhs;
    --j_lhs;
  }

  const Coefficient& b_lhs = lhs.inhomogeneous_term();

  if (t_lhs == 0) {
# 6208 "Octagonal_Shape_templates.hh"
    switch (relsym) {
    case LESS_OR_EQUAL:
      refine_no_check(lhs <= rhs);
      break;
    case EQUAL:
      refine_no_check(lhs == rhs);
      break;
    case GREATER_OR_EQUAL:
      refine_no_check(lhs >= rhs);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
  }

  else if (t_lhs == 1) {



    Variable v(j_lhs);

    const Coefficient& denom = lhs.coefficient(v);
    Relation_Symbol new_relsym = relsym;
    if (denom < 0) {
      if (relsym == LESS_OR_EQUAL)
        new_relsym = GREATER_OR_EQUAL;
      else if (relsym == GREATER_OR_EQUAL)
        new_relsym = LESS_OR_EQUAL;
    }
    Linear_Expression expr = rhs - b_lhs;
    generalized_affine_image(v, new_relsym, expr, denom);
  }
  else {


    std::vector<Variable> lhs_vars;
    for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end();
          i != i_end; ++i)
      lhs_vars.push_back(i.variable());

    const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim);
    if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) {


      for (dimension_type i = lhs_vars.size(); i-- > 0; ) {
        dimension_type lhs_vars_i = lhs_vars[i].id();
        forget_all_octagonal_constraints(lhs_vars_i);
      }




      switch (relsym) {
      case LESS_OR_EQUAL:
        refine_no_check(lhs <= rhs);
        break;
      case EQUAL:
        refine_no_check(lhs == rhs);
        break;
      case GREATER_OR_EQUAL:
        refine_no_check(lhs >= rhs);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }
    }
    else {




      for (dimension_type i = lhs_vars.size(); i-- > 0; ) {
        dimension_type lhs_vars_i = lhs_vars[i].id();
        forget_all_octagonal_constraints(lhs_vars_i);
      }
# 6333 "Octagonal_Shape_templates.hh"
    }
  }

  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::bounded_affine_image(const Variable var,
                                         const Linear_Expression& lb_expr,
                                         const Linear_Expression& ub_expr,
                                         Coefficient_traits::const_reference
                                         denominator) {

  if (denominator == 0)
    throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0");


  const dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 var_id + 1);



  const dimension_type lb_space_dim = lb_expr.space_dimension();
  if (space_dim < lb_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "lb", lb_expr);
  const dimension_type ub_space_dim = ub_expr.space_dimension();
  if (space_dim < ub_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "ub", ub_expr);

  strong_closure_assign();

  if (marked_empty())
    return;



  dimension_type t = 0;

  dimension_type w_id = lb_expr.last_nonzero();

  if (w_id != 0) {
    ++t;
    if (!lb_expr.all_zeroes(1, w_id))
      ++t;
    --w_id;
  }

  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const dimension_type n_var = 2*var_id;
  const Coefficient& b = lb_expr.inhomogeneous_term();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign_r(minus_denom, denominator, ROUND_NOT_NEEDED);
# 6405 "Octagonal_Shape_templates.hh"
  if (t == 0) {

    generalized_affine_image(var,
                             LESS_OR_EQUAL,
                             ub_expr,
                             denominator);
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_two_b; Parma_Polyhedra_Library::Coefficient& two_b = holder_two_b.item();
    two_b = 2*b;

    add_octagonal_constraint(n_var, n_var + 1, two_b, minus_denom);
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& w_coeff = lb_expr.coefficient(Variable(w_id));
    if (w_coeff == denominator || w_coeff == minus_denom) {

      if (w_id == var_id) {


        const Variable new_var(space_dim);
        add_space_dimensions_and_embed(1);


        affine_image(new_var, lb_expr, denominator);

        strong_closure_assign();
        ((void) 0);

        generalized_affine_image(var,
                                 LESS_OR_EQUAL,
                                 ub_expr,
                                 denominator);

        refine_no_check(var >= new_var);

        remove_higher_space_dimensions(space_dim-1);
        return;
      }
      else {

        generalized_affine_image(var,
                                 LESS_OR_EQUAL,
                                 ub_expr,
                                 denominator);


        const dimension_type n_w = 2*w_id;

        if (w_coeff == denominator)
          if (var_id < w_id)
            add_octagonal_constraint(n_w + 1, n_var + 1, b, minus_denom);
          else
            add_octagonal_constraint(n_var, n_w, b, minus_denom);
        else {

          if (var_id < w_id)
            add_octagonal_constraint(n_w, n_var + 1, b, minus_denom);
          else
            add_octagonal_constraint(n_var, n_w + 1, b, minus_denom);
        }
        ((void) 0);
        return;
      }
    }
  }
# 6486 "Octagonal_Shape_templates.hh"
  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign_r(minus_b, b, ROUND_NOT_NEEDED);

  const Coefficient& minus_sc_b = is_sc ? minus_b : b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -lb_expr;
  const Linear_Expression& sc_expr = is_sc ? lb_expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_neg_sum; N& neg_sum = holder_neg_sum.item();

  dimension_type neg_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type neg_pinf_count = 0;


  assign_r(neg_sum, minus_sc_b, ROUND_UP);


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_minus_coeff_i; N& minus_coeff_i = holder_minus_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_half; N& half = holder_half.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();


  for (Row_iterator m_iter = m_begin, m_iter_end = m_begin + (2 * w_id + 2);
       m_iter != m_iter_end; ) {
    const dimension_type n_i = m_iter.index();
    const dimension_type id = n_i/2;
    Row_reference m_i = *m_iter;
    ++m_iter;
    Row_reference m_ci = *m_iter;
    ++m_iter;
    const Coefficient& sc_i = sc_expr.coefficient(Variable(id));
    const int sign_i = sgn(sc_i);
    if (sign_i > 0) {
      assign_r(coeff_i, sc_i, ROUND_UP);

      if (neg_pinf_count <= 1) {
        const N& double_up_approx_minus_i = m_i[n_i + 1];
        if (!is_plus_infinity(double_up_approx_minus_i)) {

          div_2exp_assign_r(half, double_up_approx_minus_i, 1, ROUND_UP);
          add_mul_assign_r(neg_sum, coeff_i, half, ROUND_UP);
        }
        else {
          ++neg_pinf_count;
          neg_pinf_index = id;
        }
      }
    }
    else if (sign_i < 0) {
      neg_assign_r(minus_sc_i, sc_i, ROUND_NOT_NEEDED);
      assign_r(minus_coeff_i, minus_sc_i, ROUND_UP);

      if (neg_pinf_count <= 1) {
        const N& double_up_approx_i = m_ci[n_i];
        if (!is_plus_infinity(double_up_approx_i)) {

          div_2exp_assign_r(half, double_up_approx_i, 1, ROUND_UP);
          add_mul_assign_r(neg_sum, minus_coeff_i, half, ROUND_UP);
        }
        else {
          ++neg_pinf_count;
          neg_pinf_index = id;
        }
      }
    }
  }


  generalized_affine_image(var,
                           LESS_OR_EQUAL,
                           ub_expr,
                           denominator);


  if (neg_pinf_count > 1) {
    return;
  }


  reset_strongly_closed();


  if (neg_pinf_count <= 1) {

    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP);
    }

    if (neg_pinf_count == 0) {

      Parma_Polyhedra_Library::Dirty_Temp<N> holder_double_neg_sum; N& double_neg_sum = holder_double_neg_sum.item();
      mul_2exp_assign_r(double_neg_sum, neg_sum, 1, ROUND_UP);
      matrix[n_var][n_var + 1] = double_neg_sum;

      deduce_minus_v_pm_u_bounds(var_id, w_id, sc_expr, sc_denom, neg_sum);
    }
    else

      if (neg_pinf_index != var_id) {
        const Coefficient& npi = sc_expr.coefficient(Variable(neg_pinf_index));
        if (npi == sc_denom)


          if (neg_pinf_index < var_id)
            matrix[n_var][2*neg_pinf_index] = neg_sum;
          else
            matrix[2*neg_pinf_index + 1][n_var + 1] = neg_sum;
        else
          if (npi == minus_sc_denom) {


            if (neg_pinf_index < var_id)
              matrix[n_var][2*neg_pinf_index + 1] = neg_sum;
            else
              matrix[2*neg_pinf_index][n_var + 1] = neg_sum;
          }
      }
  }

  ((void) 0);
}


template <typename T>
void
Octagonal_Shape<T>
::generalized_affine_preimage(const Variable var,
                              const Relation_Symbol relsym,
                              const Linear_Expression& expr,
                              Coefficient_traits::const_reference
                              denominator) {

  if (denominator == 0)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)", "d == 0");




  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)",
                                 "e", expr);


  const dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)",
                                 var_id + 1);


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "r is the disequality relation symbol");

  if (relsym == EQUAL) {


    affine_preimage(var, expr, denominator);
    return;
  }


  strong_closure_assign();
  if (marked_empty())
    return;



  const Coefficient& expr_v = expr.coefficient(var);
  if (expr_v != 0) {
    const Relation_Symbol reversed_relsym = (relsym == LESS_OR_EQUAL)
      ? GREATER_OR_EQUAL : LESS_OR_EQUAL;
    const Linear_Expression inverse
      = expr - (expr_v + denominator)*var;
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_inverse_denom; Parma_Polyhedra_Library::Coefficient& inverse_denom = holder_inverse_denom.item();
    neg_assign(inverse_denom, expr_v);
    const Relation_Symbol inverse_relsym
      = (sgn(denominator) == sgn(inverse_denom)) ? relsym : reversed_relsym;
    generalized_affine_image(var, inverse_relsym, inverse, inverse_denom);
    return;
  }





  refine(var, relsym, expr, denominator);


  if (is_empty())
    return;


  forget_all_octagonal_constraints(var_id);
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>
::generalized_affine_preimage(const Linear_Expression& lhs,
                              const Relation_Symbol relsym,
                              const Linear_Expression& rhs) {



  dimension_type lhs_space_dim = lhs.space_dimension();
  if (space_dim < lhs_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)",
                                 "e1", lhs);



  const dimension_type rhs_space_dim = rhs.space_dimension();
  if (space_dim < rhs_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)",
                                 "e2", rhs);


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_preimage(e1, r, e2)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_preimage(e1, r, e2)",
                           "r is the disequality relation symbol");

  strong_closure_assign();

  if (marked_empty())
    return;



  dimension_type t_lhs = 0;

  dimension_type j_lhs = lhs.last_nonzero();

  if (j_lhs != 0) {
    ++t_lhs;
    if (!lhs.all_zeroes(1, j_lhs))
      ++t_lhs;
    j_lhs--;
  }

  const Coefficient& b_lhs = lhs.inhomogeneous_term();



  if (t_lhs == 0) {
    generalized_affine_image(lhs, relsym, rhs);
    return;
  }

  else if (t_lhs == 1) {



    Variable v(j_lhs);

    const Coefficient& denom = lhs.coefficient(v);
    Relation_Symbol new_relsym = relsym;
    if (denom < 0) {
      if (relsym == LESS_OR_EQUAL)
        new_relsym = GREATER_OR_EQUAL;
      else if (relsym == GREATER_OR_EQUAL)
        new_relsym = LESS_OR_EQUAL;
    }
    Linear_Expression expr = rhs - b_lhs;
    generalized_affine_preimage(v, new_relsym, expr, denom);
  }

  else {


    std::vector<Variable> lhs_vars;
    for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end();
          i != i_end; ++i)
      lhs_vars.push_back(i.variable());

    const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim);
    if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) {





      switch (relsym) {
      case LESS_OR_EQUAL:
        refine_no_check(lhs <= rhs);
        break;
      case EQUAL:
        refine_no_check(lhs == rhs);
        break;
      case GREATER_OR_EQUAL:
        refine_no_check(lhs >= rhs);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }


      if (is_empty())
        return;

      for (dimension_type i = lhs_vars.size(); i-- > 0; ) {
        dimension_type lhs_vars_i = lhs_vars[i].id();
        forget_all_octagonal_constraints(lhs_vars_i);
      }
    }
    else {






      const Variable new_var(space_dim);
      add_space_dimensions_and_embed(1);




      affine_image(new_var, lhs);


      strong_closure_assign();
      ((void) 0);
      for (dimension_type i = lhs_vars.size(); i-- > 0; ) {
        dimension_type lhs_vars_i = lhs_vars[i].id();
        forget_all_octagonal_constraints(lhs_vars_i);
      }







      switch (relsym) {
      case LESS_OR_EQUAL:
        refine_no_check(new_var <= rhs);
        break;
      case EQUAL:
        refine_no_check(new_var == rhs);
        break;
      case GREATER_OR_EQUAL:
        refine_no_check(new_var >= rhs);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }

      remove_higher_space_dimensions(space_dim-1);
    }
  }
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::bounded_affine_preimage(const Variable var,
                                            const Linear_Expression& lb_expr,
                                            const Linear_Expression& ub_expr,
                                            Coefficient_traits::const_reference
                                            denominator) {

  if (denominator == 0)
    throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0");


  const dimension_type var_id = var.id();
  if (space_dim < var_id + 1)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 var_id + 1);



  const dimension_type lb_space_dim = lb_expr.space_dimension();
  if (space_dim < lb_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "lb", lb_expr);
  const dimension_type ub_space_dim = ub_expr.space_dimension();
  if (space_dim < ub_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "ub", ub_expr);

  strong_closure_assign();

  if (marked_empty())
    return;

  if (ub_expr.coefficient(var) == 0) {
    refine(var, LESS_OR_EQUAL, ub_expr, denominator);
    generalized_affine_preimage(var, GREATER_OR_EQUAL,
                                lb_expr, denominator);
    return;
  }
  if (lb_expr.coefficient(var) == 0) {
    refine(var, GREATER_OR_EQUAL, lb_expr, denominator);
    generalized_affine_preimage(var, LESS_OR_EQUAL,
                                ub_expr, denominator);
    return;
  }

  const Coefficient& expr_v = lb_expr.coefficient(var);


  const Variable new_var(space_dim);
  add_space_dimensions_and_embed(1);
  const Linear_Expression lb_inverse
    = lb_expr - (expr_v + denominator)*var;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_inverse_denom; Parma_Polyhedra_Library::Coefficient& inverse_denom = holder_inverse_denom.item();
  neg_assign(inverse_denom, expr_v);
  affine_image(new_var, lb_inverse, inverse_denom);
  strong_closure_assign();
  ((void) 0);
  generalized_affine_preimage(var, LESS_OR_EQUAL,
                              ub_expr, denominator);
  if (sgn(denominator) == sgn(inverse_denom))
    refine_no_check(var >= new_var) ;
  else
    refine_no_check(var <= new_var);

  remove_higher_space_dimensions(space_dim-1);
}

template <typename T>
Constraint_System
Octagonal_Shape<T>::constraints() const {
  const dimension_type space_dim = space_dimension();
  Constraint_System cs;
  cs.set_space_dimension(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cs = Constraint_System::zero_dim_empty();
    return cs;
  }

  if (marked_empty()) {
    cs.insert(Constraint::zero_dim_false());
    return cs;
  }

  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;

  row_iterator m_begin = matrix.row_begin();
  row_iterator m_end = matrix.row_end();

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_a; Parma_Polyhedra_Library::Coefficient& a = holder_a.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_b; Parma_Polyhedra_Library::Coefficient& b = holder_b.item();


  for (row_iterator i_iter = m_begin; i_iter != m_end; ) {
    const dimension_type i = i_iter.index();
    const Variable x(i/2);
    const N& c_i_ii = (*i_iter)[i + 1];
    ++i_iter;
    const N& c_ii_i = (*i_iter)[i];
    ++i_iter;

    if (is_additive_inverse(c_i_ii, c_ii_i)) {

      numer_denom(c_ii_i, b, a);
      a *= 2;
      cs.insert(a*x == b);
    }
    else {

      if (!is_plus_infinity(c_i_ii)) {
        numer_denom(c_i_ii, b, a);
        a *= 2;
        cs.insert(-a*x <= b);
      }
      if (!is_plus_infinity(c_ii_i)) {
        numer_denom(c_ii_i, b, a);
        a *= 2;
        cs.insert(a*x <= b);
      }
    }
  }

  for (row_iterator i_iter = m_begin; i_iter != m_end; ) {
    const dimension_type i = i_iter.index();
    row_reference r_i = *i_iter;
    ++i_iter;
    row_reference r_ii = *i_iter;
    ++i_iter;
    const Variable y(i/2);
    for (dimension_type j = 0; j < i; j += 2) {
      const N& c_i_j = r_i[j];
      const N& c_ii_jj = r_ii[j + 1];
      const Variable x(j/2);
      if (is_additive_inverse(c_ii_jj, c_i_j)) {

        numer_denom(c_i_j, b, a);
        cs.insert(a*x - a*y == b);
      }
      else {

        if (!is_plus_infinity(c_i_j)) {
          numer_denom(c_i_j, b, a);
          cs.insert(a*x - a*y <= b);
        }
        if (!is_plus_infinity(c_ii_jj)) {
          numer_denom(c_ii_jj, b, a);
          cs.insert(a*y - a*x <= b);
        }
      }

      const N& c_ii_j = r_ii[j];
      const N& c_i_jj = r_i[j + 1];
      if (is_additive_inverse(c_i_jj, c_ii_j)) {

        numer_denom(c_ii_j, b, a);
        cs.insert(a*x + a*y == b);
      }
      else {

        if (!is_plus_infinity(c_i_jj)) {
          numer_denom(c_i_jj, b, a);
          cs.insert(-a*x - a*y <= b);
        }
        if (!is_plus_infinity(c_ii_j)) {
          numer_denom(c_ii_j, b, a);
          cs.insert(a*x + a*y <= b);
        }
      }
    }
  }
  return cs;
}

template <typename T>
void
Octagonal_Shape<T>::expand_space_dimension(Variable var, dimension_type m) {

  const dimension_type var_id = var.id();
  if (var_id + 1 > space_dim)
    throw_dimension_incompatible("expand_space_dimension(v, m)", var_id + 1);



  if (m > max_space_dimension() - space_dim)
    throw_invalid_argument("expand_dimension(v, m)",
                           "adding m new space dimensions exceeds "
                           "the maximum allowed space dimension");


  if (m == 0)
    return;


  const dimension_type old_num_rows = matrix.num_rows();


  add_space_dimensions_and_embed(m);




  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  typedef typename OR_Matrix<N>::const_row_iterator Row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type Row_reference;

  const row_iterator m_begin = matrix.row_begin();
  const row_iterator m_end = matrix.row_end();
  const dimension_type n_var = 2*var_id;
  Row_iterator v_iter = m_begin + n_var;
  Row_reference m_v = *v_iter;
  Row_reference m_cv = *(v_iter + 1);

  for (row_iterator i_iter = m_begin + old_num_rows; i_iter != m_end;
       i_iter += 2) {
    row_reference m_i = *i_iter;
    row_reference m_ci = *(i_iter + 1);
    const dimension_type i = i_iter.index();
    const dimension_type ci = i + 1;
    m_i[ci] = m_v[n_var + 1];
    m_ci[i] = m_cv[n_var];
    for (dimension_type j = 0; j < n_var; ++j) {
      m_i[j] = m_v[j];
      m_ci[j] = m_cv[j];
    }
    for (dimension_type j = n_var + 2; j < old_num_rows; ++j) {
      row_iterator j_iter = m_begin + j;
      row_reference m_cj = (j % 2 != 0) ? *(j_iter-1) : *(j_iter + 1);
      m_i[j] = m_cj[n_var + 1];
      m_ci[j] = m_cj[n_var];
    }
  }


  if (marked_strongly_closed())
    reset_strongly_closed();
  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>::fold_space_dimensions(const Variables_Set& vars,
                                          Variable dest) {

  if (dest.space_dimension() > space_dim)
    throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest);


  if (vars.empty())
    return;


  if (vars.space_dimension() > space_dim)
    throw_dimension_incompatible("fold_space_dimensions(vs, v)",
                                 vars.space_dimension());


  if (vars.find(dest.id()) != vars.end())
    throw_invalid_argument("fold_space_dimensions(vs, v)",
                           "v should not occur in vs");





  typedef typename OR_Matrix<N>::row_iterator row_iterator;
  typedef typename OR_Matrix<N>::row_reference_type row_reference;

  const row_iterator m_begin = matrix.row_begin();

  strong_closure_assign();
  const dimension_type n_rows = matrix.num_rows();
  const dimension_type n_dest = 2*dest.id();
  row_iterator v_iter = m_begin + n_dest;
  row_reference m_v = *v_iter;
  row_reference m_cv = *(v_iter + 1);
  for (Variables_Set::const_iterator i = vars.begin(),
         vs_end = vars.end(); i != vs_end; ++i) {
    const dimension_type tbf_id = *i;
    const dimension_type tbf_var = 2*tbf_id;
    row_iterator tbf_iter = m_begin + tbf_var;
    row_reference m_tbf = *tbf_iter;
    row_reference m_ctbf = *(tbf_iter + 1);
    max_assign(m_v[n_dest + 1], m_tbf[tbf_var + 1]);
    max_assign(m_cv[n_dest], m_ctbf[tbf_var]);

    const dimension_type min_id = std::min(n_dest, tbf_var);
    const dimension_type max_id = std::max(n_dest, tbf_var);

    using namespace Implementation::Octagonal_Shapes;
    for (dimension_type j = 0; j < min_id; ++j) {
      const dimension_type cj = coherent_index(j);
      max_assign(m_v[j], m_tbf[j]);
      max_assign(m_cv[j], m_ctbf[j]);
      max_assign(m_cv[cj], m_ctbf[cj]);
      max_assign(m_v[cj], m_tbf[cj]);
    }
    for (dimension_type j = min_id + 2; j < max_id; ++j) {
      const dimension_type cj = coherent_index(j);
      row_iterator j_iter = m_begin + j;
      row_reference m_j = *j_iter;
      row_reference m_cj = (j % 2 != 0) ? *(j_iter-1) : *(j_iter + 1);
      if (n_dest == min_id) {
        max_assign(m_cj[n_dest + 1], m_tbf[j]);
        max_assign(m_cj[n_dest], m_ctbf[j]);
        max_assign(m_j[n_dest], m_ctbf[cj]);
        max_assign(m_j[n_dest + 1], m_tbf[cj]);
      }
      else {
        max_assign(m_v[j], m_cj[tbf_var + 1]);
        max_assign(m_cv[j], m_cj[tbf_var]);
        max_assign(m_cv[cj], m_j[tbf_var]);
        max_assign(m_v[cj], m_j[tbf_var + 1]);
      }
    }
    for (dimension_type j = max_id + 2; j < n_rows; ++j) {
      row_iterator j_iter = m_begin + j;
      row_reference m_j = *j_iter;
      row_reference m_cj = (j % 2 != 0) ? *(j_iter-1) : *(j_iter + 1);
      max_assign(m_cj[n_dest + 1], m_cj[tbf_var + 1]);
      max_assign(m_cj[n_dest], m_cj[tbf_var]);
      max_assign(m_j[n_dest], m_j[tbf_var]);
      max_assign(m_j[n_dest + 1], m_j[tbf_var + 1]);
    }
  }
  remove_space_dimensions(vars);
}

template <typename T>
bool
Octagonal_Shape<T>::upper_bound_assign_if_exact(const Octagonal_Shape& y) {



  const Octagonal_Shape& x = *this;
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y);


  if (x_space_dim == 0) {
    upper_bound_assign(y);
    return true;
  }

  if (x.marked_empty()) {
    *this = y;
    return true;
  }
  else if (y.is_empty())
    return true;
  else if (x.is_empty()) {
    *this = y;
    return true;
  }


  ((void) 0);
  ((void) 0);

  Octagonal_Shape<T> ub(x);
  ub.upper_bound_assign(y);



  std::vector<Bit_Row> x_non_red;
  x.non_redundant_matrix_entries(x_non_red);
  std::vector<Bit_Row> y_non_red;
  y.non_redundant_matrix_entries(y_non_red);

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs; N& lhs = holder_lhs.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs_copy; N& lhs_copy = holder_lhs_copy.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_rhs; N& rhs = holder_rhs.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_zero; N& temp_zero = holder_temp_zero.item();
  assign_r(temp_zero, 0, ROUND_NOT_NEEDED);

  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;
  const dimension_type n_rows = x.matrix.num_rows();
  const row_iterator x_m_begin = x.matrix.row_begin();
  const row_iterator y_m_begin = y.matrix.row_begin();
  const row_iterator ub_m_begin = ub.matrix.row_begin();

  for (dimension_type i = n_rows; i-- > 0; ) {
    const Bit_Row& x_non_red_i = x_non_red[i];
    using namespace Implementation::Octagonal_Shapes;
    const dimension_type ci = coherent_index(i);
    const dimension_type row_size_i = OR_Matrix<N>::row_size(i);
    row_reference x_i = *(x_m_begin + i);
    row_reference y_i = *(y_m_begin + i);
    row_reference ub_i = *(ub_m_begin + i);
    const N& ub_i_ci = ub_i[ci];
    for (dimension_type j = row_size_i; j-- > 0; ) {

      if (!x_non_red_i[j])
        continue;
      const N& x_i_j = x_i[j];

      if (x_i_j >= y_i[j])
        continue;
      const dimension_type cj = coherent_index(j);
      const dimension_type row_size_cj = OR_Matrix<N>::row_size(cj);
      row_reference ub_cj = *(ub_m_begin + cj);
      const N& ub_cj_j = ub_cj[j];
      for (dimension_type k = 0; k < n_rows; ++k) {
        const Bit_Row& y_non_red_k = y_non_red[k];
        const dimension_type ck = coherent_index(k);
        const dimension_type row_size_k = OR_Matrix<N>::row_size(k);
        row_reference x_k = *(x_m_begin + k);
        row_reference y_k = *(y_m_begin + k);
        row_reference ub_k = *(ub_m_begin + k);
        const N& ub_k_ck = ub_k[ck];



        const N& ub_k_j
          = (k == j)
          ? temp_zero
          : ((j < row_size_k) ? ub_k[j] : ub_cj[ck]);
        const N& ub_i_ck
          = (i == ck)
          ? temp_zero
          : ((ck < row_size_i) ? ub_i[ck] : ub_k[ci]);

        for (dimension_type ell = row_size_k; ell-- > 0; ) {

          if (!y_non_red_k[ell])
            continue;
          const N& y_k_ell = y_k[ell];

          if (y_k_ell >= x_k[ell])
            continue;
          const dimension_type cell = coherent_index(ell);
          row_reference ub_cell = *(ub_m_begin + cell);
          const N& ub_i_ell
            = (i == ell)
            ? temp_zero
            : ((ell < row_size_i) ? ub_i[ell] : ub_cell[ci]);
          const N& ub_cj_ell
            = (cj == ell)
            ? temp_zero
            : ((ell < row_size_cj) ? ub_cj[ell] : ub_cell[j]);

          add_assign_r(lhs, x_i_j, y_k_ell, ROUND_UP);
          add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_UP);
          if (lhs >= rhs)
            continue;

          add_assign_r(rhs, ub_i_ck, ub_cj_ell, ROUND_UP);
          if (lhs >= rhs)
            continue;

          assign_r(lhs_copy, lhs, ROUND_NOT_NEEDED);
          add_assign_r(lhs, lhs_copy, x_i_j, ROUND_UP);
          add_assign_r(rhs, ub_i_ell, ub_i_ck, ROUND_UP);
          add_assign_r(rhs, rhs, ub_cj_j, ROUND_UP);
          if (lhs >= rhs)
            continue;

          add_assign_r(rhs, ub_k_j, ub_cj_ell, ROUND_UP);
          add_assign_r(rhs, rhs, ub_i_ci, ROUND_UP);
          if (lhs >= rhs)
            continue;

          add_assign_r(lhs, lhs_copy, y_k_ell, ROUND_UP);
          add_assign_r(rhs, ub_i_ell, ub_cj_ell, ROUND_UP);
          add_assign_r(rhs, rhs, ub_k_ck, ROUND_UP);
          if (lhs >= rhs)
            continue;

          add_assign_r(rhs, ub_k_j, ub_i_ck, ROUND_UP);
          add_assign_r(rhs, rhs, ub_cell[ell], ROUND_UP);
          if (lhs < rhs)


            return false;
        }
      }
    }
  }


  m_swap(ub);
  ((void) 0);
  return true;
}

template <typename T>
bool
Octagonal_Shape<T>
::integer_upper_bound_assign_if_exact(const Octagonal_Shape& y) {
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_7367 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(std::numeric_limits<T>::is_integer)>) };




  const Octagonal_Shape& x = *this;
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    throw_dimension_incompatible("integer_upper_bound_assign_if_exact(y)", y);


  if (x_space_dim == 0) {
    upper_bound_assign(y);
    return true;
  }



  if (x.marked_empty()) {
    *this = y;
    tight_closure_assign();
    return true;
  }
  else if (y.marked_empty()) {
    tight_closure_assign();
    return true;
  }
  else if (x.is_empty() || x.tight_coherence_would_make_empty()) {
    *this = y;
    tight_closure_assign();
    return true;
  }
  else if (y.is_empty() || y.tight_coherence_would_make_empty()) {
    tight_closure_assign();
    return true;
  }


  ((void) 0);
  ((void) 0);


  Octagonal_Shape<T> tx(x);
  tx.tight_closure_assign();
  Octagonal_Shape<T> ty(y);
  ty.tight_closure_assign();
  Octagonal_Shape<T> ub(tx);
  ub.upper_bound_assign(ty);





  std::vector<Bit_Row> tx_non_red;
  tx.non_redundant_matrix_entries(tx_non_red);
  std::vector<Bit_Row> ty_non_red;
  ty.non_redundant_matrix_entries(ty_non_red);

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs_i_j; N& lhs_i_j = holder_lhs_i_j.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs_k_ell; N& lhs_k_ell = holder_lhs_k_ell.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs; N& lhs = holder_lhs.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs_copy; N& lhs_copy = holder_lhs_copy.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_rhs; N& rhs = holder_rhs.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_zero; N& temp_zero = holder_temp_zero.item();
  assign_r(temp_zero, 0, ROUND_NOT_NEEDED);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_one; N& temp_one = holder_temp_one.item();
  assign_r(temp_one, 1, ROUND_NOT_NEEDED);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_two; N& temp_two = holder_temp_two.item();
  assign_r(temp_two, 2, ROUND_NOT_NEEDED);

  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;
  const dimension_type n_rows = tx.matrix.num_rows();
  const row_iterator tx_m_begin = tx.matrix.row_begin();
  const row_iterator ty_m_begin = ty.matrix.row_begin();
  const row_iterator ub_m_begin = ub.matrix.row_begin();

  for (dimension_type i = n_rows; i-- > 0; ) {
    const Bit_Row& tx_non_red_i = tx_non_red[i];
    using namespace Implementation::Octagonal_Shapes;
    const dimension_type ci = coherent_index(i);
    const dimension_type row_size_i = OR_Matrix<N>::row_size(i);
    row_reference tx_i = *(tx_m_begin + i);
    row_reference ty_i = *(ty_m_begin + i);
    row_reference ub_i = *(ub_m_begin + i);
    const N& ub_i_ci = ub_i[ci];
    for (dimension_type j = row_size_i; j-- > 0; ) {

      if (!tx_non_red_i[j])
        continue;
      const N& tx_i_j = tx_i[j];
      const dimension_type cj = coherent_index(j);
      const N& eps_i_j = (i == cj) ? temp_two : temp_one;

      add_assign_r(lhs_i_j, tx_i_j, eps_i_j, ROUND_NOT_NEEDED);
      if (lhs_i_j > ty_i[j])
        continue;
      const dimension_type row_size_cj = OR_Matrix<N>::row_size(cj);
      row_reference ub_cj = *(ub_m_begin + cj);
      const N& ub_cj_j = ub_cj[j];
      for (dimension_type k = 0; k < n_rows; ++k) {
        const Bit_Row& ty_non_red_k = ty_non_red[k];
        const dimension_type ck = coherent_index(k);
        const dimension_type row_size_k = OR_Matrix<N>::row_size(k);
        row_reference tx_k = *(tx_m_begin + k);
        row_reference ty_k = *(ty_m_begin + k);
        row_reference ub_k = *(ub_m_begin + k);
        const N& ub_k_ck = ub_k[ck];



        const N& ub_k_j
          = (k == j)
          ? temp_zero
          : ((j < row_size_k) ? ub_k[j] : ub_cj[ck]);
        const N& ub_i_ck
          = (i == ck)
          ? temp_zero
          : ((ck < row_size_i) ? ub_i[ck] : ub_k[ci]);

        for (dimension_type ell = row_size_k; ell-- > 0; ) {

          if (!ty_non_red_k[ell])
            continue;
          const N& ty_k_ell = ty_k[ell];
          const dimension_type cell = coherent_index(ell);
          const N& eps_k_ell = (k == cell) ? temp_two : temp_one;

          add_assign_r(lhs_k_ell, ty_k_ell, eps_k_ell, ROUND_NOT_NEEDED);
          if (lhs_k_ell > tx_k[ell])
            continue;
          row_reference ub_cell = *(ub_m_begin + cell);
          const N& ub_i_ell
            = (i == ell)
            ? temp_zero
            : ((ell < row_size_i) ? ub_i[ell] : ub_cell[ci]);
          const N& ub_cj_ell
            = (cj == ell)
            ? temp_zero
            : ((ell < row_size_cj) ? ub_cj[ell] : ub_cell[j]);

          add_assign_r(lhs, lhs_i_j, lhs_k_ell, ROUND_NOT_NEEDED);
          add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_NOT_NEEDED);
          if (lhs > rhs)
            continue;

          add_assign_r(rhs, ub_i_ck, ub_cj_ell, ROUND_NOT_NEEDED);
          if (lhs > rhs)
            continue;

          assign_r(lhs_copy, lhs, ROUND_NOT_NEEDED);
          add_assign_r(lhs, lhs, lhs_i_j, ROUND_NOT_NEEDED);
          add_assign_r(rhs, ub_i_ell, ub_i_ck, ROUND_NOT_NEEDED);
          add_assign_r(rhs, rhs, ub_cj_j, ROUND_NOT_NEEDED);
          if (lhs > rhs)
            continue;

          add_assign_r(rhs, ub_k_j, ub_cj_ell, ROUND_NOT_NEEDED);
          add_assign_r(rhs, rhs, ub_i_ci, ROUND_NOT_NEEDED);
          if (lhs > rhs)
            continue;

          add_assign_r(lhs, lhs_copy, lhs_k_ell, ROUND_NOT_NEEDED);
          add_assign_r(rhs, ub_i_ell, ub_cj_ell, ROUND_NOT_NEEDED);
          add_assign_r(rhs, rhs, ub_k_ck, ROUND_NOT_NEEDED);
          if (lhs > rhs)
            continue;

          add_assign_r(rhs, ub_k_j, ub_i_ck, ROUND_NOT_NEEDED);
          add_assign_r(rhs, rhs, ub_cell[ell], ROUND_NOT_NEEDED);
          if (lhs <= rhs)


            return false;
        }
      }
    }
  }


  m_swap(ub);
  ((void) 0);
  return true;
}

template <typename T>
void
Octagonal_Shape<T>::drop_some_non_integer_points(Complexity_Class) {
  if (std::numeric_limits<T>::is_integer)
    return;

  const dimension_type space_dim = space_dimension();
  strong_closure_assign();
  if (space_dim == 0 || marked_empty())
    return;

  for (typename OR_Matrix<N>::element_iterator i = matrix.element_begin(),
         i_end = matrix.element_end(); i != i_end; ++i)
    drop_some_non_integer_points_helper(*i);


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_one; N& temp_one = holder_temp_one.item();
  assign_r(temp_one, 1, ROUND_NOT_NEEDED);
  for (dimension_type i = 0; i < 2*space_dim; i += 2) {
    const dimension_type ci = i + 1;
    N& mat_i_ci = matrix[i][ci];
    if (!is_plus_infinity(mat_i_ci) && !is_even(mat_i_ci)) {
      sub_assign_r(mat_i_ci, mat_i_ci, temp_one, ROUND_UP);
      reset_strongly_closed();
    }
    N& mat_ci_i = matrix[ci][i];
    if (!is_plus_infinity(mat_ci_i) && !is_even(mat_ci_i)) {
      sub_assign_r(mat_ci_i, mat_ci_i, temp_one, ROUND_UP);
      reset_strongly_closed();
    }
  }

  ((void) 0);
}

template <typename T>
void
Octagonal_Shape<T>
::drop_some_non_integer_points(const Variables_Set& vars,
                               Complexity_Class) {

  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dimension() < min_space_dim)
    throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)",
                                 min_space_dim);

  if (std::numeric_limits<T>::is_integer || min_space_dim == 0)
    return;

  strong_closure_assign();
  if (marked_empty())
    return;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_one; N& temp_one = holder_temp_one.item();
  assign_r(temp_one, 1, ROUND_NOT_NEEDED);

  const Variables_Set::const_iterator v_begin = vars.begin();
  const Variables_Set::const_iterator v_end = vars.end();
  ((void) 0);
  typedef typename OR_Matrix<N>::row_reference_type row_reference;
  for (Variables_Set::const_iterator v_i = v_begin; v_i != v_end; ++v_i) {
    const dimension_type i = 2 * (*v_i);
    const dimension_type ci = i + 1;
    row_reference m_i = matrix[i];
    row_reference m_ci = matrix[ci];


    N& m_i_ci = m_i[ci];
    if (!is_plus_infinity(m_i_ci)) {
      drop_some_non_integer_points_helper(m_i_ci);
      if (!is_even(m_i_ci)) {
        sub_assign_r(m_i_ci, m_i_ci, temp_one, ROUND_UP);
        reset_strongly_closed();
      }
    }
    N& m_ci_i = m_ci[i];
    if (!is_plus_infinity(m_ci_i)) {
      drop_some_non_integer_points_helper(m_ci_i);
      if (!is_even(m_ci_i)) {
        sub_assign_r(m_ci_i, m_ci_i, temp_one, ROUND_UP);
        reset_strongly_closed();
      }
    }


    for (Variables_Set::const_iterator v_j = v_begin; v_j != v_i; ++v_j) {
      const dimension_type j = 2 * (*v_j);
      const dimension_type cj = j + 1;
      drop_some_non_integer_points_helper(m_i[j]);
      drop_some_non_integer_points_helper(m_i[cj]);
      drop_some_non_integer_points_helper(m_ci[j]);
      drop_some_non_integer_points_helper(m_ci[cj]);
    }
  }
  ((void) 0);
}

template <typename T>
template <typename U>
void
Octagonal_Shape<T>
::export_interval_constraints(U& dest) const {
  if (space_dim > dest.space_dimension())
    throw std::invalid_argument(
               "Octagonal_Shape<T>::export_interval_constraints");

  strong_closure_assign();

  if (marked_empty()) {
    dest.set_empty();
    return;
  }

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lb; N& lb = holder_lb.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_ub; N& ub = holder_ub.item();
  for (dimension_type i = space_dim; i-- > 0; ) {
    const dimension_type ii = 2*i;
    const dimension_type cii = ii + 1;


    const N& twice_ub = matrix[cii][ii];
    if (!is_plus_infinity(twice_ub)) {
      assign_r(ub, twice_ub, ROUND_NOT_NEEDED);
      div_2exp_assign_r(ub, ub, 1, ROUND_UP);

      if (!dest.restrict_upper(i, ub.raw_value()))
        return;
    }


    const N& twice_lb = matrix[ii][cii];
    if (!is_plus_infinity(twice_lb)) {
      assign_r(lb, twice_lb, ROUND_NOT_NEEDED);
      neg_assign_r(lb, lb, ROUND_NOT_NEEDED);
      div_2exp_assign_r(lb, lb, 1, ROUND_DOWN);

      if (!dest.restrict_lower(i, lb.raw_value()))
        return;
    }
  }

}


template <typename T>
std::ostream&
IO_Operators::operator<<(std::ostream& s, const Octagonal_Shape<T>& oct) {

  if (oct.marked_empty()) {
    s << "false";
    return s;
  }
  if (oct.is_universe()) {
    s << "true";
    return s;
  }

  typedef typename Octagonal_Shape<T>::coefficient_type N;
  typedef typename OR_Matrix<N>::const_row_iterator row_iterator;
  typedef typename OR_Matrix<N>::const_row_reference_type row_reference;


  bool first = true;

  row_iterator m_begin = oct.matrix.row_begin();
  row_iterator m_end = oct.matrix.row_end();


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_negation; N& negation = holder_negation.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_half; N& half = holder_half.item();


  for (row_iterator i_iter = m_begin; i_iter != m_end; ) {
    const dimension_type i = i_iter.index();
    const Variable v_i(i/2);
    const N& c_i_ii = (*i_iter)[i + 1];
    ++i_iter;
    const N& c_ii_i = (*i_iter)[i];
    ++i_iter;

    if (is_additive_inverse(c_i_ii, c_ii_i)) {

      ((void) 0);
      if (first)
        first = false;
      else
        s << ", ";


      if (div_2exp_assign_r(half, c_ii_i, 1,
                            ROUND_UP | ROUND_STRICT_RELATION)
          == V_EQ)
        s << v_i << " = " << half;
      else
        s << "2*" << v_i << " = " << c_ii_i;
    }
    else {

      if (!is_plus_infinity(c_i_ii)) {
        if (first)
          first = false;
        else
          s << ", ";
        neg_assign_r(negation, c_i_ii, ROUND_NOT_NEEDED);


        if (div_2exp_assign_r(half, negation, 1,
                              ROUND_UP | ROUND_STRICT_RELATION)
            == V_EQ)
          s << v_i << " >= " << half;
        else
          s << "2*" << v_i << " >= " << negation;
      }
      if (!is_plus_infinity(c_ii_i)) {
        if (first)
          first = false;
        else
          s << ", ";


        if (div_2exp_assign_r(half, c_ii_i, 1,
                              ROUND_UP | ROUND_STRICT_RELATION)
            == V_EQ)
          s << v_i << " <= " << half;
        else
          s << "2*" << v_i << " <= " << c_ii_i;
      }
    }
  }



  for (row_iterator i_iter = m_begin; i_iter != m_end; ) {
    const dimension_type i = i_iter.index();
    const Variable v_i(i/2);
    row_reference r_i = *i_iter;
    ++i_iter;
    row_reference r_ii = *i_iter;
    ++i_iter;

    for (dimension_type j = 0; j < i; j += 2) {
      const Variable v_j(j/2);

      const N& c_ii_jj = r_ii[j + 1];
      const N& c_i_j = r_i[j];

      if (is_additive_inverse(c_ii_jj, c_i_j)) {

        ((void) 0);
        if (first)
          first = false;
        else
          s << ", ";
        if (sgn(c_i_j) >= 0)
          s << v_j << " - " << v_i << " = " << c_i_j;
        else
          s << v_i << " - " << v_j << " = " << c_ii_jj;
      }
      else {

        if (!is_plus_infinity(c_i_j)) {
          if (first)
            first = false;
          else
            s << ", ";
          if (sgn(c_i_j) >= 0)
            s << v_j << " - " << v_i << " <= " << c_i_j;
          else {
            neg_assign_r(negation, c_i_j, ROUND_DOWN);
            s << v_i << " - " << v_j << " >= " << negation;
          }
        }
        if (!is_plus_infinity(c_ii_jj)) {
          if (first)
            first = false;
          else
            s << ", ";
          if (sgn(c_ii_jj) >= 0)
            s << v_i << " - " << v_j << " <= " << c_ii_jj;
          else {
            neg_assign_r(negation, c_ii_jj, ROUND_DOWN);
            s << v_j << " - " << v_i << " >= " << negation;
          }
        }
      }

      const N& c_i_jj = r_i[j + 1];
      const N& c_ii_j = r_ii[j];

      if (is_additive_inverse(c_i_jj, c_ii_j)) {

        ((void) 0);
        if (first)
          first = false;
        else
          s << ", ";
        s << v_j << " + " << v_i << " = " << c_ii_j;
      }
      else {

        if (!is_plus_infinity(c_i_jj)) {
          if (first)
            first = false;
          else
            s << ", ";
          neg_assign_r(negation, c_i_jj, ROUND_DOWN);
          s << v_j << " + " << v_i << " >= " << negation;
        }
        if (!is_plus_infinity(c_ii_j)) {
          if (first)
            first = false;
          else
            s << ", ";
          s << v_j << " + " << v_i << " <= " << c_ii_j;
        }
      }
    }
  }
  return s;
}

template <typename T>
void
Octagonal_Shape<T>::ascii_dump(std::ostream& s) const {
  s << "space_dim "
    << space_dim
    << "\n";
  status.ascii_dump(s);
  s << "\n";
  matrix.ascii_dump(s);
}

template <typename T> void Octagonal_Shape<T>::ascii_dump() const { ascii_dump(std::cerr); } template <typename T> void Octagonal_Shape<T>::print() const { using IO_Operators::operator<<; std::cerr << *this; }

template <typename T>
bool
Octagonal_Shape<T>::ascii_load(std::istream& s) {
  std::string str;

  if (!(s >> str) || str != "space_dim")
    return false;

  if (!(s >> space_dim))
    return false;

  if (!status.ascii_load(s))
    return false;

  if (!matrix.ascii_load(s))
    return false;

  ((void) 0);
  return true;
}

template <typename T>
memory_size_type
Octagonal_Shape<T>::external_memory_in_bytes() const {
  return matrix.external_memory_in_bytes();
}

template <typename T>
bool
Octagonal_Shape<T>::OK() const {

  if (!matrix.OK())
    return false;


  if (!status.OK())
    return false;


  if (marked_empty())
    return true;


  if (space_dim == 0)
    return true;


  for (typename OR_Matrix<N>::const_row_iterator i = matrix.row_begin(),
         matrix_row_end = matrix.row_end(); i != matrix_row_end; ++i) {
    typename OR_Matrix<N>::const_row_reference_type x_i = *i;
    for (dimension_type j = i.row_size(); j-- > 0; )
      if (is_minus_infinity(x_i[j])) {







        return false;
      }
  }


  for (typename OR_Matrix<N>::const_row_iterator i = matrix.row_begin(),
         m_end = matrix.row_end(); i != m_end; ++i) {
    typename OR_Matrix<N>::const_row_reference_type r = *i;
    const N& m_i_i = r[i.index()];
    if (!is_plus_infinity(m_i_i)) {






      return false;
    }
  }




  if (std::numeric_limits<coefficient_type_base>::is_exact) {


    if (marked_strongly_closed()) {
      Octagonal_Shape x = *this;
      x.reset_strongly_closed();
      x.strong_closure_assign();
      if (x.matrix != matrix) {




        return false;
      }
    }


    if (marked_strongly_closed())
      if (!is_strong_coherent()) {



        return false;
      }
  }


  return true;
}


template <typename T>
void
Octagonal_Shape<T>
::throw_dimension_incompatible(const char* method,
                               const Octagonal_Shape& y) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", y->space_dimension() == " << y.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>
::throw_dimension_incompatible(const char* method,
                               dimension_type required_dim) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", required dimension == " << required_dim << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>::throw_dimension_incompatible(const char* method,
                                                 const Constraint& c) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", c->space_dimension == " << c.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>::throw_dimension_incompatible(const char* method,
                                                 const Congruence& cg) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", cg->space_dimension == " << cg.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>::throw_dimension_incompatible(const char* method,
                                                 const Generator& g) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", g->space_dimension == " << g.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>::throw_constraint_incompatible(const char* method) {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "the constraint is incompatible.";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>::throw_expression_too_complex(const char* method,
                                                 const Linear_Expression& le) {
  using namespace IO_Operators;
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << le << " is too complex.";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>
::throw_dimension_incompatible(const char* method,
                               const char* le_name,
                               const Linear_Expression& le) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", " << le_name << "->space_dimension() == "
    << le.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
template <typename C>
void
Octagonal_Shape<T>
::throw_dimension_incompatible(const char* method,
                               const char* lf_name,
                               const Linear_Form<C>& lf) const {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", " << lf_name << "->space_dimension() == "
    << lf.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
Octagonal_Shape<T>::throw_invalid_argument(const char* method,
                                           const char* reason) {
  std::ostringstream s;
  s << "PPL::Octagonal_Shape::" << method << ":\n"
    << reason << ".";
  throw std::invalid_argument(s.str());
}

}
# 2323 "Octagonal_Shape_defs.hh" 2
# 32 "BD_Shape_inlines.hh" 2
# 42 "BD_Shape_inlines.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
inline dimension_type
BD_Shape<T>::max_space_dimension() {


  return std::min(DB_Matrix<N>::max_num_rows() - 1,
                  DB_Matrix<N>::max_num_columns() - 1);
}

template <typename T>
inline bool
BD_Shape<T>::marked_zero_dim_univ() const {
  return status.test_zero_dim_univ();
}

template <typename T>
inline bool
BD_Shape<T>::marked_empty() const {
  return status.test_empty();
}

template <typename T>
inline bool
BD_Shape<T>::marked_shortest_path_closed() const {
  return status.test_shortest_path_closed();
}

template <typename T>
inline bool
BD_Shape<T>::marked_shortest_path_reduced() const {
  return status.test_shortest_path_reduced();
}

template <typename T>
inline void
BD_Shape<T>::set_zero_dim_univ() {
  status.set_zero_dim_univ();
}

template <typename T>
inline void
BD_Shape<T>::set_empty() {
  status.set_empty();
}

template <typename T>
inline void
BD_Shape<T>::set_shortest_path_closed() {
  status.set_shortest_path_closed();
}

template <typename T>
inline void
BD_Shape<T>::set_shortest_path_reduced() {
  status.set_shortest_path_reduced();
}

template <typename T>
inline void
BD_Shape<T>::reset_shortest_path_closed() {
  status.reset_shortest_path_closed();
}

template <typename T>
inline void
BD_Shape<T>::reset_shortest_path_reduced() {
  status.reset_shortest_path_reduced();
}

template <typename T>
inline
BD_Shape<T>::BD_Shape(const dimension_type num_dimensions,
                      const Degenerate_Element kind)
  : dbm(num_dimensions + 1), status(), redundancy_dbm() {
  if (kind == EMPTY)
    set_empty();
  else {
    if (num_dimensions > 0)

      set_shortest_path_closed();
  }
  ((void) 0);
}

template <typename T>
inline
BD_Shape<T>::BD_Shape(const BD_Shape& y, Complexity_Class)
  : dbm(y.dbm), status(y.status), redundancy_dbm() {
  if (y.marked_shortest_path_reduced())
    redundancy_dbm = y.redundancy_dbm;
}

template <typename T>
template <typename U>
inline
BD_Shape<T>::BD_Shape(const BD_Shape<U>& y, Complexity_Class)


  : dbm((y.shortest_path_closure_assign(), y.dbm)),
    status(),
    redundancy_dbm() {

  if (y.marked_empty())
    set_empty();
  else if (y.marked_zero_dim_univ())
    set_zero_dim_univ();
}

template <typename T>
inline Congruence_System
BD_Shape<T>::congruences() const {
  return minimized_congruences();
}

template <typename T>
inline void
BD_Shape<T>::add_constraints(const Constraint_System& cs) {
  for (Constraint_System::const_iterator i = cs.begin(),
         cs_end = cs.end(); i != cs_end; ++i)
    add_constraint(*i);
}

template <typename T>
inline void
BD_Shape<T>::add_recycled_constraints(Constraint_System& cs) {
  add_constraints(cs);
}

template <typename T>
inline void
BD_Shape<T>::add_congruences(const Congruence_System& cgs) {
  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); i != cgs_end; ++i)
    add_congruence(*i);
}

template <typename T>
inline void
BD_Shape<T>::add_recycled_congruences(Congruence_System& cgs) {
  add_congruences(cgs);
}

template <typename T>
inline void
BD_Shape<T>::refine_with_constraint(const Constraint& c) {
  const dimension_type c_space_dim = c.space_dimension();

  if (c_space_dim > space_dimension())
    throw_dimension_incompatible("refine_with_constraint(c)", c);

  if (!marked_empty())
    refine_no_check(c);
}

template <typename T>
inline void
BD_Shape<T>::refine_with_constraints(const Constraint_System& cs) {

  if (cs.space_dimension() > space_dimension())
    throw_invalid_argument("refine_with_constraints(cs)",
                           "cs and *this are space-dimension incompatible");

  for (Constraint_System::const_iterator i = cs.begin(),
         cs_end = cs.end(); !marked_empty() && i != cs_end; ++i)
    refine_no_check(*i);
}

template <typename T>
inline void
BD_Shape<T>::refine_with_congruence(const Congruence& cg) {
  const dimension_type cg_space_dim = cg.space_dimension();

  if (cg_space_dim > space_dimension())
    throw_dimension_incompatible("refine_with_congruence(cg)", cg);

  if (!marked_empty())
    refine_no_check(cg);
}

template <typename T>
void
BD_Shape<T>::refine_with_congruences(const Congruence_System& cgs) {

  if (cgs.space_dimension() > space_dimension())
    throw_invalid_argument("refine_with_congruences(cgs)",
                           "cgs and *this are space-dimension incompatible");

  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i)
    refine_no_check(*i);
}

template <typename T>
inline void
BD_Shape<T>::refine_no_check(const Congruence& cg) {
  ((void) 0);
  ((void) 0);

  if (cg.is_proper_congruence()) {
    if (cg.is_inconsistent())
      set_empty();

    return;
  }

  ((void) 0);
  Constraint c(cg);
  refine_no_check(c);
}

template <typename T>
inline bool
BD_Shape<T>::can_recycle_constraint_systems() {
  return false;
}


template <typename T>
inline bool
BD_Shape<T>::can_recycle_congruence_systems() {
  return false;
}

template <typename T>
inline
BD_Shape<T>::BD_Shape(const Constraint_System& cs)
  : dbm(cs.space_dimension() + 1), status(), redundancy_dbm() {
  if (cs.space_dimension() > 0)

    set_shortest_path_closed();
  add_constraints(cs);
}

template <typename T>
template <typename Interval>
inline
BD_Shape<T>::BD_Shape(const Box<Interval>& box,
                      Complexity_Class)
  : dbm(box.space_dimension() + 1), status(), redundancy_dbm() {

  if (box.is_empty())
    set_empty();
  else if (box.space_dimension() > 0) {

    set_shortest_path_closed();
    refine_with_constraints(box.constraints());
  }
}

template <typename T>
inline
BD_Shape<T>::BD_Shape(const Grid& grid,
                      Complexity_Class)
  : dbm(grid.space_dimension() + 1), status(), redundancy_dbm() {
  if (grid.space_dimension() > 0)

    set_shortest_path_closed();

  refine_with_congruences(grid.minimized_congruences());
}

template <typename T>
template <typename U>
inline
BD_Shape<T>::BD_Shape(const Octagonal_Shape<U>& os,
                      Complexity_Class)
  : dbm(os.space_dimension() + 1), status(), redundancy_dbm() {

  if (os.is_empty())
    set_empty();
  else if (os.space_dimension() > 0) {

    set_shortest_path_closed();
    refine_with_constraints(os.constraints());



  }
}

template <typename T>
inline BD_Shape<T>&
BD_Shape<T>::operator=(const BD_Shape& y) {
  dbm = y.dbm;
  status = y.status;
  if (y.marked_shortest_path_reduced())
    redundancy_dbm = y.redundancy_dbm;
  return *this;
}

template <typename T>
inline
BD_Shape<T>::~BD_Shape() {
}

template <typename T>
inline void
BD_Shape<T>::m_swap(BD_Shape& y) {
  using std::swap;
  swap(dbm, y.dbm);
  swap(status, y.status);
  swap(redundancy_dbm, y.redundancy_dbm);
}

template <typename T>
inline dimension_type
BD_Shape<T>::space_dimension() const {
  return dbm.num_rows() - 1;
}

template <typename T>
inline bool
BD_Shape<T>::is_empty() const {
  shortest_path_closure_assign();
  return marked_empty();
}

template <typename T>
inline bool
BD_Shape<T>::bounds_from_above(const Linear_Expression& expr) const {
  return bounds(expr, true);
}

template <typename T>
inline bool
BD_Shape<T>::bounds_from_below(const Linear_Expression& expr) const {
  return bounds(expr, false);
}

template <typename T>
inline bool
BD_Shape<T>::maximize(const Linear_Expression& expr,
                      Coefficient& sup_n, Coefficient& sup_d,
                      bool& maximum) const {
  return max_min(expr, true, sup_n, sup_d, maximum);
}

template <typename T>
inline bool
BD_Shape<T>::maximize(const Linear_Expression& expr,
                      Coefficient& sup_n, Coefficient& sup_d, bool& maximum,
                      Generator& g) const {
  return max_min(expr, true, sup_n, sup_d, maximum, g);
}

template <typename T>
inline bool
BD_Shape<T>::minimize(const Linear_Expression& expr,
                      Coefficient& inf_n, Coefficient& inf_d,
                      bool& minimum) const {
  return max_min(expr, false, inf_n, inf_d, minimum);
}

template <typename T>
inline bool
BD_Shape<T>::minimize(const Linear_Expression& expr,
                      Coefficient& inf_n, Coefficient& inf_d, bool& minimum,
                      Generator& g) const {
  return max_min(expr, false, inf_n, inf_d, minimum, g);
}

template <typename T>
inline bool
BD_Shape<T>::is_topologically_closed() const {
  return true;
}

template <typename T>
inline bool
BD_Shape<T>::is_discrete() const {
  return affine_dimension() == 0;
}

template <typename T>
inline void
BD_Shape<T>::topological_closure_assign() {
}


template <typename T>
inline bool
operator==(const BD_Shape<T>& x, const BD_Shape<T>& y) {
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    return false;


  if (x_space_dim == 0) {
    if (x.marked_empty())
      return y.marked_empty();
    else
      return !y.marked_empty();
  }


  x.shortest_path_closure_assign();
  y.shortest_path_closure_assign();



  if (x.marked_empty())
    return y.marked_empty();
  if (y.marked_empty())
    return false;


  return x.dbm == y.dbm;
}


template <typename T>
inline bool
operator!=(const BD_Shape<T>& x, const BD_Shape<T>& y) {
  return !(x == y);
}


template <typename Temp, typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const BD_Shape<T>& x,
                            const BD_Shape<T>& y,
                            const Rounding_Dir dir,
                            Temp& tmp0,
                            Temp& tmp1,
                            Temp& tmp2) {
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    return false;


  if (x_space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  x.shortest_path_closure_assign();
  y.shortest_path_closure_assign();



  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }

  return rectilinear_distance_assign(r, x.dbm, y.dbm, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const BD_Shape<T>& x,
                            const BD_Shape<T>& y,
                            const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return rectilinear_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename T>
inline bool
rectilinear_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                            const BD_Shape<T>& x,
                            const BD_Shape<T>& y,
                            const Rounding_Dir dir) {
  return rectilinear_distance_assign<To, To, T>(r, x, y, dir);
}


template <typename Temp, typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const BD_Shape<T>& x,
                          const BD_Shape<T>& y,
                          const Rounding_Dir dir,
                          Temp& tmp0,
                          Temp& tmp1,
                          Temp& tmp2) {
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    return false;


  if (x_space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  x.shortest_path_closure_assign();
  y.shortest_path_closure_assign();



  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }

  return euclidean_distance_assign(r, x.dbm, y.dbm, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const BD_Shape<T>& x,
                          const BD_Shape<T>& y,
                          const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return euclidean_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename T>
inline bool
euclidean_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                          const BD_Shape<T>& x,
                          const BD_Shape<T>& y,
                          const Rounding_Dir dir) {
  return euclidean_distance_assign<To, To, T>(r, x, y, dir);
}


template <typename Temp, typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const BD_Shape<T>& x,
                           const BD_Shape<T>& y,
                           const Rounding_Dir dir,
                           Temp& tmp0,
                           Temp& tmp1,
                           Temp& tmp2) {
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    return false;


  if (x_space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  x.shortest_path_closure_assign();
  y.shortest_path_closure_assign();



  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }

  return l_infinity_distance_assign(r, x.dbm, y.dbm, dir, tmp0, tmp1, tmp2);
}


template <typename Temp, typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const BD_Shape<T>& x,
                           const BD_Shape<T>& y,
                           const Rounding_Dir dir) {
  typedef Checked_Number<Temp, Extended_Number_Policy> Checked_Temp;
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp0; Checked_Temp& tmp0 = holder_tmp0.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp1; Checked_Temp& tmp1 = holder_tmp1.item();
  Parma_Polyhedra_Library::Dirty_Temp<Checked_Temp> holder_tmp2; Checked_Temp& tmp2 = holder_tmp2.item();
  return l_infinity_distance_assign(r, x, y, dir, tmp0, tmp1, tmp2);
}


template <typename To, typename T>
inline bool
l_infinity_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                           const BD_Shape<T>& x,
                           const BD_Shape<T>& y,
                           const Rounding_Dir dir) {
  return l_infinity_distance_assign<To, To, T>(r, x, y, dir);
}

template <typename T>
inline void
BD_Shape<T>::add_dbm_constraint(const dimension_type i,
                                const dimension_type j,
                                const N& k) {

  ((void) 0);
  N& dbm_ij = dbm[i][j];
  if (dbm_ij > k) {
    dbm_ij = k;
    if (marked_shortest_path_closed())
      reset_shortest_path_closed();
  }
}

template <typename T>
inline void
BD_Shape<T>::add_dbm_constraint(const dimension_type i,
                                const dimension_type j,
                                Coefficient_traits::const_reference numer,
                                Coefficient_traits::const_reference denom) {

  ((void) 0);
  ((void) 0);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_k; N& k = holder_k.item();
  div_round_up(k, numer, denom);
  add_dbm_constraint(i, j, k);
}

template <typename T>
inline void
BD_Shape<T>::time_elapse_assign(const BD_Shape& y) {

  if (space_dimension() != y.space_dimension())
    throw_dimension_incompatible("time_elapse_assign(y)", y);


  C_Polyhedron ph_x(constraints());
  C_Polyhedron ph_y(y.constraints());
  ph_x.time_elapse_assign(ph_y);
  BD_Shape<T> x(ph_x);
  m_swap(x);
  ((void) 0);
}

template <typename T>
inline bool
BD_Shape<T>::strictly_contains(const BD_Shape& y) const {
  const BD_Shape<T>& x = *this;
  return x.contains(y) && !y.contains(x);
}

template <typename T>
inline bool
BD_Shape<T>::upper_bound_assign_if_exact(const BD_Shape& y) {
  if (space_dimension() != y.space_dimension())
    throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y);



  const bool integer_upper_bound = false;
  return BHZ09_upper_bound_assign_if_exact<integer_upper_bound>(y);

}

template <typename T>
inline bool
BD_Shape<T>::integer_upper_bound_assign_if_exact(const BD_Shape& y) {
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_726 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(std::numeric_limits<T>::is_integer)>) };


  if (space_dimension() != y.space_dimension())
    throw_dimension_incompatible("integer_upper_bound_assign_if_exact(y)", y);
  const bool integer_upper_bound = true;
  return BHZ09_upper_bound_assign_if_exact<integer_upper_bound>(y);
}

template <typename T>
inline void
BD_Shape<T>
::remove_higher_space_dimensions(const dimension_type new_dimension) {


  const dimension_type space_dim = space_dimension();
  if (new_dimension > space_dim)
    throw_dimension_incompatible("remove_higher_space_dimensions(nd)",
                                 new_dimension);




  if (new_dimension == space_dim) {
    ((void) 0);
    return;
  }


  shortest_path_closure_assign();
  dbm.resize_no_copy(new_dimension + 1);



  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();



  if (new_dimension == 0 && !marked_empty())
    set_zero_dim_univ();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::wrap_assign(const Variables_Set& vars,
                         Bounded_Integer_Type_Width w,
                         Bounded_Integer_Type_Representation r,
                         Bounded_Integer_Type_Overflow o,
                         const Constraint_System* cs_p,
                         unsigned complexity_threshold,
                         bool wrap_individually) {
  Implementation::wrap_assign(*this,
                              vars, w, r, o, cs_p,
                              complexity_threshold, wrap_individually,
                              "BD_Shape");
}

template <typename T>
inline void
BD_Shape<T>::CC76_extrapolation_assign(const BD_Shape& y, unsigned* tp) {
  static N stop_points[] = {
    N(-2, ROUND_UP),
    N(-1, ROUND_UP),
    N( 0, ROUND_UP),
    N( 1, ROUND_UP),
    N( 2, ROUND_UP)
  };
  CC76_extrapolation_assign(y,
                            stop_points,
                            stop_points
                            + sizeof(stop_points)/sizeof(stop_points[0]),
                            tp);
}

template <typename T>
inline void
BD_Shape<T>::H79_widening_assign(const BD_Shape& y, unsigned* tp) {


  C_Polyhedron ph_x(constraints());
  C_Polyhedron ph_y(y.constraints());
  ph_x.H79_widening_assign(ph_y, tp);
  BD_Shape x(ph_x);
  m_swap(x);
  ((void) 0);
}

template <typename T>
inline void
BD_Shape<T>::widening_assign(const BD_Shape& y, unsigned* tp) {
  H79_widening_assign(y, tp);
}

template <typename T>
inline void
BD_Shape<T>::limited_H79_extrapolation_assign(const BD_Shape& y,
                                              const Constraint_System& cs,
                                              unsigned* tp) {


  C_Polyhedron ph_x(constraints());
  C_Polyhedron ph_y(y.constraints());
  ph_x.limited_H79_extrapolation_assign(ph_y, cs, tp);
  BD_Shape x(ph_x);
  m_swap(x);
  ((void) 0);
}

template <typename T>
inline memory_size_type
BD_Shape<T>::total_memory_in_bytes() const {
  return sizeof(*this) + external_memory_in_bytes();
}

template <typename T>
inline int32_t
BD_Shape<T>::hash_code() const {
  return hash_code_from_dimension(space_dimension());
}

template <typename T>
template <typename Interval_Info>
inline void
BD_Shape<T>::generalized_refine_with_linear_form_inequality(
             const Linear_Form<Interval<T, Interval_Info> >& left,
             const Linear_Form<Interval<T, Interval_Info> >& right,
             const Relation_Symbol relsym) {
  switch (relsym) {
  case EQUAL:

    refine_with_linear_form_inequality(left, right);
    refine_with_linear_form_inequality(right, left);
    break;
  case LESS_THAN:
  case LESS_OR_EQUAL:
    refine_with_linear_form_inequality(left, right);
    break;
  case GREATER_THAN:
  case GREATER_OR_EQUAL:
    refine_with_linear_form_inequality(right, left);
    break;
  case NOT_EQUAL:
    break;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
  }
}

template <typename T>
template <typename Interval_Info>
inline void
BD_Shape<T>
::refine_fp_interval_abstract_store(Box<Interval<T, Interval_Info> >&
                                    store) const {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_884 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };



  typedef Interval<T, Interval_Info> FP_Interval_Type;
  store.intersection_assign(Box<FP_Interval_Type>(*this));
}

template <typename T>
inline void
BD_Shape<T>::drop_some_non_integer_points_helper(N& elem) {
  if (!is_integer(elem)) {
    Result r = floor_assign_r(elem, elem, ROUND_DOWN);
    (void)(r);
    ((void) 0);
    reset_shortest_path_closed();
  }
}


template <typename T>
inline void
swap(BD_Shape<T>& x, BD_Shape<T>& y) {
  x.m_swap(y);
}

}
# 2369 "BD_Shape_defs.hh" 2
# 1 "BD_Shape_templates.hh" 1
# 47 "BD_Shape_templates.hh"
namespace Parma_Polyhedra_Library {

template <typename T>
BD_Shape<T>::BD_Shape(const Congruence_System& cgs)
  : dbm(cgs.space_dimension() + 1),
    status(),
    redundancy_dbm() {
  add_congruences(cgs);
}

template <typename T>
BD_Shape<T>::BD_Shape(const Generator_System& gs)
  : dbm(gs.space_dimension() + 1), status(), redundancy_dbm() {
  const Generator_System::const_iterator gs_begin = gs.begin();
  const Generator_System::const_iterator gs_end = gs.end();
  if (gs_begin == gs_end) {

    set_empty();
    return;
  }

  const dimension_type space_dim = space_dimension();
  DB_Row<N>& dbm_0 = dbm[0];
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();

  bool dbm_initialized = false;
  bool point_seen = false;

  for (Generator_System::const_iterator gs_i = gs_begin;
       gs_i != gs_end; ++gs_i) {
    const Generator& g = *gs_i;
    switch (g.type()) {
    case Generator::POINT:
      point_seen = true;

    case Generator::CLOSURE_POINT:
      if (!dbm_initialized) {

        dbm_initialized = true;
        const Coefficient& d = g.divisor();


        for (dimension_type i = space_dim; i > 0; --i) {
          const Coefficient& g_i = g.expression().get(Variable(i - 1));
          DB_Row<N>& dbm_i = dbm[i];
          for (dimension_type j = space_dim; j > 0; --j)
            if (i != j) {
              const Coefficient& g_j = g.expression().get(Variable(j - 1));
              div_round_up(dbm_i[j], g_j - g_i, d);
            }
          div_round_up(dbm_i[0], -g_i, d);
        }
        for (dimension_type j = space_dim; j > 0; --j) {
          const Coefficient& g_j = g.expression().get(Variable(j - 1));
          div_round_up(dbm_0[j], g_j, d);
        }

      }
      else {


        const Coefficient& d = g.divisor();


        for (dimension_type i = space_dim; i > 0; --i) {
          const Coefficient& g_i = g.expression().get(Variable(i - 1));
          DB_Row<N>& dbm_i = dbm[i];

          for (dimension_type j = space_dim; j > 0; --j) {
            const Coefficient& g_j = g.expression().get(Variable(j - 1));
            div_round_up(tmp, g_j - g_i, d);
            max_assign(dbm_i[j], tmp);
          }
          div_round_up(tmp, -g_i, d);
          max_assign(dbm_i[0], tmp);
        }
        for (dimension_type j = space_dim; j > 0; --j) {
          const Coefficient& g_j = g.expression().get(Variable(j - 1));
          div_round_up(tmp, g_j, d);
          max_assign(dbm_0[j], tmp);
        }
      }
      break;
    default:

      break;
    }
  }

  if (!point_seen)

    throw_invalid_argument("BD_Shape(gs)",
                           "the non-empty generator system gs "
                           "contains no points.");


  for (Generator_System::const_iterator gs_i = gs_begin;
       gs_i != gs_end; ++gs_i) {
    const Generator& g = *gs_i;
    switch (g.type()) {
    case Generator::LINE:


      for (dimension_type i = space_dim; i > 0; --i) {
        const Coefficient& g_i = g.expression().get(Variable(i - 1));
        DB_Row<N>& dbm_i = dbm[i];

        for (dimension_type j = space_dim; j > 0; --j)
          if (g_i != g.expression().get(Variable(j - 1)))
            assign_r(dbm_i[j], PLUS_INFINITY, ROUND_NOT_NEEDED);
        if (g_i != 0)
          assign_r(dbm_i[0], PLUS_INFINITY, ROUND_NOT_NEEDED);
      }
      for (Generator::expr_type::const_iterator i = g.expression().begin(),
            i_end = g.expression().end(); i != i_end; ++i)
        assign_r(dbm_0[i.variable().space_dimension()],
                 PLUS_INFINITY, ROUND_NOT_NEEDED);
      break;
    case Generator::RAY:


      for (dimension_type i = space_dim; i > 0; --i) {
        const Coefficient& g_i = g.expression().get(Variable(i - 1));
        DB_Row<N>& dbm_i = dbm[i];

        for (dimension_type j = space_dim; j > 0; --j)
          if (g_i < g.expression().get(Variable(j - 1)))
            assign_r(dbm_i[j], PLUS_INFINITY, ROUND_NOT_NEEDED);
        if (g_i < 0)
          assign_r(dbm_i[0], PLUS_INFINITY, ROUND_NOT_NEEDED);
      }
      for (Generator::expr_type::const_iterator i = g.expression().begin(),
            i_end = g.expression().end(); i != i_end; ++i)
        if (*i > 0)
          assign_r(dbm_0[i.variable().space_dimension()],
                   PLUS_INFINITY, ROUND_NOT_NEEDED);
      break;
    default:

      break;
    }
  }
  set_shortest_path_closed();
  ((void) 0);
}

template <typename T>
BD_Shape<T>::BD_Shape(const Polyhedron& ph, const Complexity_Class complexity)
  : dbm(), status(), redundancy_dbm() {
  const dimension_type num_dimensions = ph.space_dimension();

  if (ph.marked_empty()) {
    *this = BD_Shape<T>(num_dimensions, EMPTY);
    return;
  }

  if (num_dimensions == 0) {
    *this = BD_Shape<T>(num_dimensions, UNIVERSE);
    return;
  }



  if (complexity == ANY_COMPLEXITY
      || (!ph.has_pending_constraints() && ph.generators_are_up_to_date())) {
    *this = BD_Shape<T>(ph.generators());
    return;
  }




  ((void) 0);

  if (!ph.has_something_pending() && ph.constraints_are_minimized()) {


    if (ph.is_universe()) {
      *this = BD_Shape<T>(num_dimensions, UNIVERSE);
      return;
    }
  }


  for (Constraint_System::const_iterator i = ph.con_sys.begin(),
         cs_end = ph.con_sys.end(); i != cs_end; ++i)
    if (i->is_inconsistent()) {
      *this = BD_Shape<T>(num_dimensions, EMPTY);
      return;
    }



  if (complexity == SIMPLEX_COMPLEXITY) {
    MIP_Problem lp(num_dimensions);
    lp.set_optimization_mode(MAXIMIZATION);

    const Constraint_System& ph_cs = ph.constraints();
    if (!ph_cs.has_strict_inequalities())
      lp.add_constraints(ph_cs);
    else

      for (Constraint_System::const_iterator i = ph_cs.begin(),
             ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) {
        const Constraint& c = *i;
        if (c.is_strict_inequality()) {
          Linear_Expression expr(c.expression());
          lp.add_constraint(expr >= 0);
        }
        else
          lp.add_constraint(c);
      }


    if (!lp.is_satisfiable()) {
      *this = BD_Shape<T>(num_dimensions, EMPTY);
      return;
    }


    *this = BD_Shape<T>(num_dimensions, UNIVERSE);

    Generator g(point());
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
    for (dimension_type i = 1; i <= num_dimensions; ++i) {
      Variable x(i-1);

      lp.set_objective_function(x);
      if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
        g = lp.optimizing_point();
        lp.evaluate_objective_function(g, numer, denom);
        div_round_up(dbm[0][i], numer, denom);
      }

      for (dimension_type j = 1; j <= num_dimensions; ++j) {
        if (i == j)
          continue;
        Variable y(j-1);
        lp.set_objective_function(x - y);
        if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
          g = lp.optimizing_point();
          lp.evaluate_objective_function(g, numer, denom);
          div_round_up(dbm[j][i], numer, denom);
        }
      }

      lp.set_objective_function(-x);
      if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
        g = lp.optimizing_point();
        lp.evaluate_objective_function(g, numer, denom);
        div_round_up(dbm[i][0], numer, denom);
      }
    }
    set_shortest_path_closed();
    ((void) 0);
    return;
  }


  ((void) 0);
  *this = BD_Shape<T>(num_dimensions, UNIVERSE);
  refine_with_constraints(ph.constraints());
}

template <typename T>
dimension_type
BD_Shape<T>::affine_dimension() const {
  const dimension_type space_dim = space_dimension();

  if (space_dim == 0)
    return 0;



  shortest_path_closure_assign();
  if (marked_empty())
    return 0;




  std::vector<dimension_type> predecessor;
  compute_predecessors(predecessor);



  dimension_type affine_dim = 0;

  for (dimension_type i = 1; i <= space_dim; ++i)
    if (predecessor[i] == i)
      ++affine_dim;

  return affine_dim;
}

template <typename T>
Congruence_System
BD_Shape<T>::minimized_congruences() const {


  shortest_path_closure_assign();

  const dimension_type space_dim = space_dimension();
  Congruence_System cgs(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cgs = Congruence_System::zero_dim_empty();
    return cgs;
  }

  if (marked_empty()) {
    cgs.insert(Congruence::zero_dim_false());
    return cgs;
  }

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();


  std::vector<dimension_type> leaders;
  compute_leaders(leaders);


  const DB_Row<N>& dbm_0 = dbm[0];
  for (dimension_type i = 1; i <= space_dim; ++i) {
    const dimension_type leader = leaders[i];
    if (i != leader) {

      if (leader == 0) {

        ((void) 0);
        numer_denom(dbm_0[i], numer, denom);
        cgs.insert(denom*Variable(i-1) == numer);
      }
      else {

        ((void) 0);
        numer_denom(dbm[i][leader], numer, denom);
        cgs.insert(denom*Variable(leader-1) - denom*Variable(i-1) == numer);
      }
    }
  }
  return cgs;
}

template <typename T>
void
BD_Shape<T>::add_constraint(const Constraint& c) {

  if (c.space_dimension() > space_dimension())
    throw_dimension_incompatible("add_constraint(c)", c);


  if (c.is_strict_inequality()) {
    if (c.is_inconsistent()) {
      set_empty();
      return;
    }
    if (c.is_tautological())
      return;

    throw_invalid_argument("add_constraint(c)",
                           "strict inequalities are not allowed");
  }

  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();

  if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff))
    throw_invalid_argument("add_constraint(c)",
                           "c is not a bounded difference constraint");

  const Coefficient& inhomo = c.inhomogeneous_term();
  if (num_vars == 0) {

    if (inhomo < 0
        || (inhomo != 0 && c.is_equality()))
      set_empty();
    return;
  }



  const bool negative = (coeff < 0);
  if (negative)
    neg_assign(coeff);

  bool changed = false;
  N& x = negative ? dbm[i][j] : dbm[j][i];

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
  div_round_up(d, inhomo, coeff);
  if (x > d) {
    x = d;
    changed = true;
  }

  if (c.is_equality()) {
    N& y = negative ? dbm[j][i] : dbm[i][j];

    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_c_term; Parma_Polyhedra_Library::Coefficient& minus_c_term = holder_minus_c_term.item();
    neg_assign(minus_c_term, inhomo);
    div_round_up(d, minus_c_term, coeff);
    if (y > d) {
      y = d;
      changed = true;
    }
  }



  if (changed && marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::add_congruence(const Congruence& cg) {
  const dimension_type cg_space_dim = cg.space_dimension();


  if (space_dimension() < cg_space_dim)
    throw_dimension_incompatible("add_congruence(cg)", cg);


  if (cg.is_proper_congruence()) {
    if (cg.is_tautological())
      return;
    if (cg.is_inconsistent()) {
      set_empty();
      return;
    }

    throw_invalid_argument("add_congruence(cg)",
                           "cg is a non-trivial, proper congruence");
  }

  ((void) 0);
  Constraint c(cg);
  add_constraint(c);
}

template <typename T>
void
BD_Shape<T>::refine_no_check(const Constraint& c) {
  ((void) 0);
  ((void) 0);

  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();

  if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff))
    return;

  const Coefficient& inhomo = c.inhomogeneous_term();
  if (num_vars == 0) {

    if (inhomo < 0
        || (c.is_equality() && inhomo != 0)
        || (c.is_strict_inequality() && inhomo == 0))
      set_empty();
    return;
  }



  const bool negative = (coeff < 0);
  N& x = negative ? dbm[i][j] : dbm[j][i];
  N& y = negative ? dbm[j][i] : dbm[i][j];
  if (negative)
    neg_assign(coeff);

  bool changed = false;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
  div_round_up(d, inhomo, coeff);
  if (x > d) {
    x = d;
    changed = true;
  }

  if (c.is_equality()) {

    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_c_term; Parma_Polyhedra_Library::Coefficient& minus_c_term = holder_minus_c_term.item();
    neg_assign(minus_c_term, inhomo);
    div_round_up(d, minus_c_term, coeff);
    if (y > d) {
      y = d;
      changed = true;
    }
  }



  if (changed && marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::concatenate_assign(const BD_Shape& y) {
  BD_Shape& x = *this;

  const dimension_type x_space_dim = x.space_dimension();
  const dimension_type y_space_dim = y.space_dimension();



  if (y_space_dim == 0 && y.marked_empty()) {
    set_empty();
    return;
  }



  if (x_space_dim == 0 && marked_empty()) {
    dbm.grow(y_space_dim + 1);
    ((void) 0);
    return;
  }







  add_space_dimensions_and_embed(y_space_dim);
  const dimension_type new_space_dim = x_space_dim + y_space_dim;
  for (dimension_type i = x_space_dim + 1; i <= new_space_dim; ++i) {
    DB_Row<N>& dbm_i = dbm[i];
    dbm_i[0] = y.dbm[i - x_space_dim][0];
    dbm[0][i] = y.dbm[0][i - x_space_dim];
    for (dimension_type j = x_space_dim + 1; j <= new_space_dim; ++j)
      dbm_i[j] = y.dbm[i - x_space_dim][j - x_space_dim];
  }

  if (marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
bool
BD_Shape<T>::contains(const BD_Shape& y) const {
  const BD_Shape<T>& x = *this;
  const dimension_type x_space_dim = x.space_dimension();


  if (x_space_dim != y.space_dimension())
    throw_dimension_incompatible("contains(y)", y);

  if (x_space_dim == 0) {




    return marked_empty() ? y.marked_empty() : true;
  }
# 637 "BD_Shape_templates.hh"
  y.shortest_path_closure_assign();

  if (y.marked_empty())
    return true;


  if (x.is_empty())
    return false;



  for (dimension_type i = x_space_dim + 1; i-- > 0; ) {
    const DB_Row<N>& x_dbm_i = x.dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    for (dimension_type j = x_space_dim + 1; j-- > 0; )
      if (x_dbm_i[j] < y_dbm_i[j])
        return false;
  }
  return true;
}

template <typename T>
bool
BD_Shape<T>::is_disjoint_from(const BD_Shape& y) const {
  const dimension_type space_dim = space_dimension();

  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("is_disjoint_from(y)", y);



  shortest_path_closure_assign();
  if (marked_empty())
    return true;
  y.shortest_path_closure_assign();
  if (y.marked_empty())
    return true;
# 687 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
  for (dimension_type i = space_dim+1; i-- > 0; ) {
    const DB_Row<N>& x_i = dbm[i];
    for (dimension_type j = space_dim+1; j-- > 0; ) {
      neg_assign_r(tmp, y.dbm[j][i], ROUND_UP);
      if (x_i[j] < tmp)
        return true;
    }
  }

  return false;
}

template <typename T>
bool
BD_Shape<T>::is_universe() const {
  if (marked_empty())
    return false;

  const dimension_type space_dim = space_dimension();


  if (space_dim == 0)
    return true;



  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    const DB_Row<N>& dbm_i = dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; )
      if (!is_plus_infinity(dbm_i[j]))
        return false;
  }
  return true;
}

template <typename T>
bool
BD_Shape<T>::is_bounded() const {
  shortest_path_closure_assign();
  const dimension_type space_dim = space_dimension();

  if (marked_empty() || space_dim == 0)
    return true;



  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    const DB_Row<N>& dbm_i = dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; )
      if (i != j)
        if (is_plus_infinity(dbm_i[j]))
          return false;
  }

  return true;
}

template <typename T>
bool
BD_Shape<T>::contains_integer_point() const {

  if (is_empty())
    return false;

  const dimension_type space_dim = space_dimension();
  if (space_dim == 0)
    return true;



  if (std::numeric_limits<T>::is_integer)
    return true;



  BD_Shape<mpz_class> bds_z(space_dim);
  typedef BD_Shape<mpz_class>::N Z;
  bds_z.reset_shortest_path_closed();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
  bool all_integers = true;
  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<Z>& z_i = bds_z.dbm[i];
    const DB_Row<N>& dbm_i = dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; ) {
      const N& dbm_i_j = dbm_i[j];
      if (is_plus_infinity(dbm_i_j))
        continue;
      if (is_integer(dbm_i_j))
        assign_r(z_i[j], dbm_i_j, ROUND_NOT_NEEDED);
      else {
        all_integers = false;
        Z& z_i_j = z_i[j];

        neg_assign_r(tmp, dbm_i_j, ROUND_NOT_NEEDED);
        assign_r(z_i_j, tmp, ROUND_UP);
        neg_assign_r(z_i_j, z_i_j, ROUND_NOT_NEEDED);
      }
    }
  }
  return all_integers || !bds_z.is_empty();
}

template <typename T>
bool
BD_Shape<T>::frequency(const Linear_Expression& expr,
                       Coefficient& freq_n, Coefficient& freq_d,
                       Coefficient& val_n, Coefficient& val_d) const {
  dimension_type space_dim = space_dimension();

  if (space_dim < expr.space_dimension())
    throw_dimension_incompatible("frequency(e, ...)", "e", expr);
# 807 "BD_Shape_templates.hh"
  if (space_dim == 0) {
    if (is_empty())
      return false;
    freq_n = 0;
    freq_d = 1;
    val_n = expr.inhomogeneous_term();
    val_d = 1;
    return true;
  }

  shortest_path_closure_assign();

  if (marked_empty())
    return false;


  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
  Linear_Expression le = expr;




  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_val_denom; Parma_Polyhedra_Library::Coefficient& val_denom = holder_val_denom.item();
  val_denom = 1;



  for (dimension_type i = dbm.num_rows(); i-- > 1; ) {
    const Variable v(i-1);
    coeff = le.coefficient(v);
    if (coeff == 0)
      continue;

    const DB_Row<N>& dbm_i = dbm[i];

    assign_r(tmp, dbm_i[0], ROUND_NOT_NEEDED);
    if (is_additive_inverse(dbm[0][i], tmp)) {

      numer_denom(tmp, numer, denom);
      sub_mul_assign(le, coeff, v);
      le *= denom;
      le -= numer*coeff;
      val_denom *= denom;
      continue;
    }


    else {
      bool constant_v = false;
      for (Linear_Expression::const_iterator j = le.begin(),
            j_end = le.lower_bound(Variable(i - 1)); j != j_end; ++j) {
        const Variable vj = j.variable();
        const dimension_type j_dim = vj.space_dimension();
        assign_r(tmp, dbm_i[j_dim], ROUND_NOT_NEEDED);
        if (is_additive_inverse(dbm[j_dim][i], tmp)) {



          numer_denom(tmp, numer, denom);


          sub_mul_assign(le, coeff, v);
          add_mul_assign(le, coeff, vj);
          le *= denom;
          le -= numer*coeff;
          val_denom *= denom;
          constant_v = true;
          break;
        }
      }
      if (!constant_v)

        return false;
    }
  }


  freq_n = 0;
  freq_d = 1;


  normalize2(le.inhomogeneous_term(), val_denom, val_n, val_d);
  return true;
}

template <typename T>
bool
BD_Shape<T>::constrains(const Variable var) const {

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dimension() < var_space_dim)
    throw_dimension_incompatible("constrains(v)", "v", var);

  shortest_path_closure_assign();


  if (marked_empty())
    return true;


  const DB_Row<N>& dbm_v = dbm[var_space_dim];
  for (dimension_type i = dbm.num_rows(); i-- > 0; ) {
    if (!is_plus_infinity(dbm_v[i])
        || !is_plus_infinity(dbm[i][var_space_dim]))
      return true;
  }



  return is_empty();
}

template <typename T>
void
BD_Shape<T>
::compute_predecessors(std::vector<dimension_type>& predecessor) const {
  ((void) 0);
  ((void) 0);





  const dimension_type predecessor_size = dbm.num_rows();

  predecessor.reserve(predecessor_size);
  for (dimension_type i = 0; i < predecessor_size; ++i)
    predecessor.push_back(i);

  for (dimension_type i = predecessor_size; i-- > 1; )
    if (i == predecessor[i]) {
      const DB_Row<N>& dbm_i = dbm[i];
      for (dimension_type j = i; j-- > 0; )
        if (j == predecessor[j]
            && is_additive_inverse(dbm[j][i], dbm_i[j])) {

          predecessor[i] = j;
          break;
        }
    }
}

template <typename T>
void
BD_Shape<T>::compute_leaders(std::vector<dimension_type>& leaders) const {
  ((void) 0);
  ((void) 0);

  compute_predecessors(leaders);

  ((void) 0);
  for (dimension_type i = 1, l_size = leaders.size(); i != l_size; ++i) {
    const dimension_type leaders_i = leaders[i];
    ((void) 0);
    if (leaders_i != i) {
      const dimension_type leaders_leaders_i = leaders[leaders_i];
      ((void) 0);
      leaders[i] = leaders_leaders_i;
    }
  }
}

template <typename T>
bool
BD_Shape<T>::is_shortest_path_reduced() const {

  if (marked_empty())
    return true;

  const dimension_type space_dim = space_dimension();

  if (space_dim == 0)
    return true;




  if (!marked_shortest_path_reduced())
    return false;

  const BD_Shape x_copy = *this;
  x_copy.shortest_path_closure_assign();

  if (x_copy.marked_empty())
    return false;


  std::vector<dimension_type> leader(space_dim + 1);


  for (dimension_type i = space_dim + 1; i-- > 0; )
    leader[i] = i;





  for (dimension_type i = 0; i < space_dim; ++i) {
    const DB_Row<N>& x_copy_dbm_i = x_copy.dbm[i];
    for (dimension_type j = i + 1; j <= space_dim; ++j)
      if (is_additive_inverse(x_copy.dbm[j][i], x_copy_dbm_i[j]))


        leader[j] = leader[i];
  }






  Parma_Polyhedra_Library::Dirty_Temp<N> holder_c; N& c = holder_c.item();
  for (dimension_type k = 0; k <= space_dim; ++k)
    if (leader[k] == k) {
      const DB_Row<N>& x_k = x_copy.dbm[k];
      for (dimension_type i = 0; i <= space_dim; ++i)
        if (leader[i] == i) {
          const DB_Row<N>& x_i = x_copy.dbm[i];
          const Bit_Row& redundancy_i = redundancy_dbm[i];
          const N& x_i_k = x_i[k];
          for (dimension_type j = 0; j <= space_dim; ++j)
            if (leader[j] == j) {
              const N& x_i_j = x_i[j];
              if (!is_plus_infinity(x_i_j)) {
                add_assign_r(c, x_i_k, x_k[j], ROUND_UP);
                if (x_i_j >= c && !redundancy_i[j])
                  return false;
              }
            }
        }
    }





  std::vector<dimension_type> var_conn(space_dim + 1);
  for (dimension_type i = space_dim + 1; i-- > 0; )
    var_conn[i] = space_dim + 1;






  for (dimension_type i = 0; i <= space_dim; ++i) {


    dimension_type t = 0;
    dimension_type leader_i = leader[i];

    if (leader_i == i) {
      for (dimension_type j = 0; j <= space_dim; ++j) {
        dimension_type leader_j = leader[j];


        if (j != leader_j)
          if (!redundancy_dbm[i][j]) {
            if (t == 1)

              return false;
            else
              if (leader_j != i)

                return false;
              else {
                ++t;
                var_conn[i] = j;
              }
          }
      }
    }

    else {
      for (dimension_type j = 0; j <= space_dim; ++j) {
        if (!redundancy_dbm[i][j]) {
          dimension_type leader_j = leader[j];
          if (leader_i != leader_j)

            return false;
          else {
            if (t == 1)

              return false;
            else {
              ++t;
              var_conn[i] = j;
            }
          }


          if (t == 0)
            return false;
        }
      }
    }
  }



  std::vector<bool> just_checked(space_dim + 1);
  for (dimension_type i = space_dim + 1; i-- > 0; )
    just_checked[i] = false;



  for (dimension_type i = 0; i <= space_dim; ++i) {

    if (!just_checked[i]) {
      dimension_type v_con = var_conn[i];


      if (v_con != space_dim + 1) {


        while (v_con != i) {
          just_checked[v_con] = true;
          v_con = var_conn[v_con];


          if (just_checked[v_con])
            return false;
        }
      }
    }
    just_checked[i] = true;
  }


  return true;
}

template <typename T>
bool
BD_Shape<T>::bounds(const Linear_Expression& expr,
                    const bool from_above) const {


  const dimension_type expr_space_dim = expr.space_dimension();
  const dimension_type space_dim = space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((from_above
                                  ? "bounds_from_above(e)"
                                  : "bounds_from_below(e)"), "e", expr);

  shortest_path_closure_assign();

  if (space_dim == 0 || marked_empty())
    return true;



  const Constraint& c = from_above ? expr <= 0 : expr >= 0;
  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();

  if (BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) {
    if (num_vars == 0)

      return true;

    const N& x = (coeff < 0) ? dbm[i][j] : dbm[j][i];
    return !is_plus_infinity(x);
  }
  else {

    Optimization_Mode mode_bounds
      = from_above ? MAXIMIZATION : MINIMIZATION;
    MIP_Problem mip(space_dim, constraints(), expr, mode_bounds);

    return mip.solve() == OPTIMIZED_MIP_PROBLEM;
  }
}

template <typename T>
bool
BD_Shape<T>::max_min(const Linear_Expression& expr,
                     const bool maximize,
                     Coefficient& ext_n, Coefficient& ext_d,
                     bool& included) const {


  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((maximize
                                  ? "maximize(e, ...)"
                                  : "minimize(e, ...)"), "e", expr);

  if (space_dim == 0) {
    if (marked_empty())
      return false;
    else {
      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      return true;
    }
  }

  shortest_path_closure_assign();

  if (marked_empty())
    return false;



  const Constraint& c = maximize ? expr <= 0 : expr >= 0;
  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();

  if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) {
    Optimization_Mode mode_max_min
      = maximize ? MAXIMIZATION : MINIMIZATION;
    MIP_Problem mip(space_dim, constraints(), expr, mode_max_min);
    if (mip.solve() == OPTIMIZED_MIP_PROBLEM) {
      mip.optimal_value(ext_n, ext_d);
      included = true;
      return true;
    }
    else

      return false;
  }
  else {

    if (num_vars == 0) {

      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      return true;
    }


    const N& x = (coeff < 0) ? dbm[i][j] : dbm[j][i];
    if (!is_plus_infinity(x)) {

      Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
      const Coefficient& b = expr.inhomogeneous_term();
      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
      neg_assign(minus_b, b);
      const Coefficient& sc_b = maximize ? b : minus_b;
      assign_r(d, sc_b, ROUND_UP);


      Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_expr; N& coeff_expr = holder_coeff_expr.item();
      ((void) 0);
      const Coefficient& coeff_i = expr.get(Variable(i - 1));
      const int sign_i = sgn(coeff_i);
      if (sign_i > 0)
        assign_r(coeff_expr, coeff_i, ROUND_UP);
      else {
        Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_coeff_i; Parma_Polyhedra_Library::Coefficient& minus_coeff_i = holder_minus_coeff_i.item();
        neg_assign(minus_coeff_i, coeff_i);
        assign_r(coeff_expr, minus_coeff_i, ROUND_UP);
      }

      add_mul_assign_r(d, coeff_expr, x, ROUND_UP);
      numer_denom(d, ext_n, ext_d);
      if (!maximize)
        neg_assign(ext_n);
      included = true;
      return true;
    }


    return false;
  }
}

template <typename T>
bool
BD_Shape<T>::max_min(const Linear_Expression& expr,
                     const bool maximize,
                     Coefficient& ext_n, Coefficient& ext_d,
                     bool& included,
                     Generator& g) const {


  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((maximize
                                  ? "maximize(e, ...)"
                                  : "minimize(e, ...)"), "e", expr);

  if (space_dim == 0) {
    if (marked_empty())
      return false;
    else {
      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      g = point();
      return true;
    }
  }

  shortest_path_closure_assign();

  if (marked_empty())
    return false;

  Optimization_Mode mode_max_min
    = maximize ? MAXIMIZATION : MINIMIZATION;
  MIP_Problem mip(space_dim, constraints(), expr, mode_max_min);
  if (mip.solve() == OPTIMIZED_MIP_PROBLEM) {
    g = mip.optimizing_point();
    mip.evaluate_objective_function(g, ext_n, ext_d);
    included = true;
    return true;
  }

  return false;
}

template <typename T>
Poly_Con_Relation
BD_Shape<T>::relation_with(const Congruence& cg) const {
  const dimension_type space_dim = space_dimension();


  if (cg.space_dimension() > space_dim)
    throw_dimension_incompatible("relation_with(cg)", cg);



  if (cg.is_equality()) {
    Constraint c(cg);
    return relation_with(c);
  }

  shortest_path_closure_assign();

  if (marked_empty())
    return Poly_Con_Relation::saturates()
      && Poly_Con_Relation::is_included()
      && Poly_Con_Relation::is_disjoint();

  if (space_dim == 0) {
    if (cg.is_inconsistent())
      return Poly_Con_Relation::is_disjoint();
    else
      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_included();
  }



  Linear_Expression le = Linear_Expression(cg.expression());
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_numer; Parma_Polyhedra_Library::Coefficient& min_numer = holder_min_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_denom; Parma_Polyhedra_Library::Coefficient& min_denom = holder_min_denom.item();
  bool min_included;
  bool bounded_below = minimize(le, min_numer, min_denom, min_included);



  if (!bounded_below)
    return Poly_Con_Relation::strictly_intersects();







  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_numer; Parma_Polyhedra_Library::Coefficient& max_numer = holder_max_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_denom; Parma_Polyhedra_Library::Coefficient& max_denom = holder_max_denom.item();
  bool max_included;
  bool bounded_above = maximize(le, max_numer, max_denom, max_included);



  if (!bounded_above)
    return Poly_Con_Relation::strictly_intersects();

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_signed_distance; Parma_Polyhedra_Library::Coefficient& signed_distance = holder_signed_distance.item();



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_value; Parma_Polyhedra_Library::Coefficient& min_value = holder_min_value.item();
  min_value = min_numer / min_denom;
  const Coefficient& modulus = cg.modulus();
  signed_distance = min_value % modulus;
  min_value -= signed_distance;
  if (min_value * min_denom < min_numer)
    min_value += modulus;



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_value; Parma_Polyhedra_Library::Coefficient& max_value = holder_max_value.item();
  max_value = max_numer / max_denom;
  signed_distance = max_value % modulus;
  max_value += signed_distance;
  if (max_value * max_denom > max_numer)
    max_value -= modulus;




  if (max_value < min_value)
    return Poly_Con_Relation::is_disjoint();
  else
    return Poly_Con_Relation::strictly_intersects();
}


template <typename T>
Poly_Con_Relation
BD_Shape<T>::relation_with(const Constraint& c) const {
  const dimension_type c_space_dim = c.space_dimension();
  const dimension_type space_dim = space_dimension();


  if (c_space_dim > space_dim)
    throw_dimension_incompatible("relation_with(c)", c);

  shortest_path_closure_assign();

  if (marked_empty())
    return Poly_Con_Relation::saturates()
      && Poly_Con_Relation::is_included()
      && Poly_Con_Relation::is_disjoint();

  if (space_dim == 0) {
    if ((c.is_equality() && c.inhomogeneous_term() != 0)
        || (c.is_inequality() && c.inhomogeneous_term() < 0))
      return Poly_Con_Relation::is_disjoint();
    else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0)


      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_disjoint();
    else if (c.is_equality() || c.inhomogeneous_term() == 0)
      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_included();
    else



      return Poly_Con_Relation::is_included();
  }

  dimension_type num_vars = 0;
  dimension_type i = 0;
  dimension_type j = 0;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  if (!BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) {






    Linear_Expression le(c.expression());
    le.set_inhomogeneous_term(Coefficient_zero());

    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_numer; Coefficient& max_numer = holder_max_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_denom; Coefficient& max_denom = holder_max_denom.item();
    bool max_included;
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_numer; Coefficient& min_numer = holder_min_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_denom; Coefficient& min_denom = holder_min_denom.item();
    bool min_included;
    bool bounded_above = maximize(le, max_numer, max_denom, max_included);
    bool bounded_below = minimize(le, min_numer, min_denom, min_included);
    if (!bounded_above) {
      if (!bounded_below)
        return Poly_Con_Relation::strictly_intersects();
      min_numer += c.inhomogeneous_term() * min_denom;
      switch (sgn(min_numer)) {
      case 1:
        if (c.is_equality())
          return Poly_Con_Relation::is_disjoint();
        return Poly_Con_Relation::is_included();
      case 0:
        if (c.is_strict_inequality() || c.is_equality())
          return Poly_Con_Relation::strictly_intersects();
        return Poly_Con_Relation::is_included();
      case -1:
        return Poly_Con_Relation::strictly_intersects();
      }
    }
    if (!bounded_below) {
      max_numer += c.inhomogeneous_term() * max_denom;
      switch (sgn(max_numer)) {
      case 1:
        return Poly_Con_Relation::strictly_intersects();
      case 0:
        if (c.is_strict_inequality())
          return Poly_Con_Relation::is_disjoint();
        return Poly_Con_Relation::strictly_intersects();
      case -1:
        return Poly_Con_Relation::is_disjoint();
      }
    }
    else {
      max_numer += c.inhomogeneous_term() * max_denom;
      min_numer += c.inhomogeneous_term() * min_denom;
      switch (sgn(max_numer)) {
      case 1:
        switch (sgn(min_numer)) {
        case 1:
          if (c.is_equality())
            return Poly_Con_Relation::is_disjoint();
          return Poly_Con_Relation::is_included();
        case 0:
          if (c.is_equality())
            return Poly_Con_Relation::strictly_intersects();
          if (c.is_strict_inequality())
            return Poly_Con_Relation::strictly_intersects();
          return Poly_Con_Relation::is_included();
        case -1:
          return Poly_Con_Relation::strictly_intersects();
        }
        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      case 0:
        if (min_numer == 0) {
          if (c.is_strict_inequality())
            return Poly_Con_Relation::is_disjoint()
              && Poly_Con_Relation::saturates();
          return Poly_Con_Relation::is_included()
            && Poly_Con_Relation::saturates();
        }
        if (c.is_strict_inequality())
          return Poly_Con_Relation::is_disjoint();
        return Poly_Con_Relation::strictly_intersects();
      case -1:
        return Poly_Con_Relation::is_disjoint();
      }
    }
  }


  if (num_vars == 0) {

    switch (sgn(c.inhomogeneous_term())) {
    case -1:
      return Poly_Con_Relation::is_disjoint();
    case 0:
      if (c.is_strict_inequality())
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_disjoint();
      else
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_included();
    case 1:
      if (c.is_equality())
        return Poly_Con_Relation::is_disjoint();
      else
        return Poly_Con_Relation::is_included();
    }
  }



  const bool negative = (coeff < 0);
  const N& x = negative ? dbm[i][j] : dbm[j][i];
  const N& y = negative ? dbm[j][i] : dbm[i][j];
  if (negative)
    neg_assign(coeff);
# 1584 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_x; mpq_class& q_x = holder_q_x.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_y; mpq_class& q_y = holder_q_y.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_d; mpq_class& d = holder_d.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_d1; mpq_class& d1 = holder_d1.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_c_denom; mpq_class& c_denom = holder_c_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_denom; mpq_class& q_denom = holder_q_denom.item();
  assign_r(c_denom, coeff, ROUND_NOT_NEEDED);
  assign_r(d, c.inhomogeneous_term(), ROUND_NOT_NEEDED);
  neg_assign_r(d1, d, ROUND_NOT_NEEDED);
  div_assign_r(d, d, c_denom, ROUND_NOT_NEEDED);
  div_assign_r(d1, d1, c_denom, ROUND_NOT_NEEDED);

  if (is_plus_infinity(x)) {
    if (!is_plus_infinity(y)) {





      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
      Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
      numer_denom(y, numer, denom);
      assign_r(q_denom, denom, ROUND_NOT_NEEDED);
      assign_r(q_y, numer, ROUND_NOT_NEEDED);
      div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED);
      if (q_y < d1)
        return Poly_Con_Relation::is_disjoint();
      if (q_y == d1 && c.is_strict_inequality())
        return Poly_Con_Relation::is_disjoint();
    }


    return Poly_Con_Relation::strictly_intersects();
  }


  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  numer_denom(x, numer, denom);
  assign_r(q_denom, denom, ROUND_NOT_NEEDED);
  assign_r(q_x, numer, ROUND_NOT_NEEDED);
  div_assign_r(q_x, q_x, q_denom, ROUND_NOT_NEEDED);

  if (!is_plus_infinity(y)) {
    numer_denom(y, numer, denom);
    assign_r(q_denom, denom, ROUND_NOT_NEEDED);
    assign_r(q_y, numer, ROUND_NOT_NEEDED);
    div_assign_r(q_y, q_y, q_denom, ROUND_NOT_NEEDED);
    if (q_x == d && q_y == d1) {
      if (c.is_strict_inequality())
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_disjoint();
      else
        return Poly_Con_Relation::saturates()
          && Poly_Con_Relation::is_included();
    }



    if (q_y < d1)
      return Poly_Con_Relation::is_disjoint();
    if (q_y == d1 && c.is_strict_inequality())
      return Poly_Con_Relation::is_disjoint();
  }




  if (d > q_x) {
    if (c.is_equality())
      return Poly_Con_Relation::is_disjoint();
    else
      return Poly_Con_Relation::is_included();
  }

  if (d == q_x && c.is_nonstrict_inequality())
    return Poly_Con_Relation::is_included();


  return Poly_Con_Relation::strictly_intersects();
}

template <typename T>
Poly_Gen_Relation
BD_Shape<T>::relation_with(const Generator& g) const {
  const dimension_type space_dim = space_dimension();
  const dimension_type g_space_dim = g.space_dimension();


  if (space_dim < g_space_dim)
    throw_dimension_incompatible("relation_with(g)", g);

  shortest_path_closure_assign();

  if (marked_empty())
    return Poly_Gen_Relation::nothing();



  if (space_dim == 0)
    return Poly_Gen_Relation::subsumes();

  const bool is_line = g.is_line();
  const bool is_line_or_ray = g.is_line_or_ray();
# 1696 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_product; Parma_Polyhedra_Library::Coefficient& product = holder_product.item();


  for (dimension_type i = 0; i <= space_dim; ++i) {
    const Coefficient& g_coeff_y = (i > g_space_dim || i == 0)
      ? Coefficient_zero() : g.coefficient(Variable(i-1));
    const DB_Row<N>& dbm_i = dbm[i];
    for (dimension_type j = i + 1; j <= space_dim; ++j) {
      const Coefficient& g_coeff_x = (j > g_space_dim)
        ? Coefficient_zero() : g.coefficient(Variable(j-1));
      const N& dbm_ij = dbm_i[j];
      const N& dbm_ji = dbm[j][i];
      if (is_additive_inverse(dbm_ji, dbm_ij)) {


        numer_denom(dbm_ij, numer, denom);
        product = g_coeff_y;
        product -= g_coeff_x;
        product *= denom;
        if (!is_line_or_ray)
          add_mul_assign(product, numer, g.divisor());
        if (product != 0)
          return Poly_Gen_Relation::nothing();
      }
      else {

        if (!is_plus_infinity(dbm_ij)) {



          numer_denom(dbm_ij, numer, denom);
          product = g_coeff_y;
          product -= g_coeff_x;
          product *= denom;
          if (!is_line_or_ray)
            add_mul_assign(product, numer, g.divisor());
          if (is_line) {
            if (product != 0)

              return Poly_Gen_Relation::nothing();
          }
          else

            if (product < 0)
              return Poly_Gen_Relation::nothing();
        }

        if (!is_plus_infinity(dbm_ji)) {


          numer_denom(dbm_ji, numer, denom);
          product = 0;
          add_mul_assign(product, denom, g_coeff_x);
          add_mul_assign(product, -denom, g_coeff_y);
          if (!is_line_or_ray)
            add_mul_assign(product, numer, g.divisor());
          if (is_line) {
            if (product != 0)

              return Poly_Gen_Relation::nothing();
          }
          else

            if (product < 0)
              return Poly_Gen_Relation::nothing();
        }
      }
    }
  }


  return Poly_Gen_Relation::subsumes();
}

template <typename T>
void
BD_Shape<T>::shortest_path_closure_assign() const {

  if (marked_empty() || marked_shortest_path_closed())
    return;
  const dimension_type num_dimensions = space_dimension();

  if (num_dimensions == 0)
    return;



  BD_Shape& x = const_cast<BD_Shape<T>&>(*this);


  for (dimension_type h = num_dimensions + 1; h-- > 0; ) {
    ((void) 0);
    assign_r(x.dbm[h][h], 0, ROUND_NOT_NEEDED);
  }

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();
  for (dimension_type k = num_dimensions + 1; k-- > 0; ) {
    const DB_Row<N>& x_dbm_k = x.dbm[k];
    for (dimension_type i = num_dimensions + 1; i-- > 0; ) {
      DB_Row<N>& x_dbm_i = x.dbm[i];
      const N& x_dbm_i_k = x_dbm_i[k];
      if (!is_plus_infinity(x_dbm_i_k))
        for (dimension_type j = num_dimensions + 1; j-- > 0; ) {
          const N& x_dbm_k_j = x_dbm_k[j];
          if (!is_plus_infinity(x_dbm_k_j)) {

            add_assign_r(sum, x_dbm_i_k, x_dbm_k_j, ROUND_UP);
            min_assign(x_dbm_i[j], sum);
          }
        }
    }
  }



  for (dimension_type h = num_dimensions + 1; h-- > 0; ) {
    N& x_dbm_hh = x.dbm[h][h];
    if (sgn(x_dbm_hh) < 0) {
      x.set_empty();
      return;
    }
    else {
      ((void) 0);

      assign_r(x_dbm_hh, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }


  x.set_shortest_path_closed();
}

template <typename T>
void
BD_Shape<T>::incremental_shortest_path_closure_assign(Variable var) const {

  if (marked_empty() || marked_shortest_path_closed())
    return;
  const dimension_type num_dimensions = space_dimension();
  ((void) 0);



  BD_Shape& x = const_cast<BD_Shape&>(*this);


  for (dimension_type h = num_dimensions + 1; h-- > 0; ) {
    ((void) 0);
    assign_r(x.dbm[h][h], 0, ROUND_NOT_NEEDED);
  }


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();
  const dimension_type v = var.id() + 1;
  DB_Row<N>& x_v = x.dbm[v];

  for (dimension_type k = num_dimensions + 1; k-- > 0; ) {
    DB_Row<N>& x_k = x.dbm[k];
    const N& x_v_k = x_v[k];
    const N& x_k_v = x_k[v];
    const bool x_v_k_finite = !is_plus_infinity(x_v_k);
    const bool x_k_v_finite = !is_plus_infinity(x_k_v);

    if (x_v_k_finite) {
      if (x_k_v_finite) {

        for (dimension_type i = num_dimensions + 1; i-- > 0; ) {
          DB_Row<N>& x_i = x.dbm[i];
          const N& x_i_k = x_i[k];
          if (!is_plus_infinity(x_i_k)) {
            add_assign_r(sum, x_i_k, x_k_v, ROUND_UP);
            min_assign(x_i[v], sum);
          }
          const N& x_k_i = x_k[i];
          if (!is_plus_infinity(x_k_i)) {
            add_assign_r(sum, x_v_k, x_k_i, ROUND_UP);
            min_assign(x_v[i], sum);
          }
        }
      }
      else {

        for (dimension_type i = num_dimensions + 1; i-- > 0; ) {
          const N& x_k_i = x_k[i];
          if (!is_plus_infinity(x_k_i)) {
            add_assign_r(sum, x_v_k, x_k_i, ROUND_UP);
            min_assign(x_v[i], sum);
          }
        }
      }
    }
    else if (x_k_v_finite) {

      for (dimension_type i = num_dimensions + 1; i-- > 0; ) {
        DB_Row<N>& x_i = x.dbm[i];
        const N& x_i_k = x_i[k];
        if (!is_plus_infinity(x_i_k)) {
          add_assign_r(sum, x_i_k, x_k_v, ROUND_UP);
          min_assign(x_i[v], sum);
        }
      }
    }
    else

      continue;
  }



  for (dimension_type i = num_dimensions + 1; i-- > 0; ) {
    DB_Row<N>& x_i = x.dbm[i];
    const N& x_i_v = x_i[v];
    if (!is_plus_infinity(x_i_v)) {
      for (dimension_type j = num_dimensions + 1; j-- > 0; ) {
        const N& x_v_j = x_v[j];
        if (!is_plus_infinity(x_v_j)) {
          add_assign_r(sum, x_i_v, x_v_j, ROUND_UP);
          min_assign(x_i[j], sum);
        }
      }
    }
  }



  for (dimension_type h = num_dimensions + 1; h-- > 0; ) {
    N& x_dbm_hh = x.dbm[h][h];
    if (sgn(x_dbm_hh) < 0) {
      x.set_empty();
      return;
    }
    else {
      ((void) 0);

      assign_r(x_dbm_hh, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }


  x.set_shortest_path_closed();
}

template <typename T>
void
BD_Shape<T>::shortest_path_reduction_assign() const {

  if (marked_shortest_path_reduced())
    return;

  const dimension_type space_dim = space_dimension();

  if (space_dim == 0)
    return;


  shortest_path_closure_assign();


  if (marked_empty())
    return;





  std::vector<dimension_type> predecessor;
  compute_predecessors(predecessor);
  std::vector<dimension_type> leaders;
  compute_leader_indices(predecessor, leaders);
  const dimension_type num_leaders = leaders.size();

  Bit_Matrix redundancy(space_dim + 1, space_dim + 1);


  Bit_Row& red_0 = redundancy[0];
  for (dimension_type j = space_dim + 1; j-- > 0; )
    red_0.set(j);
  for (dimension_type i = space_dim + 1; i-- > 0; )
    redundancy[i] = red_0;



  Parma_Polyhedra_Library::Dirty_Temp<N> holder_c; N& c = holder_c.item();
  for (dimension_type l_i = 0; l_i < num_leaders; ++l_i) {
    const dimension_type i = leaders[l_i];
    const DB_Row<N>& dbm_i = dbm[i];
    Bit_Row& redundancy_i = redundancy[i];
    for (dimension_type l_j = 0; l_j < num_leaders; ++l_j) {
      const dimension_type j = leaders[l_j];
      if (redundancy_i[j]) {
        const N& dbm_i_j = dbm_i[j];
        redundancy_i.clear(j);
        for (dimension_type l_k = 0; l_k < num_leaders; ++l_k) {
          const dimension_type k = leaders[l_k];
          add_assign_r(c, dbm_i[k], dbm[k][j], ROUND_UP);
          if (dbm_i_j >= c) {
            redundancy_i.set(j);
            break;
          }
        }
      }
    }
  }




  std::deque<bool> dealt_with(space_dim + 1, false);
  for (dimension_type i = space_dim + 1; i-- > 0; )


    if (i != predecessor[i] && !dealt_with[i]) {
      dimension_type j = i;
      while (true) {
        const dimension_type predecessor_j = predecessor[j];
        if (j == predecessor_j) {

          ((void) 0);
          redundancy[i].clear(j);


          break;
        }

        ((void) 0);
        redundancy[predecessor_j].clear(j);
        dealt_with[predecessor_j] = true;
        j = predecessor_j;
      }
    }



  BD_Shape<T>& x = const_cast<BD_Shape<T>&>(*this);
  using std::swap;
  swap(x.redundancy_dbm, redundancy);
  x.set_shortest_path_reduced();

  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::upper_bound_assign(const BD_Shape& y) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("upper_bound_assign(y)", y);


  y.shortest_path_closure_assign();
  if (y.marked_empty())
    return;
  shortest_path_closure_assign();
  if (marked_empty()) {
    *this = y;
    return;
  }



  ((void) 0);
  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; ) {
      N& dbm_ij = dbm_i[j];
      const N& y_dbm_ij = y_dbm_i[j];
      if (dbm_ij < y_dbm_ij)
        dbm_ij = y_dbm_ij;
    }
  }


  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();
  ((void) 0);
}

template <typename T>
bool
BD_Shape<T>::BFT00_upper_bound_assign_if_exact(const BD_Shape& y) {

  const BD_Shape& x = *this;
  const dimension_type x_space_dim = x.space_dimension();


  ((void) 0);


  if (x_space_dim == 0) {
    upper_bound_assign(y);
    return true;
  }

  if (x.marked_empty()) {
    *this = y;
    return true;
  }
  else if (y.is_empty())
    return true;
  else if (x.is_empty()) {
    *this = y;
    return true;
  }





  Variable epsilon(x_space_dim);
  Linear_Expression zero_expr;
  zero_expr.set_space_dimension(x_space_dim + 1);
  Linear_Expression db_expr;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();





  Constraint_System env_cs;
  Constraint_System x_cs_removed;
  Constraint_System y_cs_removed;
  x.shortest_path_reduction_assign();
  y.shortest_path_reduction_assign();
  for (dimension_type i = x_space_dim + 1; i-- > 0; ) {
    const Bit_Row& x_red_i = x.redundancy_dbm[i];
    const Bit_Row& y_red_i = y.redundancy_dbm[i];
    const DB_Row<N>& x_dbm_i = x.dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    for (dimension_type j = x_space_dim + 1; j-- > 0; ) {
      if (x_red_i[j] && y_red_i[j])
        continue;
      if (!x_red_i[j]) {
        const N& x_dbm_ij = x_dbm_i[j];
        ((void) 0);
        numer_denom(x_dbm_ij, numer, denom);

        db_expr = zero_expr;
        if (i > 0)
          db_expr += Variable(i-1);
        if (j > 0)
          db_expr -= Variable(j-1);
        if (denom != 1)
          db_expr *= denom;
        db_expr += numer;
        if (x_dbm_ij >= y_dbm_i[j])
          env_cs.insert(db_expr >= 0);
        else {
          db_expr += epsilon;
          x_cs_removed.insert(db_expr == 0);
        }
      }
      if (!y_red_i[j]) {
        const N& y_dbm_ij = y_dbm_i[j];
        const N& x_dbm_ij = x_dbm_i[j];
        ((void) 0);
        numer_denom(y_dbm_ij, numer, denom);

        db_expr = zero_expr;
        if (i > 0)
          db_expr += Variable(i-1);
        if (j > 0)
          db_expr -= Variable(j-1);
        if (denom != 1)
          db_expr *= denom;
        db_expr += numer;
        if (y_dbm_ij >= x_dbm_ij) {

          if (!x_red_i[j] && x_dbm_ij == y_dbm_ij)
            continue;
          env_cs.insert(db_expr >= 0);
        }
        else {
          db_expr += epsilon;
          y_cs_removed.insert(db_expr == 0);
        }
      }
    }
  }

  if (x_cs_removed.empty())

    return true;
  if (y_cs_removed.empty()) {

    *this = y;
    return true;
  }




  MIP_Problem env_lp(x_space_dim + 1, env_cs, epsilon, MAXIMIZATION);

  env_lp.solve();
  ((void) 0);


  for (Constraint_System::const_iterator i = x_cs_removed.begin(),
         i_end = x_cs_removed.end(); i != i_end; ++i) {
    MIP_Problem lp_i(env_lp);
    lp_i.add_constraint(*i);

    if (lp_i.solve() == UNFEASIBLE_MIP_PROBLEM)
      continue;
    for (Constraint_System::const_iterator j = y_cs_removed.begin(),
           j_end = y_cs_removed.end(); j != j_end; ++j) {
      MIP_Problem lp_ij(lp_i);
      lp_ij.add_constraint(*j);

      switch (lp_ij.solve()) {
      case UNFEASIBLE_MIP_PROBLEM:

        Parma_Polyhedra_Library::ppl_unreachable();
        return false;
      case UNBOUNDED_MIP_PROBLEM:
        return false;
      case OPTIMIZED_MIP_PROBLEM:
        lp_ij.optimal_value(numer, denom);
        if (numer > 0)
          return false;
        break;
      }
    }
  }


  upper_bound_assign(y);
  ((void) 0);
  return true;
}

template <typename T>
template <bool integer_upper_bound>
bool
BD_Shape<T>::BHZ09_upper_bound_assign_if_exact(const BD_Shape& y) {
  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_2241 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!integer_upper_bound || std::numeric_limits<T>::is_integer)>) };







  const BD_Shape& x = *this;
  const dimension_type x_space_dim = x.space_dimension();


  ((void) 0);


  if (x_space_dim == 0) {
    upper_bound_assign(y);
    return true;
  }

  if (x.marked_empty()) {
    *this = y;
    return true;
  }
  else if (y.is_empty())
    return true;
  else if (x.is_empty()) {
    *this = y;
    return true;
  }


  x.shortest_path_reduction_assign();
  y.shortest_path_reduction_assign();
  ((void) 0);
  ((void) 0);

  BD_Shape<T> ub(x);
  ub.upper_bound_assign(y);

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lhs; N& lhs = holder_lhs.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_rhs; N& rhs = holder_rhs.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_zero; N& temp_zero = holder_temp_zero.item();
  assign_r(temp_zero, 0, ROUND_NOT_NEEDED);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_temp_one; N& temp_one = holder_temp_one.item();
  if (integer_upper_bound)
    assign_r(temp_one, 1, ROUND_NOT_NEEDED);

  for (dimension_type i = x_space_dim + 1; i-- > 0; ) {
    const DB_Row<N>& x_i = x.dbm[i];
    const Bit_Row& x_red_i = x.redundancy_dbm[i];
    const DB_Row<N>& y_i = y.dbm[i];
    const DB_Row<N>& ub_i = ub.dbm[i];
    for (dimension_type j = x_space_dim + 1; j-- > 0; ) {

      if (x_red_i[j])
        continue;

      ((void) 0);
      const N& x_i_j = x_i[j];
      if (x_i_j < y_i[j]) {
        for (dimension_type k = x_space_dim + 1; k-- > 0; ) {
          const DB_Row<N>& x_k = x.dbm[k];
          const DB_Row<N>& y_k = y.dbm[k];
          const Bit_Row& y_red_k = y.redundancy_dbm[k];
          const DB_Row<N>& ub_k = ub.dbm[k];
          const N& ub_k_j = (k == j) ? temp_zero : ub_k[j];
          for (dimension_type ell = x_space_dim + 1; ell-- > 0; ) {

            if (y_red_k[ell])
              continue;

            ((void) 0);
            const N& y_k_ell = y_k[ell];
            if (y_k_ell < x_k[ell]) {


              add_assign_r(lhs, x_i_j, y_k_ell, ROUND_UP);
              const N& ub_i_ell = (i == ell) ? temp_zero : ub_i[ell];
              add_assign_r(rhs, ub_i_ell, ub_k_j, ROUND_UP);
              if (integer_upper_bound) {


                add_assign_r(lhs, lhs, temp_one, ROUND_NOT_NEEDED);
              }

              if (lhs < rhs)
                return false;
            }
          }
        }
      }
    }
  }

  m_swap(ub);
  ((void) 0);
  return true;
}

template <typename T>
void
BD_Shape<T>::difference_assign(const BD_Shape& y) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("difference_assign(y)", y);

  BD_Shape new_bd_shape(space_dim, EMPTY);

  BD_Shape& x = *this;

  x.shortest_path_closure_assign();


  if (x.marked_empty())
    return;
  y.shortest_path_closure_assign();


  if (y.marked_empty())
    return;




  if (space_dim == 0) {
    x.set_empty();
    return;
  }



  if (y.contains(x)) {
    x.set_empty();
    return;
  }




  const Constraint_System& y_cs = y.constraints();
  for (Constraint_System::const_iterator i = y_cs.begin(),
         y_cs_end = y_cs.end(); i != y_cs_end; ++i) {
    const Constraint& c = *i;






    if (x.relation_with(c).implies(Poly_Con_Relation::is_included()))
      continue;
    BD_Shape z = x;
    const Linear_Expression e(c.expression());
    z.add_constraint(e <= 0);
    if (!z.is_empty())
      new_bd_shape.upper_bound_assign(z);
    if (c.is_equality()) {
      z = x;
      z.add_constraint(e >= 0);
      if (!z.is_empty())
        new_bd_shape.upper_bound_assign(z);
    }
  }
  *this = new_bd_shape;
  ((void) 0);
}

template <typename T>
bool
BD_Shape<T>::simplify_using_context_assign(const BD_Shape& y) {
  BD_Shape& x = *this;
  const dimension_type dim = x.space_dimension();

  if (dim != y.space_dimension())
    throw_dimension_incompatible("simplify_using_context_assign(y)", y);


  if (dim == 0) {
    if (y.marked_empty()) {
      x.set_zero_dim_univ();
      return false;
    }
    else
      return !x.marked_empty();
  }



  y.shortest_path_closure_assign();
  if (x.contains(y)) {
    BD_Shape<T> res(dim, UNIVERSE);
    x.m_swap(res);
    return false;
  }


  x.shortest_path_closure_assign();
  if (x.marked_empty()) {

    dimension_type i;
    dimension_type j;

    i = 0;
    const DB_Row<N>& y_dbm_0 = y.dbm[0];
    for (j = 1; j <= dim; ++j) {
      if (!is_plus_infinity(y_dbm_0[j]))



        goto found;
    }
    j = 0;
    for (i = 1; i <= dim; ++i) {
      if (!is_plus_infinity(y.dbm[i][0]))



        goto found;
    }

    for (i = 1; i <= dim; ++i) {
      const DB_Row<N>& y_dbm_i = y.dbm[i];
      for (j = 1; j <= dim; ++j)
        if (!is_plus_infinity(y_dbm_i[j]))



          goto found;
    }


    return false;

  found:

    ((void) 0);
    BD_Shape<T> res(dim, UNIVERSE);
    Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
    assign_r(tmp, 1, ROUND_UP);
    add_assign_r(tmp, tmp, y.dbm[i][j], ROUND_UP);
    ((void) 0);

    neg_assign_r(res.dbm[j][i], tmp, ROUND_DOWN);
    x.m_swap(res);
    return false;
  }




  BD_Shape<T> target = x;
  target.intersection_assign(y);
  const bool bool_result = !target.is_empty();


  x.shortest_path_reduction_assign();

  dimension_type x_num_non_redundant = (dim+1)*(dim+1);
  for (dimension_type i = dim + 1; i-- > 0; )
    x_num_non_redundant -= x.redundancy_dbm[i].count_ones();
  ((void) 0);




  BD_Shape<T> yy = y;


  BD_Shape<T> res(dim, UNIVERSE);

  dimension_type res_num_non_redundant = 0;


  std::vector<dimension_type> x_leaders;
  x.compute_leaders(x_leaders);


  const DB_Row<N>& x_dbm_0 = x.dbm[0];
  DB_Row<N>& yy_dbm_0 = yy.dbm[0];
  DB_Row<N>& res_dbm_0 = res.dbm[0];
  for (dimension_type j = 1; j <= dim; ++j) {


    if (x_leaders[j] != 0)
      continue;
    ((void) 0);
    if (x_dbm_0[j] < yy_dbm_0[j]) {
      res_dbm_0[j] = x_dbm_0[j];
      ++res_num_non_redundant;

      yy_dbm_0[j] = x_dbm_0[j];
      yy.reset_shortest_path_closed();
    }
    ((void) 0);
    if (x.dbm[j][0] < yy.dbm[j][0]) {
      res.dbm[j][0] = x.dbm[j][0];
      ++res_num_non_redundant;

      yy.dbm[j][0] = x.dbm[j][0];
      yy.reset_shortest_path_closed();
    }

    if (!yy.marked_shortest_path_closed()) {
      Variable var_j(j-1);
      yy.incremental_shortest_path_closure_assign(var_j);
      if (target.contains(yy)) {

        if (res_num_non_redundant < x_num_non_redundant) {
          res.reset_shortest_path_closed();
          x.m_swap(res);
        }
        return bool_result;
      }
    }
  }



  for (dimension_type i = 2; i <= dim; ++i) {
    const dimension_type j = x_leaders[i];
    if (j == i || j == 0)
      continue;
    ((void) 0);
    if (x.dbm[i][j] < yy.dbm[i][j]) {
      res.dbm[i][j] = x.dbm[i][j];
      ++res_num_non_redundant;

      yy.dbm[i][j] = x.dbm[i][j];
      yy.reset_shortest_path_closed();
    }
    ((void) 0);
    if (x.dbm[j][i] < yy.dbm[j][i]) {
      res.dbm[j][i] = x.dbm[j][i];
      ++res_num_non_redundant;

      yy.dbm[j][i] = x.dbm[j][i];
      yy.reset_shortest_path_closed();
    }

    if (!yy.marked_shortest_path_closed()) {
      Variable var_j(j-1);
      yy.incremental_shortest_path_closure_assign(var_j);
      if (target.contains(yy)) {

        if (res_num_non_redundant < x_num_non_redundant) {
          res.reset_shortest_path_closed();
          x.m_swap(res);
        }
        return bool_result;
      }
    }
  }



  for (dimension_type i = 0; i <= dim; ++i) {
    if (i != x_leaders[i])
      continue;
    const DB_Row<N>& x_dbm_i = x.dbm[i];
    const Bit_Row& x_redundancy_dbm_i = x.redundancy_dbm[i];
    DB_Row<N>& yy_dbm_i = yy.dbm[i];
    DB_Row<N>& res_dbm_i = res.dbm[i];
    for (dimension_type j = 0; j <= dim; ++j) {
      if (j != x_leaders[j] || x_redundancy_dbm_i[j])
        continue;
      N& yy_dbm_ij = yy_dbm_i[j];
      const N& x_dbm_ij = x_dbm_i[j];
      if (x_dbm_ij < yy_dbm_ij) {
        res_dbm_i[j] = x_dbm_ij;
        ++res_num_non_redundant;

        yy_dbm_ij = x_dbm_ij;
        yy.reset_shortest_path_closed();
        ((void) 0);
        Variable var(((i > 0) ? i : j) - 1);
        yy.incremental_shortest_path_closure_assign(var);
        if (target.contains(yy)) {

          if (res_num_non_redundant < x_num_non_redundant) {
            res.reset_shortest_path_closed();
            x.m_swap(res);
          }
          return bool_result;
        }
      }
    }
  }

  Parma_Polyhedra_Library::ppl_unreachable();
  return false;
}

template <typename T>
void
BD_Shape<T>::add_space_dimensions_and_embed(const dimension_type m) {

  if (m == 0)
    return;

  const dimension_type space_dim = space_dimension();
  const dimension_type new_space_dim = space_dim + m;
  const bool was_zero_dim_univ = (!marked_empty() && space_dim == 0);




  dbm.grow(new_space_dim + 1);



  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();



  if (was_zero_dim_univ)
    set_shortest_path_closed();

  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::add_space_dimensions_and_project(const dimension_type m) {

  if (m == 0)
    return;

  const dimension_type space_dim = space_dimension();




  if (space_dim == 0) {
    dbm.grow(m + 1);
    if (!marked_empty()) {
      for (dimension_type i = m + 1; i-- > 0; ) {
        DB_Row<N>& dbm_i = dbm[i];
        for (dimension_type j = m + 1; j-- > 0; )
          if (i != j)
            assign_r(dbm_i[j], 0, ROUND_NOT_NEEDED);
      }
      set_shortest_path_closed();
    }
    ((void) 0);
    return;
  }





  const dimension_type new_space_dim = space_dim + m;
  dbm.grow(new_space_dim + 1);


  DB_Row<N>& dbm_0 = dbm[0];
  for (dimension_type i = space_dim + 1; i <= new_space_dim; ++i) {
    assign_r(dbm[i][0], 0, ROUND_NOT_NEEDED);
    assign_r(dbm_0[i], 0, ROUND_NOT_NEEDED);
  }

  if (marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::remove_space_dimensions(const Variables_Set& vars) {



  if (vars.empty()) {
    ((void) 0);
    return;
  }

  const dimension_type old_space_dim = space_dimension();


  const dimension_type min_space_dim = vars.space_dimension();
  if (old_space_dim < min_space_dim)
    throw_dimension_incompatible("remove_space_dimensions(vs)", min_space_dim);


  shortest_path_closure_assign();



  const dimension_type new_space_dim = old_space_dim - vars.size();
  if (new_space_dim == 0) {
    dbm.resize_no_copy(1);
    if (!marked_empty())

      set_zero_dim_univ();
    ((void) 0);
    return;
  }


  if (marked_empty()) {
    dbm.resize_no_copy(new_space_dim + 1);
    ((void) 0);
    return;
  }



  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();




  Variables_Set::const_iterator vsi = vars.begin();
  Variables_Set::const_iterator vsi_end = vars.end();
  dimension_type dst = *vsi + 1;
  dimension_type src = dst + 1;
  for (++vsi; vsi != vsi_end; ++vsi) {
    const dimension_type vsi_next = *vsi + 1;


    while (src < vsi_next) {
      using std::swap;
      swap(dbm[dst], dbm[src]);
      for (dimension_type i = old_space_dim + 1; i-- > 0; ) {
        DB_Row<N>& dbm_i = dbm[i];
        assign_or_swap(dbm_i[dst], dbm_i[src]);
      }
      ++dst;
      ++src;
    }
    ++src;
  }


  while (src <= old_space_dim) {
    using std::swap;
    swap(dbm[dst], dbm[src]);
    for (dimension_type i = old_space_dim + 1; i-- > 0; ) {
      DB_Row<N>& dbm_i = dbm[i];
      assign_or_swap(dbm_i[dst], dbm_i[src]);
    }
    ++src;
    ++dst;
  }


  dbm.resize_no_copy(new_space_dim + 1);
  ((void) 0);
}

template <typename T>
template <typename Partial_Function>
void
BD_Shape<T>::map_space_dimensions(const Partial_Function& pfunc) {
  const dimension_type space_dim = space_dimension();

  if (space_dim == 0)
    return;

  if (pfunc.has_empty_codomain()) {

    remove_higher_space_dimensions(0);
    return;
  }

  const dimension_type new_space_dim = pfunc.max_in_codomain() + 1;


  if (new_space_dim < space_dim)
    shortest_path_closure_assign();



  if (marked_empty()) {
    remove_higher_space_dimensions(new_space_dim);
    return;
  }



  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();


  DB_Matrix<N> x(new_space_dim+1);



  DB_Row<N>& dbm_0 = dbm[0];
  DB_Row<N>& x_0 = x[0];
  for (dimension_type j = 1; j <= space_dim; ++j) {
    dimension_type new_j;
    if (pfunc.maps(j - 1, new_j)) {
      assign_or_swap(x_0[new_j + 1], dbm_0[j]);
      assign_or_swap(x[new_j + 1][0], dbm[j][0]);
    }
  }

  for (dimension_type i = 1; i <= space_dim; ++i) {
    dimension_type new_i;
    if (pfunc.maps(i - 1, new_i)) {
      DB_Row<N>& dbm_i = dbm[i];
      ++new_i;
      DB_Row<N>& x_new_i = x[new_i];
      for (dimension_type j = i+1; j <= space_dim; ++j) {
        dimension_type new_j;
        if (pfunc.maps(j - 1, new_j)) {
          ++new_j;
          assign_or_swap(x_new_i[new_j], dbm_i[j]);
          assign_or_swap(x[new_j][new_i], dbm[j][i]);
        }
      }
    }
  }

  using std::swap;
  swap(dbm, x);
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::intersection_assign(const BD_Shape& y) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("intersection_assign(y)", y);



  if (marked_empty())
    return;
  if (y.marked_empty()) {
    set_empty();
    return;
  }




  if (space_dim == 0)
    return;



  bool changed = false;
  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; ) {
      N& dbm_ij = dbm_i[j];
      const N& y_dbm_ij = y_dbm_i[j];
      if (dbm_ij > y_dbm_ij) {
        dbm_ij = y_dbm_ij;
        changed = true;
      }
    }
  }

  if (changed && marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
template <typename Iterator>
void
BD_Shape<T>::CC76_extrapolation_assign(const BD_Shape& y,
                                       Iterator first, Iterator last,
                                       unsigned* tp) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("CC76_extrapolation_assign(y)", y);


  ((void) 0);



  if (space_dim == 0)
    return;

  shortest_path_closure_assign();

  if (marked_empty())
    return;
  y.shortest_path_closure_assign();

  if (y.marked_empty())
    return;


  if (tp != 0 && *tp > 0) {
    BD_Shape<T> x_tmp(*this);
    x_tmp.CC76_extrapolation_assign(y, first, last, 0);

    if (!contains(x_tmp))
      --(*tp);
    return;
  }
# 2955 "BD_Shape_templates.hh"
  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; ) {
      N& dbm_ij = dbm_i[j];
      const N& y_dbm_ij = y_dbm_i[j];
      if (y_dbm_ij < dbm_ij) {
        Iterator k = std::lower_bound(first, last, dbm_ij);
        if (k != last) {
          if (dbm_ij < *k)
            assign_r(dbm_ij, *k, ROUND_UP);
        }
        else
          assign_r(dbm_ij, PLUS_INFINITY, ROUND_NOT_NEEDED);
      }
    }
  }
  reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::get_limiting_shape(const Constraint_System& cs,
                                BD_Shape& limiting_shape) const {

  ((void) 0);

  shortest_path_closure_assign();
  bool changed = false;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_coeff; Parma_Polyhedra_Library::Coefficient& coeff = holder_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_c_term; Parma_Polyhedra_Library::Coefficient& minus_c_term = holder_minus_c_term.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_d1; N& d1 = holder_d1.item();
  for (Constraint_System::const_iterator cs_i = cs.begin(),
         cs_end = cs.end(); cs_i != cs_end; ++cs_i) {
    const Constraint& c = *cs_i;
    dimension_type num_vars = 0;
    dimension_type i = 0;
    dimension_type j = 0;

    if (BD_Shape_Helpers::extract_bounded_difference(c, num_vars, i, j, coeff)) {


      const bool negative = (coeff < 0);
      const N& x = negative ? dbm[i][j] : dbm[j][i];
      const N& y = negative ? dbm[j][i] : dbm[i][j];
      DB_Matrix<N>& ls_dbm = limiting_shape.dbm;
      if (negative)
        neg_assign(coeff);

      div_round_up(d, c.inhomogeneous_term(), coeff);
      if (x <= d) {
        if (c.is_inequality()) {
          N& ls_x = negative ? ls_dbm[i][j] : ls_dbm[j][i];
          if (ls_x > d) {
            ls_x = d;
            changed = true;
          }
        }
        else {

          neg_assign(minus_c_term, c.inhomogeneous_term());
          div_round_up(d1, minus_c_term, coeff);
          if (y <= d1) {
            N& ls_x = negative ? ls_dbm[i][j] : ls_dbm[j][i];
            N& ls_y = negative ? ls_dbm[j][i] : ls_dbm[i][j];
            if ((ls_x >= d && ls_y > d1) || (ls_x > d && ls_y >= d1)) {
              ls_x = d;
              ls_y = d1;
              changed = true;
            }
          }
        }
      }
    }
  }



  if (changed && limiting_shape.marked_shortest_path_closed())
    limiting_shape.reset_shortest_path_closed();
}

template <typename T>
void
BD_Shape<T>::limited_CC76_extrapolation_assign(const BD_Shape& y,
                                               const Constraint_System& cs,
                                               unsigned* tp) {

  const dimension_type space_dim = space_dimension();
  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)",
                                 y);



  const dimension_type cs_space_dim = cs.space_dimension();
  if (space_dim < cs_space_dim)
    throw_invalid_argument("limited_CC76_extrapolation_assign(y, cs)",
                           "cs is space_dimension incompatible");


  if (cs.has_strict_inequalities())
    throw_invalid_argument("limited_CC76_extrapolation_assign(y, cs)",
                           "cs has strict inequalities");




  if (space_dim == 0)
    return;


  ((void) 0);


  if (marked_empty())
    return;

  if (y.marked_empty())
    return;

  BD_Shape<T> limiting_shape(space_dim, UNIVERSE);
  get_limiting_shape(cs, limiting_shape);
  CC76_extrapolation_assign(y, tp);
  intersection_assign(limiting_shape);
}

template <typename T>
void
BD_Shape<T>::BHMZ05_widening_assign(const BD_Shape& y, unsigned* tp) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("BHMZ05_widening_assign(y)", y);


  ((void) 0);


  const dimension_type y_affine_dim = y.affine_dimension();



  if (y_affine_dim == 0)
    return;



  const dimension_type x_affine_dim = affine_dimension();
  ((void) 0);
  if (x_affine_dim != y_affine_dim)
    return;


  if (tp != 0 && *tp > 0) {
    BD_Shape<T> x_tmp(*this);
    x_tmp.BHMZ05_widening_assign(y, 0);

    if (!contains(x_tmp))
      --(*tp);
    return;
  }


  ((void) 0);

  y.shortest_path_reduction_assign();


  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    const Bit_Row& y_redundancy_i = y.redundancy_dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; ) {
      N& dbm_ij = dbm_i[j];



      if (y_redundancy_i[j] || y_dbm_i[j] != dbm_ij)
        assign_r(dbm_ij, PLUS_INFINITY, ROUND_NOT_NEEDED);
    }
  }




  reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::limited_BHMZ05_extrapolation_assign(const BD_Shape& y,
                                                 const Constraint_System& cs,
                                                 unsigned* tp) {

  const dimension_type space_dim = space_dimension();
  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("limited_BHMZ05_extrapolation_assign(y, cs)",
                                 y);


  const dimension_type cs_space_dim = cs.space_dimension();
  if (space_dim < cs_space_dim)
    throw_invalid_argument("limited_BHMZ05_extrapolation_assign(y, cs)",
                           "cs is space-dimension incompatible");


  if (cs.has_strict_inequalities())
    throw_invalid_argument("limited_BHMZ05_extrapolation_assign(y, cs)",
                           "cs has strict inequalities");




  if (space_dim == 0)
    return;


  ((void) 0);


  if (marked_empty())
    return;

  if (y.marked_empty())
    return;

  BD_Shape<T> limiting_shape(space_dim, UNIVERSE);
  get_limiting_shape(cs, limiting_shape);
  BHMZ05_widening_assign(y, tp);
  intersection_assign(limiting_shape);
}

template <typename T>
void
BD_Shape<T>::CC76_narrowing_assign(const BD_Shape& y) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("CC76_narrowing_assign(y)", y);


  ((void) 0);



  if (space_dim == 0)
    return;

  y.shortest_path_closure_assign();

  if (y.marked_empty())
    return;
  shortest_path_closure_assign();

  if (marked_empty())
    return;



  bool changed = false;
  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    const DB_Row<N>& y_dbm_i = y.dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; ) {
      N& dbm_ij = dbm_i[j];
      const N& y_dbm_ij = y_dbm_i[j];
      if (!is_plus_infinity(dbm_ij)
          && !is_plus_infinity(y_dbm_ij)
          && dbm_ij != y_dbm_ij) {
        dbm_ij = y_dbm_ij;
        changed = true;
      }
    }
  }
  if (changed && marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>
::deduce_v_minus_u_bounds(const dimension_type v,
                          const dimension_type last_v,
                          const Linear_Expression& sc_expr,
                          Coefficient_traits::const_reference sc_denom,
                          const N& ub_v) {
  ((void) 0);
  ((void) 0);
# 3258 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_mpq_sc_denom; mpq_class& mpq_sc_denom = holder_mpq_sc_denom.item();
  assign_r(mpq_sc_denom, sc_denom, ROUND_NOT_NEEDED);
  const DB_Row<N>& dbm_0 = dbm[0];

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_minus_lb_u; mpq_class& minus_lb_u = holder_minus_lb_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_ub_u; mpq_class& ub_u = holder_ub_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_up_approx; N& up_approx = holder_up_approx.item();
  for (Linear_Expression::const_iterator u = sc_expr.begin(),
        u_end = sc_expr.lower_bound(Variable(last_v)); u != u_end; ++u) {
    const dimension_type u_dim = u.variable().space_dimension();
    if (u_dim == v)
      continue;
    const Coefficient& expr_u = *u;
    if (expr_u < 0)
      continue;
    ((void) 0);
    if (expr_u >= sc_denom)

      sub_assign_r(dbm[u_dim][v], ub_v, dbm_0[u_dim], ROUND_UP);
    else {
      DB_Row<N>& dbm_u = dbm[u_dim];
      const N& dbm_u0 = dbm_u[0];
      if (!is_plus_infinity(dbm_u0)) {






        assign_r(minus_lb_u, dbm_u0, ROUND_NOT_NEEDED);
        assign_r(q, expr_u, ROUND_NOT_NEEDED);
        div_assign_r(q, q, mpq_sc_denom, ROUND_NOT_NEEDED);
        assign_r(ub_u, dbm_0[u_dim], ROUND_NOT_NEEDED);

        add_assign_r(ub_u, ub_u, minus_lb_u, ROUND_NOT_NEEDED);

        sub_mul_assign_r(minus_lb_u, q, ub_u, ROUND_NOT_NEEDED);
        assign_r(up_approx, minus_lb_u, ROUND_UP);

        add_assign_r(dbm_u[v], ub_v, up_approx, ROUND_UP);
      }
    }
  }
}

template <typename T>
void
BD_Shape<T>
::deduce_u_minus_v_bounds(const dimension_type v,
                          const dimension_type last_v,
                          const Linear_Expression& sc_expr,
                          Coefficient_traits::const_reference sc_denom,
                          const N& minus_lb_v) {
  ((void) 0);
  ((void) 0);
# 3322 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_mpq_sc_denom; mpq_class& mpq_sc_denom = holder_mpq_sc_denom.item();
  assign_r(mpq_sc_denom, sc_denom, ROUND_NOT_NEEDED);
  DB_Row<N>& dbm_0 = dbm[0];
  DB_Row<N>& dbm_v = dbm[v];

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_ub_u; mpq_class& ub_u = holder_ub_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_minus_lb_u; mpq_class& minus_lb_u = holder_minus_lb_u.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_up_approx; N& up_approx = holder_up_approx.item();

  for (Linear_Expression::const_iterator u = sc_expr.begin(),
        u_end = sc_expr.lower_bound(Variable(last_v)); u != u_end; ++u) {
    const Variable u_var = u.variable();
    const dimension_type u_dim = u_var.space_dimension();
    if (u_var.space_dimension() == v)
      continue;
    const Coefficient& expr_u = *u;
    if (expr_u < 0)
      continue;
    ((void) 0);
    if (expr_u >= sc_denom)


      sub_assign_r(dbm_v[u_dim], minus_lb_v, dbm[u_dim][0], ROUND_UP);
    else {
      const N& dbm_0u = dbm_0[u_dim];
      if (!is_plus_infinity(dbm_0u)) {






        assign_r(ub_u, dbm_0u, ROUND_NOT_NEEDED);
        assign_r(q, expr_u, ROUND_NOT_NEEDED);
        div_assign_r(q, q, mpq_sc_denom, ROUND_NOT_NEEDED);
        assign_r(minus_lb_u, dbm[u_dim][0], ROUND_NOT_NEEDED);

        add_assign_r(minus_lb_u, minus_lb_u, ub_u, ROUND_NOT_NEEDED);

        sub_mul_assign_r(ub_u, q, minus_lb_u, ROUND_NOT_NEEDED);
        assign_r(up_approx, ub_u, ROUND_UP);

        add_assign_r(dbm_v[u_dim], up_approx, minus_lb_v, ROUND_UP);
      }
    }
  }
}

template <typename T>
void
BD_Shape<T>::forget_all_dbm_constraints(const dimension_type v) {
  ((void) 0);
  DB_Row<N>& dbm_v = dbm[v];
  for (dimension_type i = dbm.num_rows(); i-- > 0; ) {
    assign_r(dbm_v[i], PLUS_INFINITY, ROUND_NOT_NEEDED);
    assign_r(dbm[i][v], PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
}

template <typename T>
void
BD_Shape<T>::forget_binary_dbm_constraints(const dimension_type v) {
  ((void) 0);
  DB_Row<N>& dbm_v = dbm[v];
  for (dimension_type i = dbm.num_rows()-1; i > 0; --i) {
    assign_r(dbm_v[i], PLUS_INFINITY, ROUND_NOT_NEEDED);
    assign_r(dbm[i][v], PLUS_INFINITY, ROUND_NOT_NEEDED);
  }
}

template <typename T>
void
BD_Shape<T>::unconstrain(const Variable var) {

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dimension() < var_space_dim)
    throw_dimension_incompatible("unconstrain(var)", var_space_dim);



  shortest_path_closure_assign();


  if (marked_empty())
    return;

  forget_all_dbm_constraints(var_space_dim);

  reset_shortest_path_reduced();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::unconstrain(const Variables_Set& vars) {


  if (vars.empty())
    return;


  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dimension() < min_space_dim)
    throw_dimension_incompatible("unconstrain(vs)", min_space_dim);



  shortest_path_closure_assign();


  if (marked_empty())
    return;

  for (Variables_Set::const_iterator vsi = vars.begin(),
         vsi_end = vars.end(); vsi != vsi_end; ++vsi)
    forget_all_dbm_constraints(*vsi + 1);

  reset_shortest_path_reduced();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::refine(const Variable var,
                    const Relation_Symbol relsym,
                    const Linear_Expression& expr,
                    Coefficient_traits::const_reference denominator) {
  ((void) 0);
  ((void) 0);
  const dimension_type v = var.id() + 1;
  ((void) 0);
  ((void) 0);
  ((void) 0);

  const Coefficient& b = expr.inhomogeneous_term();


  dimension_type t = 0;

  dimension_type w = expr.last_nonzero();

  if (w != 0) {
    ++t;
    if (!expr.all_zeroes(1, w))
      ++t;
  }






  if (t == 1 && expr.get(Variable(w - 1)) != denominator)
    t = 2;





  const DB_Row<N>& dbm_0 = dbm[0];
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign(minus_denom, denominator);

  if (t == 0) {

    switch (relsym) {
    case EQUAL:

      add_dbm_constraint(0, v, b, denominator);
      add_dbm_constraint(v, 0, b, minus_denom);
      break;
    case LESS_OR_EQUAL:

      add_dbm_constraint(0, v, b, denominator);
      break;
    case GREATER_OR_EQUAL:


      add_dbm_constraint(v, 0, b, minus_denom);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
    return;
  }

  if (t == 1) {

    ((void) 0);
    Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
    switch (relsym) {
    case EQUAL:

      div_round_up(d, b, denominator);
      add_dbm_constraint(w, v, d);


      div_round_up(d, b, minus_denom);
      add_dbm_constraint(v, w, d);
      break;
    case LESS_OR_EQUAL:

      div_round_up(d, b, denominator);
      add_dbm_constraint(w, v, d);
      break;
    case GREATER_OR_EQUAL:


      div_round_up(d, b, minus_denom);
      add_dbm_constraint(v, w, d);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
    return;
  }




  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign(minus_b, b);
  const Coefficient& sc_b = is_sc ? b : minus_b;
  const Coefficient& minus_sc_b = is_sc ? minus_b : b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -expr;
  const Linear_Expression& sc_expr = is_sc ? expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();

  dimension_type pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type pinf_count = 0;



  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();

  switch (relsym) {
  case EQUAL:
    {
      Parma_Polyhedra_Library::Dirty_Temp<N> holder_neg_sum; N& neg_sum = holder_neg_sum.item();

      dimension_type neg_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

      dimension_type neg_pinf_count = 0;





      assign_r(sum, sc_b, ROUND_UP);
      assign_r(neg_sum, minus_sc_b, ROUND_UP);




      for (Linear_Expression::const_iterator i = sc_expr.begin(),
            i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
        const dimension_type i_dim = i.variable().space_dimension();
        const Coefficient& sc_i = *i;
        const int sign_i = sgn(sc_i);
        ((void) 0);
        if (sign_i > 0) {
          assign_r(coeff_i, sc_i, ROUND_UP);

          if (pinf_count <= 1) {
            const N& approx_i = dbm_0[i_dim];
            if (!is_plus_infinity(approx_i))
              add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
            else {
              ++pinf_count;
              pinf_index = i_dim;
            }
          }

          if (neg_pinf_count <= 1) {
            const N& approx_minus_i = dbm[i_dim][0];
            if (!is_plus_infinity(approx_minus_i))
              add_mul_assign_r(neg_sum, coeff_i, approx_minus_i, ROUND_UP);
            else {
              ++neg_pinf_count;
              neg_pinf_index = i_dim;
            }
          }
        }
        else {
          ((void) 0);
          neg_assign(minus_sc_i, sc_i);

          assign_r(coeff_i, minus_sc_i, ROUND_UP);

          if (pinf_count <= 1) {
            const N& approx_minus_i = dbm[i_dim][0];
            if (!is_plus_infinity(approx_minus_i))
              add_mul_assign_r(sum, coeff_i, approx_minus_i, ROUND_UP);
            else {
              ++pinf_count;
              pinf_index = i_dim;
            }
          }

          if (neg_pinf_count <= 1) {
            const N& approx_i = dbm_0[i_dim];
            if (!is_plus_infinity(approx_i))
              add_mul_assign_r(neg_sum, coeff_i, approx_i, ROUND_UP);
            else {
              ++neg_pinf_count;
              neg_pinf_index = i_dim;
            }
          }
        }
      }

      if (pinf_count > 1 && neg_pinf_count > 1) {
        ((void) 0);
        return;
      }


      reset_shortest_path_closed();





      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);


      if (pinf_count <= 1) {

        if (down_sc_denom != 1)
          div_assign_r(sum, sum, down_sc_denom, ROUND_UP);

        if (pinf_count == 0) {

          dbm[0][v] = sum;

          deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum);
        }
        else

          if (pinf_index != v
              && sc_expr.get(Variable(pinf_index - 1)) == sc_denom)

            dbm[pinf_index][v] = sum;
      }


      if (neg_pinf_count <= 1) {

        if (down_sc_denom != 1)
          div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP);

        if (neg_pinf_count == 0) {

          DB_Row<N>& dbm_v = dbm[v];
          dbm_v[0] = neg_sum;

          deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, neg_sum);
        }
        else

          if (neg_pinf_index != v
              && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom)


            dbm[v][neg_pinf_index] = neg_sum;
      }
    }
    break;

  case LESS_OR_EQUAL:




    assign_r(sum, sc_b, ROUND_UP);




    for (Linear_Expression::const_iterator i = sc_expr.begin(),
          i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
      const Coefficient& sc_i = *i;
      const dimension_type i_dim = i.variable().space_dimension();
      const int sign_i = sgn(sc_i);
      ((void) 0);

      const N& approx_i = (sign_i > 0) ? dbm_0[i_dim] : dbm[i_dim][0];
      if (is_plus_infinity(approx_i)) {
        if (++pinf_count > 1)
          break;
        pinf_index = i_dim;
        continue;
      }
      if (sign_i > 0)
        assign_r(coeff_i, sc_i, ROUND_UP);
      else {
        neg_assign(minus_sc_i, sc_i);
        assign_r(coeff_i, minus_sc_i, ROUND_UP);
      }
      add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
    }


    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
    }

    if (pinf_count == 0) {

      add_dbm_constraint(0, v, sum);

      deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum);
    }
    else if (pinf_count == 1)
      if (expr.get(Variable(pinf_index - 1)) == denominator)

        add_dbm_constraint(pinf_index, v, sum);
    break;

  case GREATER_OR_EQUAL:





    assign_r(sum, minus_sc_b, ROUND_UP);


    for (Linear_Expression::const_iterator i = sc_expr.begin(),
          i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
      const Coefficient& sc_i = *i;
      const dimension_type i_dim = i.variable().space_dimension();
      const int sign_i = sgn(sc_i);
      ((void) 0);

      const N& approx_i = (sign_i > 0) ? dbm[i_dim][0] : dbm_0[i_dim];
      if (is_plus_infinity(approx_i)) {
        if (++pinf_count > 1)
          break;
        pinf_index = i_dim;
        continue;
      }
      if (sign_i > 0)
        assign_r(coeff_i, sc_i, ROUND_UP);
      else {
        neg_assign(minus_sc_i, sc_i);
        assign_r(coeff_i, minus_sc_i, ROUND_UP);
      }
      add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
    }


    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
    }

    if (pinf_count == 0) {

      add_dbm_constraint(v, 0, sum);

      deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, sum);
    }
    else if (pinf_count == 1)
      if (pinf_index != v
          && expr.get(Variable(pinf_index - 1)) == denominator)


        add_dbm_constraint(v, pinf_index, sum);
    break;

  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }

  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::affine_image(const Variable var,
                          const Linear_Expression& expr,
                          Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("affine_image(v, e, d)", "d == 0");




  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("affine_image(v, e, d)", "e", expr);


  const dimension_type v = var.id() + 1;
  if (v > space_dim)
    throw_dimension_incompatible("affine_image(v, e, d)", var.id());


  shortest_path_closure_assign();
  if (marked_empty())
    return;

  const Coefficient& b = expr.inhomogeneous_term();


  dimension_type t = 0;

  dimension_type w = expr.last_nonzero();

  if (w != 0) {
    ++t;
    if (!expr.all_zeroes(1, w))
      ++t;
  }
# 3880 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign(minus_denom, denominator);

  if (t == 0) {


    forget_all_dbm_constraints(v);

    if (marked_shortest_path_reduced())
      reset_shortest_path_reduced();

    add_dbm_constraint(0, v, b, denominator);
    add_dbm_constraint(v, 0, b, minus_denom);
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& a = expr.get(Variable(w - 1));
    if (a == denominator || a == minus_denom) {

      if (w == v) {

        if (a == denominator) {
          if (b == 0)

            return;
          else {


            Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
            div_round_up(d, b, denominator);
            Parma_Polyhedra_Library::Dirty_Temp<N> holder_c; N& c = holder_c.item();
            div_round_up(c, b, minus_denom);
            DB_Row<N>& dbm_v = dbm[v];
            for (dimension_type i = space_dim + 1; i-- > 0; ) {
              N& dbm_vi = dbm_v[i];
              add_assign_r(dbm_vi, dbm_vi, c, ROUND_UP);
              N& dbm_iv = dbm[i][v];
              add_assign_r(dbm_iv, dbm_iv, d, ROUND_UP);
            }

          }
        }
        else {


          forget_binary_dbm_constraints(v);

          using std::swap;
          swap(dbm[v][0], dbm[0][v]);

          reset_shortest_path_closed();
          if (b != 0) {


            Parma_Polyhedra_Library::Dirty_Temp<N> holder_c; N& c = holder_c.item();
            div_round_up(c, b, minus_denom);
            N& dbm_v0 = dbm[v][0];
            add_assign_r(dbm_v0, dbm_v0, c, ROUND_UP);
            Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
            div_round_up(d, b, denominator);
            N& dbm_0v = dbm[0][v];
            add_assign_r(dbm_0v, dbm_0v, d, ROUND_UP);
          }
        }
      }
      else {



        forget_all_dbm_constraints(v);

        if (marked_shortest_path_reduced())
          reset_shortest_path_reduced();
        if (a == denominator) {

          add_dbm_constraint(w, v, b, denominator);
          add_dbm_constraint(v, w, b, minus_denom);
        }
        else {



          const N& dbm_w0 = dbm[w][0];
          if (!is_plus_infinity(dbm_w0)) {

            Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
            div_round_up(d, b, denominator);
            add_assign_r(dbm[0][v], d, dbm_w0, ROUND_UP);
            reset_shortest_path_closed();
          }
          const N& dbm_0w = dbm[0][w];
          if (!is_plus_infinity(dbm_0w)) {

            Parma_Polyhedra_Library::Dirty_Temp<N> holder_c; N& c = holder_c.item();
            div_round_up(c, b, minus_denom);
            add_assign_r(dbm[v][0], dbm_0w, c, ROUND_UP);
            reset_shortest_path_closed();
          }
        }
      }
      ((void) 0);
      return;
    }
  }
# 4000 "BD_Shape_templates.hh"
  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign(minus_b, b);
  const Coefficient& sc_b = is_sc ? b : minus_b;
  const Coefficient& minus_sc_b = is_sc ? minus_b : b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -expr;
  const Linear_Expression& sc_expr = is_sc ? expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_pos_sum; N& pos_sum = holder_pos_sum.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_neg_sum; N& neg_sum = holder_neg_sum.item();

  dimension_type pos_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();
  dimension_type neg_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type pos_pinf_count = 0;
  dimension_type neg_pinf_count = 0;


  assign_r(pos_sum, sc_b, ROUND_UP);
  assign_r(neg_sum, minus_sc_b, ROUND_UP);


  const DB_Row<N>& dbm_0 = dbm[0];

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();



  for (Linear_Expression::const_iterator i = sc_expr.begin(),
        i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
    const Coefficient& sc_i = *i;
    const dimension_type i_dim = i.variable().space_dimension();
    const int sign_i = sgn(sc_i);
    if (sign_i > 0) {
      assign_r(coeff_i, sc_i, ROUND_UP);

      if (pos_pinf_count <= 1) {
        const N& up_approx_i = dbm_0[i_dim];
        if (!is_plus_infinity(up_approx_i))
          add_mul_assign_r(pos_sum, coeff_i, up_approx_i, ROUND_UP);
        else {
          ++pos_pinf_count;
          pos_pinf_index = i_dim;
        }
      }

      if (neg_pinf_count <= 1) {
        const N& up_approx_minus_i = dbm[i_dim][0];
        if (!is_plus_infinity(up_approx_minus_i))
          add_mul_assign_r(neg_sum, coeff_i, up_approx_minus_i, ROUND_UP);
        else {
          ++neg_pinf_count;
          neg_pinf_index = i_dim;
        }
      }
    }
    else {
      ((void) 0);
      neg_assign(minus_sc_i, sc_i);

      assign_r(coeff_i, minus_sc_i, ROUND_UP);

      if (pos_pinf_count <= 1) {
        const N& up_approx_minus_i = dbm[i_dim][0];
        if (!is_plus_infinity(up_approx_minus_i))
          add_mul_assign_r(pos_sum, coeff_i, up_approx_minus_i, ROUND_UP);
        else {
          ++pos_pinf_count;
          pos_pinf_index = i_dim;
        }
      }

      if (neg_pinf_count <= 1) {
        const N& up_approx_i = dbm_0[i_dim];
        if (!is_plus_infinity(up_approx_i))
          add_mul_assign_r(neg_sum, coeff_i, up_approx_i, ROUND_UP);
        else {
          ++neg_pinf_count;
          neg_pinf_index = i_dim;
        }
      }
    }
  }


  forget_all_dbm_constraints(v);

  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();

  if (pos_pinf_count > 1 && neg_pinf_count > 1) {
    ((void) 0);
    return;
  }


  reset_shortest_path_closed();


  if (pos_pinf_count <= 1) {

    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(pos_sum, pos_sum, down_sc_denom, ROUND_UP);
    }

    if (pos_pinf_count == 0) {

      dbm[0][v] = pos_sum;

      deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, pos_sum);
    }
    else

      if (pos_pinf_index != v
          && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom)

        dbm[pos_pinf_index][v] = pos_sum;
  }


  if (neg_pinf_count <= 1) {

    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(neg_sum, neg_sum, down_sc_denom, ROUND_UP);
    }

    if (neg_pinf_count == 0) {

      DB_Row<N>& dbm_v = dbm[v];
      dbm_v[0] = neg_sum;

      deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, neg_sum);
    }
    else

      if (neg_pinf_index != v
          && sc_expr.get(Variable(neg_pinf_index - 1)) == sc_denom)


        dbm[v][neg_pinf_index] = neg_sum;
  }

  ((void) 0);
}

template <typename T>
template <typename Interval_Info>
void
BD_Shape<T>::affine_form_image(const Variable var,
                    const Linear_Form< Interval<T, Interval_Info> >& lf) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_4176 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };






  const dimension_type space_dim = space_dimension();
  const dimension_type lf_space_dim = lf.space_dimension();
  if (space_dim < lf_space_dim)
    throw_dimension_incompatible("affine_form_image(var_id, l)", "l", lf);


  const dimension_type var_id = var.id() + 1;
  if (space_dim < var_id)
    throw_dimension_incompatible("affine_form_image(var_id, l)", var.id());


  shortest_path_closure_assign();
  if (marked_empty())
    return;



  dimension_type t = 0;

  dimension_type w_id = 0;

  for (dimension_type i = lf_space_dim; i-- > 0; )
    if (lf.coefficient(Variable(i)) != 0) {
      if (t++ == 1)
        break;
      else
        w_id = i + 1;
    }

  typedef Interval<T, Interval_Info> FP_Interval_Type;

  const FP_Interval_Type& b = lf.inhomogeneous_term();







  if (t == 0) {
    inhomogeneous_affine_form_image(var_id, b);
    ((void) 0);
    return;
  }
  else if (t == 1) {
    const FP_Interval_Type& w_coeff = lf.coefficient(Variable(w_id - 1));
    if (w_coeff == 1 || w_coeff == -1) {
      one_variable_affine_form_image(var_id, b, w_coeff, w_id, space_dim);
      ((void) 0);
      return;
    }
  }
  two_variables_affine_form_image(var_id, lf, space_dim);
  ((void) 0);
}


template <typename T>
template <typename Interval_Info>
void
BD_Shape<T>
::inhomogeneous_affine_form_image(const dimension_type& var_id,
                                  const Interval<T, Interval_Info>& b) {
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_ub; N& b_ub = holder_b_ub.item();
  assign_r(b_ub, b.upper(), ROUND_NOT_NEEDED);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_mlb; N& b_mlb = holder_b_mlb.item();
  neg_assign_r(b_mlb, b.lower(), ROUND_NOT_NEEDED);


  forget_all_dbm_constraints(var_id);

  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();

    add_dbm_constraint(0, var_id, b_ub);
    add_dbm_constraint(var_id, 0, b_mlb);
    return;
}



template <typename T>
template <typename Interval_Info>
void BD_Shape<T>
::one_variable_affine_form_image(const dimension_type& var_id,
                            const Interval<T, Interval_Info>& b,
                            const Interval<T, Interval_Info>& w_coeff,
                            const dimension_type& w_id,
                            const dimension_type& space_dim) {

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_ub; N& b_ub = holder_b_ub.item();
  assign_r(b_ub, b.upper(), ROUND_NOT_NEEDED);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_mlb; N& b_mlb = holder_b_mlb.item();
  neg_assign_r(b_mlb, b.lower(), ROUND_NOT_NEEDED);


  bool is_w_coeff_one = (w_coeff == 1);

  if (w_id == var_id) {

    bool is_b_zero = (b_mlb == 0 && b_ub == 0);

    if (is_w_coeff_one) {
      if (is_b_zero)

        return;
      else {


        DB_Row<N>& dbm_v = dbm[var_id];
        for (dimension_type i = space_dim + 1; i-- > 0; ) {
          N& dbm_vi = dbm_v[i];
          add_assign_r(dbm_vi, dbm_vi, b_mlb, ROUND_UP);
          N& dbm_iv = dbm[i][var_id];
          add_assign_r(dbm_iv, dbm_iv, b_ub, ROUND_UP);
        }

      }
    }
    else {


      forget_binary_dbm_constraints(var_id);
      using std::swap;
      swap(dbm[var_id][0], dbm[0][var_id]);

      reset_shortest_path_closed();
      if (!is_b_zero) {


        N& dbm_v0 = dbm[var_id][0];
        add_assign_r(dbm_v0, dbm_v0, b_mlb, ROUND_UP);
        N& dbm_0v = dbm[0][var_id];
        add_assign_r(dbm_0v, dbm_0v, b_ub, ROUND_UP);
      }
    }
  }
  else {



    forget_all_dbm_constraints(var_id);

    if (marked_shortest_path_reduced())
      reset_shortest_path_reduced();
    if (is_w_coeff_one) {


      add_dbm_constraint(w_id, var_id, b_ub);
      add_dbm_constraint(var_id, w_id, b_mlb);
    }
    else {


      const N& mlb_w = dbm[w_id][0];
      if (!is_plus_infinity(mlb_w)) {

        add_assign_r(dbm[0][var_id], b_ub, mlb_w, ROUND_UP);
        reset_shortest_path_closed();
      }
      const N& ub_w = dbm[0][w_id];
      if (!is_plus_infinity(ub_w)) {

        add_assign_r(dbm[var_id][0], ub_w, b_mlb, ROUND_UP);
        reset_shortest_path_closed();
      }
    }
  }
  return;
}





template <typename T>
template <typename Interval_Info>
void BD_Shape<T>
::two_variables_affine_form_image(const dimension_type& var_id,
           const Linear_Form< Interval<T, Interval_Info> >& lf,
                             const dimension_type& space_dim) {

  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();

  reset_shortest_path_closed();

  Linear_Form< Interval<T, Interval_Info> > minus_lf(lf);
  minus_lf.negate();


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_upper_bound; N& upper_bound = holder_upper_bound.item();


  for (dimension_type curr_var = 1; curr_var < var_id; ++curr_var) {
    Variable current(curr_var - 1);
    linear_form_upper_bound(lf - current, upper_bound);
    assign_r(dbm[curr_var][var_id], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(minus_lf + current, upper_bound);
    assign_r(dbm[var_id][curr_var], upper_bound, ROUND_NOT_NEEDED);
  }
  for (dimension_type curr_var = var_id + 1; curr_var <= space_dim;
                                                      ++curr_var) {
    Variable current(curr_var - 1);
    linear_form_upper_bound(lf - current, upper_bound);
    assign_r(dbm[curr_var][var_id], upper_bound, ROUND_NOT_NEEDED);
    linear_form_upper_bound(minus_lf + current, upper_bound);
    assign_r(dbm[var_id][curr_var], upper_bound, ROUND_NOT_NEEDED);
  }

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_lf_ub; N& lf_ub = holder_lf_ub.item();
  linear_form_upper_bound(lf, lf_ub);
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_minus_lf_ub; N& minus_lf_ub = holder_minus_lf_ub.item();
  linear_form_upper_bound(minus_lf, minus_lf_ub);
  assign_r(dbm[0][var_id], lf_ub, ROUND_NOT_NEEDED);
  assign_r(dbm[var_id][0], minus_lf_ub, ROUND_NOT_NEEDED);
}

template <typename T>
template <typename Interval_Info>
void BD_Shape<T>::refine_with_linear_form_inequality(
                   const Linear_Form< Interval<T, Interval_Info> >& left,
                   const Linear_Form< Interval<T, Interval_Info> >& right) {

    enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_4407 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };




    ((void) 0);




    const dimension_type left_space_dim = left.space_dimension();
    const dimension_type space_dim = space_dimension();
    if (space_dim < left_space_dim)
      throw_dimension_incompatible(
          "refine_with_linear_form_inequality(left, right)", "left", left);

    const dimension_type right_space_dim = right.space_dimension();
    if (space_dim < right_space_dim)
      throw_dimension_incompatible(
          "refine_with_linear_form_inequality(left, right)", "right", right);



  dimension_type left_t = 0;

  dimension_type left_w_id = 0;


  dimension_type right_t = 0;

  dimension_type right_w_id = 0;

  typedef Interval<T, Interval_Info> FP_Interval_Type;


  for (dimension_type i = left_space_dim; i-- > 0; )
    if (left.coefficient(Variable(i)) != 0) {
      if (left_t++ == 1)
        break;
      else
        left_w_id = i;
    }


  for (dimension_type i = right_space_dim; i-- > 0; )
    if (right.coefficient(Variable(i)) != 0) {
      if (right_t++ == 1)
        break;
      else
        right_w_id = i;
    }

  const FP_Interval_Type& left_w_coeff =
          left.coefficient(Variable(left_w_id));
  const FP_Interval_Type& right_w_coeff =
          right.coefficient(Variable(right_w_id));

  if (left_t == 0) {
    if (right_t == 0) {


      ((void) 0);
      return;
    }
    else if (right_w_coeff == 1 || right_w_coeff == -1) {
      left_inhomogeneous_refine(right_t, right_w_id, left, right);
      ((void) 0);
      return;
    }
  }
  else if (left_t == 1) {
    if (left_w_coeff == 1 || left_w_coeff == -1) {
      if (right_t == 0 || (right_w_coeff == 1 || right_w_coeff == -1)) {
        left_one_var_refine(left_w_id, right_t, right_w_id, left, right);
        ((void) 0);
        return;
      }
    }
  }


  general_refine(left_w_id, right_w_id, left, right);
  ((void) 0);
}

template <typename T>
template <typename U>
void
BD_Shape<T>
::export_interval_constraints(U& dest) const {
  const dimension_type space_dim = space_dimension();
  if (space_dim > dest.space_dimension())
    throw std::invalid_argument(
               "BD_Shape<T>::export_interval_constraints");


  shortest_path_closure_assign();

  if (marked_empty()) {
    dest.set_empty();
    ((void) 0);
    return;
  }

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_tmp; N& tmp = holder_tmp.item();
  const DB_Row<N>& dbm_0 = dbm[0];
  for (dimension_type i = space_dim; i-- > 0; ) {

    const N& u = dbm_0[i+1];
    if (!is_plus_infinity(u))
      if (!dest.restrict_upper(i, u.raw_value()))
        return;


    const N& negated_l = dbm[i+1][0];
    if (!is_plus_infinity(negated_l)) {
      neg_assign_r(tmp, negated_l, ROUND_DOWN);
      if (!dest.restrict_lower(i, tmp.raw_value()))
        return;
    }
  }

  ((void) 0);
}

template <typename T>
template <typename Interval_Info>
void
BD_Shape<T>::left_inhomogeneous_refine(const dimension_type& right_t,
                                       const dimension_type& right_w_id,
                    const Linear_Form< Interval<T, Interval_Info> >& left,
                    const Linear_Form< Interval<T, Interval_Info> >& right) {

  typedef Interval<T, Interval_Info> FP_Interval_Type;

  if (right_t == 1) {


      const FP_Interval_Type& right_w_coeff =
                              right.coefficient(Variable(right_w_id));
      if (right_w_coeff == 1) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_plus_minus_a_minus; N& b_plus_minus_a_minus = holder_b_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_b = right.inhomogeneous_term();
        sub_assign_r(b_plus_minus_a_minus, right_b.upper(), left_a.lower(),
                     ROUND_UP);
        add_dbm_constraint(right_w_id+1, 0, b_plus_minus_a_minus);
        return;
      }

      if (right_w_coeff == -1) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_b_plus_minus_a_minus; N& b_plus_minus_a_minus = holder_b_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_b = right.inhomogeneous_term();
        sub_assign_r(b_plus_minus_a_minus, right_b.upper(), left_a.lower(),
                     ROUND_UP);
        add_dbm_constraint(0, right_w_id+1, b_plus_minus_a_minus);
        return;
      }
    }
}


template <typename T>
template <typename Interval_Info>
void
BD_Shape<T>
::left_one_var_refine(const dimension_type& left_w_id,
                      const dimension_type& right_t,
                      const dimension_type& right_w_id,
                const Linear_Form< Interval<T, Interval_Info> >& left,
                const Linear_Form< Interval<T, Interval_Info> >& right) {

  typedef Interval<T, Interval_Info> FP_Interval_Type;

    if (right_t == 0) {


      const FP_Interval_Type& left_w_coeff =
        left.coefficient(Variable(left_w_id));

      if (left_w_coeff == 1) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
        const FP_Interval_Type& left_b = left.inhomogeneous_term();
        const FP_Interval_Type& right_a = right.inhomogeneous_term();
        sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                     ROUND_UP);
        add_dbm_constraint(0, left_w_id+1, a_plus_minus_b_minus);
        return;
      }

      if (left_w_coeff == -1) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
        const FP_Interval_Type& left_b = left.inhomogeneous_term();
        const FP_Interval_Type& right_a = right.inhomogeneous_term();
        sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                     ROUND_UP);
        add_dbm_constraint(left_w_id+1, 0, a_plus_minus_b_minus);
        return;
      }
    }
    else if (right_t == 1) {




      const FP_Interval_Type& left_w_coeff =
                              left.coefficient(Variable(left_w_id));

      const FP_Interval_Type& right_w_coeff =
                              right.coefficient(Variable(right_w_id));

      bool is_left_coeff_one = (left_w_coeff == 1);
      bool is_left_coeff_minus_one = (left_w_coeff == -1);
      bool is_right_coeff_one = (right_w_coeff == 1);
      bool is_right_coeff_minus_one = (right_w_coeff == -1);
      if (left_w_id == right_w_id) {
        if ((is_left_coeff_one && is_right_coeff_one)
            ||
            (is_left_coeff_minus_one && is_right_coeff_minus_one)) {

          return;
        }
        if (is_left_coeff_one && is_right_coeff_minus_one) {

          Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
          const FP_Interval_Type& left_b = left.inhomogeneous_term();
          const FP_Interval_Type& right_a = right.inhomogeneous_term();
          sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                       ROUND_UP);
          div_2exp_assign_r(a_plus_minus_b_minus, a_plus_minus_b_minus, 1,
                            ROUND_UP);
          add_dbm_constraint(0, left_w_id + 1, a_plus_minus_b_minus);
          return;
        }
        if (is_left_coeff_minus_one && is_right_coeff_one) {

          Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
          const FP_Interval_Type& left_b = left.inhomogeneous_term();
          const FP_Interval_Type& right_a = right.inhomogeneous_term();
          sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                       ROUND_UP);
          div_2exp_assign_r(a_plus_minus_b_minus, a_plus_minus_b_minus, 1,
                            ROUND_UP);
          add_dbm_constraint(right_w_id + 1, 0, a_plus_minus_b_minus);
          return;
        }
      }
      else if (is_left_coeff_minus_one && is_right_coeff_one) {




        Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
        const FP_Interval_Type& left_b = left.inhomogeneous_term();
        const FP_Interval_Type& right_a = right.inhomogeneous_term();
        sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                       ROUND_UP);
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_ub; N& ub = holder_ub.item();
        ub = dbm[0][right_w_id + 1];
        if (!is_plus_infinity(ub)) {
          add_assign_r(ub, ub, a_plus_minus_b_minus, ROUND_UP);
          add_dbm_constraint(left_w_id + 1, 0, ub);
        }
        ub = dbm[0][left_w_id + 1];
        if (!is_plus_infinity(ub)) {
          add_assign_r(ub, ub, a_plus_minus_b_minus, ROUND_UP);
          add_dbm_constraint(right_w_id + 1, 0, ub);
        }
        return;
      }
      if (is_left_coeff_one && is_right_coeff_minus_one) {




        Parma_Polyhedra_Library::Dirty_Temp<N> holder_a_plus_minus_b_minus; N& a_plus_minus_b_minus = holder_a_plus_minus_b_minus.item();
        const FP_Interval_Type& left_b = left.inhomogeneous_term();
        const FP_Interval_Type& right_a = right.inhomogeneous_term();
        sub_assign_r(a_plus_minus_b_minus, right_a.upper(), left_b.lower(),
                       ROUND_UP);
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_ub; N& ub = holder_ub.item();
        ub = dbm[right_w_id + 1][0];
        if (!is_plus_infinity(ub)) {
          add_assign_r(ub, ub, a_plus_minus_b_minus, ROUND_UP);
          add_dbm_constraint(0, left_w_id + 1, ub);
        }
        ub = dbm[left_w_id + 1][0];
        if (!is_plus_infinity(ub)) {
          add_assign_r(ub, ub, a_plus_minus_b_minus, ROUND_UP);
          add_dbm_constraint(0, right_w_id + 1, ub);
        }
            return;
      }
      if (is_left_coeff_one && is_right_coeff_one) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_c_plus_minus_a_minus; N& c_plus_minus_a_minus = holder_c_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_c = right.inhomogeneous_term();
        sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(),
                     ROUND_UP);
        add_dbm_constraint(right_w_id+1, left_w_id+1, c_plus_minus_a_minus);
        return;
      }
      if (is_left_coeff_minus_one && is_right_coeff_minus_one) {
        Parma_Polyhedra_Library::Dirty_Temp<N> holder_c_plus_minus_a_minus; N& c_plus_minus_a_minus = holder_c_plus_minus_a_minus.item();
        const FP_Interval_Type& left_a = left.inhomogeneous_term();
        const FP_Interval_Type& right_c = right.inhomogeneous_term();
        sub_assign_r(c_plus_minus_a_minus, right_c.upper(), left_a.lower(),
                     ROUND_UP);
        add_dbm_constraint(left_w_id+1, right_w_id+1, c_plus_minus_a_minus);
        return;
      }
    }
}

template <typename T>
template <typename Interval_Info>
void
BD_Shape<T>
::general_refine(const dimension_type& left_w_id,
                 const dimension_type& right_w_id,
                 const Linear_Form< Interval<T, Interval_Info> >& left,
                 const Linear_Form< Interval<T, Interval_Info> >& right) {

  typedef Interval<T, Interval_Info> FP_Interval_Type;
  Linear_Form<FP_Interval_Type> right_minus_left(right);
  right_minus_left -= left;


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_low_coeff; N& low_coeff = holder_low_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_high_coeff; N& high_coeff = holder_high_coeff.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_upper_bound; N& upper_bound = holder_upper_bound.item();

  dimension_type max_w_id = std::max(left_w_id, right_w_id);

  for (dimension_type first_v = 0; first_v < max_w_id; ++first_v) {
    for (dimension_type second_v = first_v+1;
         second_v <= max_w_id; ++second_v) {
      const FP_Interval_Type& lfv_coefficient =
        left.coefficient(Variable(first_v));
      const FP_Interval_Type& lsv_coefficient =
        left.coefficient(Variable(second_v));
      const FP_Interval_Type& rfv_coefficient =
        right.coefficient(Variable(first_v));
      const FP_Interval_Type& rsv_coefficient =
        right.coefficient(Variable(second_v));


      bool do_update = false;
      assign_r(low_coeff, lfv_coefficient.lower(), ROUND_NOT_NEEDED);
      assign_r(high_coeff, lfv_coefficient.upper(), ROUND_NOT_NEEDED);
      if (low_coeff != 0 || high_coeff != 0) {
        assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED);
        assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED);
        if (low_coeff != 0 || high_coeff != 0)
          do_update = true;
        else {
          assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED);
          assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED);
          if (low_coeff != 0 || high_coeff != 0)
            do_update = true;
        }
      }
      else {
        assign_r(low_coeff, rfv_coefficient.lower(), ROUND_NOT_NEEDED);
        assign_r(high_coeff, rfv_coefficient.upper(), ROUND_NOT_NEEDED);
        if (low_coeff != 0 || high_coeff != 0) {
          assign_r(low_coeff, lsv_coefficient.lower(), ROUND_NOT_NEEDED);
          assign_r(high_coeff, lsv_coefficient.upper(), ROUND_NOT_NEEDED);
          if (low_coeff != 0 || high_coeff != 0)
            do_update = true;
          else {
            assign_r(low_coeff, rsv_coefficient.lower(), ROUND_NOT_NEEDED);
            assign_r(high_coeff, rsv_coefficient.upper(), ROUND_NOT_NEEDED);
            if (low_coeff != 0 || high_coeff != 0)
              do_update = true;
          }
        }
      }

      if (do_update) {
        Variable first(first_v);
        Variable second(second_v);
        dimension_type n_first_var = first_v +1 ;
        dimension_type n_second_var = second_v + 1;
        linear_form_upper_bound(right_minus_left - first + second,
                                upper_bound);
        add_dbm_constraint(n_first_var, n_second_var, upper_bound);
        linear_form_upper_bound(right_minus_left + first - second,
                                upper_bound);
        add_dbm_constraint(n_second_var, n_first_var, upper_bound);
      }
    }
  }


  for (dimension_type v = 0; v < max_w_id; ++v) {
    const FP_Interval_Type& lv_coefficient =
      left.coefficient(Variable(v));
    const FP_Interval_Type& rv_coefficient =
      right.coefficient(Variable(v));


    bool do_update = false;
    assign_r(low_coeff, lv_coefficient.lower(), ROUND_NOT_NEEDED);
    assign_r(high_coeff, lv_coefficient.upper(), ROUND_NOT_NEEDED);
    if (low_coeff != 0 || high_coeff != 0)
      do_update = true;
    else {
      assign_r(low_coeff, rv_coefficient.lower(), ROUND_NOT_NEEDED);
      assign_r(high_coeff, rv_coefficient.upper(), ROUND_NOT_NEEDED);
      if (low_coeff != 0 || high_coeff != 0)
        do_update = true;
    }

    if (do_update) {
      Variable var(v);
      dimension_type n_var = v + 1;
      linear_form_upper_bound(right_minus_left + var, upper_bound);
      add_dbm_constraint(0, n_var, upper_bound);
      linear_form_upper_bound(right_minus_left - var, upper_bound);
      add_dbm_constraint(n_var, 0, upper_bound);
    }
  }

}

template <typename T>
template <typename Interval_Info>
void
BD_Shape<T>::
linear_form_upper_bound(const Linear_Form< Interval<T, Interval_Info> >& lf,
                        N& result) const {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_4842 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<T>::is_exact)>) };



  const dimension_type lf_space_dimension = lf.space_dimension();
  ((void) 0);

  typedef Interval<T, Interval_Info> FP_Interval_Type;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_lb; N& curr_lb = holder_curr_lb.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_ub; N& curr_ub = holder_curr_ub.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_var_ub; N& curr_var_ub = holder_curr_var_ub.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_curr_minus_var_ub; N& curr_minus_var_ub = holder_curr_minus_var_ub.item();

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_first_comparison_term; N& first_comparison_term = holder_first_comparison_term.item();
  Parma_Polyhedra_Library::Dirty_Temp<N> holder_second_comparison_term; N& second_comparison_term = holder_second_comparison_term.item();

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_negator; N& negator = holder_negator.item();

  assign_r(result, lf.inhomogeneous_term().upper(), ROUND_NOT_NEEDED);

  for (dimension_type curr_var = 0, n_var = 0; curr_var < lf_space_dimension;
       ++curr_var) {
    n_var = curr_var + 1;
    const FP_Interval_Type&
      curr_coefficient = lf.coefficient(Variable(curr_var));
    assign_r(curr_lb, curr_coefficient.lower(), ROUND_NOT_NEEDED);
    assign_r(curr_ub, curr_coefficient.upper(), ROUND_NOT_NEEDED);
    if (curr_lb != 0 || curr_ub != 0) {
      assign_r(curr_var_ub, dbm[0][n_var], ROUND_NOT_NEEDED);
      neg_assign_r(curr_minus_var_ub, dbm[n_var][0], ROUND_NOT_NEEDED);

      if (curr_lb == 1 && curr_ub == 1) {
        add_assign_r(result, result, std::max(curr_var_ub, curr_minus_var_ub),
                     ROUND_UP);
      }
      else if (curr_lb == -1 && curr_ub == -1) {
        neg_assign_r(negator, std::min(curr_var_ub, curr_minus_var_ub),
                     ROUND_NOT_NEEDED);
        add_assign_r(result, result, negator, ROUND_UP);
      }
      else {

        assign_r(first_comparison_term, 0, ROUND_NOT_NEEDED);
        assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
        add_mul_assign_r(first_comparison_term, curr_var_ub, curr_ub,
                         ROUND_UP);
        add_mul_assign_r(second_comparison_term, curr_var_ub, curr_lb,
                         ROUND_UP);
        assign_r(first_comparison_term, std::max(first_comparison_term,
                                                 second_comparison_term),
                 ROUND_NOT_NEEDED);
        assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
        add_mul_assign_r(second_comparison_term, curr_minus_var_ub, curr_ub,
                         ROUND_UP);
        assign_r(first_comparison_term, std::max(first_comparison_term,
                                                 second_comparison_term),
                 ROUND_NOT_NEEDED);
        assign_r(second_comparison_term, 0, ROUND_NOT_NEEDED);
        add_mul_assign_r(second_comparison_term, curr_minus_var_ub, curr_lb,
                         ROUND_UP);
        assign_r(first_comparison_term, std::max(first_comparison_term,
                                                 second_comparison_term),
                 ROUND_NOT_NEEDED);

        add_assign_r(result, result, first_comparison_term, ROUND_UP);
      }
    }
  }
}

template <typename T>
void
BD_Shape<T>::affine_preimage(const Variable var,
                             const Linear_Expression& expr,
                             Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("affine_preimage(v, e, d)", "d == 0");




  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr);



  const dimension_type v = var.id() + 1;
  if (v > space_dim)
    throw_dimension_incompatible("affine_preimage(v, e, d)", var.id());


  shortest_path_closure_assign();
  if (marked_empty())
    return;

  const Coefficient& b = expr.inhomogeneous_term();


  dimension_type t = 0;

  dimension_type j = expr.last_nonzero();

  if (j != 0) {
    ++t;
    if (!expr.all_zeroes(1, j))
      ++t;
  }
# 4959 "BD_Shape_templates.hh"
  if (t == 0) {

    forget_all_dbm_constraints(v);

    if (marked_shortest_path_reduced())
      reset_shortest_path_reduced();
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& a = expr.get(Variable(j - 1));
    if (a == denominator || a == -denominator) {

      if (j == var.space_dimension())

        affine_image(var, denominator*var - b, a);
      else {


        forget_all_dbm_constraints(v);

        if (marked_shortest_path_reduced())
          reset_shortest_path_reduced();
        ((void) 0);
      }
      return;
    }
  }





  const Coefficient& expr_v = expr.coefficient(var);
  if (expr_v != 0) {

    Linear_Expression inverse((expr_v + denominator)*var);
    inverse -= expr;
    affine_image(var, inverse, expr_v);
  }
  else {

    forget_all_dbm_constraints(v);

    if (marked_shortest_path_reduced())
      reset_shortest_path_reduced();
  }
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>
::bounded_affine_image(const Variable var,
                       const Linear_Expression& lb_expr,
                       const Linear_Expression& ub_expr,
                       Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0");



  const dimension_type bds_space_dim = space_dimension();
  const dimension_type v = var.id() + 1;
  if (v > bds_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "v", var);


  const dimension_type lb_space_dim = lb_expr.space_dimension();
  if (bds_space_dim < lb_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "lb", lb_expr);
  const dimension_type ub_space_dim = ub_expr.space_dimension();
  if (bds_space_dim < ub_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "ub", ub_expr);


  shortest_path_closure_assign();
  if (marked_empty())
    return;

  const Coefficient& b = ub_expr.inhomogeneous_term();


  dimension_type t = 0;

  dimension_type w = ub_expr.last_nonzero();

  if (w != 0) {
    ++t;
    if (!ub_expr.all_zeroes(1, w))
      ++t;
  }
# 5065 "BD_Shape_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign(minus_denom, denominator);

  if (t == 0) {

    generalized_affine_image(var,
                             GREATER_OR_EQUAL,
                             lb_expr,
                             denominator);

    add_dbm_constraint(0, v, b, denominator);
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& a = ub_expr.get(Variable(w - 1));
    if (a == denominator || a == minus_denom) {

      if (w == v) {


        const Variable new_var(bds_space_dim);
        add_space_dimensions_and_embed(1);

        affine_image(new_var, ub_expr, denominator);

        shortest_path_closure_assign();
        ((void) 0);

        generalized_affine_image(var,
                                 GREATER_OR_EQUAL,
                                 lb_expr,
                                 denominator);

        add_constraint(var <= new_var);

        remove_higher_space_dimensions(bds_space_dim);
        return;
      }
      else {



        generalized_affine_image(var,
                                 GREATER_OR_EQUAL,
                                 lb_expr,
                                 denominator);
        if (a == denominator) {

          add_dbm_constraint(w, v, b, denominator);
        }
        else {



          const N& dbm_w0 = dbm[w][0];
          if (!is_plus_infinity(dbm_w0)) {

            Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
            div_round_up(d, b, denominator);
            add_assign_r(dbm[0][v], d, dbm_w0, ROUND_UP);
            reset_shortest_path_closed();
          }
        }
        ((void) 0);
        return;
      }
    }
  }
# 5146 "BD_Shape_templates.hh"
  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign(minus_b, b);
  const Coefficient& sc_b = is_sc ? b : minus_b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -ub_expr;
  const Linear_Expression& sc_expr = is_sc ? ub_expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_pos_sum; N& pos_sum = holder_pos_sum.item();

  dimension_type pos_pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type pos_pinf_count = 0;


  assign_r(pos_sum, sc_b, ROUND_UP);


  const DB_Row<N>& dbm_0 = dbm[0];

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();


  for (Linear_Expression::const_iterator i = sc_expr.begin(),
        i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
    const Coefficient& sc_i = *i;
    const dimension_type i_dim = i.variable().space_dimension();
    const int sign_i = sgn(sc_i);
    if (sign_i > 0) {
      assign_r(coeff_i, sc_i, ROUND_UP);

      if (pos_pinf_count <= 1) {
        const N& up_approx_i = dbm_0[i_dim];
        if (!is_plus_infinity(up_approx_i))
          add_mul_assign_r(pos_sum, coeff_i, up_approx_i, ROUND_UP);
        else {
          ++pos_pinf_count;
          pos_pinf_index = i_dim;
        }
      }
    }
    else {
      ((void) 0);
      neg_assign(minus_sc_i, sc_i);

      assign_r(coeff_i, minus_sc_i, ROUND_UP);

      if (pos_pinf_count <= 1) {
        const N& up_approx_minus_i = dbm[i_dim][0];
        if (!is_plus_infinity(up_approx_minus_i))
          add_mul_assign_r(pos_sum, coeff_i, up_approx_minus_i, ROUND_UP);
        else {
          ++pos_pinf_count;
          pos_pinf_index = i_dim;
        }
      }
    }
  }

  generalized_affine_image(var,
                           GREATER_OR_EQUAL,
                           lb_expr,
                           denominator);

  if (pos_pinf_count > 1) {
    return;
  }


  reset_shortest_path_closed();


  if (pos_pinf_count <= 1) {

    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(pos_sum, pos_sum, down_sc_denom, ROUND_UP);
    }

    if (pos_pinf_count == 0) {

      dbm[0][v] = pos_sum;

      deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, pos_sum);
    }
    else

      if (pos_pinf_index != v
          && sc_expr.get(Variable(pos_pinf_index - 1)) == sc_denom)

        dbm[pos_pinf_index][v] = pos_sum;
  }
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>
::bounded_affine_preimage(const Variable var,
                          const Linear_Expression& lb_expr,
                          const Linear_Expression& ub_expr,
                          Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0");



  const dimension_type space_dim = space_dimension();
  const dimension_type v = var.id() + 1;
  if (v > space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "v", var);


  const dimension_type lb_space_dim = lb_expr.space_dimension();
  if (space_dim < lb_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "lb", lb_expr);
  const dimension_type ub_space_dim = ub_expr.space_dimension();
  if (space_dim < ub_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "ub", ub_expr);


  shortest_path_closure_assign();
  if (marked_empty())
    return;

  if (ub_expr.coefficient(var) == 0) {
    refine(var, LESS_OR_EQUAL, ub_expr, denominator);
    generalized_affine_preimage(var, GREATER_OR_EQUAL,
                                lb_expr, denominator);
    return;
  }
  if (lb_expr.coefficient(var) == 0) {
    refine(var, GREATER_OR_EQUAL, lb_expr, denominator);
    generalized_affine_preimage(var, LESS_OR_EQUAL,
                                ub_expr, denominator);
    return;
  }

  const Coefficient& lb_expr_v = lb_expr.coefficient(var);


  const Variable new_var(space_dim);
  add_space_dimensions_and_embed(1);
  const Linear_Expression lb_inverse
    = lb_expr - (lb_expr_v + denominator)*var;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_lb_inverse_denom; Parma_Polyhedra_Library::Coefficient& lb_inverse_denom = holder_lb_inverse_denom.item();
  neg_assign(lb_inverse_denom, lb_expr_v);
  affine_image(new_var, lb_inverse, lb_inverse_denom);
  shortest_path_closure_assign();
  ((void) 0);
  generalized_affine_preimage(var, LESS_OR_EQUAL,
                              ub_expr, denominator);
  if (sgn(denominator) == sgn(lb_inverse_denom))
    add_constraint(var >= new_var);
  else
    add_constraint(var <= new_var);

  remove_higher_space_dimensions(space_dim);
}

template <typename T>
void
BD_Shape<T>::generalized_affine_image(const Variable var,
                                      const Relation_Symbol relsym,
                                      const Linear_Expression& expr,
                                      Coefficient_traits::const_reference
                                      denominator) {

  if (denominator == 0)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0");




  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("generalized_affine_image(v, r, e, d)",
                                 "e", expr);


  const dimension_type v = var.id() + 1;
  if (v > space_dim)
    throw_dimension_incompatible("generalized_affine_image(v, r, e, d)",
                                 var.id());


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)",
                           "r is the disequality relation symbol");

  if (relsym == EQUAL) {


    affine_image(var, expr, denominator);
    return;
  }


  shortest_path_closure_assign();
  if (marked_empty())
    return;

  const Coefficient& b = expr.inhomogeneous_term();


  dimension_type t = 0;

  dimension_type w = expr.last_nonzero();

  if (w != 0) {
    ++t;
    if (!expr.all_zeroes(1, w))
      ++t;
  }
# 5390 "BD_Shape_templates.hh"
  DB_Row<N>& dbm_0 = dbm[0];
  DB_Row<N>& dbm_v = dbm[v];
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_denom; Parma_Polyhedra_Library::Coefficient& minus_denom = holder_minus_denom.item();
  neg_assign(minus_denom, denominator);

  if (t == 0) {


    forget_all_dbm_constraints(v);

    reset_shortest_path_closed();
    switch (relsym) {
    case LESS_OR_EQUAL:

      add_dbm_constraint(0, v, b, denominator);
      break;
    case GREATER_OR_EQUAL:


      add_dbm_constraint(v, 0, b, minus_denom);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
    ((void) 0);
    return;
  }

  if (t == 1) {

    const Coefficient& a = expr.get(Variable(w - 1));
    if (a == denominator || a == minus_denom) {

      Parma_Polyhedra_Library::Dirty_Temp<N> holder_d; N& d = holder_d.item();
      switch (relsym) {
      case LESS_OR_EQUAL:
        div_round_up(d, b, denominator);
        if (w == v) {


          reset_shortest_path_closed();
          if (a == denominator) {



            for (dimension_type i = space_dim + 1; i-- > 0; ) {
              N& dbm_iv = dbm[i][v];
              add_assign_r(dbm_iv, dbm_iv, d, ROUND_UP);
              assign_r(dbm_v[i], PLUS_INFINITY, ROUND_NOT_NEEDED);
            }
          }
          else {



            N& dbm_v0 = dbm_v[0];
            add_assign_r(dbm_0[v], dbm_v0, d, ROUND_UP);

            assign_r(dbm_v0, PLUS_INFINITY, ROUND_NOT_NEEDED);
            forget_binary_dbm_constraints(v);
          }
        }
        else {



          forget_all_dbm_constraints(v);

          if (marked_shortest_path_reduced())
            reset_shortest_path_reduced();
          if (a == denominator)

            add_dbm_constraint(w, v, d);
          else {



            const N& dbm_w0 = dbm[w][0];
            if (!is_plus_infinity(dbm_w0)) {

              add_assign_r(dbm_0[v], d, dbm_w0, ROUND_UP);

              reset_shortest_path_closed();
            }
          }
        }
        break;

      case GREATER_OR_EQUAL:
        div_round_up(d, b, minus_denom);
        if (w == v) {


          reset_shortest_path_closed();
          if (a == denominator) {



            for (dimension_type i = space_dim + 1; i-- > 0; ) {
              N& dbm_vi = dbm_v[i];
              add_assign_r(dbm_vi, dbm_vi, d, ROUND_UP);
              assign_r(dbm[i][v], PLUS_INFINITY, ROUND_NOT_NEEDED);
            }
          }
          else {



            N& dbm_0v = dbm_0[v];
            add_assign_r(dbm_v[0], dbm_0v, d, ROUND_UP);

            assign_r(dbm_0v, PLUS_INFINITY, ROUND_NOT_NEEDED);
            forget_binary_dbm_constraints(v);
          }
        }
        else {



          forget_all_dbm_constraints(v);

          if (marked_shortest_path_reduced())
            reset_shortest_path_reduced();
          if (a == denominator)


            add_dbm_constraint(v, w, d);
          else {




            const N& dbm_0w = dbm_0[w];
            if (!is_plus_infinity(dbm_0w)) {

              add_assign_r(dbm_v[0], dbm_0w, d, ROUND_UP);

              reset_shortest_path_closed();
            }
          }
        }
        break;

      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }
      ((void) 0);
      return;
    }
  }
# 5552 "BD_Shape_templates.hh"
  const bool is_sc = (denominator > 0);
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_b; Parma_Polyhedra_Library::Coefficient& minus_b = holder_minus_b.item();
  neg_assign(minus_b, b);
  const Coefficient& sc_b = is_sc ? b : minus_b;
  const Coefficient& minus_sc_b = is_sc ? minus_b : b;
  const Coefficient& sc_denom = is_sc ? denominator : minus_denom;
  const Coefficient& minus_sc_denom = is_sc ? minus_denom : denominator;



  Linear_Expression minus_expr;
  if (!is_sc)
    minus_expr = -expr;
  const Linear_Expression& sc_expr = is_sc ? expr : minus_expr;

  Parma_Polyhedra_Library::Dirty_Temp<N> holder_sum; N& sum = holder_sum.item();

  dimension_type pinf_index = Suppress_Uninitialized_Warnings_Type<dimension_type>::synonym ();

  dimension_type pinf_count = 0;


  Parma_Polyhedra_Library::Dirty_Temp<N> holder_coeff_i; N& coeff_i = holder_coeff_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_minus_sc_i; Parma_Polyhedra_Library::Coefficient& minus_sc_i = holder_minus_sc_i.item();

  switch (relsym) {
  case LESS_OR_EQUAL:



    assign_r(sum, sc_b, ROUND_UP);



    ((void) 0);
    for (Linear_Expression::const_iterator i = sc_expr.begin(),
        i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
      const Coefficient& sc_i = *i;
      const dimension_type i_dim = i.variable().space_dimension();
      const int sign_i = sgn(sc_i);
      ((void) 0);

      const N& approx_i = (sign_i > 0) ? dbm_0[i_dim] : dbm[i_dim][0];
      if (is_plus_infinity(approx_i)) {
        if (++pinf_count > 1)
          break;
        pinf_index = i_dim;
        continue;
      }
      if (sign_i > 0)
        assign_r(coeff_i, sc_i, ROUND_UP);
      else {
        neg_assign(minus_sc_i, sc_i);
        assign_r(coeff_i, minus_sc_i, ROUND_UP);
      }
      add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
    }


    forget_all_dbm_constraints(v);

    if (marked_shortest_path_reduced())
      reset_shortest_path_reduced();

    if (pinf_count > 1) {
      ((void) 0);
      return;
    }


    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
    }

    if (pinf_count == 0) {

      add_dbm_constraint(0, v, sum);

      deduce_v_minus_u_bounds(v, w, sc_expr, sc_denom, sum);
    }
    else if (pinf_count == 1)
      if (pinf_index != v && expr.get(Variable(pinf_index - 1)) == denominator)

        add_dbm_constraint(pinf_index, v, sum);
    break;

  case GREATER_OR_EQUAL:





    assign_r(sum, minus_sc_b, ROUND_UP);

    for (Linear_Expression::const_iterator i = sc_expr.begin(),
        i_end = sc_expr.lower_bound(Variable(w)); i != i_end; ++i) {
      const Coefficient& sc_i = *i;
      const int sign_i = sgn(sc_i);
      ((void) 0);
      const dimension_type i_dim = i.variable().space_dimension();

      const N& approx_i = (sign_i > 0) ? dbm[i_dim][0] : dbm_0[i_dim];
      if (is_plus_infinity(approx_i)) {
        if (++pinf_count > 1)
          break;
        pinf_index = i_dim;
        continue;
      }
      if (sign_i > 0)
        assign_r(coeff_i, sc_i, ROUND_UP);
      else {
        neg_assign(minus_sc_i, sc_i);
        assign_r(coeff_i, minus_sc_i, ROUND_UP);
      }
      add_mul_assign_r(sum, coeff_i, approx_i, ROUND_UP);
    }


    forget_all_dbm_constraints(v);

    if (marked_shortest_path_reduced())
      reset_shortest_path_reduced();

    if (pinf_count > 1) {
      ((void) 0);
      return;
    }


    if (sc_denom != 1) {




      Parma_Polyhedra_Library::Dirty_Temp<N> holder_down_sc_denom; N& down_sc_denom = holder_down_sc_denom.item();
      assign_r(down_sc_denom, minus_sc_denom, ROUND_UP);
      neg_assign_r(down_sc_denom, down_sc_denom, ROUND_UP);
      div_assign_r(sum, sum, down_sc_denom, ROUND_UP);
    }

    if (pinf_count == 0) {

      add_dbm_constraint(v, 0, sum);

      deduce_u_minus_v_bounds(v, w, sc_expr, sc_denom, sum);
    }
    else if (pinf_count == 1)
      if (pinf_index != v && expr.get(Variable(pinf_index - 1)) == denominator)


        add_dbm_constraint(v, pinf_index, sum);
    break;

  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::generalized_affine_image(const Linear_Expression& lhs,
                                      const Relation_Symbol relsym,
                                      const Linear_Expression& rhs) {



  const dimension_type space_dim = space_dimension();
  const dimension_type lhs_space_dim = lhs.space_dimension();
  if (space_dim < lhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e1", lhs);



  const dimension_type rhs_space_dim = rhs.space_dimension();
  if (space_dim < rhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e2", rhs);


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_image(e1, r, e2)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(e1, r, e2)",
                           "r is the disequality relation symbol");


  shortest_path_closure_assign();
  if (marked_empty())
    return;



  dimension_type t_lhs = 0;

  dimension_type j_lhs = lhs.last_nonzero();

  if (j_lhs != 0) {
    ++t_lhs;
    if (!lhs.all_zeroes(1, j_lhs))
      ++t_lhs;
    --j_lhs;
  }

  const Coefficient& b_lhs = lhs.inhomogeneous_term();

  if (t_lhs == 0) {







    switch (relsym) {
    case LESS_OR_EQUAL:
      refine_no_check(lhs <= rhs);
      break;
    case EQUAL:
      refine_no_check(lhs == rhs);
      break;
    case GREATER_OR_EQUAL:
      refine_no_check(lhs >= rhs);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
  }
  else if (t_lhs == 1) {



    Variable v(j_lhs);

    const Coefficient& denom = lhs.coefficient(v);
    Relation_Symbol new_relsym = relsym;
    if (denom < 0) {
      if (relsym == LESS_OR_EQUAL)
        new_relsym = GREATER_OR_EQUAL;
      else if (relsym == GREATER_OR_EQUAL)
        new_relsym = LESS_OR_EQUAL;
    }
    Linear_Expression expr = rhs - b_lhs;
    generalized_affine_image(v, new_relsym, expr, denom);
  }
  else {


    std::vector<Variable> lhs_vars;
    for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end();
          i != i_end; ++i)
      lhs_vars.push_back(i.variable());

    const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim);
    if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) {


      for (dimension_type i = lhs_vars.size(); i-- > 0; )
        forget_all_dbm_constraints(lhs_vars[i].id() + 1);




      switch (relsym) {
      case LESS_OR_EQUAL:
        refine_no_check(lhs <= rhs);
        break;
      case EQUAL:
        refine_no_check(lhs == rhs);
        break;
      case GREATER_OR_EQUAL:
        refine_no_check(lhs >= rhs);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }
    }
    else {




      for (dimension_type i = lhs_vars.size(); i-- > 0; )
        forget_all_dbm_constraints(lhs_vars[i].id() + 1);
# 5896 "BD_Shape_templates.hh"
    }
  }

  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::generalized_affine_preimage(const Variable var,
                                         const Relation_Symbol relsym,
                                         const Linear_Expression& expr,
                                         Coefficient_traits::const_reference
                                         denominator) {

  if (denominator == 0)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "d == 0");




  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)",
                                 "e", expr);


  const dimension_type v = var.id() + 1;
  if (v > space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)",
                                 var.id());


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "r is the disequality relation symbol");

  if (relsym == EQUAL) {


    affine_preimage(var, expr, denominator);
    return;
  }


  shortest_path_closure_assign();
  if (marked_empty())
    return;



  const Coefficient& expr_v = expr.coefficient(var);
  if (expr_v != 0) {
    const Relation_Symbol reversed_relsym = (relsym == LESS_OR_EQUAL)
      ? GREATER_OR_EQUAL : LESS_OR_EQUAL;
    const Linear_Expression inverse
      = expr - (expr_v + denominator)*var;
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_inverse_denom; Parma_Polyhedra_Library::Coefficient& inverse_denom = holder_inverse_denom.item();
    neg_assign(inverse_denom, expr_v);
    const Relation_Symbol inverse_relsym
      = (sgn(denominator) == sgn(inverse_denom)) ? relsym : reversed_relsym;
    generalized_affine_image(var, inverse_relsym, inverse, inverse_denom);
    return;
  }

  refine(var, relsym, expr, denominator);

  if (is_empty())
    return;


  forget_all_dbm_constraints(v);

  if (marked_shortest_path_reduced())
    reset_shortest_path_reduced();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::generalized_affine_preimage(const Linear_Expression& lhs,
                                         const Relation_Symbol relsym,
                                         const Linear_Expression& rhs) {



  const dimension_type bds_space_dim = space_dimension();
  const dimension_type lhs_space_dim = lhs.space_dimension();
  if (bds_space_dim < lhs_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)",
                                 "e1", lhs);



  const dimension_type rhs_space_dim = rhs.space_dimension();
  if (bds_space_dim < rhs_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(e1, r, e2)",
                                 "e2", rhs);


  if (relsym == LESS_THAN || relsym == GREATER_THAN)
    throw_invalid_argument("generalized_affine_preimage(e1, r, e2)",
                           "r is a strict relation symbol");

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_preimage(e1, r, e2)",
                           "r is the disequality relation symbol");


  shortest_path_closure_assign();
  if (marked_empty())
    return;



  dimension_type t_lhs = 0;

  dimension_type j_lhs = lhs.last_nonzero();

  if (j_lhs != 0) {
    ++t_lhs;
    if (!lhs.all_zeroes(1, j_lhs))
      ++t_lhs;
    --j_lhs;
  }

  const Coefficient& b_lhs = lhs.inhomogeneous_term();

  if (t_lhs == 0) {


    generalized_affine_image(lhs, relsym, rhs);
    return;
  }
  else if (t_lhs == 1) {



    Variable v(j_lhs);

    const Coefficient& denom = lhs.coefficient(v);
    Relation_Symbol new_relsym = relsym;
    if (denom < 0) {
      if (relsym == LESS_OR_EQUAL)
        new_relsym = GREATER_OR_EQUAL;
      else if (relsym == GREATER_OR_EQUAL)
        new_relsym = LESS_OR_EQUAL;
    }
    Linear_Expression expr = rhs - b_lhs;
    generalized_affine_preimage(v, new_relsym, expr, denom);
  }
  else {


    std::vector<Variable> lhs_vars;
    for (Linear_Expression::const_iterator i = lhs.begin(), i_end = lhs.end();
          i != i_end; ++i)
      lhs_vars.push_back(i.variable());

    const dimension_type num_common_dims = std::min(lhs_space_dim, rhs_space_dim);
    if (!lhs.have_a_common_variable(rhs, Variable(0), Variable(num_common_dims))) {






      switch (relsym) {
      case LESS_OR_EQUAL:
        refine_no_check(lhs <= rhs);
        break;
      case EQUAL:
        refine_no_check(lhs == rhs);
        break;
      case GREATER_OR_EQUAL:
        refine_no_check(lhs >= rhs);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }


      if (is_empty())
        return;

      for (dimension_type i = lhs_vars.size(); i-- > 0; )
        forget_all_dbm_constraints(lhs_vars[i].id() + 1);
    }
    else {



      const Variable new_var(bds_space_dim);
      add_space_dimensions_and_embed(1);




      affine_image(new_var, lhs);


      shortest_path_closure_assign();
      ((void) 0);
      for (dimension_type i = lhs_vars.size(); i-- > 0; )
        forget_all_dbm_constraints(lhs_vars[i].id() + 1);







      switch (relsym) {
      case LESS_OR_EQUAL:
        refine_no_check(new_var <= rhs);
        break;
      case EQUAL:
        refine_no_check(new_var == rhs);
        break;
      case GREATER_OR_EQUAL:
        refine_no_check(new_var >= rhs);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }

      remove_higher_space_dimensions(bds_space_dim);
    }
  }

  ((void) 0);
}

template <typename T>
Constraint_System
BD_Shape<T>::constraints() const {
  const dimension_type space_dim = space_dimension();
  Constraint_System cs;
  cs.set_space_dimension(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cs = Constraint_System::zero_dim_empty();
    return cs;
  }

  if (marked_empty()) {
    cs.insert(Constraint::zero_dim_false());
    return cs;
  }

  if (marked_shortest_path_reduced()) {

    cs = minimized_constraints();
    return cs;
  }

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_a; Parma_Polyhedra_Library::Coefficient& a = holder_a.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_b; Parma_Polyhedra_Library::Coefficient& b = holder_b.item();

  const DB_Row<N>& dbm_0 = dbm[0];
  for (dimension_type j = 1; j <= space_dim; ++j) {
    const Variable x(j-1);
    const N& dbm_0j = dbm_0[j];
    const N& dbm_j0 = dbm[j][0];
    if (is_additive_inverse(dbm_j0, dbm_0j)) {

      numer_denom(dbm_0j, b, a);
      cs.insert(a*x == b);
    }
    else {

      if (!is_plus_infinity(dbm_0j)) {
        numer_denom(dbm_0j, b, a);
        cs.insert(a*x <= b);
      }
      if (!is_plus_infinity(dbm_j0)) {
        numer_denom(dbm_j0, b, a);
        cs.insert(-a*x <= b);
      }
    }
  }


  for (dimension_type i = 1; i <= space_dim; ++i) {
    const Variable y(i-1);
    const DB_Row<N>& dbm_i = dbm[i];
    for (dimension_type j = i + 1; j <= space_dim; ++j) {
      const Variable x(j-1);
      const N& dbm_ij = dbm_i[j];
      const N& dbm_ji = dbm[j][i];
      if (is_additive_inverse(dbm_ji, dbm_ij)) {

        numer_denom(dbm_ij, b, a);
        cs.insert(a*x - a*y == b);
      }
      else {

        if (!is_plus_infinity(dbm_ij)) {
          numer_denom(dbm_ij, b, a);
          cs.insert(a*x - a*y <= b);
        }
        if (!is_plus_infinity(dbm_ji)) {
          numer_denom(dbm_ji, b, a);
          cs.insert(a*y - a*x <= b);
        }
      }
    }
  }
  return cs;
}

template <typename T>
Constraint_System
BD_Shape<T>::minimized_constraints() const {
  shortest_path_reduction_assign();
  const dimension_type space_dim = space_dimension();
  Constraint_System cs;
  cs.set_space_dimension(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cs = Constraint_System::zero_dim_empty();
    return cs;
  }

  if (marked_empty()) {
    cs.insert(Constraint::zero_dim_false());
    return cs;
  }

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();


  std::vector<dimension_type> leaders;
  compute_leaders(leaders);
  std::vector<dimension_type> leader_indices;
  compute_leader_indices(leaders, leader_indices);
  const dimension_type num_leaders = leader_indices.size();


  const DB_Row<N>& dbm_0 = dbm[0];
  for (dimension_type i = 1; i <= space_dim; ++i) {
    const dimension_type leader = leaders[i];
    if (i != leader) {

      if (leader == 0) {

        ((void) 0);
        numer_denom(dbm_0[i], numer, denom);
        cs.insert(denom*Variable(i-1) == numer);
      }
      else {

        ((void) 0);
        numer_denom(dbm[i][leader], numer, denom);
        cs.insert(denom*Variable(leader-1) - denom*Variable(i-1) == numer);
      }
    }
  }



  const Bit_Row& red_0 = redundancy_dbm[0];
  for (dimension_type l_i = 1; l_i < num_leaders; ++l_i) {
    const dimension_type i = leader_indices[l_i];
    if (!red_0[i]) {
      numer_denom(dbm_0[i], numer, denom);
      cs.insert(denom*Variable(i-1) <= numer);
    }
    if (!redundancy_dbm[i][0]) {
      numer_denom(dbm[i][0], numer, denom);
      cs.insert(-denom*Variable(i-1) <= numer);
    }
  }

  for (dimension_type l_i = 1; l_i < num_leaders; ++l_i) {
    const dimension_type i = leader_indices[l_i];
    const DB_Row<N>& dbm_i = dbm[i];
    const Bit_Row& red_i = redundancy_dbm[i];
    for (dimension_type l_j = l_i + 1; l_j < num_leaders; ++l_j) {
      const dimension_type j = leader_indices[l_j];
      if (!red_i[j]) {
        numer_denom(dbm_i[j], numer, denom);
        cs.insert(denom*Variable(j-1) - denom*Variable(i-1) <= numer);
      }
      if (!redundancy_dbm[j][i]) {
        numer_denom(dbm[j][i], numer, denom);
        cs.insert(denom*Variable(i-1) - denom*Variable(j-1) <= numer);
      }
    }
  }
  return cs;
}

template <typename T>
void
BD_Shape<T>::expand_space_dimension(Variable var, dimension_type m) {
  dimension_type old_dim = space_dimension();

  if (var.space_dimension() > old_dim)
    throw_dimension_incompatible("expand_space_dimension(v, m)", "v", var);



  if (m > max_space_dimension() - space_dimension())
    throw_invalid_argument("expand_dimension(v, m)",
                           "adding m new space dimensions exceeds "
                           "the maximum allowed space dimension");


  if (m == 0)
    return;


  add_space_dimensions_and_embed(m);




  const dimension_type v_id = var.id() + 1;
  const DB_Row<N>& dbm_v = dbm[v_id];
  for (dimension_type i = old_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    const N& dbm_i_v = dbm[i][v_id];
    const N& dbm_v_i = dbm_v[i];
    for (dimension_type j = old_dim+1; j < old_dim+m+1; ++j) {
      dbm_i[j] = dbm_i_v;
      dbm[j][i] = dbm_v_i;
    }
  }


  if (marked_shortest_path_closed())
    reset_shortest_path_closed();
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::fold_space_dimensions(const Variables_Set& vars,
                                   Variable dest) {
  const dimension_type space_dim = space_dimension();

  if (dest.space_dimension() > space_dim)
    throw_dimension_incompatible("fold_space_dimensions(vs, v)",
                                 "v", dest);


  if (vars.empty())
    return;


  if (vars.space_dimension() > space_dim)
    throw_dimension_incompatible("fold_space_dimensions(vs, v)",
                                 vars.space_dimension());


  if (vars.find(dest.id()) != vars.end())
    throw_invalid_argument("fold_space_dimensions(vs, v)",
                           "v should not occur in vs");

  shortest_path_closure_assign();
  if (!marked_empty()) {




    const dimension_type v_id = dest.id() + 1;
    DB_Row<N>& dbm_v = dbm[v_id];
    for (Variables_Set::const_iterator i = vars.begin(),
           vs_end = vars.end(); i != vs_end; ++i) {
      const dimension_type to_be_folded_id = *i + 1;
      const DB_Row<N>& dbm_to_be_folded_id = dbm[to_be_folded_id];
      for (dimension_type j = space_dim + 1; j-- > 0; ) {
        max_assign(dbm[j][v_id], dbm[j][to_be_folded_id]);
        max_assign(dbm_v[j], dbm_to_be_folded_id[j]);
      }
    }
  }
  remove_space_dimensions(vars);
}

template <typename T>
void
BD_Shape<T>::drop_some_non_integer_points(Complexity_Class) {
  if (std::numeric_limits<T>::is_integer)
    return;

  const dimension_type space_dim = space_dimension();
  shortest_path_closure_assign();
  if (space_dim == 0 || marked_empty())
    return;

  for (dimension_type i = space_dim + 1; i-- > 0; ) {
    DB_Row<N>& dbm_i = dbm[i];
    for (dimension_type j = space_dim + 1; j-- > 0; )
      if (i != j)
        drop_some_non_integer_points_helper(dbm_i[j]);
  }
  ((void) 0);
}

template <typename T>
void
BD_Shape<T>::drop_some_non_integer_points(const Variables_Set& vars,
                                          Complexity_Class) {

  const dimension_type space_dim = space_dimension();
  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dim < min_space_dim)
    throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)",
                                 min_space_dim);

  if (std::numeric_limits<T>::is_integer || min_space_dim == 0)
    return;

  shortest_path_closure_assign();
  if (marked_empty())
    return;

  const Variables_Set::const_iterator v_begin = vars.begin();
  const Variables_Set::const_iterator v_end = vars.end();
  ((void) 0);

  DB_Row<N>& dbm_0 = dbm[0];
  for (Variables_Set::const_iterator v_i = v_begin; v_i != v_end; ++v_i) {
    const dimension_type i = *v_i + 1;
    drop_some_non_integer_points_helper(dbm_0[i]);
    drop_some_non_integer_points_helper(dbm[i][0]);
  }


  for (Variables_Set::const_iterator v_i = v_begin; v_i != v_end; ++v_i) {
    const dimension_type i = *v_i + 1;
    DB_Row<N>& dbm_i = dbm[i];
    for (Variables_Set::const_iterator v_j = v_begin; v_j != v_end; ++v_j) {
      const dimension_type j = *v_j + 1;
      if (i != j)
        drop_some_non_integer_points_helper(dbm_i[j]);
    }
  }
  ((void) 0);
}


template <typename T>
std::ostream&
IO_Operators::operator<<(std::ostream& s, const BD_Shape<T>& bds) {
  typedef typename BD_Shape<T>::coefficient_type N;
  if (bds.is_universe())
    s << "true";
  else {

    dimension_type n = bds.space_dimension();
    if (bds.marked_empty())
      s << "false";
    else {
      Parma_Polyhedra_Library::Dirty_Temp<N> holder_v; N& v = holder_v.item();
      bool first = true;
      for (dimension_type i = 0; i <= n; ++i)
        for (dimension_type j = i + 1; j <= n; ++j) {
          const N& c_i_j = bds.dbm[i][j];
          const N& c_j_i = bds.dbm[j][i];
          if (is_additive_inverse(c_j_i, c_i_j)) {

            if (first)
              first = false;
            else
              s << ", ";
            if (i == 0) {

              s << Variable(j - 1);
              s << " = " << c_i_j;
            }
            else {

              if (sgn(c_i_j) >= 0) {
                s << Variable(j - 1);
                s << " - ";
                s << Variable(i - 1);
                s << " = " << c_i_j;
              }
              else {
                s << Variable(i - 1);
                s << " - ";
                s << Variable(j - 1);
                s << " = " << c_j_i;
              }
            }
          }
          else {

            if (!is_plus_infinity(c_j_i)) {
              if (first)
                first = false;
              else
                s << ", ";
              if (i == 0) {

                s << Variable(j - 1);
                neg_assign_r(v, c_j_i, ROUND_DOWN);
                s << " >= " << v;
              }
              else {

                if (sgn(c_j_i) >= 0) {
                  s << Variable(i - 1);
                  s << " - ";
                  s << Variable(j - 1);
                  s << " <= " << c_j_i;
                }
                else {
                  s << Variable(j - 1);
                  s << " - ";
                  s << Variable(i - 1);
                  neg_assign_r(v, c_j_i, ROUND_DOWN);
                  s << " >= " << v;
                }
              }
            }
            if (!is_plus_infinity(c_i_j)) {
              if (first)
                first = false;
              else
                s << ", ";
              if (i == 0) {

                s << Variable(j - 1);
                s << " <= " << c_i_j;
              }
              else {

                if (sgn(c_i_j) >= 0) {
                  s << Variable(j - 1);
                  s << " - ";
                  s << Variable(i - 1);
                  s << " <= " << c_i_j;
                }
                else {
                  s << Variable(i - 1);
                  s << " - ";
                  s << Variable(j - 1);
                  neg_assign_r(v, c_i_j, ROUND_DOWN);
                  s << " >= " << v;
                }
              }
            }
          }
        }
    }
  }
  return s;
}

template <typename T>
void
BD_Shape<T>::ascii_dump(std::ostream& s) const {
  status.ascii_dump(s);
  s << "\n";
  dbm.ascii_dump(s);
  s << "\n";
  redundancy_dbm.ascii_dump(s);
}

template <typename T> void BD_Shape<T>::ascii_dump() const { ascii_dump(std::cerr); } template <typename T> void BD_Shape<T>::print() const { using IO_Operators::operator<<; std::cerr << *this; }

template <typename T>
bool
BD_Shape<T>::ascii_load(std::istream& s) {
  if (!status.ascii_load(s))
    return false;
  if (!dbm.ascii_load(s))
    return false;
  if (!redundancy_dbm.ascii_load(s))
    return false;
  return true;
}

template <typename T>
memory_size_type
BD_Shape<T>::external_memory_in_bytes() const {
  return dbm.external_memory_in_bytes()
    + redundancy_dbm.external_memory_in_bytes();
}

template <typename T>
bool
BD_Shape<T>::OK() const {

  if (!dbm.OK())
    return false;


  if (!status.OK())
    return false;


  if (marked_empty())
    return true;


  for (dimension_type i = dbm.num_rows(); i-- > 0; )
    for (dimension_type j = dbm.num_rows(); j-- > 0; )
      if (is_minus_infinity(dbm[i][j])) {






        return false;
      }


  for (dimension_type i = dbm.num_rows(); i-- > 0; )
    if (!is_plus_infinity(dbm[i][i])) {






      return false;
    }


  if (marked_shortest_path_closed()) {
    BD_Shape x = *this;
    x.reset_shortest_path_closed();
    x.shortest_path_closure_assign();
    if (x.dbm != dbm) {




      return false;
    }
  }




  if (std::numeric_limits<coefficient_type_base>::is_exact) {


    if (marked_shortest_path_reduced()) {

      for (dimension_type i = dbm.num_rows(); i-- > 0; )
        for (dimension_type j = dbm.num_rows(); j-- > 0; )
          if (!redundancy_dbm[i][j] && is_plus_infinity(dbm[i][j])) {






            return false;
          }

      BD_Shape x = *this;
      x.reset_shortest_path_reduced();
      x.shortest_path_reduction_assign();
      if (x.redundancy_dbm != redundancy_dbm) {




        return false;
      }
    }
  }


  return true;
}

template <typename T>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          const BD_Shape& y) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", y->space_dimension() == " << y.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          dimension_type required_dim) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", required dimension == " << required_dim << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          const Constraint& c) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", c->space_dimension == " << c.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          const Congruence& cg) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", cg->space_dimension == " << cg.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          const Generator& g) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", g->space_dimension == " << g.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
BD_Shape<T>::throw_expression_too_complex(const char* method,
                                          const Linear_Expression& le) {
  using namespace IO_Operators;
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << le << " is too complex.";
  throw std::invalid_argument(s.str());
}


template <typename T>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          const char* le_name,
                                          const Linear_Expression& le) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", " << le_name << "->space_dimension() == "
    << le.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
template<typename Interval_Info>
void
BD_Shape<T>::throw_dimension_incompatible(const char* method,
                                          const char* lf_name,
                                          const Linear_Form< Interval<T,
                                          Interval_Info> >& lf) const {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", " << lf_name << "->space_dimension() == "
    << lf.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename T>
void
BD_Shape<T>::throw_invalid_argument(const char* method, const char* reason) {
  std::ostringstream s;
  s << "PPL::BD_Shape::" << method << ":" << std::endl
    << reason << ".";
  throw std::invalid_argument(s.str());
}

}
# 2370 "BD_Shape_defs.hh" 2
# 39 "Box_templates.hh" 2


# 1 "Rational_Interval.hh" 1
# 30 "Rational_Interval.hh"
namespace Parma_Polyhedra_Library {

struct Rational_Interval_Info_Policy {
  enum const_bool_value_store_special { store_special = (true) };
  enum const_bool_value_store_open { store_open = (true) };
  enum const_bool_value_cache_empty { cache_empty = (true) };
  enum const_bool_value_cache_singleton { cache_singleton = (true) };
  enum const_bool_value_cache_normalized { cache_normalized = (false) };
  enum anonymous_enum_next_bit { next_bit = (0) };
  enum const_bool_value_may_be_empty { may_be_empty = (true) };
  enum const_bool_value_may_contain_infinity { may_contain_infinity = (false) };
  enum const_bool_value_check_inexact { check_inexact = (false) };
};

typedef Interval_Info_Bitset<unsigned int,
                             Rational_Interval_Info_Policy> Rational_Interval_Info;




typedef Interval<mpq_class, Rational_Interval_Info> Rational_Interval;

}
# 42 "Box_templates.hh" 2




namespace Parma_Polyhedra_Library {

template <typename ITV>
inline
Box<ITV>::Box(dimension_type num_dimensions, Degenerate_Element kind)
  : seq(check_space_dimension_overflow(num_dimensions,
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(n, k)",
                                       "n exceeds the maximum "
                                       "allowed space dimension")),
    status() {


  if (kind == UNIVERSE) {
    for (dimension_type i = num_dimensions; i-- > 0; )
      seq[i].assign(UNIVERSE);
    set_empty_up_to_date();
  }
  else
    set_empty();
  ((void) 0);
}

template <typename ITV>
inline
Box<ITV>::Box(const Constraint_System& cs)
  : seq(check_space_dimension_overflow(cs.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(cs)",
                                       "cs exceeds the maximum "
                                       "allowed space dimension")),
    status() {

  for (dimension_type i = cs.space_dimension(); i-- > 0; )
    seq[i].assign(UNIVERSE);
  add_constraints_no_check(cs);
}

template <typename ITV>
inline
Box<ITV>::Box(const Congruence_System& cgs)
  : seq(check_space_dimension_overflow(cgs.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(cgs)",
                                       "cgs exceeds the maximum "
                                       "allowed space dimension")),
    status() {

  for (dimension_type i = cgs.space_dimension(); i-- > 0; )
    seq[i].assign(UNIVERSE);
  add_congruences_no_check(cgs);
}

template <typename ITV>
template <typename Other_ITV>
inline
Box<ITV>::Box(const Box<Other_ITV>& y, Complexity_Class)
  : seq(y.space_dimension()),


    status() {

  if (y.marked_empty())
    set_empty();

  if (!y.marked_empty())
    for (dimension_type k = y.space_dimension(); k-- > 0; )
      seq[k].assign(y.seq[k]);
  ((void) 0);
}

template <typename ITV>
Box<ITV>::Box(const Generator_System& gs)
  : seq(check_space_dimension_overflow(gs.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(gs)",
                                       "gs exceeds the maximum "
                                       "allowed space dimension")),
    status() {
  const Generator_System::const_iterator gs_begin = gs.begin();
  const Generator_System::const_iterator gs_end = gs.end();
  if (gs_begin == gs_end) {

    set_empty();
    return;
  }


  set_empty_up_to_date();

  const dimension_type space_dim = space_dimension();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
  bool point_seen = false;

  for (Generator_System::const_iterator
         gs_i = gs_begin; gs_i != gs_end; ++gs_i) {
    const Generator& g = *gs_i;
    if (g.is_point()) {
      const Coefficient& d = g.divisor();
      if (point_seen) {




        for (dimension_type i = space_dim; i-- > 0; ) {
          assign_r(q.get_num(), g.coefficient(Variable(i)), ROUND_NOT_NEEDED);
          assign_r(q.get_den(), d, ROUND_NOT_NEEDED);
          q.canonicalize();
          Parma_Polyhedra_Library::Dirty_Temp<ITV> holder_iq; ITV& iq = holder_iq.item();
          iq.build(i_constraint(EQUAL, q));
          seq[i].join_assign(iq);
        }
      }
      else {

        point_seen = true;



        for (dimension_type i = space_dim; i-- > 0; ) {
          assign_r(q.get_num(), g.coefficient(Variable(i)), ROUND_NOT_NEEDED);
          assign_r(q.get_den(), d, ROUND_NOT_NEEDED);
          q.canonicalize();
          seq[i].build(i_constraint(EQUAL, q));
        }
      }
    }
  }

  if (!point_seen)

    throw std::invalid_argument("PPL::Box<ITV>::Box(gs):\n"
                                "the non-empty generator system gs "
                                "contains no points.");


  for (Generator_System::const_iterator gs_i = gs_begin;
       gs_i != gs_end; ++gs_i) {
    const Generator& g = *gs_i;
    switch (g.type()) {
    case Generator::LINE:
      for (Generator::expr_type::const_iterator i = g.expression().begin(),
              i_end = g.expression().end();
              i != i_end; ++i)
          seq[i.variable().id()].assign(UNIVERSE);
      break;
    case Generator::RAY:
      for (Generator::expr_type::const_iterator i = g.expression().begin(),
              i_end = g.expression().end();
              i != i_end; ++i)
        switch (sgn(*i)) {
        case 1:
          seq[i.variable().id()].upper_extend();
          break;
        case -1:
          seq[i.variable().id()].lower_extend();
          break;
        default:
          Parma_Polyhedra_Library::ppl_unreachable();
          break;
        }
      break;
    case Generator::CLOSURE_POINT:
      {
        const Coefficient& d = g.divisor();



        for (dimension_type i = space_dim; i-- > 0; ) {
          assign_r(q.get_num(), g.coefficient(Variable(i)), ROUND_NOT_NEEDED);
          assign_r(q.get_den(), d, ROUND_NOT_NEEDED);
          q.canonicalize();
          ITV& seq_i = seq[i];
          seq_i.lower_extend(i_constraint(GREATER_THAN, q));
          seq_i.upper_extend(i_constraint(LESS_THAN, q));
        }
      }
      break;
    default:

      break;
    }
  }
  ((void) 0);
}

template <typename ITV>
template <typename T>
Box<ITV>::Box(const BD_Shape<T>& bds, Complexity_Class)
  : seq(check_space_dimension_overflow(bds.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(bds)",
                                       "bds exceeds the maximum "
                                       "allowed space dimension")),
    status() {

  bds.shortest_path_closure_assign();
  if (bds.marked_empty()) {
    set_empty();
    ((void) 0);
    return;
  }


  set_empty_up_to_date();

  const dimension_type space_dim = space_dimension();
  if (space_dim == 0) {
    ((void) 0);
    return;
  }

  typedef typename BD_Shape<T>::coefficient_type Coeff;
  Parma_Polyhedra_Library::Dirty_Temp<Coeff> holder_tmp; Coeff& tmp = holder_tmp.item();
  const DB_Row<Coeff>& dbm_0 = bds.dbm[0];
  for (dimension_type i = space_dim; i-- > 0; ) {
    I_Constraint<Coeff> lower;
    I_Constraint<Coeff> upper;
    ITV& seq_i = seq[i];


    const Coeff& u = dbm_0[i+1];
    if (!is_plus_infinity(u))
      upper.set(LESS_OR_EQUAL, u, true);


    const Coeff& negated_l = bds.dbm[i+1][0];
    if (!is_plus_infinity(negated_l)) {
      neg_assign_r(tmp, negated_l, ROUND_DOWN);
      lower.set(GREATER_OR_EQUAL, tmp);
    }

    seq_i.build(lower, upper);
  }
  ((void) 0);
}

template <typename ITV>
template <typename T>
Box<ITV>::Box(const Octagonal_Shape<T>& oct, Complexity_Class)
  : seq(check_space_dimension_overflow(oct.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(oct)",
                                       "oct exceeds the maximum "
                                       "allowed space dimension")),
    status() {

  oct.strong_closure_assign();
  if (oct.marked_empty()) {
    set_empty();
    return;
  }


  set_empty_up_to_date();

  const dimension_type space_dim = space_dimension();
  if (space_dim == 0)
    return;

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_lower_bound; mpq_class& lower_bound = holder_lower_bound.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_upper_bound; mpq_class& upper_bound = holder_upper_bound.item();
  for (dimension_type i = space_dim; i-- > 0; ) {
    typedef typename Octagonal_Shape<T>::coefficient_type Coeff;
    I_Constraint<mpq_class> lower;
    I_Constraint<mpq_class> upper;
    ITV& seq_i = seq[i];
    const dimension_type ii = 2*i;
    const dimension_type cii = ii + 1;


    const Coeff& twice_ub = oct.matrix[cii][ii];
    if (!is_plus_infinity(twice_ub)) {
      assign_r(upper_bound, twice_ub, ROUND_NOT_NEEDED);
      div_2exp_assign_r(upper_bound, upper_bound, 1, ROUND_NOT_NEEDED);
      upper.set(LESS_OR_EQUAL, upper_bound);
    }


    const Coeff& twice_lb = oct.matrix[ii][cii];
    if (!is_plus_infinity(twice_lb)) {
      assign_r(lower_bound, twice_lb, ROUND_NOT_NEEDED);
      neg_assign_r(lower_bound, lower_bound, ROUND_NOT_NEEDED);
      div_2exp_assign_r(lower_bound, lower_bound, 1, ROUND_NOT_NEEDED);
      lower.set(GREATER_OR_EQUAL, lower_bound);
    }
    seq_i.build(lower, upper);
  }
}

template <typename ITV>
Box<ITV>::Box(const Polyhedron& ph, Complexity_Class complexity)
  : seq(check_space_dimension_overflow(ph.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(ph)",
                                       "ph exceeds the maximum "
                                       "allowed space dimension")),
    status() {

  set_empty_up_to_date();



  if (ph.marked_empty()) {
    set_empty();
    return;
  }


  const dimension_type space_dim = ph.space_dimension();
  if (space_dim == 0)
    return;


  if (ph.generators_are_up_to_date() && !ph.has_pending_constraints()) {
    Box tmp(ph.generators());
    m_swap(tmp);
    return;
  }


  ((void) 0);

  if (complexity == POLYNOMIAL_COMPLEXITY) {

    for (dimension_type i = space_dim; i-- > 0; )
      seq[i].assign(UNIVERSE);

    const Constraint_System cs = ph.simplified_constraints();



    const dimension_type max_iterations = 20;
    propagate_constraints_no_check(cs, max_iterations);
  }
  else if (complexity == SIMPLEX_COMPLEXITY) {
    MIP_Problem lp(space_dim);
    const Constraint_System& ph_cs = ph.constraints();
    if (!ph_cs.has_strict_inequalities())
      lp.add_constraints(ph_cs);
    else

      for (Constraint_System::const_iterator i = ph_cs.begin(),
             ph_cs_end = ph_cs.end(); i != ph_cs_end; ++i) {
        const Constraint& c = *i;
        if (c.is_strict_inequality()) {
          const Linear_Expression expr(c.expression());
          lp.add_constraint(expr >= 0);
        }
        else
          lp.add_constraint(c);
      }

    if (!lp.is_satisfiable()) {
      set_empty();
      return;
    }

    Generator g(point());
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_lower_bound; mpq_class& lower_bound = holder_lower_bound.item();
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_upper_bound; mpq_class& upper_bound = holder_upper_bound.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_bound_numer; Coefficient& bound_numer = holder_bound_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_bound_denom; Coefficient& bound_denom = holder_bound_denom.item();
    for (dimension_type i = space_dim; i-- > 0; ) {
      I_Constraint<mpq_class> lower;
      I_Constraint<mpq_class> upper;
      ITV& seq_i = seq[i];
      lp.set_objective_function(Variable(i));

      lp.set_optimization_mode(MAXIMIZATION);
      if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
        g = lp.optimizing_point();
        lp.evaluate_objective_function(g, bound_numer, bound_denom);
        assign_r(upper_bound.get_num(), bound_numer, ROUND_NOT_NEEDED);
        assign_r(upper_bound.get_den(), bound_denom, ROUND_NOT_NEEDED);
        ((void) 0);
        upper.set(LESS_OR_EQUAL, upper_bound);
      }

      lp.set_optimization_mode(MINIMIZATION);
      if (lp.solve() == OPTIMIZED_MIP_PROBLEM) {
        g = lp.optimizing_point();
        lp.evaluate_objective_function(g, bound_numer, bound_denom);
        assign_r(lower_bound.get_num(), bound_numer, ROUND_NOT_NEEDED);
        assign_r(lower_bound.get_den(), bound_denom, ROUND_NOT_NEEDED);
        ((void) 0);
        lower.set(GREATER_OR_EQUAL, lower_bound);
      }
      seq_i.build(lower, upper);
    }
  }
  else {
    ((void) 0);
    if (ph.is_empty())
      set_empty();
    else {
      Box tmp(ph.generators());
      m_swap(tmp);
    }
  }
}

template <typename ITV>
Box<ITV>::Box(const Grid& gr, Complexity_Class)
  : seq(check_space_dimension_overflow(gr.space_dimension(),
                                       max_space_dimension(),
                                       "PPL::Box::",
                                       "Box(gr)",
                                       "gr exceeds the maximum "
                                       "allowed space dimension")),
    status() {

  if (gr.marked_empty()) {
    set_empty();
    return;
  }


  set_empty_up_to_date();

  const dimension_type space_dim = gr.space_dimension();

  if (space_dim == 0)
    return;

  if (!gr.generators_are_up_to_date() && !gr.update_generators()) {

    set_empty();
    return;
  }

  ((void) 0);




  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_bound; mpq_class& bound = holder_bound.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_bound_numer; Coefficient& bound_numer = holder_bound_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_bound_denom; Coefficient& bound_denom = holder_bound_denom.item();
  for (dimension_type i = space_dim; i-- > 0; ) {
    ITV& seq_i = seq[i];
    Variable var(i);
    bool max;
    if (gr.maximize(var, bound_numer, bound_denom, max)) {
      assign_r(bound.get_num(), bound_numer, ROUND_NOT_NEEDED);
      assign_r(bound.get_den(), bound_denom, ROUND_NOT_NEEDED);
      bound.canonicalize();
      seq_i.build(i_constraint(EQUAL, bound));
    }
    else
      seq_i.assign(UNIVERSE);
  }
}

template <typename ITV>
template <typename D1, typename D2, typename R>
Box<ITV>::Box(const Partially_Reduced_Product<D1, D2, R>& dp,
              Complexity_Class complexity)
  : seq(), status() {
  check_space_dimension_overflow(dp.space_dimension(),
                                 max_space_dimension(),
                                 "PPL::Box::",
                                 "Box(dp)",
                                 "dp exceeds the maximum "
                                 "allowed space dimension");
  Box tmp1(dp.domain1(), complexity);
  Box tmp2(dp.domain2(), complexity);
  tmp1.intersection_assign(tmp2);
  m_swap(tmp1);
}

template <typename ITV>
inline void
Box<ITV>::add_space_dimensions_and_embed(const dimension_type m) {

  if (m == 0)
    return;
  check_space_dimension_overflow(m, max_space_dimension() - space_dimension(),
                                 "PPL::Box::",
                                 "add_space_dimensions_and_embed(m)",
                                 "adding m new space dimensions exceeds "
                                 "the maximum allowed space dimension");


  seq.insert(seq.end(), m, ITV(UNIVERSE));
  ((void) 0);
}

template <typename ITV>
inline void
Box<ITV>::add_space_dimensions_and_project(const dimension_type m) {

  if (m == 0)
    return;
  check_space_dimension_overflow(m, max_space_dimension() - space_dimension(),
                                 "PPL::Box::",
                                 "add_space_dimensions_and_project(m)",
                                 "adding m new space dimensions exceeds "
                                 "the maximum allowed space dimension");

  seq.insert(seq.end(), m, ITV(0));
  ((void) 0);
}

template <typename ITV>
bool
operator==(const Box<ITV>& x, const Box<ITV>& y) {
  const dimension_type x_space_dim = x.space_dimension();
  if (x_space_dim != y.space_dimension())
    return false;

  if (x.is_empty())
    return y.is_empty();

  if (y.is_empty())
    return x.is_empty();

  for (dimension_type k = x_space_dim; k-- > 0; )
    if (x.seq[k] != y.seq[k])
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::bounds(const Linear_Expression& expr, const bool from_above) const {

  const dimension_type expr_space_dim = expr.space_dimension();
  const dimension_type space_dim = space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((from_above
                                  ? "bounds_from_above(e)"
                                  : "bounds_from_below(e)"), "e", expr);

  if (space_dim == 0 || is_empty())
    return true;

  const int from_above_sign = from_above ? 1 : -1;


  for (Linear_Expression::const_iterator i = expr.begin(),
          i_end = expr.end(); i != i_end; ++i) {
    const Variable v = i.variable();
    switch (sgn(*i) * from_above_sign) {
    case 1:
      if (seq[v.id()].upper_is_boundary_infinity())
        return false;
      break;
    case 0:
      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    case -1:
      if (seq[v.id()].lower_is_boundary_infinity())
        return false;
      break;
    }
  }
  return true;
}

template <typename ITV>
Poly_Con_Relation
interval_relation(const ITV& i,
                  const Constraint::Type constraint_type,
                  Coefficient_traits::const_reference numer,
                  Coefficient_traits::const_reference denom) {

  if (i.is_universe())
    return Poly_Con_Relation::strictly_intersects();

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_bound; mpq_class& bound = holder_bound.item();
  assign_r(bound.get_num(), numer, ROUND_NOT_NEEDED);
  assign_r(bound.get_den(), denom, ROUND_NOT_NEEDED);
  bound.canonicalize();
  neg_assign_r(bound, bound, ROUND_NOT_NEEDED);
  const bool is_lower_bound = (denom > 0);

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_bound_diff; mpq_class& bound_diff = holder_bound_diff.item();
  if (constraint_type == Constraint::EQUALITY) {
    if (i.lower_is_boundary_infinity()) {
      ((void) 0);
      assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED);
      sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
      switch (sgn(bound_diff)) {
      case 1:
        return Poly_Con_Relation::strictly_intersects();
      case 0:
        return i.upper_is_open()
          ? Poly_Con_Relation::is_disjoint()
          : Poly_Con_Relation::strictly_intersects();
      case -1:
        return Poly_Con_Relation::is_disjoint();
      }
    }
    else {
      assign_r(bound_diff, i.lower(), ROUND_NOT_NEEDED);
      sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
      switch (sgn(bound_diff)) {
      case 1:
        return Poly_Con_Relation::is_disjoint();
      case 0:
        if (i.lower_is_open())
          return Poly_Con_Relation::is_disjoint();
        if (i.is_singleton())
          return Poly_Con_Relation::is_included()
            && Poly_Con_Relation::saturates();
        return Poly_Con_Relation::strictly_intersects();
      case -1:
        if (i.upper_is_boundary_infinity())
          return Poly_Con_Relation::strictly_intersects();
        else {
          assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED);
          sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
          switch (sgn(bound_diff)) {
          case 1:
            return Poly_Con_Relation::strictly_intersects();
          case 0:
            if (i.upper_is_open())
              return Poly_Con_Relation::is_disjoint();
            else
              return Poly_Con_Relation::strictly_intersects();
          case -1:
            return Poly_Con_Relation::is_disjoint();
          }
        }
      }
    }
  }

  ((void) 0);
  if (is_lower_bound) {
    if (i.lower_is_boundary_infinity()) {
      ((void) 0);
      assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED);
      sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
      switch (sgn(bound_diff)) {
      case 1:
        return Poly_Con_Relation::strictly_intersects();
      case 0:
        if (constraint_type == Constraint::STRICT_INEQUALITY
            || i.upper_is_open())
          return Poly_Con_Relation::is_disjoint();
        else
          return Poly_Con_Relation::strictly_intersects();
      case -1:
        return Poly_Con_Relation::is_disjoint();
      }
    }
    else {
      assign_r(bound_diff, i.lower(), ROUND_NOT_NEEDED);
      sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
      switch (sgn(bound_diff)) {
      case 1:
        return Poly_Con_Relation::is_included();
      case 0:
        if (constraint_type == Constraint::NONSTRICT_INEQUALITY
            || i.lower_is_open()) {
          Poly_Con_Relation result = Poly_Con_Relation::is_included();
          if (i.is_singleton())
            result = result && Poly_Con_Relation::saturates();
          return result;
        }
        else {
          ((void) 0);

          if (i.is_singleton())
            return Poly_Con_Relation::is_disjoint()
              && Poly_Con_Relation::saturates();
          else
            return Poly_Con_Relation::strictly_intersects();
        }
      case -1:
        if (i.upper_is_boundary_infinity())
          return Poly_Con_Relation::strictly_intersects();
        else {
          assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED);
          sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
          switch (sgn(bound_diff)) {
          case 1:
            return Poly_Con_Relation::strictly_intersects();
          case 0:
            if (constraint_type == Constraint::STRICT_INEQUALITY
                || i.upper_is_open())
              return Poly_Con_Relation::is_disjoint();
            else
              return Poly_Con_Relation::strictly_intersects();
          case -1:
            return Poly_Con_Relation::is_disjoint();
          }
        }
      }
    }
  }
  else {

    if (i.upper_is_boundary_infinity())
      return Poly_Con_Relation::strictly_intersects();
    else {
      assign_r(bound_diff, i.upper(), ROUND_NOT_NEEDED);
      sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
      switch (sgn(bound_diff)) {
      case -1:
        return Poly_Con_Relation::is_included();
      case 0:
        if (constraint_type == Constraint::NONSTRICT_INEQUALITY
            || i.upper_is_open()) {
          Poly_Con_Relation result = Poly_Con_Relation::is_included();
          if (i.is_singleton())
            result = result && Poly_Con_Relation::saturates();
          return result;
        }
        else {
          ((void) 0);

          if (i.is_singleton())
            return Poly_Con_Relation::is_disjoint()
              && Poly_Con_Relation::saturates();
          else
            return Poly_Con_Relation::strictly_intersects();
        }
      case 1:
        if (i.lower_is_boundary_infinity())
          return Poly_Con_Relation::strictly_intersects();
        else {
          assign_r(bound_diff, i.lower(), ROUND_NOT_NEEDED);
          sub_assign_r(bound_diff, bound_diff, bound, ROUND_NOT_NEEDED);
          switch (sgn(bound_diff)) {
          case -1:
            return Poly_Con_Relation::strictly_intersects();
          case 0:
            if (constraint_type == Constraint::STRICT_INEQUALITY
                || i.lower_is_open())
              return Poly_Con_Relation::is_disjoint();
            else
              return Poly_Con_Relation::strictly_intersects();
          case 1:
            return Poly_Con_Relation::is_disjoint();
          }
        }
      }
    }
  }


  Parma_Polyhedra_Library::ppl_unreachable();
  return Poly_Con_Relation::nothing();
}

template <typename ITV>
Poly_Con_Relation
Box<ITV>::relation_with(const Congruence& cg) const {
  const dimension_type cg_space_dim = cg.space_dimension();
  const dimension_type space_dim = space_dimension();


  if (cg_space_dim > space_dim)
    throw_dimension_incompatible("relation_with(cg)", cg);

  if (is_empty())
    return Poly_Con_Relation::saturates()
      && Poly_Con_Relation::is_included()
      && Poly_Con_Relation::is_disjoint();

  if (space_dim == 0) {
    if (cg.is_inconsistent())
      return Poly_Con_Relation::is_disjoint();
    else
      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_included();
  }

  if (cg.is_equality()) {
    const Constraint c(cg);
    return relation_with(c);
  }

  Parma_Polyhedra_Library::Dirty_Temp<Rational_Interval> holder_r; Rational_Interval& r = holder_r.item();
  Parma_Polyhedra_Library::Dirty_Temp<Rational_Interval> holder_t; Rational_Interval& t = holder_t.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_m; mpq_class& m = holder_m.item();
  r = 0;
  for (Congruence::expr_type::const_iterator i = cg.expression().begin(),
      i_end = cg.expression().end(); i != i_end; ++i) {
    const Coefficient& cg_i = *i;
    const Variable v = i.variable();
    assign_r(m, cg_i, ROUND_NOT_NEEDED);

    t.build(seq[v.id()].lower_constraint(), seq[v.id()].upper_constraint());
    t *= m;
    r += t;
  }

  if (r.lower_is_boundary_infinity() || r.upper_is_boundary_infinity())
    return Poly_Con_Relation::strictly_intersects();





  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_lower; Parma_Polyhedra_Library::Coefficient& lower = holder_lower.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_mod; Parma_Polyhedra_Library::Coefficient& mod = holder_mod.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_v; Parma_Polyhedra_Library::Coefficient& v = holder_v.item();
  mod = cg.modulus();
  v = cg.inhomogeneous_term() % mod;
  assign_r(lower, r.lower(), ROUND_DOWN);
  v -= ((lower / mod) * mod);
  if (v + lower > 0)
    v -= mod;
  return interval_relation(r, Constraint::EQUALITY, v);
}

template <typename ITV>
Poly_Con_Relation
Box<ITV>::relation_with(const Constraint& c) const {
  const dimension_type c_space_dim = c.space_dimension();
  const dimension_type space_dim = space_dimension();


  if (c_space_dim > space_dim)
    throw_dimension_incompatible("relation_with(c)", c);

  if (is_empty())
    return Poly_Con_Relation::saturates()
      && Poly_Con_Relation::is_included()
      && Poly_Con_Relation::is_disjoint();

  if (space_dim == 0) {
    if ((c.is_equality() && c.inhomogeneous_term() != 0)
        || (c.is_inequality() && c.inhomogeneous_term() < 0))
      return Poly_Con_Relation::is_disjoint();
    else if (c.is_strict_inequality() && c.inhomogeneous_term() == 0)


      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_disjoint();
    else if (c.is_equality() || c.inhomogeneous_term() == 0)
      return Poly_Con_Relation::saturates()
        && Poly_Con_Relation::is_included();
    else



      return Poly_Con_Relation::is_included();
  }

  dimension_type c_num_vars = 0;
  dimension_type c_only_var = 0;

  if (Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var))
    if (c_num_vars == 0)

      switch (sgn(c.inhomogeneous_term())) {
      case -1:
        return Poly_Con_Relation::is_disjoint();
      case 0:
        if (c.is_strict_inequality())
          return Poly_Con_Relation::saturates()
            && Poly_Con_Relation::is_disjoint();
        else
          return Poly_Con_Relation::saturates()
            && Poly_Con_Relation::is_included();
      case 1:
        return Poly_Con_Relation::is_included();
      }
    else {

      return interval_relation(seq[c_only_var],
                               c.type(),
                               c.inhomogeneous_term(),
                               c.coefficient(Variable(c_only_var)));
    }
  else {

    Parma_Polyhedra_Library::Dirty_Temp<Rational_Interval> holder_r; Rational_Interval& r = holder_r.item();
    Parma_Polyhedra_Library::Dirty_Temp<Rational_Interval> holder_t; Rational_Interval& t = holder_t.item();
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_m; mpq_class& m = holder_m.item();
    r = 0;
    const Constraint::expr_type& e = c.expression();
    for (Constraint::expr_type::const_iterator i = e.begin(), i_end = e.end();
          i != i_end; ++i) {
      assign_r(m, *i, ROUND_NOT_NEEDED);
      const Variable v = i.variable();

      t.build(seq[v.id()].lower_constraint(), seq[v.id()].upper_constraint());
      t *= m;
      r += t;
    }
    return interval_relation(r,
                             c.type(),
                             c.inhomogeneous_term());
  }


  Parma_Polyhedra_Library::ppl_unreachable();
  return Poly_Con_Relation::nothing();
}

template <typename ITV>
Poly_Gen_Relation
Box<ITV>::relation_with(const Generator& g) const {
  const dimension_type space_dim = space_dimension();
  const dimension_type g_space_dim = g.space_dimension();


  if (space_dim < g_space_dim)
    throw_dimension_incompatible("relation_with(g)", g);


  if (is_empty())
    return Poly_Gen_Relation::nothing();



  if (space_dim == 0)
    return Poly_Gen_Relation::subsumes();

  if (g.is_line_or_ray()) {
    if (g.is_line()) {
      const Generator::expr_type& e = g.expression();
      for (Generator::expr_type::const_iterator i = e.begin(), i_end = e.end();
           i != i_end; ++i)
        if (!seq[i.variable().id()].is_universe())
          return Poly_Gen_Relation::nothing();
      return Poly_Gen_Relation::subsumes();
    }
    else {
      ((void) 0);
      const Generator::expr_type& e = g.expression();
      for (Generator::expr_type::const_iterator i = e.begin(), i_end = e.end();
           i != i_end; ++i) {
        const Variable v = i.variable();
        switch (sgn(*i)) {
        case 1:
          if (!seq[v.id()].upper_is_boundary_infinity())
            return Poly_Gen_Relation::nothing();
          break;
        case 0:
          Parma_Polyhedra_Library::ppl_unreachable();
          break;
        case -1:
          if (!seq[v.id()].lower_is_boundary_infinity())
            return Poly_Gen_Relation::nothing();
          break;
        }
      }
      return Poly_Gen_Relation::subsumes();
    }
  }


  const Coefficient& g_divisor = g.divisor();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_g_coord; mpq_class& g_coord = holder_g_coord.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_bound; mpq_class& bound = holder_bound.item();



  for (dimension_type i = g_space_dim; i-- > 0; ) {
    const ITV& seq_i = seq[i];
    if (seq_i.is_universe())
      continue;
    assign_r(g_coord.get_num(), g.coefficient(Variable(i)), ROUND_NOT_NEEDED);
    assign_r(g_coord.get_den(), g_divisor, ROUND_NOT_NEEDED);
    g_coord.canonicalize();

    if (!seq_i.lower_is_boundary_infinity()) {
      assign_r(bound, seq_i.lower(), ROUND_NOT_NEEDED);
      if (g_coord <= bound) {
        if (seq_i.lower_is_open()) {
          if (g.is_point() || g_coord != bound)
            return Poly_Gen_Relation::nothing();
        }
        else if (g_coord != bound)
          return Poly_Gen_Relation::nothing();
      }
    }

    if (!seq_i.upper_is_boundary_infinity()) {
      assign_r(bound, seq_i.upper(), ROUND_NOT_NEEDED);
      if (g_coord >= bound) {
        if (seq_i.upper_is_open()) {
          if (g.is_point() || g_coord != bound)
            return Poly_Gen_Relation::nothing();
        }
        else if (g_coord != bound)
          return Poly_Gen_Relation::nothing();
      }
    }
  }
  return Poly_Gen_Relation::subsumes();
}


template <typename ITV>
bool
Box<ITV>::max_min(const Linear_Expression& expr,
                  const bool maximize,
                  Coefficient& ext_n, Coefficient& ext_d,
                  bool& included) const {

  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible((maximize
                                  ? "maximize(e, ...)"
                                  : "minimize(e, ...)"), "e", expr);

  if (space_dim == 0) {
    if (marked_empty())
      return false;
    else {
      ext_n = expr.inhomogeneous_term();
      ext_d = 1;
      included = true;
      return true;
    }
  }


  if (is_empty())
    return false;

  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_result; mpq_class& result = holder_result.item();
  assign_r(result, expr.inhomogeneous_term(), ROUND_NOT_NEEDED);
  bool is_included = true;
  const int maximize_sign = maximize ? 1 : -1;
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_bound_i; mpq_class& bound_i = holder_bound_i.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_expr_i; mpq_class& expr_i = holder_expr_i.item();
  for (Linear_Expression::const_iterator i = expr.begin(),
          i_end = expr.end(); i != i_end; ++i) {
    const ITV& seq_i = seq[i.variable().id()];
    assign_r(expr_i, *i, ROUND_NOT_NEEDED);
    switch (sgn(expr_i) * maximize_sign) {
    case 1:
      if (seq_i.upper_is_boundary_infinity())
        return false;
      assign_r(bound_i, seq_i.upper(), ROUND_NOT_NEEDED);
      add_mul_assign_r(result, bound_i, expr_i, ROUND_NOT_NEEDED);
      if (seq_i.upper_is_open())
        is_included = false;
      break;
    case 0:
      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    case -1:
      if (seq_i.lower_is_boundary_infinity())
        return false;
      assign_r(bound_i, seq_i.lower(), ROUND_NOT_NEEDED);
      add_mul_assign_r(result, bound_i, expr_i, ROUND_NOT_NEEDED);
      if (seq_i.lower_is_open())
        is_included = false;
      break;
    }
  }

  ((void) 0);
  ext_n = result.get_num();
  ext_d = result.get_den();
  included = is_included;
  return true;
}

template <typename ITV>
bool
Box<ITV>::max_min(const Linear_Expression& expr,
                  const bool maximize,
                  Coefficient& ext_n, Coefficient& ext_d,
                  bool& included,
                  Generator& g) const {
  if (!max_min(expr, maximize, ext_n, ext_d, included))
    return false;


  Linear_Expression g_expr;
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_g_divisor; Coefficient& g_divisor = holder_g_divisor.item();
  g_divisor = 1;
  const int maximize_sign = maximize ? 1 : -1;
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_g_coord; mpq_class& g_coord = holder_g_coord.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_numer; Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_denom; Coefficient& denom = holder_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_lcm; Coefficient& lcm = holder_lcm.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_factor; Coefficient& factor = holder_factor.item();


  for (dimension_type i = space_dimension(); i-- > 0; ) {
    const ITV& seq_i = seq[i];
    switch (sgn(expr.coefficient(Variable(i))) * maximize_sign) {
    case 1:
      assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED);
      break;
    case 0:



      if (seq_i.contains(0))
        continue;
      if (!seq_i.lower_is_boundary_infinity())
        if (seq_i.lower_is_open())
          if (!seq_i.upper_is_boundary_infinity())
            if (seq_i.upper_is_open()) {

              assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED);
              Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_seq_i_upper; mpq_class& q_seq_i_upper = holder_q_seq_i_upper.item();
              assign_r(q_seq_i_upper, seq_i.upper(), ROUND_NOT_NEEDED);
              g_coord += q_seq_i_upper;
              g_coord /= 2;
            }
            else

              assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED);
          else {

            assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED);
            ++g_coord;
          }
        else

          assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED);
      else {


        ((void) 0);
        assign_r(g_coord, seq_i.upper(), ROUND_NOT_NEEDED);
        if (seq_i.upper_is_open())
          --g_coord;
      }
      break;
    case -1:
      assign_r(g_coord, seq_i.lower(), ROUND_NOT_NEEDED);
      break;
    }

    assign_r(denom, g_coord.get_den(), ROUND_NOT_NEEDED);
    lcm_assign(lcm, g_divisor, denom);
    exact_div_assign(factor, lcm, g_divisor);
    g_expr *= factor;
    exact_div_assign(factor, lcm, denom);
    assign_r(numer, g_coord.get_num(), ROUND_NOT_NEEDED);
    numer *= factor;
    g_expr += numer * Variable(i);
    g_divisor = lcm;
  }
  g = Generator::point(g_expr, g_divisor);
  return true;
}

template <typename ITV>
bool
Box<ITV>::contains(const Box& y) const {
  const Box& x = *this;

  if (x.space_dimension() != y.space_dimension())
    x.throw_dimension_incompatible("contains(y)", y);


  if (y.is_empty())
    return true;


  if (x.is_empty())
    return false;

  for (dimension_type k = x.seq.size(); k-- > 0; )

    if (!x.seq[k].contains(y.seq[k]))
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::is_disjoint_from(const Box& y) const {
  const Box& x = *this;

  if (x.space_dimension() != y.space_dimension())
    x.throw_dimension_incompatible("is_disjoint_from(y)", y);



  if (x.marked_empty() || y.marked_empty())
    return true;

  for (dimension_type k = x.seq.size(); k-- > 0; )

    if (x.seq[k].is_disjoint_from(y.seq[k]))
      return true;
  return false;
}

template <typename ITV>
inline bool
Box<ITV>::upper_bound_assign_if_exact(const Box& y) {
  Box& x = *this;


  if (x.space_dimension() != y.space_dimension())
    x.throw_dimension_incompatible("upper_bound_assign_if_exact(y)", y);


  if (y.is_empty())
    return true;
  if (x.is_empty()) {
    x = y;
    return true;
  }

  bool x_j_does_not_contain_y_j = false;
  bool y_j_does_not_contain_x_j = false;

  for (dimension_type i = x.seq.size(); i-- > 0; ) {
    const ITV& x_seq_i = x.seq[i];
    const ITV& y_seq_i = y.seq[i];

    if (!x_seq_i.can_be_exactly_joined_to(y_seq_i))
      return false;




    bool y_i_does_not_contain_x_i = !y_seq_i.contains(x_seq_i);
    if (y_i_does_not_contain_x_i && x_j_does_not_contain_y_j)
      return false;
    if (!x_seq_i.contains(y_seq_i)) {
      if (y_j_does_not_contain_x_j)
        return false;
      else
        x_j_does_not_contain_y_j = true;
    }
    if (y_i_does_not_contain_x_i)
      y_j_does_not_contain_x_j = true;
  }


  for (dimension_type k = x.seq.size(); k-- > 0; )
    x.seq[k].join_assign(y.seq[k]);
  return true;
}

template <typename ITV>
bool
Box<ITV>::OK() const {
  if (status.test_empty_up_to_date() && !status.test_empty()) {
    Box tmp = *this;
    tmp.reset_empty_up_to_date();
    if (tmp.check_empty()) {




      return false;
    }
  }


  if (!marked_empty()) {
    for (dimension_type k = seq.size(); k-- > 0; )
      if (!seq[k].OK())
        return false;
  }

  return true;
}

template <typename ITV>
dimension_type
Box<ITV>::affine_dimension() const {
  dimension_type d = space_dimension();

  if (d == 0)
    return 0;


  if (is_empty())
    return 0;

  for (dimension_type k = d; k-- > 0; )
    if (seq[k].is_singleton())
      --d;

  return d;
}

template <typename ITV>
bool
Box<ITV>::check_empty() const {
  ((void) 0);
  Box<ITV>& x = const_cast<Box<ITV>&>(*this);
  for (dimension_type k = seq.size(); k-- > 0; )
    if (seq[k].is_empty()) {
      x.set_empty();
      return true;
    }
  x.set_nonempty();
  return false;
}

template <typename ITV>
bool
Box<ITV>::is_universe() const {
  if (marked_empty())
    return false;
  for (dimension_type k = seq.size(); k-- > 0; )
    if (!seq[k].is_universe())
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::is_topologically_closed() const {
  if (ITV::is_always_topologically_closed() || is_empty())
    return true;

  for (dimension_type k = seq.size(); k-- > 0; )
    if (!seq[k].is_topologically_closed())
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::is_discrete() const {
  if (is_empty())
    return true;
  for (dimension_type k = seq.size(); k-- > 0; )
    if (!seq[k].is_singleton())
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::is_bounded() const {
  if (is_empty())
    return true;
  for (dimension_type k = seq.size(); k-- > 0; )
    if (!seq[k].is_bounded())
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::contains_integer_point() const {
  if (marked_empty())
    return false;
  for (dimension_type k = seq.size(); k-- > 0; )
    if (!seq[k].contains_integer_point())
      return false;
  return true;
}

template <typename ITV>
bool
Box<ITV>::frequency(const Linear_Expression& expr,
                  Coefficient& freq_n, Coefficient& freq_d,
                  Coefficient& val_n, Coefficient& val_d) const {
  dimension_type space_dim = space_dimension();

  if (space_dim < expr.space_dimension())
    throw_dimension_incompatible("frequency(e, ...)", "e", expr);
# 1420 "Box_templates.hh"
  if (space_dim == 0) {
    if (is_empty())
      return false;
    freq_n = 0;
    freq_d = 1;
    val_n = expr.inhomogeneous_term();
    val_d = 1;
    return true;
  }


  if (is_empty())
    return false;


  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_numer; Parma_Polyhedra_Library::Coefficient& numer = holder_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_denom; Parma_Polyhedra_Library::Coefficient& denom = holder_denom.item();
  Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_tmp; mpq_class& tmp = holder_tmp.item();
  Coefficient c = expr.inhomogeneous_term();

  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_val_denom; Parma_Polyhedra_Library::Coefficient& val_denom = holder_val_denom.item();
  val_denom = 1;

  for (Linear_Expression::const_iterator i = expr.begin(), i_end = expr.end();
       i != i_end; ++i) {
    const ITV& seq_i = seq[i.variable().id()];

    if (seq_i.is_singleton()) {

      assign_r(tmp, seq_i.lower(), ROUND_NOT_NEEDED);
      numer = tmp.get_num();
      denom = tmp.get_den();
      c *= denom;
      c += numer * val_denom * (*i);
      val_denom *= denom;
      continue;
    }

    return false;
  }


  freq_n = 0;
  freq_d = 1;


  normalize2(c, val_denom, val_n, val_d);
  return true;
}

template <typename ITV>
bool
Box<ITV>::constrains(Variable var) const {

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dimension() < var_space_dim)
    throw_dimension_incompatible("constrains(v)", "v", var);

  if (marked_empty() || !seq[var_space_dim-1].is_universe())
    return true;

  return is_empty();
}

template <typename ITV>
void
Box<ITV>::unconstrain(const Variables_Set& vars) {



  if (vars.empty())
    return;


  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dimension() < min_space_dim)
    throw_dimension_incompatible("unconstrain(vs)", min_space_dim);


  if (marked_empty())
    return;




  for (Variables_Set::const_iterator vsi = vars.begin(),
         vsi_end = vars.end(); vsi != vsi_end; ++vsi) {
    ITV& seq_vsi = seq[*vsi];
    if (!seq_vsi.is_empty())
      seq_vsi.assign(UNIVERSE);
    else {
      set_empty();
      break;
    }
  }
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::topological_closure_assign() {
  if (ITV::is_always_topologically_closed() || is_empty())
    return;

  for (dimension_type k = seq.size(); k-- > 0; )
    seq[k].topological_closure_assign();
}

template <typename ITV>
void
Box<ITV>::wrap_assign(const Variables_Set& vars,
                      Bounded_Integer_Type_Width w,
                      Bounded_Integer_Type_Representation r,
                      Bounded_Integer_Type_Overflow o,
                      const Constraint_System* cs_p,
                      unsigned complexity_threshold,
                      bool wrap_individually) {






  (void)(wrap_individually);
  (void)(complexity_threshold);
  Box& x = *this;


  const dimension_type vars_space_dim = vars.space_dimension();
  if (cs_p != 0 && cs_p->space_dimension() > vars_space_dim) {
    std::ostringstream s;
    s << "PPL::Box<ITV>::wrap_assign(vars, w, r, o, cs_p, ...):"
      << std::endl
      << "vars.space_dimension() == " << vars_space_dim
      << ", cs_p->space_dimension() == " << cs_p->space_dimension() << ".";
    throw std::invalid_argument(s.str());
  }


  if (vars.empty()) {
    if (cs_p != 0)
      refine_with_constraints(*cs_p);
    return;
  }


  const dimension_type space_dim = x.space_dimension();
  if (space_dim < vars_space_dim) {
    std::ostringstream s;
    s << "PPL::Box<ITV>::wrap_assign(vars, ...):"
      << std::endl
      << "this->space_dimension() == " << space_dim
      << ", required space dimension == " << vars_space_dim << ".";
    throw std::invalid_argument(s.str());
  }


  if (x.is_empty())
    return;




  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_min_value; Parma_Polyhedra_Library::Coefficient& min_value = holder_min_value.item();
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_max_value; Parma_Polyhedra_Library::Coefficient& max_value = holder_max_value.item();
  if (r == UNSIGNED) {
    min_value = 0;
    mul_2exp_assign(max_value, Coefficient_one(), w);
    --max_value;
  }
  else {
    ((void) 0);
    mul_2exp_assign(max_value, Coefficient_one(), w-1);
    neg_assign(min_value, max_value);
    --max_value;
  }


  Parma_Polyhedra_Library::Dirty_Temp<ITV> holder_integer_quadrant_itv; ITV& integer_quadrant_itv = holder_integer_quadrant_itv.item();
  Parma_Polyhedra_Library::Dirty_Temp<ITV> holder_rational_quadrant_itv; ITV& rational_quadrant_itv = holder_rational_quadrant_itv.item();
  {
    I_Constraint<Coefficient> lower = i_constraint(GREATER_OR_EQUAL, min_value);
    I_Constraint<Coefficient> upper = i_constraint(LESS_OR_EQUAL, max_value);
    integer_quadrant_itv.build(lower, upper);

    if (o == OVERFLOW_UNDEFINED) {
      ++max_value;
      upper = i_constraint(LESS_THAN, max_value);
      rational_quadrant_itv.build(lower, upper);
    }
  }

  const Variables_Set::const_iterator vs_end = vars.end();

  if (cs_p == 0) {

    switch (o) {
    case OVERFLOW_WRAPS:
      for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i)
        x.seq[*i].wrap_assign(w, r, integer_quadrant_itv);
      reset_empty_up_to_date();
      break;
    case OVERFLOW_UNDEFINED:
      for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) {
        ITV& x_seq_v = x.seq[*i];
        if (!rational_quadrant_itv.contains(x_seq_v)) {
          x_seq_v.assign(integer_quadrant_itv);
        }
      }
      break;
    case OVERFLOW_IMPOSSIBLE:
      for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i)
        x.seq[*i].intersect_assign(integer_quadrant_itv);
      reset_empty_up_to_date();
      break;
    }
    ((void) 0);
    return;
  }

  ((void) 0);
  const Constraint_System& cs = *cs_p;

  typedef std::map<dimension_type, std::vector<const Constraint*> > map_type;
  map_type var_cs_map;
  for (Constraint_System::const_iterator i = cs.begin(),
         i_end = cs.end(); i != i_end; ++i) {
    const Constraint& c = *i;
    dimension_type c_num_vars = 0;
    dimension_type c_only_var = 0;
    if (Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) {
      if (c_num_vars == 1) {

        ((void) 0);

        if (vars.find(c_only_var) != vs_end)
          var_cs_map[c_only_var].push_back(&c);
      }
      else {
        ((void) 0);

        ((void) 0);
        x.set_empty();
        return;
      }
    }
  }

  Parma_Polyhedra_Library::Dirty_Temp<ITV> holder_refinement_itv; ITV& refinement_itv = holder_refinement_itv.item();
  const map_type::const_iterator var_cs_map_end = var_cs_map.end();

  for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) {
    const dimension_type v = *i;
    refinement_itv = integer_quadrant_itv;

    map_type::const_iterator var_cs_map_iter = var_cs_map.find(v);
    if (var_cs_map_iter != var_cs_map_end) {

      const map_type::mapped_type& var_cs = var_cs_map_iter->second;
      for (dimension_type j = var_cs.size(); j-- > 0; ) {
        const Constraint& c = *var_cs[j];
        refine_interval_no_check(refinement_itv,
                                 c.type(),
                                 c.inhomogeneous_term(),
                                 c.coefficient(Variable(v)));
      }
    }

    ITV& x_seq_v = x.seq[v];
    switch (o) {
    case OVERFLOW_WRAPS:
      x_seq_v.wrap_assign(w, r, refinement_itv);
      break;
    case OVERFLOW_UNDEFINED:
      if (!rational_quadrant_itv.contains(x_seq_v))
        x_seq_v.assign(UNIVERSE);
      break;
    case OVERFLOW_IMPOSSIBLE:
      x_seq_v.intersect_assign(refinement_itv);
      break;
    }
  }
  ((void) 0);

}

template <typename ITV>
void
Box<ITV>::drop_some_non_integer_points(Complexity_Class) {
  if (std::numeric_limits<typename ITV::boundary_type>::is_integer
      && !ITV::info_type::store_open)
    return;

  if (marked_empty())
    return;

  for (dimension_type k = seq.size(); k-- > 0; )
    seq[k].drop_some_non_integer_points();

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::drop_some_non_integer_points(const Variables_Set& vars,
                                       Complexity_Class) {

  const dimension_type min_space_dim = vars.space_dimension();
  if (space_dimension() < min_space_dim)
    throw_dimension_incompatible("drop_some_non_integer_points(vs, cmpl)",
                                 min_space_dim);

  if (std::numeric_limits<typename ITV::boundary_type>::is_integer
      && !ITV::info_type::store_open)
    return;

  if (marked_empty())
    return;

  for (Variables_Set::const_iterator v_i = vars.begin(),
         v_end = vars.end(); v_i != v_end; ++v_i)
    seq[*v_i].drop_some_non_integer_points();

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::intersection_assign(const Box& y) {
  Box& x = *this;
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    x.throw_dimension_incompatible("intersection_assign(y)", y);


  if (x.marked_empty())
    return;
  if (y.marked_empty()) {
    x.set_empty();
    return;
  }



  if (space_dim == 0)
    return;



  reset_empty_up_to_date();

  for (dimension_type k = space_dim; k-- > 0; )
    x.seq[k].intersect_assign(y.seq[k]);

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::upper_bound_assign(const Box& y) {
  Box& x = *this;


  if (x.space_dimension() != y.space_dimension())
    x.throw_dimension_incompatible("upper_bound_assign(y)", y);


  if (y.is_empty())
    return;
  if (x.is_empty()) {
    x = y;
    return;
  }

  for (dimension_type k = x.seq.size(); k-- > 0; )
    x.seq[k].join_assign(y.seq[k]);

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::concatenate_assign(const Box& y) {
  Box& x = *this;
  const dimension_type x_space_dim = x.space_dimension();
  const dimension_type y_space_dim = y.space_dimension();


  if (y.marked_empty())
    x.set_empty();


  if (y_space_dim == 0)
    return;

  check_space_dimension_overflow(y.space_dimension(),
                                 max_space_dimension() - space_dimension(),
                                 "PPL::Box::",
                                 "concatenate_assign(y)",
                                 "concatenation exceeds the maximum "
                                 "allowed space dimension");


  x.seq.reserve(x_space_dim + y_space_dim);



  if (x.marked_empty()) {
    x.seq.insert(x.seq.end(), y_space_dim, ITV(EMPTY));
    ((void) 0);
    return;
  }


  std::copy(y.seq.begin(), y.seq.end(),
            std::back_insert_iterator<Sequence>(x.seq));

  if (!y.status.test_empty_up_to_date())
    reset_empty_up_to_date();

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::difference_assign(const Box& y) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("difference_assign(y)", y);

  Box& x = *this;
  if (x.is_empty() || y.is_empty())
    return;

  switch (space_dim) {
  case 0:


    x.set_empty();
    break;

  case 1:
    x.seq[0].difference_assign(y.seq[0]);
    if (x.seq[0].is_empty())
      x.set_empty();
    break;

  default:
    {
      dimension_type index_non_contained = space_dim;
      dimension_type number_non_contained = 0;
      for (dimension_type i = space_dim; i-- > 0; )
        if (!y.seq[i].contains(x.seq[i])) {
          if (++number_non_contained == 1)
            index_non_contained = i;
          else
            break;
        }

      switch (number_non_contained) {
      case 0:

        x.set_empty();
        break;
      case 1:
        x.seq[index_non_contained]
          .difference_assign(y.seq[index_non_contained]);
        if (x.seq[index_non_contained].is_empty())
          x.set_empty();
        break;
      default:

        break;
      }
    }
    break;
  }
  ((void) 0);
}

template <typename ITV>
bool
Box<ITV>::simplify_using_context_assign(const Box& y) {
  Box& x = *this;
  const dimension_type num_dims = x.space_dimension();

  if (num_dims != y.space_dimension())
    x.throw_dimension_incompatible("simplify_using_context_assign(y)", y);


  if (num_dims == 0) {
    if (y.marked_empty()) {
      x.set_nonempty();
      return false;
    }
    else
      return !x.marked_empty();
  }


  if (y.is_empty()) {
    for (dimension_type i = num_dims; i-- > 0; )
      x.seq[i].assign(UNIVERSE);
    x.set_nonempty();
    return false;
  }

  if (x.is_empty()) {

    for (dimension_type i = 0; i < num_dims; ++i) {
      if (y.seq[i].is_universe())
        x.seq[i].assign(UNIVERSE);
      else {

        ITV& seq_i = x.seq[i];
        seq_i.empty_intersection_assign(y.seq[i]);
        if (seq_i.is_empty()) {


          seq_i.assign(UNIVERSE);
          continue;
        }


        for (++i; i < num_dims; ++i)
          x.seq[i].assign(UNIVERSE);
        x.set_nonempty();
        ((void) 0);
        return false;
      }
    }


    ((void) 0);
    return false;
  }


  for (dimension_type i = 0; i < num_dims; ++i) {
    if (!x.seq[i].simplify_using_context_assign(y.seq[i])) {
      ((void) 0);


      for (dimension_type j = num_dims; j-- > i; )
        x.seq[j].assign(UNIVERSE);
      for (dimension_type j = i; j-- > 0; )
        x.seq[j].assign(UNIVERSE);
      ((void) 0);
      return false;
    }
  }
  ((void) 0);
  return true;
}

template <typename ITV>
void
Box<ITV>::time_elapse_assign(const Box& y) {
  Box& x = *this;
  const dimension_type x_space_dim = x.space_dimension();


  if (x_space_dim != y.space_dimension())
    x.throw_dimension_incompatible("time_elapse_assign(y)", y);


  if (x_space_dim == 0) {
    if (y.marked_empty())
      x.set_empty();
    return;
  }



  if (x.marked_empty() || y.marked_empty()
      || x.is_empty() || y.is_empty()) {
    x.set_empty();
    return;
  }

  for (dimension_type i = x_space_dim; i-- > 0; ) {
    ITV& x_seq_i = x.seq[i];
    const ITV& y_seq_i = y.seq[i];
    if (!x_seq_i.lower_is_boundary_infinity())
      if (y_seq_i.lower_is_boundary_infinity() || y_seq_i.lower() < 0)
        x_seq_i.lower_extend();
    if (!x_seq_i.upper_is_boundary_infinity())
      if (y_seq_i.upper_is_boundary_infinity() || y_seq_i.upper() > 0)
        x_seq_i.upper_extend();
  }
  ((void) 0);
}

template <typename ITV>
inline void
Box<ITV>::remove_space_dimensions(const Variables_Set& vars) {



  if (vars.empty()) {
    ((void) 0);
    return;
  }

  const dimension_type old_space_dim = space_dimension();


  const dimension_type vsi_space_dim = vars.space_dimension();
  if (old_space_dim < vsi_space_dim)
    throw_dimension_incompatible("remove_space_dimensions(vs)",
                                 vsi_space_dim);

  const dimension_type new_space_dim = old_space_dim - vars.size();




  if (is_empty() || new_space_dim == 0) {
    seq.resize(new_space_dim);
    ((void) 0);
    return;
  }



  Variables_Set::const_iterator vsi = vars.begin();
  Variables_Set::const_iterator vsi_end = vars.end();
  dimension_type dst = *vsi;
  dimension_type src = dst + 1;
  for (++vsi; vsi != vsi_end; ++vsi) {
    const dimension_type vsi_next = *vsi;

    while (src < vsi_next)
      swap(seq[dst++], seq[src++]);
    ++src;
  }

  while (src < old_space_dim)
    swap(seq[dst++], seq[src++]);

  ((void) 0);
  seq.resize(new_space_dim);

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::remove_higher_space_dimensions(const dimension_type new_dimension) {


  const dimension_type space_dim = space_dimension();
  if (new_dimension > space_dim)
    throw_dimension_incompatible("remove_higher_space_dimensions(nd)",
                                 new_dimension);




  if (new_dimension == space_dim) {
    ((void) 0);
    return;
  }

  seq.resize(new_dimension);
  ((void) 0);
}

template <typename ITV>
template <typename Partial_Function>
void
Box<ITV>::map_space_dimensions(const Partial_Function& pfunc) {
  const dimension_type space_dim = space_dimension();
  if (space_dim == 0)
    return;

  if (pfunc.has_empty_codomain()) {

    remove_higher_space_dimensions(0);
    return;
  }

  const dimension_type new_space_dim = pfunc.max_in_codomain() + 1;

  if (is_empty()) {
    remove_higher_space_dimensions(new_space_dim);
    return;
  }


  Box<ITV> tmp(new_space_dim);

  for (dimension_type i = 0; i < space_dim; ++i) {
    dimension_type new_i;
    if (pfunc.maps(i, new_i))
      swap(seq[i], tmp.seq[new_i]);
  }
  m_swap(tmp);
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::fold_space_dimensions(const Variables_Set& vars,
                                const Variable dest) {
  const dimension_type space_dim = space_dimension();

  if (dest.space_dimension() > space_dim)
    throw_dimension_incompatible("fold_space_dimensions(vs, v)", "v", dest);


  if (vars.empty())
    return;


  if (vars.space_dimension() > space_dim)
    throw_dimension_incompatible("fold_space_dimensions(vs, v)",
                                 vars.space_dimension());


  if (vars.find(dest.id()) != vars.end())
    throw_invalid_argument("fold_space_dimensions(vs, v)",
                           "v should not occur in vs");


  if (!is_empty()) {


    ITV& seq_v = seq[dest.id()];
    for (Variables_Set::const_iterator i = vars.begin(),
           vs_end = vars.end(); i != vs_end; ++i)
      seq_v.join_assign(seq[*i]);
  }
  remove_space_dimensions(vars);
}

template <typename ITV>
void
Box<ITV>::add_constraint_no_check(const Constraint& c) {
  ((void) 0);

  dimension_type c_num_vars = 0;
  dimension_type c_only_var = 0;

  if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var))
    throw_invalid_argument("add_constraint(c)",
                           "c is not an interval constraint");



  if (c.is_strict_inequality() && c_num_vars != 0
      && ITV::is_always_topologically_closed())
    throw_invalid_argument("add_constraint(c)",
                           "c is a nontrivial strict constraint");


  if (marked_empty())
    return;

  const Coefficient& n = c.inhomogeneous_term();
  if (c_num_vars == 0) {

    if (n < 0
        || (c.is_equality() && n != 0)
        || (c.is_strict_inequality() && n == 0))
      set_empty();
    return;
  }

  ((void) 0);
  const Coefficient& d = c.coefficient(Variable(c_only_var));
  add_interval_constraint_no_check(c_only_var, c.type(), n, d);
}

template <typename ITV>
void
Box<ITV>::add_constraints_no_check(const Constraint_System& cs) {
  ((void) 0);



  for (Constraint_System::const_iterator i = cs.begin(),
         cs_end = cs.end(); i != cs_end; ++i)
    add_constraint_no_check(*i);
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::add_congruence_no_check(const Congruence& cg) {
  ((void) 0);


  if (cg.is_proper_congruence()) {
    if (cg.is_inconsistent()) {
      set_empty();
      return;
    }
    else if (cg.is_tautological())
      return;
    else
      throw_invalid_argument("add_congruence(cg)",
                             "cg is a nontrivial proper congruence");
  }

  ((void) 0);
  dimension_type cg_num_vars = 0;
  dimension_type cg_only_var = 0;

  if (!Box_Helpers::extract_interval_congruence(cg, cg_num_vars, cg_only_var))
    throw_invalid_argument("add_congruence(cg)",
                           "cg is not an interval congruence");


  if (marked_empty())
    return;

  const Coefficient& n = cg.inhomogeneous_term();
  if (cg_num_vars == 0) {

    if (n != 0)
      set_empty();
    return;
  }

  ((void) 0);
  const Coefficient& d = cg.coefficient(Variable(cg_only_var));
  add_interval_constraint_no_check(cg_only_var, Constraint::EQUALITY, n, d);
}

template <typename ITV>
void
Box<ITV>::add_congruences_no_check(const Congruence_System& cgs) {
  ((void) 0);



  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); i != cgs_end; ++i)
    add_congruence_no_check(*i);
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::refine_no_check(const Constraint& c) {
  ((void) 0);
  ((void) 0);

  dimension_type c_num_vars = 0;
  dimension_type c_only_var = 0;

  if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var)) {
    propagate_constraint_no_check(c);
    return;
  }

  const Coefficient& n = c.inhomogeneous_term();
  if (c_num_vars == 0) {

    if (n < 0
        || (c.is_equality() && n != 0)
        || (c.is_strict_inequality() && n == 0))
      set_empty();
    return;
  }

  ((void) 0);
  const Coefficient& d = c.coefficient(Variable(c_only_var));
  add_interval_constraint_no_check(c_only_var, c.type(), n, d);
}

template <typename ITV>
void
Box<ITV>::refine_no_check(const Constraint_System& cs) {
  ((void) 0);
  for (Constraint_System::const_iterator i = cs.begin(),
         cs_end = cs.end(); !marked_empty() && i != cs_end; ++i)
    refine_no_check(*i);
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::refine_no_check(const Congruence& cg) {
  ((void) 0);

  ((void) 0);

  if (cg.is_proper_congruence()) {


    if (cg.is_inconsistent())
      set_empty();
    return;
  }

  ((void) 0);
  Constraint c(cg);
  refine_no_check(c);
}

template <typename ITV>
void
Box<ITV>::refine_no_check(const Congruence_System& cgs) {
  ((void) 0);
  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); !marked_empty() && i != cgs_end; ++i)
    refine_no_check(*i);
  ((void) 0);
}


namespace Implementation {

namespace Boxes {

inline bool
propagate_constraint_check_result(Result r, Ternary& open) {
  r = result_relation_class(r);
  switch (r) {
  case V_GT_MINUS_INFINITY:
  case V_LT_PLUS_INFINITY:
    return true;
  case V_LT:
  case V_GT:
    open = T_YES;
    return false;
  case V_LE:
  case V_GE:
    if (open == T_NO)
      open = T_MAYBE;
    return false;
  case V_EQ:
    return false;
  default:
    Parma_Polyhedra_Library::ppl_unreachable();
    return true;
  }
}

}

}


template <typename ITV>
void
Box<ITV>::propagate_constraint_no_check(const Constraint& c) {
  using namespace Implementation::Boxes;

  ((void) 0);

  typedef
    typename Select_Temp_Boundary_Type<typename ITV::boundary_type>::type
    Temp_Boundary_Type;

  const dimension_type c_space_dim = c.space_dimension();
  const Constraint::Type c_type = c.type();
  const Coefficient& c_inhomogeneous_term = c.inhomogeneous_term();


  const dimension_type last_k
    = c.expression().last_nonzero(1, c_space_dim + 1);
  if (last_k == c_space_dim + 1) {

    if (c_inhomogeneous_term < 0
        || (c_inhomogeneous_term == 0
            && c_type != Constraint::NONSTRICT_INEQUALITY))
      set_empty();
    return;
  }


  ((void) 0);
  Temp_Boundary_Type t_bound;
  Temp_Boundary_Type t_a;
  Temp_Boundary_Type t_x;
  Ternary open;
  const Constraint::expr_type c_e = c.expression();
  for (Constraint::expr_type::const_iterator k = c_e.begin(),
         k_end = c_e.lower_bound(Variable(last_k)); k != k_end; ++k) {
    const Coefficient& a_k = *k;
    const Variable k_var = k.variable();
    const int sgn_a_k = sgn(a_k);
    if (sgn_a_k == 0)
      continue;
    Result r;
    if (sgn_a_k > 0) {
      open = (c_type == Constraint::STRICT_INEQUALITY) ? T_YES : T_NO;
      if (open == T_NO)
        maybe_reset_fpu_inexact<Temp_Boundary_Type>();
      r = assign_r(t_bound, c_inhomogeneous_term, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_1;
      r = neg_assign_r(t_bound, t_bound, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_1;
      for (Constraint::expr_type::const_iterator i = c_e.begin(),
            i_end = c_e.lower_bound(Variable(last_k)); i != i_end; ++i) {
        const Variable i_var = i.variable();
        if (i_var.id() == k_var.id())
          continue;
        const Coefficient& a_i = *i;
        const int sgn_a_i = sgn(a_i);
        ITV& x_i = seq[i_var.id()];
        if (sgn_a_i < 0) {
          if (x_i.lower_is_boundary_infinity())
            goto maybe_refine_upper_1;
          r = assign_r(t_a, a_i, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_1;
          r = assign_r(t_x, x_i.lower(), ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_1;
          if (x_i.lower_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_1;
        }
        else {
          ((void) 0);
          if (x_i.upper_is_boundary_infinity())
            goto maybe_refine_upper_1;
          r = assign_r(t_a, a_i, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_1;
          r = assign_r(t_x, x_i.upper(), ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_1;
          if (x_i.upper_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_1;
        }
      }
      r = assign_r(t_a, a_k, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_1;
      r = div_assign_r(t_bound, t_bound, t_a, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_1;


      if (open == T_MAYBE
          && maybe_check_fpu_inexact<Temp_Boundary_Type>() == 1)
        open = T_YES;
      {
        const Relation_Symbol rel
          = (open == T_YES) ? GREATER_THAN : GREATER_OR_EQUAL;
        seq[k_var.id()].add_constraint(i_constraint(rel, t_bound));
      }
      reset_empty_up_to_date();
    maybe_refine_upper_1:
      if (c_type != Constraint::EQUALITY)
        continue;
      open = T_NO;
      maybe_reset_fpu_inexact<Temp_Boundary_Type>();
      r = assign_r(t_bound, c_inhomogeneous_term, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto next_k;
      r = neg_assign_r(t_bound, t_bound, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto next_k;
      for (Constraint::expr_type::const_iterator i = c_e.begin(),
            i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) {
        const Variable i_var = i.variable();
        if (i_var.id() == k_var.id())
          continue;
        const Coefficient& a_i = *i;
        const int sgn_a_i = sgn(a_i);
        ITV& x_i = seq[i_var.id()];
        if (sgn_a_i < 0) {
          if (x_i.upper_is_boundary_infinity())
            goto next_k;
          r = assign_r(t_a, a_i, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          r = assign_r(t_x, x_i.upper(), ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          if (x_i.upper_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
        }
        else {
          ((void) 0);
          if (x_i.lower_is_boundary_infinity())
            goto next_k;
          r = assign_r(t_a, a_i, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          r = assign_r(t_x, x_i.lower(), ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          if (x_i.lower_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
        }
      }
      r = assign_r(t_a, a_k, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto next_k;
      r = div_assign_r(t_bound, t_bound, t_a, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto next_k;


      if (open == T_MAYBE
          && maybe_check_fpu_inexact<Temp_Boundary_Type>() == 1)
        open = T_YES;
      const Relation_Symbol rel
        = (open == T_YES) ? LESS_THAN : LESS_OR_EQUAL;
      seq[k_var.id()].add_constraint(i_constraint(rel, t_bound));
      reset_empty_up_to_date();
    }
    else {
      ((void) 0);
      open = (c_type == Constraint::STRICT_INEQUALITY) ? T_YES : T_NO;
      if (open == T_NO)
        maybe_reset_fpu_inexact<Temp_Boundary_Type>();
      r = assign_r(t_bound, c_inhomogeneous_term, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_2;
      r = neg_assign_r(t_bound, t_bound, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_2;
      for (Constraint::expr_type::const_iterator i = c_e.begin(),
            i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) {
        const Variable i_var = i.variable();
        if (i_var.id() == k_var.id())
          continue;
        const Coefficient& a_i = *i;
        const int sgn_a_i = sgn(a_i);
        ITV& x_i = seq[i_var.id()];
        if (sgn_a_i < 0) {
          if (x_i.lower_is_boundary_infinity())
            goto maybe_refine_upper_2;
          r = assign_r(t_a, a_i, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_2;
          r = assign_r(t_x, x_i.lower(), ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_2;
          if (x_i.lower_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_2;
        }
        else {
          ((void) 0);
          if (x_i.upper_is_boundary_infinity())
            goto maybe_refine_upper_2;
          r = assign_r(t_a, a_i, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_2;
          r = assign_r(t_x, x_i.upper(), ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_2;
          if (x_i.upper_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto maybe_refine_upper_2;
        }
      }
      r = assign_r(t_a, a_k, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_2;
      r = div_assign_r(t_bound, t_bound, t_a, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto maybe_refine_upper_2;


      if (open == T_MAYBE
          && maybe_check_fpu_inexact<Temp_Boundary_Type>() == 1)
        open = T_YES;
      {
        const Relation_Symbol rel
          = (open == T_YES) ? LESS_THAN : LESS_OR_EQUAL;
        seq[k_var.id()].add_constraint(i_constraint(rel, t_bound));
      }
      reset_empty_up_to_date();
    maybe_refine_upper_2:
      if (c_type != Constraint::EQUALITY)
        continue;
      open = T_NO;
      maybe_reset_fpu_inexact<Temp_Boundary_Type>();
      r = assign_r(t_bound, c_inhomogeneous_term, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto next_k;
      r = neg_assign_r(t_bound, t_bound, ROUND_UP);
      if (propagate_constraint_check_result(r, open))
        goto next_k;
      for (Constraint::expr_type::const_iterator i = c_e.begin(),
            i_end = c_e.lower_bound(Variable(c_space_dim)); i != i_end; ++i) {
        const Variable i_var = i.variable();
        if (i_var.id() == k_var.id())
          continue;
        const Coefficient& a_i = *i;
        const int sgn_a_i = sgn(a_i);
        ITV& x_i = seq[i_var.id()];
        if (sgn_a_i < 0) {
          if (x_i.upper_is_boundary_infinity())
            goto next_k;
          r = assign_r(t_a, a_i, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          r = assign_r(t_x, x_i.upper(), ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          if (x_i.upper_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
        }
        else {
          ((void) 0);
          if (x_i.lower_is_boundary_infinity())
            goto next_k;
          r = assign_r(t_a, a_i, ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          r = assign_r(t_x, x_i.lower(), ROUND_DOWN);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
          if (x_i.lower_is_open())
            open = T_YES;
          r = sub_mul_assign_r(t_bound, t_a, t_x, ROUND_UP);
          if (propagate_constraint_check_result(r, open))
            goto next_k;
        }
      }
      r = assign_r(t_a, a_k, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto next_k;
      r = div_assign_r(t_bound, t_bound, t_a, ROUND_DOWN);
      if (propagate_constraint_check_result(r, open))
        goto next_k;


      if (open == T_MAYBE
          && maybe_check_fpu_inexact<Temp_Boundary_Type>() == 1)
        open = T_YES;
      const Relation_Symbol rel
        = (open == T_YES) ? GREATER_THAN : GREATER_OR_EQUAL;
      seq[k_var.id()].add_constraint(i_constraint(rel, t_bound));
      reset_empty_up_to_date();
    }
  next_k:
    ;
  }
}
# 2748 "Box_templates.hh"
template <typename ITV>
void
Box<ITV>
::propagate_constraints_no_check(const Constraint_System& cs,
                                 const dimension_type max_iterations) {
  const dimension_type space_dim = space_dimension();
  ((void) 0);

  const Constraint_System::const_iterator cs_begin = cs.begin();
  const Constraint_System::const_iterator cs_end = cs.end();
  const dimension_type propagation_weight
    = Implementation::num_constraints(cs) * space_dim;

  Sequence copy;
  bool changed;
  dimension_type num_iterations = 0;
  do {
    do { } while (false);
    ++num_iterations;
    copy = seq;
    for (Constraint_System::const_iterator i = cs_begin; i != cs_end; ++i)
      propagate_constraint_no_check(*i);

    do { Weightwatch_Traits::weight += (40)*(propagation_weight); } while (false);



    maybe_abandon();



    if (num_iterations == max_iterations)
      break;

    changed = (copy != seq);
  } while (changed);
}

template <typename ITV>
void
Box<ITV>::affine_image(const Variable var,
                       const Linear_Expression& expr,
                       Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("affine_image(v, e, d)", "d == 0");


  const dimension_type space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (space_dim < expr_space_dim)
    throw_dimension_incompatible("affine_image(v, e, d)", "e", expr);

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dim < var_space_dim)
    throw_dimension_incompatible("affine_image(v, e, d)", "v", var);

  if (is_empty())
    return;

  Tmp_Interval_Type expr_value;
  Tmp_Interval_Type temp0;
  Tmp_Interval_Type temp1;
  expr_value.assign(expr.inhomogeneous_term());
  for (Linear_Expression::const_iterator i = expr.begin(),
          i_end = expr.end(); i != i_end; ++i) {
    temp0.assign(*i);
    temp1.assign(seq[i.variable().id()]);
    temp0.mul_assign(temp0, temp1);
    expr_value.add_assign(expr_value, temp0);
  }
  if (denominator != 1) {
    temp0.assign(denominator);
    expr_value.div_assign(expr_value, temp0);
  }
  seq[var.id()].assign(expr_value);

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::affine_form_image(const Variable var,
                            const Linear_Form<ITV>& lf) {


  enum anonymous_enum_compile_time_check___LINE__ { compile_time_check_2836 = sizeof(Parma_Polyhedra_Library::Compile_Time_Check<(!std::numeric_limits<typename ITV::boundary_type> ::is_exact)>) };




  const dimension_type space_dim = space_dimension();
  const dimension_type lf_space_dim = lf.space_dimension();
  if (space_dim < lf_space_dim)
    throw_dimension_incompatible("affine_form_image(var, lf)", "lf", lf);

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dim < var_space_dim)
    throw_dimension_incompatible("affine_form_image(var, lf)", "var", var);

  if (is_empty())
    return;


  ITV result = lf.inhomogeneous_term();
  for (dimension_type i = 0; i < lf_space_dim; ++i) {
    ITV current_addend = lf.coefficient(Variable(i));
    const ITV& curr_int = seq[i];
    current_addend *= curr_int;
    result += current_addend;
  }

  seq[var.id()].assign(result);
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::affine_preimage(const Variable var,
                          const Linear_Expression& expr,
                          Coefficient_traits::const_reference
                          denominator) {

  if (denominator == 0)
    throw_invalid_argument("affine_preimage(v, e, d)", "d == 0");


  const dimension_type x_space_dim = space_dimension();
  const dimension_type expr_space_dim = expr.space_dimension();
  if (x_space_dim < expr_space_dim)
    throw_dimension_incompatible("affine_preimage(v, e, d)", "e", expr);

  const dimension_type var_space_dim = var.space_dimension();
  if (x_space_dim < var_space_dim)
    throw_dimension_incompatible("affine_preimage(v, e, d)", "v", var);

  if (is_empty())
    return;

  const Coefficient& expr_v = expr.coefficient(var);
  const bool invertible = (expr_v != 0);
  if (!invertible) {
    Tmp_Interval_Type expr_value;
    Tmp_Interval_Type temp0;
    Tmp_Interval_Type temp1;
    expr_value.assign(expr.inhomogeneous_term());
    for (Linear_Expression::const_iterator i = expr.begin(),
            i_end = expr.end(); i != i_end; ++i) {
      temp0.assign(*i);
      temp1.assign(seq[i.variable().id()]);
      temp0.mul_assign(temp0, temp1);
      expr_value.add_assign(expr_value, temp0);
    }
    if (denominator != 1) {
      temp0.assign(denominator);
      expr_value.div_assign(expr_value, temp0);
    }
    ITV& x_seq_v = seq[var.id()];
    expr_value.intersect_assign(x_seq_v);
    if (expr_value.is_empty())
      set_empty();
    else
      x_seq_v.assign(UNIVERSE);
  }
  else {




    Linear_Expression inverse;
    inverse -= expr;
    inverse += (expr_v + denominator) * var;
    affine_image(var, inverse, expr_v);
  }
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>
::bounded_affine_image(const Variable var,
                       const Linear_Expression& lb_expr,
                       const Linear_Expression& ub_expr,
                       Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("bounded_affine_image(v, lb, ub, d)", "d == 0");


  const dimension_type space_dim = space_dimension();


  const dimension_type lb_space_dim = lb_expr.space_dimension();
  if (space_dim < lb_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "lb", lb_expr);
  const dimension_type ub_space_dim = ub_expr.space_dimension();
  if (space_dim < ub_space_dim)
    throw_dimension_incompatible("bounded_affine_image(v, lb, ub, d)",
                                 "ub", ub_expr);

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dim < var_space_dim)
    throw_dimension_incompatible("affine_image(v, e, d)", "v", var);


  if (is_empty())
    return;


  if (denominator > 0)
    refine_with_constraint(lb_expr <= ub_expr);
  else
    refine_with_constraint(lb_expr >= ub_expr);


  if (lb_expr.coefficient(var) == 0) {

    generalized_affine_image(var,
                             LESS_OR_EQUAL,
                             ub_expr,
                             denominator);
    if (denominator > 0)
      refine_with_constraint(lb_expr <= denominator*var);
    else
      refine_with_constraint(denominator*var <= lb_expr);
  }
  else if (ub_expr.coefficient(var) == 0) {

    generalized_affine_image(var,
                             GREATER_OR_EQUAL,
                             lb_expr,
                             denominator);
    if (denominator > 0)
      refine_with_constraint(denominator*var <= ub_expr);
    else
      refine_with_constraint(ub_expr <= denominator*var);
  }
  else {




    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_numer; Coefficient& max_numer = holder_max_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_denom; Coefficient& max_denom = holder_max_denom.item();
    bool max_included;
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_numer; Coefficient& min_numer = holder_min_numer.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_denom; Coefficient& min_denom = holder_min_denom.item();
    bool min_included;
    ITV& seq_v = seq[var.id()];
    if (maximize(ub_expr, max_numer, max_denom, max_included)) {
      if (minimize(lb_expr, min_numer, min_denom, min_included)) {



        min_denom *= denominator;
        Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q1; mpq_class& q1 = holder_q1.item();
        Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q2; mpq_class& q2 = holder_q2.item();
        assign_r(q1.get_num(), min_numer, ROUND_NOT_NEEDED);
        assign_r(q1.get_den(), min_denom, ROUND_NOT_NEEDED);
        q1.canonicalize();


        max_denom *= denominator;
        assign_r(q2.get_num(), max_numer, ROUND_NOT_NEEDED);
        assign_r(q2.get_den(), max_denom, ROUND_NOT_NEEDED);
        q2.canonicalize();

        if (denominator > 0) {
          Relation_Symbol gr = min_included ? GREATER_OR_EQUAL : GREATER_THAN;
          Relation_Symbol lr = max_included ? LESS_OR_EQUAL : LESS_THAN;
          seq_v.build(i_constraint(gr, q1), i_constraint(lr, q2));
        }
        else {
          Relation_Symbol gr = max_included ? GREATER_OR_EQUAL : GREATER_THAN;
          Relation_Symbol lr = min_included ? LESS_OR_EQUAL : LESS_THAN;
          seq_v.build(i_constraint(gr, q2), i_constraint(lr, q1));
        }
      }
      else {



        Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
        max_denom *= denominator;
        assign_r(q.get_num(), max_numer, ROUND_NOT_NEEDED);
        assign_r(q.get_den(), max_denom, ROUND_NOT_NEEDED);
        q.canonicalize();
        Relation_Symbol rel = (denominator > 0)
          ? (max_included ? LESS_OR_EQUAL : LESS_THAN)
          : (max_included ? GREATER_OR_EQUAL : GREATER_THAN);
        seq_v.build(i_constraint(rel, q));
      }
    }
    else if (minimize(lb_expr, min_numer, min_denom, min_included)) {



        min_denom *= denominator;
        Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
        assign_r(q.get_num(), min_numer, ROUND_NOT_NEEDED);
        assign_r(q.get_den(), min_denom, ROUND_NOT_NEEDED);
        q.canonicalize();

        Relation_Symbol rel = (denominator > 0)
          ? (min_included ? GREATER_OR_EQUAL : GREATER_THAN)
          : (min_included ? LESS_OR_EQUAL : LESS_THAN);
        seq_v.build(i_constraint(rel, q));
    }
    else {



      seq_v.assign(UNIVERSE);
    }
  }
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>
::bounded_affine_preimage(const Variable var,
                          const Linear_Expression& lb_expr,
                          const Linear_Expression& ub_expr,
                          Coefficient_traits::const_reference denominator) {

  const dimension_type space_dim = space_dimension();
  if (denominator == 0)
    throw_invalid_argument("bounded_affine_preimage(v, lb, ub, d)", "d == 0");



  const dimension_type var_space_dim = var.space_dimension();
  if (space_dim < var_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "v", var);


  const dimension_type lb_space_dim = lb_expr.space_dimension();
  if (space_dim < lb_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "lb", lb_expr);
  const dimension_type ub_space_dim = ub_expr.space_dimension();
  if (space_dim < ub_space_dim)
    throw_dimension_incompatible("bounded_affine_preimage(v, lb, ub, d)",
                                 "ub", ub_expr);


  if (marked_empty())
    return;

  const bool negative_denom = (denominator < 0);
  const Coefficient& lb_var_coeff = lb_expr.coefficient(var);
  const Coefficient& ub_var_coeff = ub_expr.coefficient(var);



  if (lb_var_coeff == ub_var_coeff) {
    if (negative_denom)
      refine_with_constraint(lb_expr >= ub_expr);
    else
      refine_with_constraint(lb_expr <= ub_expr);
  }

  ITV& seq_var = seq[var.id()];
  if (!seq_var.is_universe()) {


    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_pos_denominator; Parma_Polyhedra_Library::Coefficient& pos_denominator = holder_pos_denominator.item();
    pos_denominator = denominator;
    if (negative_denom)
      neg_assign(pos_denominator, pos_denominator);


    bool open_lower = seq_var.lower_is_open();
    bool unbounded_lower = seq_var.lower_is_boundary_infinity();
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_seq_var_lower; mpq_class& q_seq_var_lower = holder_q_seq_var_lower.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_numer_lower; Coefficient& numer_lower = holder_numer_lower.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_denom_lower; Coefficient& denom_lower = holder_denom_lower.item();
    if (!unbounded_lower) {
      assign_r(q_seq_var_lower, seq_var.lower(), ROUND_NOT_NEEDED);
      assign_r(numer_lower, q_seq_var_lower.get_num(), ROUND_NOT_NEEDED);
      assign_r(denom_lower, q_seq_var_lower.get_den(), ROUND_NOT_NEEDED);
      if (negative_denom)
        neg_assign(denom_lower, denom_lower);
      numer_lower *= pos_denominator;
      seq_var.lower_extend();
    }
    bool open_upper = seq_var.upper_is_open();
    bool unbounded_upper = seq_var.upper_is_boundary_infinity();
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_seq_var_upper; mpq_class& q_seq_var_upper = holder_q_seq_var_upper.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_numer_upper; Coefficient& numer_upper = holder_numer_upper.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_denom_upper; Coefficient& denom_upper = holder_denom_upper.item();
    if (!unbounded_upper) {
      assign_r(q_seq_var_upper, seq_var.upper(), ROUND_NOT_NEEDED);
      assign_r(numer_upper, q_seq_var_upper.get_num(), ROUND_NOT_NEEDED);
      assign_r(denom_upper, q_seq_var_upper.get_den(), ROUND_NOT_NEEDED);
      if (negative_denom)
        neg_assign(denom_upper, denom_upper);
      numer_upper *= pos_denominator;
      seq_var.upper_extend();
    }

    if (!unbounded_lower) {



      Linear_Expression revised_lb_expr(ub_expr);
      revised_lb_expr -= ub_var_coeff * var;
      Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_d; Coefficient& d = holder_d.item();
      neg_assign(d, denom_lower);
      revised_lb_expr *= d;
      revised_lb_expr += numer_lower;



      bool included;
      Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_denom; Coefficient& denom = holder_denom.item();
      if (minimize(revised_lb_expr, numer_lower, denom, included)) {
        denom_lower *= (denom * ub_var_coeff);
        Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
        assign_r(q.get_num(), numer_lower, ROUND_NOT_NEEDED);
        assign_r(q.get_den(), denom_lower, ROUND_NOT_NEEDED);
        q.canonicalize();
        if (!included)
          open_lower = true;
        Relation_Symbol rel;
        if ((ub_var_coeff >= 0) ? !negative_denom : negative_denom)
          rel = open_lower ? GREATER_THAN : GREATER_OR_EQUAL;
        else
          rel = open_lower ? LESS_THAN : LESS_OR_EQUAL;
        seq_var.add_constraint(i_constraint(rel, q));
        if (seq_var.is_empty()) {
          set_empty();
          return;
        }
      }
    }

    if (!unbounded_upper) {



      Linear_Expression revised_ub_expr(lb_expr);
      revised_ub_expr -= lb_var_coeff * var;
      Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_d; Coefficient& d = holder_d.item();
      neg_assign(d, denom_upper);
      revised_ub_expr *= d;
      revised_ub_expr += numer_upper;



      bool included;
      Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_denom; Coefficient& denom = holder_denom.item();
      if (maximize(revised_ub_expr, numer_upper, denom, included)) {
        denom_upper *= (denom * lb_var_coeff);
        Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q; mpq_class& q = holder_q.item();
        assign_r(q.get_num(), numer_upper, ROUND_NOT_NEEDED);
        assign_r(q.get_den(), denom_upper, ROUND_NOT_NEEDED);
        q.canonicalize();
        if (!included)
          open_upper = true;
        Relation_Symbol rel;
        if ((lb_var_coeff >= 0) ? !negative_denom : negative_denom)
          rel = open_upper ? LESS_THAN : LESS_OR_EQUAL;
        else
          rel = open_upper ? GREATER_THAN : GREATER_OR_EQUAL;
        seq_var.add_constraint(i_constraint(rel, q));
        if (seq_var.is_empty()) {
          set_empty();
          return;
        }
      }
    }
  }



  if (lb_var_coeff != ub_var_coeff) {
    if (denominator > 0)
      refine_with_constraint(lb_expr <= ub_expr);
    else
      refine_with_constraint(lb_expr >= ub_expr);
  }

  ((void) 0);
}

template <typename ITV>
void
Box<ITV>
::generalized_affine_image(const Variable var,
                           const Relation_Symbol relsym,
                           const Linear_Expression& expr,
                           Coefficient_traits::const_reference denominator) {

  if (denominator == 0)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)", "d == 0");


  const dimension_type space_dim = space_dimension();


  if (space_dim < expr.space_dimension())
    throw_dimension_incompatible("generalized_affine_image(v, r, e, d)",
                                 "e", expr);

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dim < var_space_dim)
    throw_dimension_incompatible("generalized_affine_image(v, r, e, d)",
                                 "v", var);


  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(v, r, e, d)",
                           "r is the disequality relation symbol");


  affine_image(var, expr, denominator);

  if (relsym == EQUAL)

    return;


  if (is_empty())
    return;

  ITV& seq_var = seq[var.id()];
  switch (relsym) {
  case LESS_OR_EQUAL:
    seq_var.lower_extend();
    break;
  case LESS_THAN:
    seq_var.lower_extend();
    if (!seq_var.upper_is_boundary_infinity())
      seq_var.remove_sup();
    break;
  case GREATER_OR_EQUAL:
    seq_var.upper_extend();
    break;
  case GREATER_THAN:
    seq_var.upper_extend();
    if (!seq_var.lower_is_boundary_infinity())
      seq_var.remove_inf();
    break;
  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>
::generalized_affine_preimage(const Variable var,
                              const Relation_Symbol relsym,
                              const Linear_Expression& expr,
                              Coefficient_traits::const_reference denominator)
{

  if (denominator == 0)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "d == 0");


  const dimension_type space_dim = space_dimension();


  if (space_dim < expr.space_dimension())
    throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)",
                                 "e", expr);

  const dimension_type var_space_dim = var.space_dimension();
  if (space_dim < var_space_dim)
    throw_dimension_incompatible("generalized_affine_preimage(v, r, e, d)",
                                 "v", var);

  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_preimage(v, r, e, d)",
                           "r is the disequality relation symbol");


  if (relsym == EQUAL) {
    affine_preimage(var, expr, denominator);
    return;
  }


  Relation_Symbol reversed_relsym;
  switch (relsym) {
  case LESS_THAN:
    reversed_relsym = GREATER_THAN;
    break;
  case LESS_OR_EQUAL:
    reversed_relsym = GREATER_OR_EQUAL;
    break;
  case GREATER_OR_EQUAL:
    reversed_relsym = LESS_OR_EQUAL;
    break;
  case GREATER_THAN:
    reversed_relsym = LESS_THAN;
    break;
  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }



  const Coefficient& var_coefficient = expr.coefficient(var);
  if (var_coefficient != 0) {
    Linear_Expression inverse_expr
      = expr - (denominator + var_coefficient) * var;
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_inverse_denominator; Parma_Polyhedra_Library::Coefficient& inverse_denominator = holder_inverse_denominator.item();
    neg_assign(inverse_denominator, var_coefficient);
    Relation_Symbol inverse_relsym
      = (sgn(denominator) == sgn(inverse_denominator))
      ? relsym
      : reversed_relsym;
    generalized_affine_image(var, inverse_relsym, inverse_expr,
                             inverse_denominator);
    return;
  }
# 3384 "Box_templates.hh"
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_numer; Coefficient& max_numer = holder_max_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_denom; Coefficient& max_denom = holder_max_denom.item();
  bool max_included;
  bool bound_above = maximize(denominator*var, max_numer, max_denom, max_included);
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_numer; Coefficient& min_numer = holder_min_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_denom; Coefficient& min_denom = holder_min_denom.item();
  bool min_included;
  bool bound_below = minimize(denominator*var, min_numer, min_denom, min_included);

  const Relation_Symbol corrected_relsym
    = (denominator > 0) ? relsym : reversed_relsym;


  Linear_Expression revised_expr;
  Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_d; Parma_Polyhedra_Library::Coefficient& d = holder_d.item();
  if (corrected_relsym == LESS_THAN || corrected_relsym == LESS_OR_EQUAL) {
    if (bound_below) {
      revised_expr = expr;
      revised_expr.set_inhomogeneous_term(Coefficient_zero());
      revised_expr *= d;
    }
  }
  else {
    if (bound_above) {
      revised_expr = expr;
      revised_expr.set_inhomogeneous_term(Coefficient_zero());
      revised_expr *= max_denom;
    }
  }

  switch (corrected_relsym) {
  case LESS_THAN:
    if (bound_below)
      refine_with_constraint(min_numer < revised_expr);
    break;
  case LESS_OR_EQUAL:
    if (bound_below)
      (min_included)
        ? refine_with_constraint(min_numer <= revised_expr)
        : refine_with_constraint(min_numer < revised_expr);
    break;
  case GREATER_OR_EQUAL:
    if (bound_above)
      (max_included)
        ? refine_with_constraint(max_numer >= revised_expr)
        : refine_with_constraint(max_numer > revised_expr);
    break;
  case GREATER_THAN:
    if (bound_above)
      refine_with_constraint(max_numer > revised_expr);
    break;
  default:

    Parma_Polyhedra_Library::ppl_unreachable();
    break;
  }

  if (is_empty())
    return;
  ITV& seq_v = seq[var.id()];
  seq_v.assign(UNIVERSE);
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>
::generalized_affine_image(const Linear_Expression& lhs,
                           const Relation_Symbol relsym,
                           const Linear_Expression& rhs) {



  dimension_type lhs_space_dim = lhs.space_dimension();
  const dimension_type space_dim = space_dimension();
  if (space_dim < lhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e1", lhs);


  const dimension_type rhs_space_dim = rhs.space_dimension();
  if (space_dim < rhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e2", rhs);


  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(e1, r, e2)",
                           "r is the disequality relation symbol");


  if (marked_empty())
    return;


  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_numer; Coefficient& max_numer = holder_max_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_max_denom; Coefficient& max_denom = holder_max_denom.item();
  bool max_included;
  bool max_rhs = maximize(rhs, max_numer, max_denom, max_included);
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_numer; Coefficient& min_numer = holder_min_numer.item();
  Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_min_denom; Coefficient& min_denom = holder_min_denom.item();
  bool min_included;
  bool min_rhs = minimize(rhs, min_numer, min_denom, min_included);





  bool has_var = false;
  dimension_type has_var_id = lhs.last_nonzero();

  if (has_var_id != 0) {
    has_var = true;
    --has_var_id;
    dimension_type other_var = lhs.first_nonzero(1, has_var_id + 1);
    --other_var;
    if (other_var != has_var_id) {


      ITV& seq_var = seq[has_var_id];
      seq_var.assign(UNIVERSE);



      ITV& seq_i = seq[other_var];
      seq_i.assign(UNIVERSE);
      ((void) 0);
      return;
    }
  }

  if (has_var) {

    ITV& seq_var = seq[has_var_id];



    const Coefficient& inhomo = lhs.inhomogeneous_term();
    const Coefficient& coeff = lhs.coefficient(Variable(has_var_id));
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_max; mpq_class& q_max = holder_q_max.item();
    Parma_Polyhedra_Library::Dirty_Temp<mpq_class> holder_q_min; mpq_class& q_min = holder_q_min.item();
    if (max_rhs) {
      max_numer -= inhomo * max_denom;
      max_denom *= coeff;
      assign_r(q_max.get_num(), max_numer, ROUND_NOT_NEEDED);
      assign_r(q_max.get_den(), max_denom, ROUND_NOT_NEEDED);
      q_max.canonicalize();
    }
    if (min_rhs) {
      min_numer -= inhomo * min_denom;
      min_denom *= coeff;
      assign_r(q_min.get_num(), min_numer, ROUND_NOT_NEEDED);
      assign_r(q_min.get_den(), min_denom, ROUND_NOT_NEEDED);
      q_min.canonicalize();
    }



    if (coeff > 0)

      switch (relsym) {
      case LESS_OR_EQUAL:
        if (max_rhs) {
          Relation_Symbol rel = max_included ? LESS_OR_EQUAL : LESS_THAN;
          seq_var.build(i_constraint(rel, q_max));
        }
        else
          seq_var.assign(UNIVERSE);
        break;
      case LESS_THAN:
        if (max_rhs)
          seq_var.build(i_constraint(LESS_THAN, q_max));
        else
          seq_var.assign(UNIVERSE);
        break;
      case EQUAL:
        {
          I_Constraint<mpq_class> l;
          I_Constraint<mpq_class> u;
          if (max_rhs)
            u.set(max_included ? LESS_OR_EQUAL : LESS_THAN, q_max);
          if (min_rhs)
            l.set(min_included ? GREATER_OR_EQUAL : GREATER_THAN, q_min);
          seq_var.build(l, u);
          break;
        }
      case GREATER_OR_EQUAL:
        if (min_rhs) {
          Relation_Symbol rel = min_included ? GREATER_OR_EQUAL : GREATER_THAN;
          seq_var.build(i_constraint(rel, q_min));
        }
        else
          seq_var.assign(UNIVERSE);
        break;
      case GREATER_THAN:
        if (min_rhs)
          seq_var.build(i_constraint(GREATER_THAN, q_min));
        else
          seq_var.assign(UNIVERSE);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }
    else

      switch (relsym) {
      case GREATER_OR_EQUAL:
        if (min_rhs) {
          Relation_Symbol rel = min_included ? LESS_OR_EQUAL : LESS_THAN;
          seq_var.build(i_constraint(rel, q_min));
        }
        else
          seq_var.assign(UNIVERSE);
        break;
      case GREATER_THAN:
        if (min_rhs)
          seq_var.build(i_constraint(LESS_THAN, q_min));
        else
          seq_var.assign(UNIVERSE);
        break;
      case EQUAL:
        {
          I_Constraint<mpq_class> l;
          I_Constraint<mpq_class> u;
          if (max_rhs)
            l.set(max_included ? GREATER_OR_EQUAL : GREATER_THAN, q_max);
          if (min_rhs)
            u.set(min_included ? LESS_OR_EQUAL : LESS_THAN, q_min);
          seq_var.build(l, u);
          break;
        }
      case LESS_OR_EQUAL:
        if (max_rhs) {
          Relation_Symbol rel = max_included ? GREATER_OR_EQUAL : GREATER_THAN;
          seq_var.build(i_constraint(rel, q_max));
        }
        else
          seq_var.assign(UNIVERSE);
        break;
      case LESS_THAN:
        if (max_rhs)
          seq_var.build(i_constraint(GREATER_THAN, q_max));
        else
          seq_var.assign(UNIVERSE);
        break;
      default:

        Parma_Polyhedra_Library::ppl_unreachable();
        break;
      }
  }

  else {


    const Coefficient& inhomo = lhs.inhomogeneous_term();
    switch (relsym) {
    case LESS_THAN:
      refine_with_constraint(inhomo < rhs);
      break;
    case LESS_OR_EQUAL:
      refine_with_constraint(inhomo <= rhs);
      break;
    case EQUAL:
      refine_with_constraint(inhomo == rhs);
      break;
    case GREATER_OR_EQUAL:
      refine_with_constraint(inhomo >= rhs);
      break;
    case GREATER_THAN:
      refine_with_constraint(inhomo > rhs);
      break;
    default:

      Parma_Polyhedra_Library::ppl_unreachable();
      break;
    }
  }
  ((void) 0);
}

template <typename ITV>
void
Box<ITV>::generalized_affine_preimage(const Linear_Expression& lhs,
                                      const Relation_Symbol relsym,
                                      const Linear_Expression& rhs) {



  dimension_type lhs_space_dim = lhs.space_dimension();
  const dimension_type space_dim = space_dimension();
  if (space_dim < lhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e1", lhs);


  const dimension_type rhs_space_dim = rhs.space_dimension();
  if (space_dim < rhs_space_dim)
    throw_dimension_incompatible("generalized_affine_image(e1, r, e2)",
                                 "e2", rhs);


  if (relsym == NOT_EQUAL)
    throw_invalid_argument("generalized_affine_image(e1, r, e2)",
                           "r is the disequality relation symbol");


  if (marked_empty())
    return;




  Linear_Expression revised_lhs = lhs;
  Linear_Expression revised_rhs = rhs;
  for (Linear_Expression::const_iterator i = lhs.begin(),
         i_end = lhs.end(); i != i_end; ++i) {
    const Variable var = i.variable();
    Parma_Polyhedra_Library::Dirty_Temp<Parma_Polyhedra_Library::Coefficient> holder_tmp; Parma_Polyhedra_Library::Coefficient& tmp = holder_tmp.item();
    tmp = *i;
    tmp += rhs.coefficient(var);
    sub_mul_assign(revised_rhs, tmp, var);
    sub_mul_assign(revised_lhs, tmp, var);
  }
  generalized_affine_image(revised_lhs, relsym, revised_rhs);
  ((void) 0);
}

template <typename ITV>
template <typename T, typename Iterator>
typename Enable_If<Is_Same<T, Box<ITV> >::value
                   && Is_Same_Or_Derived<Interval_Base, ITV>::value,
                   void>::type
Box<ITV>::CC76_widening_assign(const T& y, Iterator first, Iterator last) {
  if (y.is_empty())
    return;

  for (dimension_type i = seq.size(); i-- > 0; )
    seq[i].CC76_widening_assign(y.seq[i], first, last);

  ((void) 0);
}

template <typename ITV>
template <typename T>
typename Enable_If<Is_Same<T, Box<ITV> >::value
                   && Is_Same_Or_Derived<Interval_Base, ITV>::value,
                   void>::type
Box<ITV>::CC76_widening_assign(const T& y, unsigned* tp) {
  static typename ITV::boundary_type stop_points[] = {
    typename ITV::boundary_type(-2),
    typename ITV::boundary_type(-1),
    typename ITV::boundary_type(0),
    typename ITV::boundary_type(1),
    typename ITV::boundary_type(2)
  };

  Box& x = *this;

  if (tp != 0 && *tp > 0) {
    Box<ITV> x_tmp(x);
    x_tmp.CC76_widening_assign(y, 0);

    if (!x.contains(x_tmp))
      --(*tp);
    return;
  }
  x.CC76_widening_assign(y,
                         stop_points,
                         stop_points
                         + sizeof(stop_points)/sizeof(stop_points[0]));
}

template <typename ITV>
void
Box<ITV>::get_limiting_box(const Constraint_System& cs,
                           Box& limiting_box) const {

  ((void) 0);

  for (Constraint_System::const_iterator cs_i = cs.begin(),
         cs_end = cs.end(); cs_i != cs_end; ++cs_i) {
    const Constraint& c = *cs_i;
    dimension_type c_num_vars = 0;
    dimension_type c_only_var = 0;

    if (!Box_Helpers::extract_interval_constraint(c, c_num_vars, c_only_var))
      continue;

    if (c_num_vars != 0) {


      const Coefficient& n = c.inhomogeneous_term();
      const Coefficient& d = c.coefficient(Variable(c_only_var));
      if (interval_relation(seq[c_only_var], c.type(), n, d)
          == Poly_Con_Relation::is_included())
        limiting_box.add_interval_constraint_no_check(c_only_var, c.type(),
                                                      n, d);
    }
  }
}

template <typename ITV>
void
Box<ITV>::limited_CC76_extrapolation_assign(const Box& y,
                                            const Constraint_System& cs,
                                            unsigned* tp) {
  Box& x = *this;
  const dimension_type space_dim = x.space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("limited_CC76_extrapolation_assign(y, cs)",
                                 y);

  const dimension_type cs_space_dim = cs.space_dimension();
  if (space_dim < cs_space_dim)
    throw_constraint_incompatible("limited_CC76_extrapolation_assign(y, cs)");



  if (space_dim == 0)
    return;


  ((void) 0);


  if (marked_empty())
    return;

  if (y.marked_empty())
    return;



  Box limiting_box(space_dim, UNIVERSE);
  get_limiting_box(cs, limiting_box);

  x.CC76_widening_assign(y, tp);


  intersection_assign(limiting_box);
}

template <typename ITV>
template <typename T>
typename Enable_If<Is_Same<T, Box<ITV> >::value
                   && Is_Same_Or_Derived<Interval_Base, ITV>::value,
                   void>::type
Box<ITV>::CC76_narrowing_assign(const T& y) {
  const dimension_type space_dim = space_dimension();


  if (space_dim != y.space_dimension())
    throw_dimension_incompatible("CC76_narrowing_assign(y)", y);


  ((void) 0);



  if (space_dim == 0)
    return;


  if (y.is_empty())
    return;

  if (is_empty())
    return;



  for (dimension_type i = space_dim; i-- > 0; ) {
    ITV& x_i = seq[i];
    const ITV& y_i = y.seq[i];
    if (!x_i.lower_is_boundary_infinity()
        && !y_i.lower_is_boundary_infinity()
        && x_i.lower() != y_i.lower())
      x_i.lower() = y_i.lower();
    if (!x_i.upper_is_boundary_infinity()
        && !y_i.upper_is_boundary_infinity()
        && x_i.upper() != y_i.upper())
      x_i.upper() = y_i.upper();
  }
  ((void) 0);
}

template <typename ITV>
Constraint_System
Box<ITV>::constraints() const {
  const dimension_type space_dim = space_dimension();
  Constraint_System cs;
  cs.set_space_dimension(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cs = Constraint_System::zero_dim_empty();
    return cs;
  }

  if (marked_empty()) {
    cs.insert(Constraint::zero_dim_false());
    return cs;
  }

  for (dimension_type k = 0; k < space_dim; ++k) {
    const Variable v_k = Variable(k);
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_n; Coefficient& n = holder_n.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_d; Coefficient& d = holder_d.item();
    bool closed = false;
    if (has_lower_bound(v_k, n, d, closed)) {
      if (closed)
        cs.insert(d * v_k >= n);
      else
        cs.insert(d * v_k > n);
    }
    if (has_upper_bound(v_k, n, d, closed)) {
      if (closed)
        cs.insert(d * v_k <= n);
      else
        cs.insert(d * v_k < n);
    }
  }
  return cs;
}

template <typename ITV>
Constraint_System
Box<ITV>::minimized_constraints() const {
  const dimension_type space_dim = space_dimension();
  Constraint_System cs;
  cs.set_space_dimension(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cs = Constraint_System::zero_dim_empty();
    return cs;
  }


  if (is_empty()) {
    cs.insert(Constraint::zero_dim_false());
    return cs;
  }

  for (dimension_type k = 0; k < space_dim; ++k) {
    const Variable v_k = Variable(k);
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_n; Coefficient& n = holder_n.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_d; Coefficient& d = holder_d.item();
    bool closed = false;
    if (has_lower_bound(v_k, n, d, closed)) {
      if (closed)

        if (seq[k].is_singleton()) {
          cs.insert(d * v_k == n);
          continue;
        }
        else
          cs.insert(d * v_k >= n);
      else
        cs.insert(d * v_k > n);
    }
    if (has_upper_bound(v_k, n, d, closed)) {
      if (closed)
        cs.insert(d * v_k <= n);
      else
        cs.insert(d * v_k < n);
    }
  }
  return cs;
}

template <typename ITV>
Congruence_System
Box<ITV>::congruences() const {
  const dimension_type space_dim = space_dimension();
  Congruence_System cgs(space_dim);

  if (space_dim == 0) {
    if (marked_empty())
      cgs = Congruence_System::zero_dim_empty();
    return cgs;
  }


  if (is_empty()) {
    cgs.insert(Congruence::zero_dim_false());
    return cgs;
  }

  for (dimension_type k = 0; k < space_dim; ++k) {
    const Variable v_k = Variable(k);
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_n; Coefficient& n = holder_n.item();
    Parma_Polyhedra_Library::Dirty_Temp<Coefficient> holder_d; Coefficient& d = holder_d.item();
    bool closed = false;
    if (has_lower_bound(v_k, n, d, closed) && closed)

      if (seq[k].is_singleton())
        cgs.insert((d * v_k %= n) / 0);
  }
  return cgs;
}

template <typename ITV>
memory_size_type
Box<ITV>::external_memory_in_bytes() const {
  memory_size_type n = seq.capacity() * sizeof(ITV);
  for (dimension_type k = seq.size(); k-- > 0; )
    n += seq[k].external_memory_in_bytes();
  return n;
}


template <typename ITV>
std::ostream&
IO_Operators::operator<<(std::ostream& s, const Box<ITV>& box) {
  if (box.is_empty())
    s << "false";
  else if (box.is_universe())
    s << "true";
  else
    for (dimension_type k = 0,
           space_dim = box.space_dimension(); k < space_dim; ) {
      s << Variable(k) << " in " << box[k];
      ++k;
      if (k < space_dim)
        s << ", ";
      else
        break;
    }
  return s;
}

template <typename ITV>
void
Box<ITV>::ascii_dump(std::ostream& s) const {
  const char separator = ' ';
  status.ascii_dump(s);
  const dimension_type space_dim = space_dimension();
  s << "space_dim" << separator << space_dim;
  s << "\n";
  for (dimension_type i = 0; i < space_dim; ++i)
    seq[i].ascii_dump(s);
}

template <typename ITV> void Box<ITV>::ascii_dump() const { ascii_dump(std::cerr); } template <typename ITV> void Box<ITV>::print() const { using IO_Operators::operator<<; std::cerr << *this; }

template <typename ITV>
bool
Box<ITV>::ascii_load(std::istream& s) {
  if (!status.ascii_load(s))
    return false;

  std::string str;
  dimension_type space_dim;
  if (!(s >> str) || str != "space_dim")
    return false;
  if (!(s >> space_dim))
    return false;

  seq.clear();
  ITV seq_i;
  for (dimension_type i = 0; i < space_dim; ++i) {
    if (seq_i.ascii_load(s))
      seq.push_back(seq_i);
    else
      return false;
  }


  ((void) 0);
  return true;
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const Box& y) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << this->space_dimension()
    << ", y->space_dimension() == " << y.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>
::throw_dimension_incompatible(const char* method,
                               dimension_type required_dim) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", required dimension == " << required_dim << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const Constraint& c) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", c->space_dimension == " << c.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const Congruence& cg) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", cg->space_dimension == " << cg.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const Constraint_System& cs) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", cs->space_dimension == " << cs.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const Congruence_System& cgs) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", cgs->space_dimension == " << cgs.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const Generator& g) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", g->space_dimension == " << g.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_constraint_incompatible(const char* method) {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "the constraint is incompatible.";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_expression_too_complex(const char* method,
                                       const Linear_Expression& le) {
  using namespace IO_Operators;
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << le << " is too complex.";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const char* le_name,
                                       const Linear_Expression& le) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << "this->space_dimension() == " << space_dimension()
    << ", " << le_name << "->space_dimension() == "
    << le.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
template <typename C>
void
Box<ITV>::throw_dimension_incompatible(const char* method,
                                       const char* lf_name,
                                       const Linear_Form<C>& lf) const {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":\n"
    << "this->space_dimension() == " << space_dimension()
    << ", " << lf_name << "->space_dimension() == "
    << lf.space_dimension() << ".";
  throw std::invalid_argument(s.str());
}

template <typename ITV>
void
Box<ITV>::throw_invalid_argument(const char* method, const char* reason) {
  std::ostringstream s;
  s << "PPL::Box::" << method << ":" << std::endl
    << reason;
  throw std::invalid_argument(s.str());
}




template <typename Specialization,
          typename Temp, typename To, typename ITV>
bool
l_m_distance_assign(Checked_Number<To, Extended_Number_Policy>& r,
                    const Box<ITV>& x, const Box<ITV>& y,
                    const Rounding_Dir dir,
                    Temp& tmp0, Temp& tmp1, Temp& tmp2) {
  const dimension_type x_space_dim = x.space_dimension();

  if (x_space_dim != y.space_dimension())
    return false;


  if (x_space_dim == 0) {
    if (x.marked_empty() == y.marked_empty())
      assign_r(r, 0, ROUND_NOT_NEEDED);
    else
      assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
    return true;
  }


  (void) x.is_empty();
  (void) y.is_empty();


  if (x.marked_empty() || y.marked_empty()) {
    if (x.marked_empty() == y.marked_empty()) {
      assign_r(r, 0, ROUND_NOT_NEEDED);
      return true;
    }
    else
      goto pinf;
  }

  assign_r(tmp0, 0, ROUND_NOT_NEEDED);
  for (dimension_type i = x_space_dim; i-- > 0; ) {
    const ITV& x_i = x.seq[i];
    const ITV& y_i = y.seq[i];

    if (x_i.lower_is_boundary_infinity()) {
      if (!y_i.lower_is_boundary_infinity())
        goto pinf;
    }
    else if (y_i.lower_is_boundary_infinity())
      goto pinf;
    else {
      const Temp* tmp1p;
      const Temp* tmp2p;
      if (x_i.lower() > y_i.lower()) {
        maybe_assign(tmp1p, tmp1, x_i.lower(), dir);
        maybe_assign(tmp2p, tmp2, y_i.lower(), inverse(dir));
      }
      else {
        maybe_assign(tmp1p, tmp1, y_i.lower(), dir);
        maybe_assign(tmp2p, tmp2, x_i.lower(), inverse(dir));
      }
      sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
      ((void) 0);
      Specialization::combine(tmp0, tmp1, dir);
    }

    if (x_i.upper_is_boundary_infinity())
      if (y_i.upper_is_boundary_infinity())
        continue;
      else
        goto pinf;
    else if (y_i.upper_is_boundary_infinity())
      goto pinf;
    else {
      const Temp* tmp1p;
      const Temp* tmp2p;
      if (x_i.upper() > y_i.upper()) {
        maybe_assign(tmp1p, tmp1, x_i.upper(), dir);
        maybe_assign(tmp2p, tmp2, y_i.upper(), inverse(dir));
      }
      else {
        maybe_assign(tmp1p, tmp1, y_i.upper(), dir);
        maybe_assign(tmp2p, tmp2, x_i.upper(), inverse(dir));
      }
      sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
      ((void) 0);
      Specialization::combine(tmp0, tmp1, dir);
    }
  }
  Specialization::finalize(tmp0, dir);
  assign_r(r, tmp0, dir);
  return true;

 pinf:
  assign_r(r, PLUS_INFINITY, ROUND_NOT_NEEDED);
  return true;
}

}
# 2285 "Box_defs.hh" 2
# 26 "Box.cc" 2

namespace PPL = Parma_Polyhedra_Library;

bool
PPL::Box_Helpers::extract_interval_constraint(const Constraint& c,
                                              dimension_type& c_num_vars,
                                              dimension_type& c_only_var) {

  ((void) 0);

  c_only_var = c.expression().first_nonzero(1, c.space_dimension() + 1);
  if (c_only_var == c.space_dimension() + 1)

    return true;

  ++c_num_vars;
  --c_only_var;
  return c.expression().all_zeroes(c_only_var + 2, c.space_dimension() + 1);
}

bool
PPL::Box_Helpers::extract_interval_congruence(const Congruence& cg,
                                              dimension_type& cg_num_vars,
                                              dimension_type& cg_only_var) {

  ((void) 0);

  ((void) 0);

  cg_only_var = cg.expression().first_nonzero(1, cg.space_dimension() + 1);
  if (cg_only_var == cg.space_dimension() + 1)

    return true;

  ++cg_num_vars;
  --cg_only_var;
  return cg.expression().all_zeroes(cg_only_var + 2, cg.space_dimension() + 1);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qzaida.vcf
Type: text/x-vcard
Size: 466 bytes
Desc: not available
URL: <http://www.cs.unipr.it/pipermail/ppl-devel/attachments/20130405/6a12d155/attachment.vcf>


More information about the PPL-devel mailing list