public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* preprocessor/5034: Internal compiler error in gcc-2.95.4, but gcc-3.0 gives syntax errors
@ 2001-12-06  5:56 Scott Hawley
  0 siblings, 0 replies; only message in thread
From: Scott Hawley @ 2001-12-06  5:56 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc


>Number:         5034
>Category:       preprocessor
>Synopsis:       Internal compiler error in gcc-2.95.4.  gcc-3.0 gives syntax errors
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 06 05:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Scott Hawley
>Release:        3.0.2 (Debian) (Debian testing/unstable)
>Organization:
Albert Einstein Institute
>Environment:
System: Linux ockham 2.4.9 #7 Thu Sep 13 15:40:55 CEST 2001 i686 unknown
Architecture: i686

	
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
  When I compile my C++ code (ACEDistribution.cpp, or any of several related
files) using gcc 2.95.4, I get this message: 

ACEDistribution.cpp: In method `ACEDistribution::ACEDistribution(int, BBoxList &)':
ACEDistribution.cpp:30: Internal compiler error.
ACEDistribution.cpp:30: Please submit a full bug report.
ACEDistribution.cpp:30: Internal compiler error:
ACEDistribution.cpp:30: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

When I compile it under gcc 3.0.2, I get many error messages that sya
"syntax error before & token".  Many of these errors are related to typedefs
that use things like istream and ostream from
iostream.h (or "iostream" in the new ISO C++).  

This was valid code under gcc 2.95.   I understand that you've adopted the
ISO standard for 3.0, but... I should still be able to compile my existing 
code somehow, right?  I notice that there appears to be some attempt towards
backwards-compatibility in that the header files gcc-3.0 is using are in
some /usr/include/g++-v3/backward/, but this is apparently not having the
desired effect..


>How-To-Repeat:
  Here is my preprocessor file, generated (using gcc-2.95.4) via

c++ -E -I. -I../include -I/home/shawley/autoconf/bbh_grace/include  -I/usr/local/include  -I/usr/include/mpi  -I/home/shawley/include -DLINUX -DIO_RNPLIO  -DSTDC_HEADERS=1 -DHAVE_STRDUP=1 -DHAVE_ATEXIT=1   -DHAVE_LIBNETCDF=1 -DHAVE_LIBDF=1 -DHAVE_HDF=1 -DHAVE_LIBVS=1 -DHAVE_LIBSV=1 -DHAVE_LIBMPI=1 -DACE_REUSE_GDB -DDEBUG_PRINT -DACE_WRITEBOXES -DDEBUG_PRINT_GD_FILL   ACEDistribution.cpp > ACEDistribution.i 


# 1 "ACEDistribution.cpp"
 









# 1 "ACEDistribution.h" 1



 









# 1 "ACEParams.h" 1



 










 
# 1 "/usr/include/stdlib.h" 1 3
 

















 





# 1 "/usr/include/features.h" 1 3
 




















 






























































 




















 





 



 







 
# 142 "/usr/include/features.h" 3


 









 








 



























# 208 "/usr/include/features.h" 3


































 



 


 








 




 
















 


# 1 "/usr/include/sys/cdefs.h" 1 3
 




















 




 






 





 








 



# 65 "/usr/include/sys/cdefs.h" 3


 





 




 









 







 

















 















 







 






 








 








 








 











 










 







 




 


















# 283 "/usr/include/features.h" 2 3



 








 





 

 








# 1 "/usr/include/gnu/stubs.h" 1 3
 



















# 312 "/usr/include/features.h" 2 3




# 25 "/usr/include/stdlib.h" 2 3


 





# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


































typedef unsigned int size_t;






















 




 





























 












































# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 33 "/usr/include/stdlib.h" 2 3


extern "C" { 




# 91 "/usr/include/stdlib.h" 3


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

 

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



# 118 "/usr/include/stdlib.h" 3



 



 





 

extern size_t __ctype_get_mb_cur_max (void) throw () ;


 
extern double atof (__const char *__nptr) throw ()   ;
 
extern int atoi (__const char *__nptr) throw ()   ;
 
extern long int atol (__const char *__nptr) throw ()   ;


 
__extension__ extern long long int atoll (__const char *__nptr)
     throw ()   ;


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










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


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



 

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



# 244 "/usr/include/stdlib.h" 3



 


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

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



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




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



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




# 377 "/usr/include/stdlib.h" 3




 


extern char *l64a (long int __n) throw () ;

 
extern long int a64l (__const char *__s) throw ()   ;


# 1 "/usr/include/sys/types.h" 1 3
 

















 








extern "C" { 

# 1 "/usr/include/bits/types.h" 1 3
 

















 









# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 29 "/usr/include/bits/types.h" 2 3


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

__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
# 48 "/usr/include/bits/types.h" 3

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;

typedef __quad_t *__qaddr_t;

typedef __u_quad_t __dev_t;		 
typedef __u_int __uid_t;		 
typedef __u_int __gid_t;		 
typedef __u_long __ino_t;		 
typedef __u_int __mode_t;		 
typedef __u_int __nlink_t; 		 
typedef long int __off_t;		 
typedef __quad_t __loff_t;		 
typedef int __pid_t;			 
typedef int __ssize_t;			 
typedef __u_long __rlim_t;		 
typedef __u_quad_t __rlim64_t;		 
typedef __u_int __id_t;			 

typedef struct
  {
    int __val[2];
  } __fsid_t;				 

 
typedef int __daddr_t;			 
typedef char *__caddr_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __swblk_t;		 
\f
typedef long int __clock_t;

 
typedef int __clockid_t;

 
typedef int __timer_t;


 



typedef int __key_t;

 
typedef unsigned short int __ipc_pid_t;


 
typedef long int __blksize_t;

 

 
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;

 
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;

 
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;

 
typedef __u_quad_t __ino64_t;

 
typedef __loff_t __off64_t;

 
typedef long int __t_scalar_t;
typedef unsigned long int __t_uscalar_t;

 
typedef int __intptr_t;

 
typedef unsigned int __socklen_t;


 

# 1 "/usr/include/bits/pthreadtypes.h" 1 3
 
 
 
 
 
 
 
 
 
 
 
 
 









# 1 "/usr/include/bits/sched.h" 1 3
 



















# 62 "/usr/include/bits/sched.h" 3





 
struct __sched_param
  {
    int __sched_priority;
  };


# 23 "/usr/include/bits/pthreadtypes.h" 2 3


 
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;


 
typedef struct
{
  struct _pthread_fastlock __c_lock;  
  _pthread_descr __c_waiting;         
} 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;


# 117 "/usr/include/bits/pthreadtypes.h" 3


# 136 "/usr/include/bits/pthreadtypes.h" 3



 
typedef unsigned long int pthread_t;


# 143 "/usr/include/bits/types.h" 2 3




# 30 "/usr/include/sys/types.h" 2 3




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 __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;





typedef __off_t off_t;











typedef __pid_t pid_t;




typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;









# 1 "/usr/include/time.h" 1 3
 

















 














# 51 "/usr/include/time.h" 3


# 61 "/usr/include/time.h" 3








 
typedef __time_t time_t;










 
typedef __clockid_t clockid_t;










 
typedef __timer_t timer_t;





# 112 "/usr/include/time.h" 3




# 364 "/usr/include/time.h" 3



# 132 "/usr/include/sys/types.h" 2 3


# 143 "/usr/include/sys/types.h" 3



# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 146 "/usr/include/sys/types.h" 2 3



 
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;


 

# 180 "/usr/include/sys/types.h" 3


 







typedef int int8_t __attribute__ ((__mode__ (  __QI__ ))) ;
typedef int int16_t __attribute__ ((__mode__ (  __HI__ ))) ;
typedef int int32_t __attribute__ ((__mode__ (  __SI__ ))) ;
typedef int int64_t __attribute__ ((__mode__ (  __DI__ ))) ;


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__)));


 






 
# 1 "/usr/include/endian.h" 1 3
 






















 











 
# 1 "/usr/include/bits/endian.h" 1 3
 






# 37 "/usr/include/endian.h" 2 3


 



















# 212 "/usr/include/sys/types.h" 2 3


 
# 1 "/usr/include/sys/select.h" 1 3
 


















 






 


 
# 1 "/usr/include/bits/select.h" 1 3
 

























# 36 "/usr/include/bits/select.h" 3












# 56 "/usr/include/bits/select.h" 3

# 72 "/usr/include/bits/select.h" 3

# 31 "/usr/include/sys/select.h" 2 3


 
# 1 "/usr/include/bits/sigset.h" 1 3
 





















typedef int __sig_atomic_t;

 


typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int))) ];
  } __sigset_t;




 





# 125 "/usr/include/bits/sigset.h" 3

# 34 "/usr/include/sys/select.h" 2 3




typedef __sigset_t sigset_t;


 


# 1 "/usr/include/time.h" 1 3
 

















 














# 51 "/usr/include/time.h" 3


# 61 "/usr/include/time.h" 3



# 72 "/usr/include/time.h" 3



# 84 "/usr/include/time.h" 3



# 96 "/usr/include/time.h" 3








 

struct timespec
  {
    __time_t tv_sec;		 
    long int tv_nsec;		 
  };





# 364 "/usr/include/time.h" 3



# 44 "/usr/include/sys/select.h" 2 3


# 1 "/usr/include/bits/time.h" 1 3
 


















 



# 57 "/usr/include/bits/time.h" 3








 

struct timeval
  {
    __time_t tv_sec;		 
    __suseconds_t tv_usec;	 
  };


# 46 "/usr/include/sys/select.h" 2 3



typedef __suseconds_t suseconds_t;




 
typedef long int __fd_mask;

 




 
typedef struct
  {
     





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


  } fd_set;

 



 
typedef __fd_mask fd_mask;

 




 






extern "C" { 

 




extern int select (int __nfds, fd_set *__restrict __readfds,
		   fd_set *__restrict __writefds,
		   fd_set *__restrict __exceptfds,
		   struct timeval *__restrict __timeout) throw () ;

# 116 "/usr/include/sys/select.h" 3


} 


# 215 "/usr/include/sys/types.h" 2 3


 
# 1 "/usr/include/sys/sysmacros.h" 1 3
 





















 








# 47 "/usr/include/sys/sysmacros.h" 3



# 218 "/usr/include/sys/types.h" 2 3









 


typedef __blkcnt_t blkcnt_t;	  



typedef __fsblkcnt_t fsblkcnt_t;  



typedef __fsfilcnt_t fsfilcnt_t;  


# 254 "/usr/include/sys/types.h" 3








} 


# 390 "/usr/include/stdlib.h" 2 3


 



 
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 () ;

 

extern char *setstate (char *__statebuf) throw () ;



 



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 () ;

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

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

extern int setstate_r (char *__restrict __statebuf,
		       struct random_data *__restrict __buf) throw () ;




 
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 () ;

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

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

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


 


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 () ;
extern int erand48_r (unsigned short int __xsubi[3],
		      struct drand48_data *__restrict __buffer,
		      double *__restrict __result) throw () ;

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

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

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

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

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







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



 

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


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



# 1 "/usr/include/alloca.h" 1 3
 























# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 25 "/usr/include/alloca.h" 2 3


extern "C" { 

 


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





} 


# 546 "/usr/include/stdlib.h" 2 3




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








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


 
extern int atexit (void (*__func) (void)) throw () ;


 

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


 


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








 
extern char *getenv (__const char *__name) throw () ;

 

extern char *__secure_getenv (__const char *__name) throw () ;


 
 

extern int putenv (char *__string) throw () ;



 

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

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



 


extern int clearenv (void) throw () ;




 



extern char *mktemp (char *__template) throw () ;

 





extern int mkstemp (char *__template) throw () ;













 




extern char *mkdtemp (char *__template) throw () ;



 
extern int system (__const char *__command) throw () ;










 





extern char *realpath (__const char *__restrict __name,
		       char *__restrict __resolved) throw () ;



 


typedef int (*__compar_fn_t) (__const void *, __const void *);






 

extern void *bsearch (__const void *__key, __const void *__base,
		      size_t __nmemb, size_t __size, __compar_fn_t __compar);

 

extern void qsort (void *__base, size_t __nmemb, size_t __size,
		   __compar_fn_t __compar);


 
extern int abs (int __x) throw ()  __attribute__ ((__const__));
extern long int labs (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__));








 


 


extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
		   int *__restrict __sign) throw () ;

 


extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
		   int *__restrict __sign) throw () ;

 


extern char *gcvt (double __value, int __ndigit, char *__buf) throw () ;



 
extern char *qecvt (long double __value, int __ndigit,
		    int *__restrict __decpt, int *__restrict __sign) throw () ;
extern char *qfcvt (long double __value, int __ndigit,
		    int *__restrict __decpt, int *__restrict __sign) throw () ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf) throw () ;


 

extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
		   int *__restrict __sign, char *__restrict __buf,
		   size_t __len) throw () ;
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
		   int *__restrict __sign, char *__restrict __buf,
		   size_t __len) throw () ;

extern int qecvt_r (long double __value, int __ndigit,
		    int *__restrict __decpt, int *__restrict __sign,
		    char *__restrict __buf, size_t __len) throw () ;
extern int qfcvt_r (long double __value, int __ndigit,
		    int *__restrict __decpt, int *__restrict __sign,
		    char *__restrict __buf, size_t __len) throw () ;




 

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 () ;



# 811 "/usr/include/stdlib.h" 3









 






# 842 "/usr/include/stdlib.h" 3


# 852 "/usr/include/stdlib.h" 3



 


extern int getloadavg (double __loadavg[], int __nelem) throw () ;





} 


# 16 "ACEParams.h" 2

# 1 "/usr/include/stdio.h" 1 3
 


















 









extern "C" { 



# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 34 "/usr/include/stdio.h" 2 3










 
typedef struct _IO_FILE FILE;








 
typedef struct _IO_FILE __FILE;









# 1 "/usr/include/libio.h" 1 3
 






























# 1 "/usr/include/_G_config.h" 1 3
 





 






# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 


# 269 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3











typedef unsigned int  wint_t;




 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 14 "/usr/include/_G_config.h" 2 3










# 1 "/usr/include/wchar.h" 1 3
 

















 











# 46 "/usr/include/wchar.h" 3


# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 190 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3














 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 48 "/usr/include/wchar.h" 2 3


# 1 "/usr/include/bits/wchar.h" 1 3
 

























# 50 "/usr/include/wchar.h" 2 3


 













 
typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    char __wchb[4];
  } __value;		 
} __mbstate_t;




 

# 682 "/usr/include/wchar.h" 3



# 24 "/usr/include/_G_config.h" 2 3


typedef struct
{
  __off_t __pos;
  __mbstate_t __state;
} _G_fpos_t;
typedef struct
{
  __off64_t __pos;
  __mbstate_t __state;
} _G_fpos64_t;








# 1 "/usr/include/gconv.h" 1 3
 

















 








# 1 "/usr/include/wchar.h" 1 3
 

















 











# 46 "/usr/include/wchar.h" 3


# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 190 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3














 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 48 "/usr/include/wchar.h" 2 3




 











# 76 "/usr/include/wchar.h" 3




 

# 682 "/usr/include/wchar.h" 3



# 28 "/usr/include/gconv.h" 2 3



# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 


# 269 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 31 "/usr/include/gconv.h" 2 3


 


 
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 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_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 [0] ;
} *__gconv_t;


# 44 "/usr/include/_G_config.h" 2 3

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__)));




 


















 




 














# 32 "/usr/include/libio.h" 2 3

 

















 

# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h" 1 3
 
































































 






typedef void *__gnuc_va_list;



 

# 122 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h" 3




















# 209 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h" 3




# 53 "/usr/include/libio.h" 2 3







# 72 "/usr/include/libio.h" 3


 

















# 103 "/usr/include/libio.h" 3











 

























 



















struct _IO_jump_t;  struct _IO_FILE;

 







typedef void _IO_lock_t;



 

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

   
  int _pos;
# 192 "/usr/include/libio.h" 3

};

 
enum __codecvt_result
{
  __codecvt_ok,
  __codecvt_partial,
  __codecvt_error,
  __codecvt_noconv
};

# 259 "/usr/include/libio.h" 3


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 _blksize;
  __off_t   _old_offset;  


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

   

  _IO_lock_t *_lock;








  __off64_t   _offset;





  void *__pad1;
  void *__pad2;

  int _mode;
   
  char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];

};





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_;











 

 

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);


# 389 "/usr/include/libio.h" 3




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 () ;
























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 () ;
















extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
			__gnuc_va_list , int *__restrict) throw () ;
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
			 __gnuc_va_list ) throw () ;
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 () ;

# 511 "/usr/include/libio.h" 3



}



# 65 "/usr/include/stdio.h" 2 3


# 76 "/usr/include/stdio.h" 3


 

typedef _G_fpos_t fpos_t;







 





 





 






 







 




 








# 1 "/usr/include/bits/stdio_lim.h" 1 3
 








































# 129 "/usr/include/stdio.h" 2 3



 
extern FILE *stdin;		 
extern FILE *stdout;		 
extern FILE *stderr;		 
 




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


 

extern FILE *tmpfile (void) throw () ;










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


 

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




 






extern char *tempnam (__const char *__dir, __const char *__pfx)
     throw ()   ;



 
extern int fclose (FILE *__stream) throw () ;
 
extern int fflush (FILE *__stream) throw () ;


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









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










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


# 249 "/usr/include/stdio.h" 3



 

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, ...) throw () ;
 
extern int printf (__const char *__restrict __format, ...) throw () ;
 
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) throw () ;
 
extern int vprintf (__const char *__restrict __format, __gnuc_va_list  __arg)
     throw () ;
 
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)));


# 321 "/usr/include/stdio.h" 3



 
extern int fscanf (FILE *__restrict __stream,
		   __const char *__restrict __format, ...) throw () ;
 
extern int scanf (__const char *__restrict __format, ...) throw () ;
 
extern int sscanf (__const char *__restrict __s,
		   __const char *__restrict __format, ...) throw () ;

# 347 "/usr/include/stdio.h" 3



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

 
extern int getchar (void) throw () ;

 




 
extern int getc_unlocked (FILE *__stream) throw () ;
extern int getchar_unlocked (void) throw () ;



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



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

 
extern int putchar (int __c) throw () ;

 




 
extern int fputc_unlocked (int __c, FILE *__stream) throw () ;



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




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

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



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







 

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


# 437 "/usr/include/stdio.h" 3



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







 
extern int puts (__const char *__s) throw () ;


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


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


 
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
			      size_t __n, FILE *__restrict __stream) throw () ;
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
			       size_t __n, FILE *__restrict __stream) throw () ;



 
extern int fseek (FILE *__stream, long int __off, int __whence) throw () ;
 
extern long int ftell (FILE *__stream) throw () ;
 
extern void rewind (FILE *__stream) throw () ;

 












 
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos)
     throw () ;
 
extern int fsetpos (FILE *__stream, __const fpos_t *__pos) throw () ;
# 520 "/usr/include/stdio.h" 3










 
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) throw () ;

 


extern int sys_nerr;
extern __const char *__const sys_errlist[];








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



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





 
extern FILE *popen (__const char *__command, __const char *__modes) throw () ;

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




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









# 602 "/usr/include/stdio.h" 3




 

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

 

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

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










 





} 




# 17 "ACEParams.h" 2

# 1 "/usr/include/math.h" 1 3
 


















 








extern "C" { 

 

# 1 "/usr/include/bits/huge_val.h" 1 3
 

























 

















 

# 81 "/usr/include/bits/huge_val.h" 3

# 33 "/usr/include/math.h" 2 3


 



 
# 1 "/usr/include/bits/mathdef.h" 1 3
 





















# 41 "/usr/include/bits/mathdef.h" 3

# 40 "/usr/include/math.h" 2 3



 



















# 1 "/usr/include/bits/mathcalls.h" 1 3
 


















 






























 

 
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   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          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          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 ()  ; extern   double         __ceil          (double  __x)    throw ()    ;

 
extern   double          fabs          (double  __x)    throw ()   __attribute__ (    (__const__)  ); extern   double         __fabs          (double  __x)    throw ()   __attribute__ (    (__const__)  )  ;

 
extern   double          floor          (double  __x)    throw ()  ; extern   double         __floor          (double  __x)    throw ()    ;

 
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  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          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          remainder          (double  __x, double  __y)    throw ()  ; extern   double         __remainder          (double  __x, double  __y)    throw ()    ;


 
extern   double          scalb          (double  __x, double  __n)    throw ()  ; extern   double         __scalb          (double  __x, double  __n)    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 ()   ;


# 333 "/usr/include/bits/mathcalls.h" 3

# 63 "/usr/include/math.h" 2 3







 











# 1 "/usr/include/bits/mathcalls.h" 1 3
 


















 






























 

 
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   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          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          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 ()  ; extern   float         __ceilf         (float   __x)    throw ()    ;

 
extern   float          fabsf         (float   __x)    throw ()   __attribute__ (    (__const__)  ); extern   float         __fabsf         (float   __x)    throw ()   __attribute__ (    (__const__)  )  ;

 
extern   float          floorf         (float   __x)    throw ()  ; extern   float         __floorf         (float   __x)    throw ()    ;

 
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  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          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          remainderf         (float   __x, float   __y)    throw ()  ; extern   float         __remainderf         (float   __x, float   __y)    throw ()    ;


 
extern   float          scalbf         (float   __x, float   __n)    throw ()  ; extern   float         __scalbf         (float   __x, float   __n)    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 ()   ;


# 333 "/usr/include/bits/mathcalls.h" 3

# 82 "/usr/include/math.h" 2 3





 











# 1 "/usr/include/bits/mathcalls.h" 1 3
 


















 






























 

 
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   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          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          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 ()  ; extern   long double         __ceill         (long double   __x)    throw ()    ;

 
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 ()  ; extern   long double         __floorl         (long double   __x)    throw ()    ;

 
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  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          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          remainderl         (long double   __x, long double   __y)    throw ()  ; extern   long double         __remainderl         (long double   __x, long double   __y)    throw ()    ;


 
extern   long double          scalbl         (long double   __x, long double   __n)    throw ()  ; extern   long double         __scalbl         (long double   __x, long double   __n)    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 ()   ;


# 333 "/usr/include/bits/mathcalls.h" 3

# 99 "/usr/include/math.h" 2 3













 
extern int signgam;



 
# 236 "/usr/include/math.h" 3



 
typedef enum
{
  _IEEE_ = -1,	 
  _SVID_,	 
  _XOPEN_,	 
  _POSIX_,
  _ISOC_	 
} _LIB_VERSION_TYPE;

 


extern _LIB_VERSION_TYPE _LIB_VERSION;




 





struct __exception



  {
    int type;
    char *name;
    double arg1;
    double arg2;
    double retval;
  };


extern int matherr (struct __exception *__exc) throw ();






 







 












 
















 


# 338 "/usr/include/math.h" 3



 






 





# 409 "/usr/include/math.h" 3


} 



# 18 "ACEParams.h" 2

# 1 "/usr/include/assert.h" 1 3
 

















 



# 33 "/usr/include/assert.h" 3











 




# 63 "/usr/include/assert.h" 3


extern "C" { 

 
extern void __assert_fail (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function)
     throw ()  __attribute__ ((__noreturn__));

 
extern void __assert_perror_fail (int __errnum, __const char *__file,
				  unsigned int __line,
				  __const char *__function)
     throw ()  __attribute__ ((__noreturn__));


 

extern void __assert (const char *__assertion, const char *__file, int __line)
     throw ()  __attribute__ ((__noreturn__));


} 













 















# 19 "ACEParams.h" 2

# 1 "/usr/include/string.h" 1 3
 

















 








extern "C" { 

 


# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 


# 19 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3



 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 

# 271 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


# 283 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 





















# 33 "/usr/include/string.h" 2 3



 
extern void *memcpy (void *__restrict __dest,
		     __const void *__restrict __src, size_t __n) throw () ;
 

extern void *memmove (void *__dest, __const void *__src, size_t __n)
     throw () ;

 



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



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

 
extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
     throw ()   ;

 
extern void *memchr (__const void *__s, int __c, size_t __n)
      throw ()   ;

# 73 "/usr/include/string.h" 3



 
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
     throw () ;
 
extern char *strncpy (char *__restrict __dest,
		      __const char *__restrict __src, size_t __n) throw () ;

 
extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
     throw () ;
 
extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
		      size_t __n) throw () ;

 
extern int strcmp (__const char *__s1, __const char *__s2)
     throw ()   ;
 
extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
     throw ()   ;

 
extern int strcoll (__const char *__s1, __const char *__s2)
     throw ()   ;
 
extern size_t strxfrm (char *__restrict __dest,
		       __const char *__restrict __src, size_t __n) throw () ;

# 116 "/usr/include/string.h" 3



 
extern char *strdup (__const char *__s) throw ()   ;


 







# 152 "/usr/include/string.h" 3


 
extern char *strchr (__const char *__s, int __c) throw ()   ;
 
extern char *strrchr (__const char *__s, int __c) throw ()   ;







 

extern size_t strcspn (__const char *__s, __const char *__reject)
     throw ()   ;
 

extern size_t strspn (__const char *__s, __const char *__accept)
     throw ()   ;
 
extern char *strpbrk (__const char *__s, __const char *__accept)
     throw ()   ;
 
extern char *strstr (__const char *__haystack, __const char *__needle)
     throw ()   ;







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

 

extern char *__strtok_r (char *__restrict __s,
			 __const char *__restrict __delim,
			 char **__restrict __save_ptr) throw () ;

extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
		       char **__restrict __save_ptr) throw () ;


# 214 "/usr/include/string.h" 3



 
extern size_t strlen (__const char *__s) throw ()   ;









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

 

extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw () ;


 

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


 
extern void bcopy (__const void *__src, void *__dest, size_t __n) throw () ;

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

 
extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
     throw ()   ;

 
extern char *index (__const char *__s, int __c) throw ()   ;

 
extern char *rindex (__const char *__s, int __c) throw ()   ;

 

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

 









 
extern int strcasecmp (__const char *__s1, __const char *__s2)
     throw ()   ;

 
extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
     throw ()   ;


# 289 "/usr/include/string.h" 3



 

extern char *strsep (char **__restrict __stringp,
		     __const char *__restrict __delim) throw () ;


# 332 "/usr/include/string.h" 3




# 361 "/usr/include/string.h" 3



} 


# 20 "ACEParams.h" 2

# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/iostream.h" 1 3
 

























#pragma interface



# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h" 1 3
 


























#pragma interface


   



extern "C" {

}
 

# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h" 1 3
 
































































 










 



 

















void va_end (__gnuc_va_list);		 


 



 












 























 
 













# 175 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stdarg.h" 3


 




 

 

 

typedef __gnuc_va_list va_list;
























# 40 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h" 2 3

























extern "C++" {
class istream;  
class ostream; class streambuf;

 




typedef __off64_t   streamoff;
typedef __off64_t   streampos;




typedef __ssize_t   streamsize;

typedef unsigned long __fmtflags;
typedef unsigned char __iostate;

struct _ios_fields
{  
    streambuf *_strbuf;
    ostream* _tie;
    int _width;
    __fmtflags _flags;
    wchar_t   _fill;
    __iostate _state;
    __iostate _exceptions;
    int _precision;

    void *_arrays;  
};















# 124 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h" 3


class ios : public _ios_fields {
  ios& operator=(ios&);   
  ios (const ios&);  
  public:
    typedef __fmtflags fmtflags;
    typedef int iostate;
    typedef int openmode;
    typedef __ssize_t   streamsize;
    enum io_state {
	goodbit = 0 ,
	eofbit = 1 ,
	failbit = 2 ,
	badbit = 4  };
    enum open_mode {
	in = 1 ,
	out = 2 ,
	ate = 4 ,
	app = 8 ,
	trunc = 16 ,
	nocreate = 32 ,
	noreplace = 64 ,
	bin = 128 ,  
	binary = 128  };
    enum seek_dir { beg, cur, end};
    typedef enum seek_dir seekdir;
     
    enum { skipws= 01 ,
	   left= 02 , right= 04 , internal= 010 ,
	   dec= 020 , oct= 040 , hex= 0100 ,
	   showbase= 0200 , showpoint= 0400 ,
	   uppercase= 01000 , showpos= 02000 ,
	   scientific= 04000 , fixed= 010000 ,
	   unitbuf= 020000 , stdio= 040000 



	   };
    enum {  
	basefield=dec+oct+hex,
	floatfield = scientific+fixed,
	adjustfield = left+right+internal
    };

# 177 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h" 3


    ostream* tie() const { return _tie; }
    ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }

     
    wchar_t   fill() const { return _fill; }
    wchar_t   fill(wchar_t   newf)
	{wchar_t   oldf = _fill; _fill = newf; return oldf;}
    fmtflags flags() const { return _flags; }
    fmtflags flags(fmtflags new_val) {
	fmtflags old_val = _flags; _flags = new_val; return old_val; }
    int precision() const { return _precision; }
    int precision(int newp) {
	unsigned short oldp = _precision; _precision = (unsigned short)newp;
	return oldp; }
    fmtflags setf(fmtflags val) {
	fmtflags oldbits = _flags;
	_flags |= val; return oldbits; }
    fmtflags setf(fmtflags val, fmtflags mask) {
	fmtflags oldbits = _flags;
	_flags = (_flags & ~mask) | (val & mask); return oldbits; }
    fmtflags unsetf(fmtflags mask) {
	fmtflags oldbits = _flags;
	_flags &= ~mask; return oldbits; }
    int width() const { return _width; }
    int width(int val) { int save = _width; _width = val; return save; }




    void _throw_failure() const { }

    void clear(iostate state = 0) {
	_state = _strbuf ? state : state|badbit;
	if (_state & _exceptions) _throw_failure(); }
    void set(iostate flag) { _state |= flag;
	if (_state & _exceptions) _throw_failure(); }
    void setstate(iostate flag) { _state |= flag;  
	if (_state & _exceptions) _throw_failure(); }
    int good() const { return _state == 0; }
    int eof() const { return _state & ios::eofbit; }
    int fail() const { return _state & (ios::badbit|ios::failbit); }
    int bad() const { return _state & ios::badbit; }
    iostate rdstate() const { return _state; }
    operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
    int operator!() const { return fail(); }
    iostate exceptions() const { return _exceptions; }
    void exceptions(iostate enable) {
	_exceptions = enable;
	if (_state & _exceptions) _throw_failure(); }

    streambuf* rdbuf() const { return _strbuf; }
    streambuf* rdbuf(streambuf *_s) {
      streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }

    static int sync_with_stdio(int on);
    static void sync_with_stdio() { sync_with_stdio(1); }
    static fmtflags bitalloc();
    static int xalloc();
    void*& pword(int);
    void* pword(int) const;
    long& iword(int);
    long iword(int) const;









     
    class Init {
    public:
      Init () { }
    };

  protected:
    inline ios(streambuf* sb = 0, ostream* tie_to = 0);
    inline virtual ~ios();
    inline void init(streambuf* sb, ostream* tie = 0);
};




typedef ios::seek_dir _seek_dir;


 
 
 
 
 

 
 
class streammarker : private _IO_marker {
    friend class streambuf;
    void set_offset(int offset) { _pos = offset; }
  public:
    streammarker(streambuf *sb);
    ~streammarker();
    int saving() { return  1; }
    int delta(streammarker&);
    int delta();
};

struct streambuf : public _IO_FILE {  
    friend class ios;
    friend class istream;
    friend class ostream;
    friend class streammarker;
    const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
  protected:
    static streambuf* _list_all;  
    _IO_FILE*& xchain() { return _chain; }
    void _un_link();
    void _link_in();
    char* gptr() const
      { return _flags  & 0x100  ? _IO_save_base : _IO_read_ptr; }
    char* pptr() const { return _IO_write_ptr; }
    char* egptr() const
      { return _flags  & 0x100  ? _IO_save_end : _IO_read_end; }
    char* epptr() const { return _IO_write_end; }
    char* pbase() const { return _IO_write_base; }
    char* eback() const
      { return _flags  & 0x100  ? _IO_save_base : _IO_read_base;}
    char* base() const { return _IO_buf_base; }
    char* ebuf() const { return _IO_buf_end; }
    int blen() const { return _IO_buf_end - _IO_buf_base; }
    void xput_char(char c) { *_IO_write_ptr++ = c; }
    int xflags() { return _flags ; }
    int xflags(int f) {int fl = _flags ; _flags  = f; return fl;}
    void xsetflags(int f) { _flags  |= f; }
    void xsetflags(int f, int mask)
      { _flags  = (_flags  & ~mask) | (f & mask); }
    void gbump(int n)
      { _flags  & 0x100  ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
    void pbump(int n) { _IO_write_ptr += n; }
    void setb(char* b, char* eb, int a=0);
    void setp(char* p, char* ep)
      { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
    void setg(char* eb, char* g, char *eg) {
      if (_flags  & 0x100 ) _IO_free_backup_area(this); 
      _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
    char *shortbuf() { return _shortbuf; }

    int in_backup() { return _flags & 0x100 ; }
     
    char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
     
    char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
     
    char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
    char *Bptr() { return _IO_backup_base; }
     
    char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
    char *Nbase() { return _IO_save_base; }
    char *eNptr() { return _IO_save_end; }
    int have_backup() { return _IO_save_base != __null ; }
    int have_markers() { return _markers != __null ; }
    void free_backup_area();
    void unsave_markers();  
    int put_mode() { return _flags & 0x800 ; }
    int switch_to_get_mode();
    
    streambuf(int flags=0);
  public:
    static int flush_all();
    static void flush_all_linebuffered();  
    virtual ~streambuf();
    virtual int overflow(int c = (-1) );  
    virtual int underflow();  
    virtual int uflow();  
    virtual int pbackfail(int c);
 
    virtual streamsize xsputn(const char* s, streamsize n);
    virtual streamsize xsgetn(char* s, streamsize n);
    virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
    virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);

    streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out)
      { return _IO_seekoff (this, o, d, mode); }
    streampos pubseekpos(streampos pos, int mode = ios::in|ios::out)
      { return _IO_seekpos (this, pos, mode); }
    streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
    streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
    virtual streambuf* setbuf(char* p, int len);
    virtual int sync();
    virtual int doallocate();

    int seekmark(streammarker& mark, int delta = 0);
    int sputbackc(char c);
    int sungetc();
    int unbuffered() { return _flags & 2  ? 1 : 0; }
    int linebuffered() { return _flags & 0x200  ? 1 : 0; }
    void unbuffered(int i)
	{ if (i) _flags |= 2 ; else _flags &= ~2 ; }
    void linebuffered(int i)
	{ if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; }
    int allocate() {  
	if (base() || unbuffered()) return 0;
	else return doallocate(); }
     
    void allocbuf() { if (base() == __null ) doallocbuf(); }
    void doallocbuf();
    int in_avail() { return _IO_read_end - _IO_read_ptr; }
    int out_waiting() { return _IO_write_ptr - _IO_write_base; }
    streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
    streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
    streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
    int ignore(int);
    int get_column();
    int set_column(int);
    long sgetline(char* buf, size_t   n, char delim, int putback_delim);
    int sputc(int c) { return _IO_putc(c, this); }
    int sbumpc() { return _IO_getc(this); }
    int sgetc() { return ((  this  )->_IO_read_ptr >= (  this  )->_IO_read_end && __underflow (  this  ) == (-1)  ? (-1)  : *(unsigned char *) (  this  )->_IO_read_ptr)  ; }
    int snextc() {
	if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) )
	  return (-1) ;
	else return _IO_read_ptr++, sgetc(); }
    void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
    int vscan(char const *fmt0, __gnuc_va_list  ap, ios* stream = __null );
    int scan(char const *fmt0 ...);
    int vform(char const *fmt0, __gnuc_va_list  ap);
    int form(char const *fmt0 ...);




    virtual streamsize sys_read(char* buf, streamsize size);
    virtual streamsize sys_write(const char*, streamsize);
    virtual streampos sys_seek(streamoff, _seek_dir);
    virtual int sys_close();
    virtual int sys_stat(void*);  

    virtual int showmanyc();
    virtual void imbue(void *);

};

 
 

class filebuf : public streambuf {
  protected:
    void init();
  public:
    static const int openprot;  
    filebuf();
    filebuf(int fd);
    filebuf(int fd, char* p, int len);



    ~filebuf();
    filebuf* attach(int fd);
    filebuf* open(const char *filename, const char *mode);
    filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
    virtual int underflow();
    virtual int overflow(int c = (-1) );
    int is_open() const { return _fileno >= 0; }
    int fd() const { return is_open() ? _fileno : (-1) ; }
    filebuf* close();
    virtual int doallocate();
    virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
    virtual streambuf* setbuf(char* p, int len);
    streamsize xsputn(const char* s, streamsize n);
    streamsize xsgetn(char* s, streamsize n);
    virtual int sync();
  protected:  
 
    int is_reading() { return eback() != egptr(); }
    char* cur_ptr() { return is_reading() ?  gptr() : pptr(); }
     
    char* file_ptr() { return eGptr(); }
     
    virtual streamsize sys_read(char* buf, streamsize size);
    virtual streampos sys_seek(streamoff, _seek_dir);
    virtual streamsize sys_write(const char*, streamsize);
    virtual int sys_stat(void*);  
    virtual int sys_close();




};

inline void ios::init(streambuf* sb, ostream* tie_to) {
		_state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
		_strbuf=sb; _tie = tie_to; _width=0; _fill=' ';

		_flags=ios::skipws|ios::dec;



		_precision=6; _arrays = 0; }

inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }

inline ios::~ios() {



     
     
    operator delete[] (_arrays);
}
}  

# 31 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/iostream.h" 2 3


extern "C++" {
class istream; class ostream;
typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);

extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);

class ostream : virtual public ios
{
     
    void do_osfx();
  public:
    ostream() { }
    ostream(streambuf* sb, ostream* tied= __null );
    int opfx() {
	if (!good()) return 0;
	else { if (_tie) _tie->flush();  ; return 1;} }
    void osfx() {  ;
		  if (flags() & (ios::unitbuf|ios::stdio))
		      do_osfx(); }
    ostream& flush();
    ostream& put(char c) { _strbuf->sputc(c); return *this; }





    ostream& write(const char *s, streamsize n);
    ostream& write(const unsigned char *s, streamsize n)
      { return write((const char*)s, n);}
    ostream& write(const signed char *s, streamsize n)
      { return write((const char*)s, n);}
    ostream& write(const void *s, streamsize n)
      { return write((const char*)s, n);}
    ostream& seekp(streampos);
    ostream& seekp(streamoff, _seek_dir);
    streampos tellp();
    ostream& form(const char *format ...);
    ostream& vform(const char *format, __gnuc_va_list  args);

    ostream& operator<<(char c);
    ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
    ostream& operator<<(signed char c) { return (*this) << (char)c; }
    ostream& operator<<(const char *s);
    ostream& operator<<(const unsigned char *s)
	{ return (*this) << (const char*)s; }
    ostream& operator<<(const signed char *s)
	{ return (*this) << (const char*)s; }
    ostream& operator<<(const void *p);
    ostream& operator<<(int n);
    ostream& operator<<(unsigned int n);
    ostream& operator<<(long n);
    ostream& operator<<(unsigned long n);

    __extension__ ostream& operator<<(long long n);
    __extension__ ostream& operator<<(unsigned long long n);

    ostream& operator<<(short n) {return operator<<((int)n);}
    ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}

    ostream& operator<<(bool b) { return operator<<((int)b); }

    ostream& operator<<(double n);
    ostream& operator<<(float n) { return operator<<((double)n); }

    ostream& operator<<(long double n);



    ostream& operator<<(__omanip func) { return (*func)(*this); }
    ostream& operator<<(__manip func) {(*func)(*this); return *this;}
    ostream& operator<<(streambuf*);



};

class istream : virtual public ios
{
     
protected:
    size_t   _gcount;

    int _skip_ws();
  public:
    istream(): _gcount (0) { }
    istream(streambuf* sb, ostream*tied= __null );
    istream& get(char* ptr, int len, char delim = '\n');
    istream& get(unsigned char* ptr, int len, char delim = '\n')
	{ return get((char*)ptr, len, delim); }
    istream& get(char& c);
    istream& get(unsigned char& c) { return get((char&)c); }
    istream& getline(char* ptr, int len, char delim = '\n');
    istream& getline(unsigned char* ptr, int len, char delim = '\n')
	{ return getline((char*)ptr, len, delim); }
    istream& get(signed char& c)  { return get((char&)c); }
    istream& get(signed char* ptr, int len, char delim = '\n')
	{ return get((char*)ptr, len, delim); }
    istream& getline(signed char* ptr, int len, char delim = '\n')
	{ return getline((char*)ptr, len, delim); }
    istream& read(char *ptr, streamsize n);
    istream& read(unsigned char *ptr, streamsize n)
      { return read((char*)ptr, n); }
    istream& read(signed char *ptr, streamsize n)
      { return read((char*)ptr, n); }
    istream& read(void *ptr, streamsize n)
      { return read((char*)ptr, n); }
    istream& get(streambuf& sb, char delim = '\n');
    istream& gets(char **s, char delim = '\n');
    int ipfx(int need = 0) {
	if (!good()) { set(ios::failbit); return 0; }
	else {
	   ;
	  if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
	  if (!need && (flags() & ios::skipws)) return _skip_ws();
	  else return 1;
	}
    }
    int ipfx0() {  
	if (!good()) { set(ios::failbit); return 0; }
	else {
	   ;
	  if (_tie) _tie->flush();
	  if (flags() & ios::skipws) return _skip_ws();
	  else return 1;
	}
    }
    int ipfx1() {  
	if (!good()) { set(ios::failbit); return 0; }
	else {
	   ;
	  if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
	  return 1;
	}
    }
    void isfx() {  ; }
    int get() { if (!ipfx1()) return (-1) ;
		else { int ch = _strbuf->sbumpc();
		       if (ch == (-1) ) set(ios::eofbit);
		       isfx();
		       return ch;
		     } }
    int peek();
    size_t   gcount() { return _gcount; }
    istream& ignore(int n=1, int delim = (-1) );
    int sync ();
    istream& seekg(streampos);
    istream& seekg(streamoff, _seek_dir);
    streampos tellg();
    istream& putback(char ch) {
	if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
	return *this;}
    istream& unget() {
	if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
	return *this;}
    istream& scan(const char *format ...);
    istream& vscan(const char *format, __gnuc_va_list  args);






    istream& operator>>(char*);
    istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
    istream& operator>>(signed char*p) { return operator>>((char*)p); }
    istream& operator>>(char& c);
    istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
    istream& operator>>(signed char& c) {return operator>>((char&)c);}
    istream& operator>>(int&);
    istream& operator>>(long&);

    __extension__ istream& operator>>(long long&);
    __extension__ istream& operator>>(unsigned long long&);

    istream& operator>>(short&);
    istream& operator>>(unsigned int&);
    istream& operator>>(unsigned long&);
    istream& operator>>(unsigned short&);

    istream& operator>>(bool&);

    istream& operator>>(float&);
    istream& operator>>(double&);
    istream& operator>>(long double&);
    istream& operator>>( __manip func) {(*func)(*this); return *this;}
    istream& operator>>(__imanip func) { return (*func)(*this); }
    istream& operator>>(streambuf*);
};

class iostream : public istream, public ostream
{
  public:
    iostream() { }
    iostream(streambuf* sb, ostream*tied= __null );
};

class _IO_istream_withassign : public istream {
public:
  _IO_istream_withassign& operator=(istream&);
  _IO_istream_withassign& operator=(_IO_istream_withassign& rhs)
    { return operator= (static_cast<istream&> (rhs)); }
};

class _IO_ostream_withassign : public ostream {
public:
  _IO_ostream_withassign& operator=(ostream&);
  _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs)
    { return operator= (static_cast<ostream&> (rhs)); }
};

extern _IO_istream_withassign cin;
 
extern _IO_ostream_withassign cout, cerr;

extern _IO_ostream_withassign clog



;

extern istream& lock(istream& ins);
extern istream& unlock(istream& ins);
extern ostream& lock(ostream& outs);
extern ostream& unlock(ostream& outs);

struct Iostream_init { } ;   

inline ios& dec(ios& i)
{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
inline ios& hex(ios& i)
{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
inline ios& oct(ios& i)
{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
}  


# 21 "ACEParams.h" 2

# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/iomanip.h" 1 3
 

























#pragma interface





extern "C++" {
 
 
 

 
 
 
 
template<class TP> class smanip;  

template<class TP> class sapp {
    ios& (*_f)(ios&, TP);
public: 
    sapp(ios& (*f)(ios&, TP)) : _f(f) {}
     
    smanip<TP> operator()(TP a) 
      { return smanip<TP>(_f, a); }
};

template<class TP>
inline istream& operator>>(istream& i, const smanip<TP>& m);
template<class TP>
inline ostream& operator<<(ostream& o, const smanip<TP>& m);

template <class TP> class smanip {
    ios& (*_f)(ios&, TP);
    TP _a;
public:
    smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {}
     
    friend 
      istream& operator>> <>(istream& i, const smanip<TP>& m);
    friend
      ostream& operator<< <>(ostream& o, const smanip<TP>& m);
};


__extension__ extern template class smanip<int>;
__extension__ extern template class smanip<ios::fmtflags>;


template<class TP>
inline istream& operator>>(istream& i, const smanip<TP>& m)
{ (*m._f)(i, m._a); return i; }

template<class TP>
inline ostream& operator<<(ostream& o, const smanip<TP>& m)
{ (*m._f)(o, m._a); return o;}


__extension__ extern 
template istream& operator>>(istream&, const smanip<int>&);
__extension__ extern 
template istream& operator>>(istream&, const smanip<ios::fmtflags>&);
__extension__ extern 
template ostream& operator<<(ostream&, const smanip<int>&);
__extension__ extern 
template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&);


 
 
 
 
template<class TP> class imanip; 

template<class TP> class iapp {
    istream& (*_f)(istream&, TP);
public: 
    iapp(istream& (*f)(istream&,TP)) : _f(f) {}
     
    imanip<TP> operator()(TP a)
       { return imanip<TP>(_f, a); }
};

template <class TP>
inline istream& operator>>(istream&, const imanip<TP>&);

template <class TP> class imanip {
    istream& (*_f)(istream&, TP);
    TP _a;
public:
    imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {}
     
    friend
      istream& operator>> <>(istream& i, const imanip<TP>& m);
};

template <class TP>
inline istream& operator>>(istream& i, const imanip<TP>& m)
{ return (*m._f)( i, m._a); }

 
 
 
 
template<class TP> class omanip; 

template<class TP> class oapp {
    ostream& (*_f)(ostream&, TP);
public: 
    oapp(ostream& (*f)(ostream&,TP)) : _f(f) {}
     
    omanip<TP> operator()(TP a)
      { return omanip<TP>(_f, a); }
};

template <class TP>
inline ostream& operator<<(ostream&, const omanip<TP>&);

template <class TP> class omanip {
    ostream& (*_f)(ostream&, TP);
    TP _a;
public:
    omanip(ostream& (*f)(ostream&, TP), TP a) : _f(f), _a(a) {}
     
    friend
      ostream& operator<< <>(ostream& o, const omanip<TP>& m);
};

template <class TP>
inline ostream& operator<<(ostream& o, const omanip<TP>& m)
{ return (*m._f)(o, m._a); }

 
 
 

 
 
 
 





extern ios& __iomanip_setbase  (ios&,   int ); inline   smanip <  int >   setbase  (  int  n) { return   smanip <  int > (__iomanip_setbase , n); } 
extern ios& __iomanip_setfill  (ios&,   int ); inline   smanip <  int >   setfill  (  int  n) { return   smanip <  int > (__iomanip_setfill , n); } 
extern ios& __iomanip_setprecision  (ios&,   int ); inline   smanip <  int >   setprecision  (  int  n) { return   smanip <  int > (__iomanip_setprecision , n); } 
extern ios& __iomanip_setw  (ios&,   int ); inline   smanip <  int >   setw  (  int  n) { return   smanip <  int > (__iomanip_setw , n); } 

extern ios& __iomanip_resetiosflags  (ios&,   ios::fmtflags ); inline   smanip <  ios::fmtflags >   resetiosflags  (  ios::fmtflags  n) { return   smanip <  ios::fmtflags > (__iomanip_resetiosflags , n); } 
extern ios& __iomanip_setiosflags  (ios&,   ios::fmtflags ); inline   smanip <  ios::fmtflags >   setiosflags  (  ios::fmtflags  n) { return   smanip <  ios::fmtflags > (__iomanip_setiosflags , n); } 
}  


# 22 "ACEParams.h" 2

# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/fstream.h" 1 3
 


























#pragma interface



extern "C++" {
class fstreambase : virtual public ios {

    mutable filebuf __my_fb;  

    void __fb_init ();
  public:
    fstreambase();
    fstreambase(int fd);
    fstreambase(int fd, char *p, int l);  
    fstreambase(const char *name, int mode, int prot=0664);
    void close();

    filebuf* rdbuf() const { return &__my_fb; }



    void open(const char *name, int mode, int prot=0664);
    int is_open() const { return rdbuf()->is_open(); }
    void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); }
    void attach(int fd);




};

class ifstream : public fstreambase, public istream {
  public:
    ifstream() : fstreambase() { }
    ifstream(int fd) : fstreambase(fd) { }
    ifstream(int fd, char *p, int l) : fstreambase(fd, p, l) { }  
    ifstream(const char *name, int mode=ios::in, int prot=0664)
	: fstreambase(name, mode | ios::in, prot) { }
    void open(const char *name, int mode=ios::in, int prot=0664)
	{ fstreambase::open(name, mode | ios::in, prot); }
};

class ofstream : public fstreambase, public ostream {
  public:
    ofstream() : fstreambase() { }
    ofstream(int fd) : fstreambase(fd) { }
    ofstream(int fd, char *p, int l) : fstreambase(fd, p, l) { }  
    ofstream(const char *name, int mode=ios::out, int prot=0664)
	: fstreambase(name, mode | ios::out, prot) { }
    void open(const char *name, int mode=ios::out, int prot=0664)
	{ fstreambase::open(name, mode | ios::out, prot); }
};

class fstream : public fstreambase, public iostream {
  public:
    fstream() : fstreambase() { }
    fstream(int fd) : fstreambase(fd) { }
    fstream(const char *name, int mode, int prot=0664)
	: fstreambase(name, mode, prot) { }
    fstream(int fd, char *p, int l) : fstreambase(fd, p, l) { }  
    void open(const char *name, int mode, int prot=0664)
	{ fstreambase::open(name, mode, prot); }
};
}  

# 23 "ACEParams.h" 2


# 1 "generic.h" 1
 
 



















 





















 
typedef int (*GPT)(int,char*);









# 25 "ACEParams.h" 2


 



 









 


 





 




 

















 

 



 



 


 











 







 


























 










 







 
 




 



 



 



 





 






 



 




 









 





 









 




 








 





 






typedef int INTEGER;

typedef float REAL;

typedef double DOUBLE;
typedef char CHARACTER;


 


 
 


 



















 



# 1 "ACEFortranInterfaces.h" 1



 









 

















 
 

























 



























 



























 










 












































# 284 "ACEParams.h" 2



inline int max(const int a, const int b)
       { return((a > b) ? a : b); }
inline int min(const int a, const int b)
       { return((a < b) ? a : b); }

inline unsigned max(const unsigned a, const unsigned b)
       { return((a > b) ? a : b); }
inline unsigned min(const unsigned a, const unsigned b)
       { return((a < b) ? a : b); }

 
 
 
 






 

 
 
 

# 1 "DAGHParams.h" 1



 










 
 
 
 
 
 
 
 

 

 



 








 


 





 










 



 


 











 







 


























 










 







 
 




 



 



 



 





 






 



 




 
 
 
 
 
 
 

 
 
 
 
 

 
 
 
 
 
 
 

 




 








 





 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 

 
 
 
 
 

 
 
 
 

 
 
 
 

 
 
 

 






 
 
 
 
 
 

 
 
 
 

 
 
 
 

 
 
 
 

 
 
 
 
 

 

# 1 "DAGHParamsOld.h" 1



 










 



 



 



 





# 293 "DAGHParams.h" 2



# 313 "ACEParams.h" 2



# 14 "ACEDistribution.h" 2

# 1 "ACEDefaults.h" 1



  










 






 
 
 



 
 
 


 
 
 



 
 
 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 


 
 
 

 
 
 


 
 
 




 
 
 


















 
 
 




 
 
 
 
 




 
 
 



# 15 "ACEDistribution.h" 2


# 1 "List.h" 1



 











# 1 "/usr/include/malloc.h" 1 3
 























 


















# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3






 







 

 




 


 





 


# 61 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3


 





 


















 





 

 





















typedef int ptrdiff_t;









 




 

 


# 188 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3





 




 


# 269 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3
















 

 

# 317 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 3




 













 







# 44 "/usr/include/malloc.h" 2 3




















 








 



# 93 "/usr/include/malloc.h" 3











extern "C" {


 





extern int __malloc_initialized;

 




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

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

 

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

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

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

 
extern void *  memalign  (size_t __alignment, size_t __size)  throw ()  ;

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

 

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

 

extern void *  (*__morecore)  (ptrdiff_t __size)  ;

 
extern void *  __default_morecore  (ptrdiff_t __size)  throw ()  
        ;

 
struct mallinfo {
  int arena;     
  int ordblks;   
  int smblks;    
  int hblks;     
  int hblkhd;    
  int usmblks;   
  int fsmblks;   
  int uordblks;  
  int fordblks;  
  int keepcost;  
};

 
extern struct mallinfo mallinfo  (void)  throw ()  ;

 













 






 
extern int mallopt  (int __param, int __val)  throw ()  ;

 

extern int malloc_trim  (size_t __pad)  throw ()  ;

 

extern size_t malloc_usable_size  (void *  __ptr)  throw ()  ;

 
extern void malloc_stats  (void)  throw ()  ;

 
extern void *  malloc_get_state  (void)  throw ()  ;

 

extern int malloc_set_state  (void *  __ptr)  throw ()  ;


 


extern void (*__malloc_initialize_hook)  (void)  ;
 
extern void (*__free_hook)  (void *  __ptr,
					__const void * )  ;
extern void *  (*__malloc_hook)  (size_t __size,
						    __const void * )  ;
extern void *  (*__realloc_hook)  (void *  __ptr,
						     size_t __size,
						     __const void * )  ;
extern void *  (*__memalign_hook)  (size_t __alignment,
						      size_t __size,
						      __const void * )  ;
extern void (*__after_morecore_hook)  (void)  ;

 
extern void __malloc_check_init  (void)  throw ()  ;



};  



# 16 "List.h" 2

# 1 "fastAlloc.h" 1



 















# 1 "/usr/include/assert.h" 1 3
 

















 
























 




# 63 "/usr/include/assert.h" 3


extern "C" { 

 
extern void __assert_fail (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function)
     throw ()  __attribute__ ((__noreturn__));

 
extern void __assert_perror_fail (int __errnum, __const char *__file,
				  unsigned int __line,
				  __const char *__function)
     throw ()  __attribute__ ((__noreturn__));


 

extern void __assert (const char *__assertion, const char *__file, int __line)
     throw ()  __attribute__ ((__noreturn__));


} 













 















# 20 "fastAlloc.h" 2


class fastAlloc 
  {
public:
   struct link { struct link *next; };   
   struct longlink { 
      struct link *item; struct longlink *next;  
      inline longlink() :item(0), next(0) {} 
      inline ~longlink() { 
        if (item) delete [] (char*) item; 
        if (next) delete next; 
      }
   };
private:                                       
   unsigned int blocksize;               
   unsigned int nblocks;                 
   link *head;                    
   longlink *top;                 
   longlink *cur;                 
   fastAlloc(const fastAlloc&);          
   void operator = (const fastAlloc&);   
   void malloc();                        
public:
   fastAlloc(const unsigned int size, const unsigned int atatime);
   inline ~fastAlloc() { delete top; }

   inline void *alloc()
     {
      if (head == ((struct link *) 0)) malloc();
      struct link *block = head;
      head = block->next;
      return(block);
     }

   inline void free(void *block)
     {
      ((struct link *) block)->next = head;
      head = (struct link *) block;
     }
  };


# 17 "List.h" 2








template <class Type> class List;

template <class Type>
class ListItem
  {
   Type item;



   class ListItem<Type> *next;


   inline ListItem(const Type& t) : item(t), next(0) { }
   inline void* operator new(size_t size, void* buf) { return buf; }
 


   inline void operator delete(void* buf, size_t size) {}
   inline ~ListItem() {}

   friend class List<Type>;
  };

template <class Type>
class List
  {
   fastAlloc block;

   int n;			 
   ListItem<Type> *head;	 
   ListItem<Type> *tail;	 

private:
   void operator = (const List<Type>&);
   List(const List<Type>&);

public:
   inline List() : block(sizeof(ListItem<Type>), (32) ), 
		   n(0), head(0), tail(0) { }
   inline List(const int cnt) 
        : block(sizeof(ListItem<Type>), cnt), 
          n(0), head(0), tail(0) { }
   inline int number() const { return(n); }
   inline int isempty() const { return(n == 0); }
   ~List();

    
   void add(const Type& t);
   void add(const List<Type>& other);
   void combine(List<Type>& other);
   void pop();
   void empty();
   inline const Type& first() const { return(head->item); }
   void array(Type **& array, int &cnt) const;
   void array(Type *& array, int &cnt) const;
   inline void reset() { n = 0; head = 0; tail = 0; }

    
   inline ListItem<Type> *Head() const { return(head); }
   inline ListItem<Type> *Tail() const { return(tail); }
   inline ListItem<Type> *Next(ListItem<Type> *listitem)  const
	{ return ( (listitem) ? listitem->next : head ); }
   inline Type& Item(ListItem<Type> *listitem) const
	{ return ( (listitem) ? listitem->item : head->item ); }

    
   void remove(ListItem<Type>*& pi, ListItem<Type>*& li);
 };






























# 17 "ACEDistribution.h" 2

# 1 "GridBox.h" 1



  










# 1 "BBox.h" 1



 













# 1 "lparx_copyright.h" 1
 














# 18 "BBox.h" 2

# 1 "Coords.h" 1



 










 

















# 1 "lparx_copyright.h" 1
 














# 33 "Coords.h" 2



# 1 "/usr/include/assert.h" 1 3
 

















 
























 




# 63 "/usr/include/assert.h" 3


extern "C" { 

 
extern void __assert_fail (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function)
     throw ()  __attribute__ ((__noreturn__));

 
extern void __assert_perror_fail (int __errnum, __const char *__file,
				  unsigned int __line,
				  __const char *__function)
     throw ()  __attribute__ ((__noreturn__));


 

extern void __assert (const char *__assertion, const char *__file, int __line)
     throw ()  __attribute__ ((__noreturn__));


} 













 















# 36 "Coords.h" 2








class CoordsIterator;

class Coords 
{
  friend istream& operator >> (istream& s, Coords& c);
  friend ostream& operator << (ostream& s, const Coords& c);
  friend ifstream& operator >> (ifstream& s, Coords& c);
  friend ofstream& operator << (ofstream& s, const Coords& c);
  
  int c[(3) ];
  
 public:
  short rank;
  static class Coords _empty_coords;
  
 public:
  typedef CoordsIterator Iterator;
  
   
  inline Coords(void) : rank(0) 
    { c[0] = 0; c[1] = 0; c[2] = 0; }
  
   
   
   
   
  
  inline Coords(int const r, int const val) : rank(r)
    { c[0] = val; c[1] = val; c[2] = val; }
  
  inline Coords(int const r, int const *val) : rank(r)
    { register int i; for (i=0; i<rank; i++) c[i] = val[i]; 
                      for (;i< (3) ; i++) c[i] = 0;}
  
  inline Coords(Coords const &other) : rank(other.rank)
    { c[0] = other.c[0]; c[1] = other.c[1]; c[2] = other.c[2]; }
  
   
  inline Coords(int const r, int const i, int const j) : rank(r) 
    { (static_cast<void>  (( r == 2 ) ? 0 :	(__assert_fail ("r == 2" , "Coords.h", 83, __PRETTY_FUNCTION__ ), 0))) ; c[0] = i; c[1] = j; ; c[2] = 0; }
  inline Coords(int const r, int const i, int const j, int const k) : rank(r) 
    { (static_cast<void>  (( r == 3 ) ? 0 :	(__assert_fail ("r == 3" , "Coords.h", 85, __PRETTY_FUNCTION__ ), 0))) ; c[0] = i; c[1] = j; c[2] = k; }
  
  Coords &operator = (Coords const &rhs)
    { 
      rank = rhs.rank;
      c[0] = rhs.c[0]; c[1] = rhs.c[1]; c[2] = rhs.c[2]; 
      return *this;
    }
  
  Coords &operator = (const int &rhs)
    { c[0] = c[1] = c[2] = rhs; return *this; }
  
  inline ~Coords() {}
  
   
  inline int& operator () (int const i) { return(c[i]); }
  inline int operator () (int const i) const { return(c[i]); }
  
  inline int * operator () (void) { return(c); }
  inline int const *operator () (void) const { return(c); }
  
  inline operator int * () { return(c); }
  inline operator const int * () const { return(c); }
  
   
  inline operator long int * () { return((long int *)c); }
  inline operator const long int * () const { return((long int *)c); }
  
   

# 128 "Coords.h"
  Coords& operator  +=  (Coords const &rhs) { c[0]  +=  rhs.c[0]; if (rank>1) c[1]  +=  rhs.c[1]; if (rank>2) c[2]  +=  rhs.c[2]; return(*this); } Coords operator  +  (Coords const &rhs) const { Coords coords(*this); coords  +=  rhs; return(coords); } 
  Coords& operator  -=  (Coords const &rhs) { c[0]  -=  rhs.c[0]; if (rank>1) c[1]  -=  rhs.c[1]; if (rank>2) c[2]  -=  rhs.c[2]; return(*this); } Coords operator  -  (Coords const &rhs) const { Coords coords(*this); coords  -=  rhs; return(coords); } 
  Coords& operator  *=  (Coords const &rhs) { c[0]  *=  rhs.c[0]; if (rank>1) c[1]  *=  rhs.c[1]; if (rank>2) c[2]  *=  rhs.c[2]; return(*this); } Coords operator  *  (Coords const &rhs) const { Coords coords(*this); coords  *=  rhs; return(coords); } 

    
   

# 148 "Coords.h"
  Coords& operator  +=  (int const rhs) { c[0]  +=  rhs; if (rank>1) c[1]  +=  rhs; if (rank>2) c[2]  +=  rhs; return(*this); } Coords operator  +  (int const rhs) const { Coords coords(*this); coords  +=  rhs; return(coords); } 
  Coords& operator  -=  (int const rhs) { c[0]  -=  rhs; if (rank>1) c[1]  -=  rhs; if (rank>2) c[2]  -=  rhs; return(*this); } Coords operator  -  (int const rhs) const { Coords coords(*this); coords  -=  rhs; return(coords); } 
  Coords& operator  *=  (int const rhs) { c[0]  *=  rhs; if (rank>1) c[1]  *=  rhs; if (rank>2) c[2]  *=  rhs; return(*this); } Coords operator  *  (int const rhs) const { Coords coords(*this); coords  *=  rhs; return(coords); } 

    
   

# 168 "Coords.h"
  Coords& operator  /=  (Coords const &rhs) { if (rhs.c[0] != 0) c[0]  /=  rhs.c[0]; if (rank>1 && rhs.c[1] != 0) c[1]  /=  rhs.c[1]; if (rank>2 && rhs.c[2] != 0) c[2]  /=  rhs.c[2]; return(*this); } Coords operator  /  (Coords const &rhs) const { Coords coords(*this); coords  /=  rhs; return(coords); } 
  Coords& operator  %=  (Coords const &rhs) { if (rhs.c[0] != 0) c[0]  %=  rhs.c[0]; if (rank>1 && rhs.c[1] != 0) c[1]  %=  rhs.c[1]; if (rank>2 && rhs.c[2] != 0) c[2]  %=  rhs.c[2]; return(*this); } Coords operator  %  (Coords const &rhs) const { Coords coords(*this); coords  %=  rhs; return(coords); } 

    
   

# 187 "Coords.h"
  Coords& operator  /=  (int const rhs) { if (rhs != 0) { c[0]  /=  rhs; if (rank>1) c[1]  /=  rhs; if (rank>2) c[2]  /=  rhs; } return(*this); } Coords operator  /  (int const rhs) const { Coords coords(*this); coords  /=  rhs; return(coords); } 
  Coords& operator  %=  (int const rhs) { if (rhs != 0) { c[0]  %=  rhs; if (rank>1) c[1]  %=  rhs; if (rank>2) c[2]  %=  rhs; } return(*this); } Coords operator  %  (int const rhs) const { Coords coords(*this); coords  %=  rhs; return(coords); } 

      
   
  inline Coords operator - () const
    { 
      Coords coords(rank,0);
      coords.c[0] = -c[0]; coords.c[1] = -c[1]; coords.c[2] = -c[2]; 
      return(coords);
    }
  
   
  inline int operator != (Coords const &rhs) const
    {
      return ( rank != rhs.rank ||
	       ((rank > 0) && (c[0] != rhs.c[0])) || 
	       ((rank > 1) && (c[1] != rhs.c[1])) || 
	       ((rank > 2) && (c[2] != rhs.c[2]))
	       ) ;
    }
  inline int operator == (Coords const &rhs) const
    { return(!(*this != rhs)); }
  
   
  inline int operator > (Coords const &rhs) const
    {
      return (!(((rank > 0) && (c[0] <= rhs.c[0])) || 
		((rank > 1) && (c[1] <= rhs.c[1])) || 
		((rank > 2) && (c[2] <= rhs.c[2])))
	      ) ;
    }
  inline int operator < (Coords const &rhs) const
    {
      return (!(((rank > 0) && (c[0] >= rhs.c[0])) || 
		((rank > 1) && (c[1] >= rhs.c[1])) || 
		((rank > 2) && (c[2] >= rhs.c[2])))
	      ) ;
    }
  
  inline void setval(int const val)
    { c[0] = val; c[1] = val; c[2] = val; }
  inline void setval(Coords const rhs)
    { c[0] = rhs.c[0]; c[1] = rhs.c[1]; c[2] = rhs.c[2]; }
  
  inline int getmaxval()
    {
      return ((rank > 1) ? 
	      ((rank > 2) ? 
	       ((c[0] > c[1]) ? 
		((c[0] > c[2]) ? c[0] : c[2]) : 
		((c[1] > c[2]) ? c[1] : c[2])) : 
	       ((c[0] > c[1]) ? c[0] : c[1])) : 
	      c[0]);
    }
  inline int getminval()
    {
      return ((rank > 1) ? 
	      ((rank > 2) ?
	       ((c[0] < c[1]) ? 
		((c[0] < c[2]) ? c[0] : c[2]) : 
		((c[1] < c[2]) ? c[1] : c[2])) : 
	       ((c[0] < c[1]) ? c[0] : c[1])) : 
	      c[0]);
    }

  inline int getmaxindex()
    {
      return ((rank > 1) ? 
	      ((rank > 2) ? 
	       ((c[0] > c[1]) ? 
		((c[0] > c[2]) ? 0 : 2) : 
		((c[1] > c[2]) ? 1 : 2)) : 
	       ((c[0] > c[1]) ? 0 : 1)) : 
	      0);
    }
  inline int getminindex()
    {
      return ((rank > 1) ? 
	      ((rank > 2) ? 
	       ((c[0] < c[1]) ? 
		((c[0] < c[2]) ? 0 : 2) : 
		((c[1] < c[2]) ? 1 : 2)) : 
	       ((c[0] < c[1]) ? 0 : 1)) : 
	      0);
    }

   
  inline void min(Coords const &rhs)
    {
       
      c[0] = (rhs.c[0] < c[0]) ? rhs.c[0] : c[0];
      if (rank > 1) c[1] = (rhs.c[1] < c[1]) ? rhs.c[1] : c[1];
      if (rank > 2) c[2] = (rhs.c[2] < c[2]) ? rhs.c[2] : c[2];
    }
  
  inline void max(Coords const &rhs)
    {
       
      c[0] = (rhs.c[0] > c[0]) ? rhs.c[0] : c[0];
      if (rank > 1) c[1] = (rhs.c[1] > c[1]) ? rhs.c[1] : c[1];
      if (rank > 2) c[2] = (rhs.c[2] > c[2]) ? rhs.c[2] : c[2];
    }
  
  inline Coords getmin(Coords const &rhs) const
    { Coords other(*this); other.min(rhs); return other; }
  
  inline Coords getmax(Coords const &rhs) const
    { Coords other(*this); other.max(rhs); return other; }
  
  inline void setabs()
    { 
      c[0] = (c[0] < 0) ? -c[0] : c[0];
      if (rank > 1) c[1] = (c[1] < 0) ? -c[1] : c[1];
      if (rank > 2) c[2] = (c[2] < 0) ? -c[2] : c[2];
    }
  
  inline Coords getabs()
    { Coords other(*this); other.setabs(); return other; }
  
  inline void ceiling(const Coords& step)
    { Coords mod(*this%step); mod.setabs(); *this += mod;}
  inline void floor(const Coords& step)
    { Coords mod(*this%step); mod.setabs(); *this -= mod;}
};

inline Coords max(const Coords& a, const Coords &b)
  { return(a.getmax(b)); }
inline Coords min(const Coords& a, const Coords &b)
  { return(a.getmin(b)); }


ostream& operator << (ostream& s, const Coords& c);
istream& operator >> (istream& s, Coords& c);
ifstream& operator>>(ifstream& s, Coords& c);
ofstream& operator<<(ofstream& s, const Coords& c);



# 19 "BBox.h" 2






 
 










class BBox  
{
  friend istream& operator >> (istream&, BBox &);
  friend ostream& operator << (ostream&, BBox const &);
  friend ifstream& operator >> (ifstream&, BBox&);
  friend ofstream& operator << (ofstream&, const BBox&);
  
  Coords lb, ub;
  Coords step;
  
 public:
  short rank;
  static class BBox _empty_bbox;
  
 public:
  inline BBox(void)
    : lb(0,( 1000000000) ), ub(0,(-1000000000) ), step(-1,1), rank(-1) {}
  inline BBox(const int r, const int s)
    : lb(r,( 1000000000) ), ub(r,(-1000000000) ), step(r,s), rank(r) {}
  inline BBox(const int r, Coords const &s)
    : lb(r,( 1000000000) ), ub(r,(-1000000000) ), step(s), rank(r) {}
  inline BBox(Coords const &l, Coords const &u, const int s)
    : lb(l), ub(u), step(l.rank,s), rank(l.rank) {}
  inline BBox(const int r, const int *l, const int *u, const int s)
    : lb(r,l), ub(r,u), step(r,s), rank(r) {}
  inline BBox(Coords const &l, Coords const &u, Coords const &s)
    : lb(l), ub(u), step(s), rank(l.rank) {}
  inline BBox(const int r, const int *l, const int *u, const int *s)
    : lb(r,l), ub(r,u), step(r,s), rank(r) {}
  inline BBox(BBox const &other)
    : lb(other.lb), ub(other.ub), step(other.step), rank(other.rank) {}
  
   
  inline BBox(const int r, const int i, 
	      const int ii, const int s)
    : lb(r,i), ub(r,ii), step(r,s), rank(r) {}
  inline BBox(const int r, const int i, const int j, 
	      const int ii, const int jj, const int s)
    : lb(r,i,j), ub(r,ii,jj), step(r,s), rank(r) {}
  inline BBox(const int r, const int i, const int j, const int k,
	      const int ii, const int jj, const int kk, const int s)
    : lb(r,i,j,k), ub(r,ii,jj,kk), step(r,s), rank(r) {}
  inline BBox(const int r, const int i, const int j, 
	      const int ii, const int jj, 
	      const int s, const int ss)
    : lb(r,i,j), ub(r,ii,jj), step(r,s,ss), rank(r) {}
  inline BBox(const int r, const int i, const int j, const int k,
	      const int ii, const int jj, const int kk, 
	      const int s, const int ss, const int sss)
    : lb(r,i,j,k), ub(r,ii,jj,kk), step(r,s,ss,sss), rank(r) {}
  
  inline BBox& operator = (const BBox& other)
    { 
      step = other.step; rank = other.rank; 
      lb = other.lb; ub = other.ub; 
      return(*this); 
    }
  
  inline ~BBox() {}
  
   
  inline void setempty()
    { lb.setval(( 1000000000) ); ub.setval((-1000000000) ); }
  
  inline void setlower(Coords const &l) { lb = l; }
  inline void setlower(const int *l)
    { register int i; for (i=0;i<rank; i++) lb(i) = l[i]; }
  
  inline void setupper(Coords const &u) { ub = u; }
  inline void setupper(const int *u)
    { register int i; for (i=0;i<rank; i++) ub(i) = u[i]; }
  
  inline void setbbox(const int *l, const int *u)
    { setlower(l); setupper(u); }
  inline void setbbox(Coords const &l, Coords const &u) 
    { lb = l; ub = u; }
  inline void setbbox(BBox const &other) 
    { step = other.step; rank = other.rank; lb = other.lb; ub = other.ub; }
  
   
  inline Coords const &lower() const { return(lb); }
  inline Coords const &upper() const { return(ub); }
  inline int lower(const int i) const { return(lb(i)); }
  inline int upper(const int i) const { return(ub(i)); }
  
  inline Coords &lower() { return(lb); }
  inline Coords &upper() { return(ub); }
  inline int &lower(const int i) { return(lb(i)); }
  inline int &upper(const int i) { return(ub(i)); }
  
  inline Coords const &stepsize(void) const { return (step); }
  inline Coords &stepsize(void) { return (step); }
  inline int stepsize(const int i) const { return (step(i)); }
  inline int &stepsize(const int i) { return (step(i)); }
  
  inline void setstepsize(const int i, const int s) { step(i) = s; }
  inline void setstepsize(Coords const &s) { step = s; }
  inline void setstepsize(const int s) { step.setval(s); }
  
  inline int extents(const int i) const 
    { return((ub(i)-lb(i)+step(i))/step(i)); }
  inline Coords extents() const 
    { return((ub-lb+step)/step); }
  
  inline int empty () const
    { return ( (rank <= 0) ||
	       ((rank > 0) && (ub(0) < lb(0))) ||
	       ((rank > 1) && (ub(1) < lb(1))) ||
	       ((rank > 2) && (ub(2) < lb(2)))
	       ) ; }
  
  inline int bottom(void) const
    {
      register int b = (rank > 0) ? lb(0)/step(0) : 0;
      register int e = (rank > 1) ? (ub(0)-lb(0)+step(0))/step(0) : 1;
      b += (rank > 1) ? e*lb(1)/step(1) : 0; 
      e *= (rank > 2) ? (ub(1)-lb(1)+step(1))/step(1) : 1;
      b += (rank > 2) ? e*lb(2)/step(2) : 0; 
      return (-b);
    }
  
  inline int size() const
    {
      if (empty()) return 0;
      register int s = (rank > 0) ? (ub(0)-lb(0)+step(0))/step(0) : 0;
      s *= (rank > 1) ? ((ub(1)-lb(1)+step(1))/step(1)) : 1;
      s *= (rank > 2) ? ((ub(2)-lb(2)+step(2))/step(2)) : 1;
      return s;
    }
  
   
  inline int compatible(BBox const &rhs, const int d) const
    { return( lb(d) == rhs.lb(d) && ub(d) == rhs.ub(d) ); }
  
   
   
  inline int mergable(BBox const &rhs, const int d, const int olap) const
    {
      return (
	      (rank == 1) ? (abs(lb(d) - rhs.ub(d)) == (1-olap)*step(d)) || 
	      (abs(ub(d) - rhs.lb(d)) == (1-olap)*step(d)) :
	      (rank == 2) ? compatible(rhs,(d+1)%2) &&
	      ((abs(lb(d) - rhs.ub(d)) == (1-olap)*step(d)) || 
	       (abs(ub(d) - rhs.lb(d)) == (1-olap)*step(d))) :
	      (rank == 3) ? compatible(rhs,(d+1)%3) &&
	      compatible(rhs,(d+2)%3) &&
	      ((abs(lb(d) - rhs.ub(d)) == (1-olap)*step(d)) || 
	       (abs(ub(d) - rhs.lb(d)) == (1-olap)*step(d))): 0
	      );
    }
  
   
  inline int mergable(BBox const &rhs, const short* olap) const
    {
      int flag = 0;
      flag = (rank == 3) ? flag || mergable(rhs, 2, olap[2]) : flag; 
      flag = (rank >= 2) ? flag || mergable(rhs, 1, olap[1]) : flag; 
      flag = (rank >= 1) ? flag || mergable(rhs, 0, olap[0]) : flag; 
      return flag;
    }
  
   
  inline BBox &operator += (Coords const &rhs)
    {
      if (empty()) { lb = rhs; ub = rhs; return(*this); }
      lb.min(rhs); ub.max(rhs); return(*this);
    }
  inline BBox operator + (Coords const &rhs) const
    { BBox bbox(*this); bbox += rhs; return(bbox); }
  
  inline BBox &operator += (BBox const &rhs)
    {
      if (empty()) return(*this = rhs);
      if (rhs.empty()) return(*this);
      lb.min(rhs.lb); ub.max(rhs.ub); return(*this);
    }
  inline BBox operator + (BBox const &rhs) const
    { BBox bbox(*this); bbox += rhs; return(bbox); }
  
   
  inline BBox &operator *= (BBox const &rhs)
    { lb.max(rhs.lb); ub.min(rhs.ub); 
    lb.ceiling(step); ub.floor(step);
    return(*this); }
  
  inline BBox operator * (BBox const &rhs) const
    { BBox both(*this); both.lb.max(rhs.lb); both.ub.min(rhs.ub); 
    both.lb.ceiling(both.step); both.ub.floor(both.step);
    return(both); }
  
  inline int intersects(BBox const &rhs) const
    { BBox both(*this); both.lb.max(rhs.lb); both.ub.min(rhs.ub); 
     
    return(!both.empty()); }
  
    
  inline int operator == (BBox const &rhs) const
    { return(((ub == rhs.ub) && (lb == rhs.lb)) || 
	     (empty() && rhs.empty())); }
  inline int operator != (BBox const &rhs) const 
    { return(!(*this == rhs)); } 
   
   

  inline int inside(const int i) const
    { return ( (i >= lb(0)) && (i <= ub(0)) ); }
  
  inline int inside(const int i, const int j) const
    { return ( ((i >= lb(0)) && (i <= ub(0)))
	       && ((j >= lb(1)) && (j <= ub(1)))); }
  
  inline int inside(const int i, const int j, const int k) const
    { return ( ((i >= lb(0)) && (i <= ub(0)))
	       && ((j >= lb(1)) && (j <= ub(1)))
	       && ((k >= lb(2)) && (k <= ub(2)))); }
  
  inline int inside(const int *c) const
    { return ( !((rank <= 0) ||
		 ((rank > 0) && (c[0] < lb(0) || c[0] > ub(0))) ||
		 ((rank > 1) && (c[1] < lb(1) || c[1] > ub(1))) ||     
		 ((rank > 2) && (c[2] < lb(2) || c[2] > ub(2)))
		 )) ; }
  
  inline int inside(Coords const &c) const
    { return (BBox::inside(c())); }
  
   

  inline int interior(const int i) const
    { return ( (i > lb(0)) && (i < ub(0)) ); }
  
  inline int interior(const int i, const int j) const
    { return ( ((i > lb(0)) && (i < ub(0)))
		&& ((j > lb(1)) && (j < ub(1)))); }
  
  inline int interior(const int i, const int j, const int k) const
    { return ( ((i > lb(0)) && (i < ub(0)))
	       && ((j > lb(1)) && (j < ub(1)))
	       && ((k > lb(2)) && (k < ub(2)))); }
  
  inline int interior(const int *c) const
    { return ( !((rank <= 0) ||
		 ((rank > 0) && (c[0] <= lb(0) || c[0] >= ub(0))) ||
		 ((rank > 1) && (c[1] <= lb(1) || c[1] >= ub(1))) ||     
		 ((rank > 2) && (c[2] <= lb(2) || c[2] >= ub(2)))
		 )) ; }
  inline int interior(Coords const &c) const
    { return (BBox::interior(c())); }
  
   
   






  
   
  inline int operator > (BBox const &rhs) const 
    { return( inside(rhs.upper()) && inside(rhs.lower()) ); } 
  inline int operator >= (BBox const &rhs) const 
    { return( (*this == rhs) || 
	      (inside(rhs.upper()) && inside(rhs.lower())) ); } 
  
  inline int operator < (BBox const &rhs) const 
    { return( rhs.inside(ub) && rhs.inside(lb) ); } 
  inline int operator <= (BBox const &rhs) const 
    { return( (rhs == *this) || 
	      (rhs.inside(ub) && rhs.inside(lb)) ); } 
  
   
  inline void accrete(const int i)
    { if (!empty()) { lb -= step*i; ub += step*i; } }
  inline void grow(const int i)
    { if (!empty()) { lb -= step*i; ub += step*i; } }
  
  inline void accrete(Coords const &c)
    { if (!empty()) { lb -= c*step; ub += c*step; } }
  inline void grow(Coords const &c)
    { if (!empty()) { lb -= c*step; ub += c*step; } }
  
  inline void growbydim(const short* c)
    {
      if (empty()) return;
      if (rank > 0) { lb(0) -= (step(0)*c[0]); ub(0) += (step(0)*c[1]); }
      if (rank > 1) { lb(1) -= (step(1)*c[2]); ub(1) += (step(1)*c[3]); }
      if (rank > 2) { lb(2) -= (step(2)*c[4]); ub(2) += (step(2)*c[5]); }
    }
  
  inline void shrinkbydim(const short* c)
    {
      if (empty()) return;
      if (rank > 0) { lb(0) += (step(0)*c[0]); ub(0) -= (step(0)*c[1]); }
      if (rank > 1) { lb(1) += (step(1)*c[2]); ub(1) -= (step(1)*c[3]); }
      if (rank > 2) { lb(2) += (step(2)*c[4]); ub(2) -= (step(2)*c[5]); }
    }
  
  inline void growupper(const int i)
    { if (!empty()) { ub += step*i; } }
  inline void growlower(const int i)
    { if (!empty()) { lb += step*i; } }
  
  inline void growupper(Coords const &c)
    { if (!empty()) { ub += step*c; } }
  inline void growlower(Coords const &c)
    { if (!empty()) { lb += step*c; } }
  
  inline void growupper(const int d, const int i)
    { if (!empty()) { ub(d) += i*step(d); } }
  inline void growlower(const int d, const int i)
    { if (!empty()) { lb(d) += i*step(d); } }
  
  inline void growupperbydim(const short* c)
    {
      if (empty()) return;
      if (rank > 0) { ub(0) += (step(0)*c[0]); }
      if (rank > 1) { ub(1) += (step(1)*c[1]); }
      if (rank > 2) { ub(2) += (step(2)*c[2]); }
    }
  inline void growlowerbydim(const short* c)
    {
      if (empty()) return;
      if (rank > 0) { lb(0) += (step(0)*c[0]); }
      if (rank > 1) { lb(1) += (step(1)*c[1]); }
      if (rank > 2) { lb(2) += (step(2)*c[2]); }
    }
  
  inline void shrinkupperbydim(const short* c)
    {
      if (empty()) return;
      if (rank > 0) { ub(0) -= (step(0)*c[0]); }
      if (rank > 1) { ub(1) -= (step(1)*c[1]); }
      if (rank > 2) { ub(2) -= (step(2)*c[2]); }
    }
  inline void shrinklowerbydim(const short* c)
    {
      if (empty()) return;
      if (rank > 0) { lb(0) -= (step(0)*c[0]); }
      if (rank > 1) { lb(1) -= (step(1)*c[1]); }
      if (rank > 2) { lb(2) -= (step(2)*c[2]); }
    }
  
  inline void shift(const int c)
    { if (!empty()) { lb+=step*c ; ub+=step*c; } }
  inline void shift(Coords const &c)
    { if (!empty()) { lb+=step*c ; ub+=step*c; } }
  inline void shift(const int d, const int c)
    { if (!empty()) { lb(d)+=step(d)*c ; ub(d)+=step(d)*c; } }
  
   
  inline void coarsen(const int by)
    { if (!empty()) 
      { step *= by; lb = (lb/step)*step; ub = (ub/step)*step; } }
  inline void coarsen(Coords const &by)
     { if (!empty()) 
       { step *= by; lb = (lb/step)*step; ub = (ub/step)*step; } }
  inline void coarsen(const int d, const int by)
    { if (!empty()) { 
      step(d) *= by;
      lb(d) = (lb(d)/step(d))*step(d);
      ub(d) = (ub(d)/step(d))*step(d); } }   
   
   
  inline void refine(const int by) { step /= by; }
  inline void refine(Coords const &by) { step /= by;}

   
  inline void refine(const int by, const int olap) 
    { step /= by; ub += (step*(olap*(by-1))); }
   
   
  inline void refine(const int d, const int by, const int olap) 
    { step(d) /= by; ub(d) += (step(d)*(olap*(by-1))); }








};

istream& operator >> (istream& s, BBox & bb);
ostream& operator << (ostream& s, const BBox &bb);
ifstream& operator >> (ifstream& s, BBox& bb);
ofstream& operator << (ofstream& s, const BBox& bb);

# 434 "BBox.h"


 
inline Coords &upper(BBox &bb)
{ return (bb.upper()); }
inline int upper(BBox &bb, const int i)
{ return (bb.upper(i)); }

inline Coords &lower(BBox &bb)
{ return (bb.lower()); }
inline int lower(BBox &bb, const int i)
{ return (bb.lower(i)); }

inline Coords &stepsize(BBox &bb)
{ return (bb.stepsize()); }
inline int stepsize(BBox &bb, const int i)
{ return (bb.stepsize(i)); }

inline Coords extents(BBox &bb)
{ return (bb.extents()); }
inline int extents(BBox &bb, const int i)
{ return (bb.extents(i)); }

inline int size(BBox &bb)
{ return (bb.size()); }
inline int inside(BBox &bb, Coords const &c)
{ return (bb.inside(c)); }

 
inline BBox accrete(BBox const &bbox, Coords const &c)
{ const Coords& u = bbox.upper(); const Coords& l = bbox.lower(); 
 const Coords& s = bbox.stepsize();
 return ( (bbox.empty()) ? bbox : BBox(l-c*s, u+c*s, s) ); }
inline BBox grow(BBox const &bbox, Coords const &c)
{ const Coords& u = bbox.upper(); const Coords& l = bbox.lower(); 
 const Coords& s = bbox.stepsize();
 return ( (bbox.empty()) ? bbox : BBox(l-c*s, u+c*s, s) ); }

inline BBox accrete(BBox const &bbox, const int c)
{ const Coords& u = bbox.upper(); const Coords& l = bbox.lower(); 
 const Coords& s = bbox.stepsize();
 return ( (bbox.empty()) ? bbox : BBox(l-s*c, u+s*c, s) ); }
inline BBox grow(BBox const &bbox, const int c)
{ const Coords& u = bbox.upper(); const Coords& l = bbox.lower(); 
 const Coords& s = bbox.stepsize();
 return ( (bbox.empty()) ? bbox : BBox(l-s*c, u+s*c, s) ); }

BBox* accrete(BBox const *const bbox, const int n, const int c);
BBox* grow(BBox const *const bbox, const int n, const int c);

BBox* accrete(BBox const *const bbox, const int n, Coords const &c);
BBox* grow(BBox const *const bbox, const int n, Coords const &c);

inline BBox growupper(BBox const &bbox, const int c)
{ const Coords& u = bbox.upper(); const Coords& l = bbox.lower(); 
 const Coords& s = bbox.stepsize();
 return ( (bbox.empty()) ? bbox : BBox(l, u+s*c, s) ); }
inline BBox growlower(BBox const &bbox, const int c)
{ const Coords& u = bbox.upper(); const Coords& l = bbox.lower(); 
 const Coords& s = bbox.stepsize();
 return ( (bbox.empty()) ? bbox : BBox(l+s*c, u, s) ); }

inline BBox growupper(BBox const &bbox, const int d, const int c)
{
  if (bbox.empty()) return(bbox);
  const Coords& l = bbox.lower(); const Coords& s = bbox.stepsize();
  Coords u = bbox.upper(); u(d) += c*s(d);
  return(BBox(l, u, s));
}
inline BBox growlower(BBox const &bbox, const int d, const int c)
{
  if (bbox.empty()) return(bbox);
  const Coords& u = bbox.upper(); const Coords& s = bbox.stepsize();
  Coords l = bbox.lower(); l(d) += c*s(d);
  return(BBox(l, u, s));
}

inline BBox growbydim(BBox const &bbox, const short* c)       
{
  BBox bb(bbox);
  if (bb.empty()) return(bb);
  if (bb.rank > 0)
    {bb.lower(0) -= (bb.stepsize(0)*c[0]);bb.upper(0) += (bb.stepsize(0)*c[1]);}
  if (bb.rank > 1)
    {bb.lower(1) -= (bb.stepsize(1)*c[2]);bb.upper(1) += (bb.stepsize(1)*c[3]);}
  if (bb.rank > 2)
    {bb.lower(2) -= (bb.stepsize(2)*c[4]);bb.upper(2) += (bb.stepsize(2)*c[5]);}
  return bb;
}
inline BBox growupperbydim(BBox const &bbox, const short* c)  
{
  BBox bb(bbox);
  if (bb.empty()) return(bb);
  if (bb.rank > 0)
    {bb.upper(0) += (bb.stepsize(0)*c[0]);}
  if (bb.rank > 1)
    {bb.upper(1) += (bb.stepsize(1)*c[1]);}
  if (bb.rank > 2)
    {bb.upper(2) += (bb.stepsize(2)*c[2]);}
  return bb;
}
inline BBox growlowerbydim(BBox const &bbox, const short* c)  
{
  BBox bb(bbox);
  if (bb.empty()) return(bb);
  if (bb.rank > 0)
    {bb.lower(0) += (bb.stepsize(0)*c[0]);}
  if (bb.rank > 1)
    {bb.lower(1) += (bb.stepsize(1)*c[1]);}
  if (bb.rank > 2)
    {bb.lower(2) += (bb.stepsize(2)*c[2]);}
  return bb;
}

inline BBox shrinkbydim(BBox const &bbox, const short* c)     
{
  BBox bb(bbox);
  if (bb.empty()) return(bb);
  if (bb.rank > 0)
    {bb.lower(0) += (bb.stepsize(0)*c[0]);bb.upper(0) -= (bb.stepsize(0)*c[1]);}
  if (bb.rank > 1)
    {bb.lower(1) += (bb.stepsize(1)*c[2]);bb.upper(1) -= (bb.stepsize(1)*c[3]);}
  if (bb.rank > 2)
    {bb.lower(2) += (bb.stepsize(2)*c[4]);bb.upper(2) -= (bb.stepsize(2)*c[5]);}
  return bb;
}
inline BBox shrinkupperbydim(BBox const &bbox, const short* c)  
{
  BBox bb(bbox);
  if (bb.empty()) return(bb);
  if (bb.rank > 0)
    {bb.upper(0) -= (bb.stepsize(0)*c[0]);}
  if (bb.rank > 1)
    {bb.upper(1) -= (bb.stepsize(1)*c[1]);}
  if (bb.rank > 2)
    {bb.upper(2) -= (bb.stepsize(2)*c[2]);}
  return bb;
}
inline BBox shrinklowerbydim(BBox const &bbox, const short* c)  
{
  BBox bb(bbox);
  if (bb.empty()) return(bb);
  if (bb.rank > 0)
    {bb.lower(0) -= (bb.stepsize(0)*c[0]);}
  if (bb.rank > 1)
    {bb.lower(1) -= (bb.stepsize(1)*c[1]);}
  if (bb.rank > 2)
    {bb.lower(2) -= (bb.stepsize(2)*c[2]);}
  return bb;
}

 
inline BBox shiftabs(BBox const &bb, const int c)
{ return(BBox(bb.lower()+c, bb.upper()+c, bb.stepsize())); }
inline BBox shiftabs(BBox const &bb, Coords const &c)
{ return(BBox(bb.lower()+c, bb.upper()+c, bb.stepsize())); }

inline BBox shift(BBox const &bb, const int c)
{ return(BBox(bb.lower()+bb.stepsize()*c, 
	      bb.upper()+bb.stepsize()*c,bb.stepsize())); }
inline BBox shift(BBox const &bb, Coords const &c)
{ return(BBox(bb.lower()+c*bb.stepsize(), 
	      bb.upper()+c*bb.stepsize(),bb.stepsize())); }

inline BBox shiftabs(BBox const &bbox, const int d, const int c)
{
  if (bbox.empty()) return(bbox);
  Coords u = bbox.upper(); u(d) += c;
  Coords l = bbox.lower(); l(d) += c;
  return(BBox(l, u, bbox.stepsize()));
}
inline BBox shift(BBox const &bbox, const int d, const int c)
{
  if (bbox.empty()) return(bbox);
  Coords u = bbox.upper(); u(d) += c*bbox.stepsize(d);
  Coords l = bbox.lower(); l(d) += c*bbox.stepsize(d);
  return(BBox(l, u, bbox.stepsize()));
}

 
inline BBox coarsen(BBox const &bbox, const int by)
{ Coords s = bbox.stepsize() * by;
 const Coords& u = bbox.upper(); const Coords& l = bbox.lower();
 return ((bbox.empty()) ? bbox : BBox((l/s)*s,(u/s)*s,s)); }
inline BBox coarsen(BBox const &bbox, Coords const by)
{ Coords s = bbox.stepsize() * by;
 const Coords& u = bbox.upper(); const Coords& l = bbox.lower();
 return ((bbox.empty()) ? bbox : BBox((l/s)*s,(u/s)*s,s)); }
inline BBox coarsen(BBox const &bbox, const int d, const int by)
{ Coords s = bbox.stepsize(); s(d) *= by;
 const Coords& u = bbox.upper(); const Coords& l = bbox.lower();
 return ((bbox.empty()) ? bbox : BBox((l/s)*s,(u/s)*s,s)); }

 
inline BBox refine(const BBox& bbox, const int by) 
{ return (BBox(bbox.lower(),bbox.upper(),bbox.stepsize()/by)); }
inline BBox refine(const BBox& bbox, const Coords& by) 
{ return (BBox(bbox.lower(),bbox.upper(),bbox.stepsize()/by)); }

 
inline BBox refine(const BBox& bbox, const int by, const int olap) 
{ Coords s = bbox.stepsize(); s /= by;
 return (BBox(bbox.lower(),bbox.upper()+(s*(olap*(by-1))),s)); }
 


inline BBox refine(const BBox& bbox, const int d, const int by, 
		   const int olap)   
{ Coords s(bbox.stepsize()); s(d) /= by; 
 Coords u(bbox.upper()); u(d) += s(d)*(olap*(by-1));
 return (BBox(bbox.lower(),u,s)); }

# 1 "CoordsIterator.h" 1


# 1 "BBox.h" 1
# 648 "BBox.h"

# 3 "CoordsIterator.h" 2



class CoordsIterator {
  BBox b;
  int i[3];
  int r;
  
  void set(BBox& bi) {
    b = bi;
    for(int n=0;n<b.rank;n++)
      i[n]=b.lower(n);
    r = b.rank - 1;
  }
  void inc(int n) {
    i[n] += b.stepsize(n);
    if(n < r && i[n] > b.upper(n)) {
      i[n] = b.lower(n);
      inc(n+1);
    }
  }
 public:
  CoordsIterator() {}
  CoordsIterator(BBox bi) { set(bi); }
  CoordsIterator& operator=(BBox& bi) {
    set(bi);
    return *this;
  }
  ~CoordsIterator() {}
  void operator++() { inc(0); }
  void operator++(int) { inc(0); }
  int good() {
    return i[r] <= b.upper(r);
  }
  operator int() { return good(); }
  Coords operator*() { return Coords(r+1,i); }
};

inline ostream&
operator<<(ostream& o,CoordsIterator& bbi) {
  return o << *bbi;
}

# 646 "BBox.h" 2



# 15 "GridBox.h" 2




class GridBox 
{
  friend ostream& operator<<(ostream&, const GridBox&);
  friend ofstream& operator<<(ofstream&, const GridBox&);
  friend ifstream& operator>>(ifstream&, GridBox&);
  friend class GridBoxList;
  
  short int owner;		 
  short int index;		 
  short int pindex;              
  short int crslev; 		 
  short int finelev; 		 
  short int levstep;             

  BBox bbox;                     

public:
   
  inline GridBox(void)
    : owner(((-1) ) ), 
      index((-1) ), 
      pindex((-1) ),
      crslev(0), 
      finelev(0), 
      levstep(0) {}
  
  inline GridBox(const int own, 
		 const int idx, 
		 const int pidx,
		 const int clev, 
		 const int flev, 
		 const int lstep, 
		 const BBox& bb)
    : owner(own), 
      index(idx),
      pindex(pidx),
      crslev(clev), 
      finelev(flev), 
      levstep(lstep), 
      bbox(bb) {}
  
  inline GridBox(GridBox const &other)
    : owner(other.owner), 
      index(other.index),
      pindex(other.pindex),
      crslev(other.crslev), 
      finelev(other.finelev), 
      levstep(other.levstep), 
      bbox(other.bbox) {}
  
  inline ~GridBox(void) {}

  inline GridBox const &operator= (GridBox const &other)
    { 
      owner=other.owner; 
      index=other.index;
      pindex=other.pindex;
      crslev=other.crslev; 
      finelev=other.finelev; 
      levstep=other.levstep;
      bbox=other.bbox; 
      return (*this); 
    }
  
  inline void SetGridBox(const int own, 
			 const int idx, 
			 const int pidx,
			 const int clev, 
			 const int flev, 
			 const int lstep, 
			 const BBox& bb)
    { 
      owner=own; 
      index=idx; 
      pindex=pidx;
      crslev=clev; 
      finelev=flev; 
      levstep=lstep; 
      bbox=bb; 
    }
  
  inline int GetCardinality(const int dim, 
			    const int lev) const
    { return (int)1<<(lev*dim); }
  
   
  inline int operator== (GridBox const &other) const
    {
      if ((this == &other) || (crslev == other.crslev && 
	   gbBBox(crslev) == other.gbBBox(crslev))) return 1;
       else return 0;
    }

    
  inline int gbOwner(void) const { return (owner); }
  inline int gbIndex(void) const { return (index); }
  inline int gbPIndex(void) const { return (pindex); }
  inline int gbRank(void) const { return (bbox.rank); }
  inline int gbFineLev(void) const { return (finelev); }
  inline int gbCrsLev(void) const { return (crslev); }
  inline int gbNumLev(void) const 
    { return ((finelev-crslev)/levstep+1); }
  inline int gbLevStep(void) const { return (levstep); }
  inline int gbLevIndex(const int lev) const
    { return ((lev-crslev)/levstep); }

  inline int gbContains(const int lev) const
    { return (lev<=finelev && lev>=crslev); }
  inline int gbContains(const int minlev, 
			const int maxlev) const
    { return (minlev<=finelev && maxlev>=crslev); }

  inline void gbSetIndex(const int idx) { index = idx; }
  inline void gbSetOwner(const int p) { owner = p; }

  int gbNum(const int overlap) const;
  int gbWork(const int clev,
	     const int overlap) const;
  int gbNum(const int lev, 
	    const int overlap) const;
  int gbWork(const int lev, 
	     const int clev,
	     const int overlap) const;

  int gbNum(const short* overlap) const;
  int gbWork(const int clev,
	     const short* overlap) const;
  int gbNum(const int lev, 
	    const short* overlap) const;
  int gbWork(const int lev, 
	     const int clev,
	     const short* overlap) const;

  inline void gbSetBBox(const BBox& bb) { bbox = bb; }

  inline const BBox& gbBBox(void) const { return bbox; }

  inline BBox gbBBox(const int lev) const 
    { return ((lev == finelev) ? bbox : (lev < finelev && lev >= crslev) ?
	      coarsen(bbox,GetCardinality(1,finelev-lev)) :
	      BBox::_empty_bbox); }
  
  inline BBox gbBBoxAbs(const int lev) const 
    { return ((lev == finelev) ? bbox : (lev < finelev) ?
	      coarsen(bbox,GetCardinality(1,finelev-lev)) :
	      refine(bbox,GetCardinality(1,lev-finelev),1)); }
				
  BBox gbBBox(const int lev, 
	      const int olap,
	      const int extgh=0) const;
  BBox gbBBox(const int lev, 
	      const short* olap,
	      const int extgh=0) const;
  BBox gbBBox(const int lev, 
	      const short* olap,
	      const short* extgh) const;
  
  BBox gbBBoxAbs(const int lev, 
		 const int olap,
		 const int extgh=0) const;
  BBox gbBBoxAbs(const int lev, 
		 const short* olap,
		 const int extgh=0) const;

  BBox gbBBox(const int minl, 
	      const int maxl, 
	      const short* olap, 
	      const int extgh=0) const;
  
    
  inline void gbGetLevels(GridBox &gb, 
			  const int lev) const
    { 
      gb.owner=owner; 
      gb.index=index;
      gb.pindex=pindex;
      gb.crslev=lev; 
      gb.finelev=lev; 
      gb.levstep=levstep; 
      gb.bbox=gbBBoxAbs(gb.finelev); 
    }

   inline void gbRefine(GridBox &gb, 
			const int levs) const
     { 
       gb.owner=owner; 
       gb.index=index;
       gb.pindex=pindex;
       gb.crslev=finelev+levstep; 
       gb.finelev=finelev+levstep*levs; 
       gb.levstep=levstep; 
       gb.bbox=gbBBoxAbs(gb.finelev); 
     }

    
   inline void gbSetLevels(GridBox &gb, 
			   const int lev) const
    { 
      gb.crslev=lev; 
      gb.finelev=lev; 
      gb.bbox=gbBBoxAbs(gb.finelev); 
    }

   inline void gbSetRefine(GridBox &gb,
			   const int levs) const
    { 
      gb.crslev=gb.finelev+gb.levstep;
      gb.finelev+=(gb.levstep*levs);
      gb.bbox=gbBBoxAbs(gb.finelev); 
    }
};

ostream&  operator << (ostream& os, const GridBox& gb);
ofstream& operator << (ofstream& ofs, const GridBox& gb);
ifstream& operator >> (ifstream& ifs, GridBox& gb);





# 18 "ACEDistribution.h" 2

# 1 "GridBoxList.h" 1



  











# 1 "BBoxList.h" 1



 












# 1 "BucketType.h" 1



 







# 1 "SimpleBucketVoid.h" 1




 







# 1 "/usr/include/assert.h" 1 3
 

















 
























 




# 63 "/usr/include/assert.h" 3


extern "C" { 

 
extern void __assert_fail (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function)
     throw ()  __attribute__ ((__noreturn__));

 
extern void __assert_perror_fail (int __errnum, __const char *__file,
				  unsigned int __line,
				  __const char *__function)
     throw ()  __attribute__ ((__noreturn__));


 

extern void __assert (const char *__assertion, const char *__file, int __line)
     throw ()  __attribute__ ((__noreturn__));


} 













 















# 13 "SimpleBucketVoid.h" 2

# 1 "/usr/include/memory.h" 1 3
 

















 















# 14 "SimpleBucketVoid.h" 2








# 1 "System.h" 1



 






typedef unsigned long pointer;


# 22 "SimpleBucketVoid.h" 2















struct rechdr 
  {
   unsigned mysize; unsigned myoff;
   unsigned noff; unsigned poff;
   pointer head;
  };

struct reclink 
  {
   unsigned mysize; unsigned myoff;
   unsigned noff; unsigned poff;
   pointer head;
   unsigned next;
  };

struct recdata 
  {
   unsigned mysize; unsigned myoff;
   unsigned noff; unsigned poff;
   pointer head;
   unsigned data[2];
  };

struct bkthdr 
  {
   unsigned blksize; unsigned nblks;
   unsigned headoff; unsigned tailoff;
   unsigned freeoff; unsigned cnt;
  };

union record 
  {
   struct bkthdr bhdr;
   struct rechdr hdr;
   struct reclink link;
   struct recdata rec;
   unsigned data[1];
 
   inline int isempty(void) { return (hdr.mysize == 0); }
   friend ostream& operator<<(ostream&, union record&);
  };
   
struct bkt
  {
   union record *head;

   inline bkt(void) : head(0) {}
   bkt(unsigned const blksize, unsigned const nblks);
   bkt(struct bkt const &other);
   bkt(union record const *hdr);
   bkt(union record *hdr);
   inline ~bkt(void) 
     { 





      delete [] ((char *)head); 
     }

   friend ostream& operator<<(ostream&, struct bkt&);
  };






class SimpleBucketVoid 
  {
   friend ostream& operator<<(ostream&, SimpleBucketVoid&);

   unsigned blksize;
   unsigned nblks;

   struct bkt *bktptr;
   unsigned freeoff;

   void operator = (const SimpleBucketVoid&);

public:
   inline SimpleBucketVoid(void)
	: blksize(0), nblks(0), bktptr(0), freeoff(0) {}

   SimpleBucketVoid(unsigned const bktsize, unsigned const bktnum);
   SimpleBucketVoid(union record *hdr);
   SimpleBucketVoid(union record const *hdr);
   SimpleBucketVoid(union record const *hdr, unsigned const size, int const n);
   SimpleBucketVoid(const SimpleBucketVoid&);	

   inline ~SimpleBucketVoid(void) { delete bktptr; }

private:
   void allocbkt(int const incr = (128) );
   
   inline union record *copydata(union record *to, const union record *from)
	{	 
          memcpy((void *)(((char *)to)+sizeof(struct rechdr)),
                 (void *)(((char const *)from)+sizeof(struct rechdr)),
	         blksize-sizeof(struct rechdr));
	   
	   
          return (to);
	}

    

   inline union record *bktGetHeadRec(union record const *bhead) const
	{ return ((union record *)
		((char const *)(bhead)+(blksize*bhead->bhdr.headoff))); }

   inline union record *bktGetTailRec(union record const *bhead) const
	{ return ((union record *)
		((char const *)(bhead)+(blksize*bhead->bhdr.tailoff))); }

   inline union record *bktGetFreeRec(union record const *bhead) const
	{ return ((union record *)
		((char const *)(bhead)+(blksize*bhead->bhdr.freeoff))); }

   inline union record *bktGetAtRec(union record const *bhead,
		unsigned const off) const
	{ return ((union record *)
		((char const *)(bhead)+(blksize*off))); }
  
   inline unsigned bktGetheadoff(union record const *bhead) const
	{ return (bhead->bhdr.headoff); }
   inline void bktSetheadoff(union record *bhead, unsigned const off) 
	{ bhead->bhdr.headoff = off; }

   inline unsigned bktGettailoff(union record const *bhead) const
	{ return (bhead->bhdr.tailoff); }
   inline void bktSettailoff(union record *bhead, unsigned const off) 
	{ bhead->bhdr.tailoff = off; }

   inline unsigned bktGetfreeoff(union record const *bhead) const
	{ return (bhead->bhdr.freeoff); }
   inline void bktSetfreeoff(union record *bhead, unsigned const off) 
	{ bhead->bhdr.freeoff = off; }

   inline unsigned bktGetcnt(union record const *bhead) const
	{ return (bhead->bhdr.cnt); }
   inline void bktSetcnt(union record *bhead, unsigned const cnt) 
	{ bhead->bhdr.cnt = cnt; }
   inline void bktIncrcnt(union record *bhead)
	{ bhead->bhdr.cnt++; }
   inline void bktDecrcnt(union record *bhead)
	{ bhead->bhdr.cnt--; }

    
  
   inline union record *recPrevRec(union record const *rec) const
        {
 	 return ( (rec->hdr.poff != ((unsigned) (0)) ) ?
         (union record *) ((char *)(rec->hdr.head)+(blksize*rec->hdr.poff)) :
         (union record *) (0) );
        }

   inline union record *recNextRec(union record const *rec) const
        {
 	 return ( (rec->hdr.noff != ((unsigned) (0)) ) ?
         (union record *) ((char *)(rec->hdr.head)+(blksize*rec->hdr.noff)) :
         (union record *) (0) );
        }
  
   inline union record *recAtRec(union record const *rec,
		unsigned const off) const
        {
 	 return ( (off != ((unsigned) (0)) ) ?
         (union record *) ((char *)(rec->hdr.head)+(blksize*off)) :
         (union record *) (0) );
        }

   union record *bktaddrec(union record *bhead);
   inline union record *bktaddrec(union record *bhead, const union record *rec)
	{
	  
	  
	  
	 return ( copydata(bktaddrec(bhead),rec) );
	}

   void bktaddfree(union record *bhead, union record *rec);

protected:
   inline int blks(void) { return (nblks-1);}
   inline int bsize(void) { return (blksize);}

   union record *addrec(void);
private:
   inline union record *addrec(const union record* rec)
        {
	  
	  
	  

# 241 "SimpleBucketVoid.h"

	 return ( copydata(addrec(),rec) );

	}

protected:
   union record *insertrec(union record*& after);
private:
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 

protected:
   void removerec(union record *rec);

    
   inline union record *nextrec(union record const *rec) const
	{ 
         return ( 
 	 (rec->hdr.myoff != bktGettailoff((union record *)rec->hdr.head)) ?
         (union record *) ((char *)(rec->hdr.head)+(blksize*rec->hdr.noff)) :
         (union record *) (0) );
	} 

   inline union record *prevrec(union record const *rec) const
	{ 
	 return (
         (rec->hdr.myoff != bktGetheadoff((union record *)rec->hdr.head)) ?
         (union record *) ((char *)(rec->hdr.head)+(blksize*rec->hdr.poff)) :
         (union record *) (0) );
	} 

   inline union record *headrec(void) const
	{
         return ( (bktptr->head->bhdr.cnt > 0) ?
	 bktGetHeadRec(bktptr->head) : ((union record *) 0)  );
	} 

   inline union record *tailrec(void) const
	{
         return ( (bktptr->head->bhdr.cnt > 0) ?
	 bktGetTailRec(bktptr->head) : ((union record *) 0)  );
	} 

   inline unsigned count(void) const
	{ return (bktGetcnt(bktptr->head)); }

public:
    
   inline int isemptybkt(void) { return (bktptr->head->bhdr.cnt == 0); }
   void emptybkt(void);

   void splitbkt(SimpleBucketVoid &sbv, union record *atrec);

   void *pack(unsigned &size);
   void pack(void *&package, unsigned &size);
   void *pack(int &size);
   void pack(void *&package, int &size);
  };


# 12 "BucketType.h" 2


template <class Type>
class Bucket : public SimpleBucketVoid
  {
   union record *cur;

   static inline void copytypedata(char *to, char const *from)
	{ 
          memcpy((void *)to, (void *)from, sizeof(Type));
           
        }

public:
   inline Bucket(const unsigned bktnum)
	:SimpleBucketVoid(sizeof(Type),bktnum), cur(0) {}

   inline Bucket(void const *package)
	:SimpleBucketVoid((union record const *) package), cur(0) {}

   inline Bucket(void *package)
	:SimpleBucketVoid((union record *) package), cur(0) {}

   inline Bucket(void const *package,unsigned const size, int const n)
	:SimpleBucketVoid((union record const *) package, size, n), cur(0) {}

   inline Bucket(Bucket<Type> const &other)
	:SimpleBucketVoid(other), cur(0) {}

   inline Type* add(void)
	{ cur = addrec(); return ( ((Type *) cur->rec.data) ); }
   inline Type* add(Type const &t)
	{ 




	 cur = addrec(); 



	 copytypedata((char *) cur->rec.data, (char *) &t);

	 return ( ((Type *) cur->rec.data) );
        }

   inline Type* insert(void)
	{ cur = insertrec(cur); return ( ((Type *) cur->rec.data) ); }
   inline Type* insert(Type const &t)
	{




 	 cur = insertrec(cur); 



	 copytypedata((char *) cur->rec.data, (char *) &t);

	 return ( ((Type *) cur->rec.data) );
        }

   inline Type* first(void)
	{ 
	 cur = headrec(); 
         return ( (cur != ((union record *) 0)  && !cur->isempty()) ? 	   (Type *) cur->rec.data : (Type *) __null  );

	}

   inline Type* last(void) 
	{ 
	 cur = tailrec(); 
         return ( (cur != ((union record *) 0)  && !cur->isempty()) ? 	   (Type *) cur->rec.data : (Type *) __null  );

	}

   inline Type* current(void) const
	{ 
         return ( (cur != ((union record *) 0)  && !cur->isempty()) ? 	   (Type *) cur->rec.data : (Type *) __null  );

	}

   Type *remove(void);
   Type *prev(void);
   Type *next(void);

   inline union record *currec(void)
        { return (cur); }

   inline void setcurrec(union record *c)
        { cur = c; }

   inline void empty(void)
	{ SimpleBucketVoid::emptybkt(); cur = ((union record *) 0) ; }

   inline void split(Bucket<Type>& bt)
	{
         union record *r = prevrec(cur); 
         SimpleBucketVoid::splitbkt((SimpleBucketVoid &)bt, cur);
 	 bt.cur = ((union record *) 0) ;
         cur = r;
	}
  };






# 17 "BBoxList.h" 2













class BBoxList : public Bucket<BBox>
{
  friend ostream& operator << (ostream& s, const BBoxList& bbl);
  friend ofstream& operator << (ofstream& s, const BBoxList& bbl);
  friend ifstream& operator >> (ifstream& s, BBoxList& bbl);
  
  friend class BBox;
  
  int num;
  
 private:
   
   
   
  inline int setstats(void)
    {
      num = 0;
      for ( BBox *b=first();b!= ((BBox *) __null ) ;b=next() ) num++;
      return num;
    }
  
 public:
   
   
   
  inline BBoxList()
    : Bucket<BBox>((128) ), num(0) {}
  
   
   
  inline BBoxList(unsigned const maxnum, const int dumarg) 
    : Bucket<BBox>(maxnum), num(0) {}
  
  inline BBoxList(void const *package, unsigned const size, const int n)
    : Bucket<BBox>(package, size, n), num(0)
    { setstats(); }
  
   







  inline BBoxList(BBoxList const &other)
    : Bucket<BBox>(other), num(other.num) {}
  
  BBoxList &operator = (const BBoxList&);
  
   
   
   
  inline ~BBoxList(void) {}
  
   
   
   
  inline int number() const { return(num); }
  inline int isempty() const { return(num == 0); }
  
   
   
   
  inline void empty(void)
    { Bucket<BBox>::empty(); num = 0; }
  
   
   
   
   
   
   
   
  void operator -= (BBoxList const &rhs);  
   

  void intersect(const BBox& bbox, BBoxList& bbl);
  void intersect(BBoxList& inbbl, BBoxList& bbl);

  void cclevelintersect(const BBox& bbox, BBoxList& bbl);
  void cclevelintersect(BBoxList& inbbl, BBoxList& bbl);
  void vclevelintersect(const BBox& bbox, BBoxList& bbl);
  void vclevelintersect(BBoxList& inbbl, BBoxList& bbl);
 private:
   
   
   
  void nest(const BBoxList &rhs);
  
 public:
   
   
   
  void mergeboxes(const short* olap);

   
   
   
  void prune(const int minw, 
	     const int maxw);
  void prune_box(const BBox& wholebbox, 
		 BBoxList& boxes,
		 const int minw, 
		 const int maxw);

   
   
   
  void combine(const BBoxList &rhs);
  
   
   
   
  void refine(const int factor, const int olap);
  
   
   
   
  BBox reduce();
  
   
   
   
  int difference(BBoxList& bbl, 
		 const BBox lhs,
		 const BBox rhs);
  
   
   
   
  inline BBox *add()
    { num++; return (Bucket<BBox>::add()); }
  inline BBox *add(BBox const &bb)
    { num++; return (Bucket<BBox>::add(bb)); }
  inline BBox *insert(BBox const &bb)
    { num++; return (Bucket<BBox>::insert(bb)); }
  inline void remove(void)
    { 
      BBox *bb = current();
      if (bb) { num--; Bucket<BBox>::remove(); }
    }
  
   
   
   
  inline void split(BBoxList &bbl)
    {
      Bucket<BBox>::split((Bucket<BBox> &) bbl);
      bbl.setstats(); num -= bbl.num;
    }


  void checkoverlap();

};

ostream& operator<<(ostream&, const BBoxList&);
ofstream& operator<<(ofstream&, const BBoxList&);
ifstream& operator>>(ifstream&, BBoxList&);

 
 
 
inline BBox *first(BBoxList &bbl)
{ return (bbl.first()); }
inline BBox *next(BBoxList &bbl)
{ return (bbl.next()); }
inline BBox *prev(BBoxList &bbl)
{ return (bbl.prev()); }
inline BBox *current(BBoxList &bbl)
{ return (bbl.current()); }
inline BBox *last(BBoxList &bbl)
{ return (bbl.last()); }

inline void add(BBoxList &bbl, BBox const &bb)
{ bbl.add(bb); }
inline void insert(BBoxList &bbl, BBox const &bb)
{ bbl.insert(bb); }
inline void remove(BBoxList &bbl)
{ bbl.remove(); }

inline int number(BBoxList const &bbl)
{ return (bbl.number()); }
inline int isempty(BBoxList const &bbl)
{ return (bbl.isempty()); }

inline void empty(BBoxList &bbl)
{ bbl.empty(); }

# 16 "GridBoxList.h" 2



# 1 "ObjectCounter.h" 1



 
























class ObjectCounter
  {
   int references;
public:
   inline ObjectCounter() : references(1) { }
   inline ObjectCounter *alias() { references++; return(this); }
   inline void free() { if (--references == 0) delete this; }
    
   inline virtual ~ObjectCounter() { }
  };


# 19 "GridBoxList.h" 2








 



class GridBoxList : public Bucket<GridBox>, public ObjectCounter
  {
   friend ostream& operator<<(ostream&, const GridBoxList&);
   friend ofstream& operator<<(ofstream&, const GridBoxList&);
   friend ifstream& operator>>(ifstream&, GridBoxList&);

   int num;

private:
   static inline void copytypedata(GridBox* to, const GridBox* from)
     { memcpy((void *) to, (void *) from, sizeof(GridBox)); }

    
    
    
   inline void setstats(void)
     {num=0;for (register GridBox *g=first();g;g=next())num++;}

public:
    
    
    
   inline GridBoxList()
     : Bucket<GridBox>((32) ), num(0) {}

    
    
   inline GridBoxList(const int maxnum, const int dumarg)
     : Bucket<GridBox>(maxnum), num(0) {}

   inline GridBoxList(const void* package, const int size, 
	       const int n)
     : Bucket<GridBox>(package, size, n), num(0) { setstats(); }

   inline GridBoxList(const GridBoxList& other)
     : Bucket<GridBox>(other), num(other.num) {}

    
    
    
   GridBoxList& operator = (const GridBoxList&);

    
    
    
   inline ~GridBoxList(void) {}

    
    
    
   inline GridBoxList *alias()
	{ return((GridBoxList *) ObjectCounter::alias()); }

    
    
    
   int difference(GridBoxList& gbl, 
		  const GridBox lhs, 
		  const GridBox rhs);
   int intersection(GridBoxList& gbl, 
		    const GridBox lhs, 
		    const GridBox rhs);
   void operator -= (const GridBoxList& rhs);  
   void operator *= (const GridBoxList& rhs);  
    
    
    

    
    
    
private: 
    
    
    
 
    
    
    
public:
   void intersect(const BBox& rhs, const int lev, GridBoxList& gbl);
   void intersect(const BBox& rhs, const int lev, GridBoxList& gbl, 
                  const int olap, const int extgh=0);
   void intersect(const BBoxList& rhs, const int lev, GridBoxList& gbl, 
                  const int olap, const int extgh=0);
   void intersect(const BBox& rhs, const int lev, GridBoxList& gbl, 
                  const short* olap, const int extgh=0);
   void intersect(const BBoxList& rhs, const int lev, GridBoxList& gbl,
                  const short* olap, const int extgh=0);

    
    
    
public:
   inline int isempty() const { return(num == 0); }
   inline int number() const { return(num); }

   int load(const int clev, 
	    const int olap,
	    const int pid);
   int load(const int lev, 
	    const int clev,
	    const int olap,
	    const int pid);
   int numelems(const int olap,
		const int pid);
   int numelems(const int lev, 
		const int olap,
		const int pid);
  
   int load(const int clev,
	    const short* olap,
	    const int pid);
   int load(const int lev, 
	    const int clev,
	    const short* olap,
	    const int pid);
   int numelems(const short* olap,
		const int pid);
   int numelems(const int lev, 
		const short* olap,
		const int pid);

   int numprocs(void);

   int coarsest(void);
   int finest(void);
   int smallest(const int level);
   int maxindex(void);

   int matches(const BBox& bb, const int lev);
   int absmatches(const BBox& bb, const int lev);

   int index(const BBox& bb, const int lev);
   int absindex(const BBox& bb, const int lev);
   const GridBox& find(const BBox& bb, const int lev);

    
    
    
public:
   inline void setindex(void)
     { register int idx=0; 
       for (register GridBox *g=first();g;g=next()) g->index=idx++; }
   inline void setowner(const int p)
     { for (register GridBox *g=first();g;g=next()) g->owner=p; }
   inline void setparent(const int p)
     { for (register GridBox *g=first();g;g=next()) g->pindex=p; }
   
    
    
    
   inline void empty(void)
     { Bucket<GridBox>::empty(); num = 0; }

    
    
    
   inline GridBox *add() 
     { num++; return (Bucket<GridBox>::add()); }
   inline GridBox *add(const GridBox& gb) 
     { num++; return (Bucket<GridBox>::add(gb)); }
   inline GridBox *insert(const GridBox& gb)
     { num++;  return (Bucket<GridBox>::insert(gb)); }
   inline void remove(void)
     { if (current()) { num--; Bucket<GridBox>::remove(); }}

    
    
    
   void levellist(GridBoxList& gbl, const int lev);
   void levellist(GridBoxList& gbl, const int minlev, 
		  const int maxlev);

    
    
    
   GridBoxList* refinelist(const int atlev, const int levs);

    
    
    
public:
   void bboxlist(BBoxList& bbl, const int lev, const int olap);
   void bboxlist(BBoxList& bbl, const int lev, const int olap, 
                 const int levid);
   void bboxlist(BBoxList& bbl, const int lev, const short* olap,
                 const int extgh);
   void bboxlist(BBoxList& bbl, const int lev, const short* olap, 
                 const int levid, const int extgh);
  };

ostream&  operator << (ostream& os, const GridBoxList& gbl);
ofstream& operator << (ofstream& ofs, const GridBoxList& gbl);
ifstream& operator >> (ifstream& ifs, GridBoxList& gbl);


# 19 "ACEDistribution.h" 2

# 1 "GridUnit.h" 1



  











 

























# 1 "ACESfc.h" 1



 













# 1 "PeanoHilbert.h" 1



 
















# 1 "sfcIndex.h" 1



 
















# 1 "BitVec.h" 1



 








 
















# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/limits.h" 1 3
 


 





 
# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/syslimits.h" 1 3
 





# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/limits.h" 1 3
 


 

# 114 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/limits.h" 3



# 1 "/usr/include/limits.h" 1 3
 

















 









 





 

# 113 "/usr/include/limits.h" 3




  




# 140 "/usr/include/limits.h" 3



 
# 1 "/usr/include/bits/posix1_lim.h" 1 3
 

















 









 

 


 


 


 


 


 


 


 



 


 


 


 


 



 


 


 


 


 


 


 


 


 


 


 


 



 


 


 


 


 



 
# 1 "/usr/include/bits/local_lim.h" 1 3
 


















 














 
# 1 "/usr/include/linux/limits.h" 1 3



















# 36 "/usr/include/bits/local_lim.h" 2 3


 




 




 





 

 


 

 


 

 


 



 


 

# 126 "/usr/include/bits/posix1_lim.h" 2 3








 







# 144 "/usr/include/limits.h" 2 3




# 1 "/usr/include/bits/posix2_lim.h" 1 3
 

















 







 


 


 


 


 



 



 


 



 




 




























 



# 148 "/usr/include/limits.h" 2 3






# 117 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/limits.h" 2 3




# 7 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/syslimits.h" 2 3


# 11 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/limits.h" 2 3





 



 



 




 





 



 












 

 




 



 








 



 













 



# 107 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/limits.h" 3




 









# 30 "BitVec.h" 2


# 1 "/usr/include/assert.h" 1 3
 

















 
























 




# 63 "/usr/include/assert.h" 3


extern "C" { 

 
extern void __assert_fail (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function)
     throw ()  __attribute__ ((__noreturn__));

 
extern void __assert_perror_fail (int __errnum, __const char *__file,
				  unsigned int __line,
				  __const char *__function)
     throw ()  __attribute__ ((__noreturn__));


 

extern void __assert (const char *__assertion, const char *__file, int __line)
     throw ()  __attribute__ ((__noreturn__));


} 













 















# 32 "BitVec.h" 2










 
typedef int BitVecType;





class BitVec
  {
   int length;
   short int slots;
   short int slot_width;
   BitVecType bvec[(4) ];

private:

   inline int GetSlot(const int loc) const
	{return loc/slot_width;}
   inline int MaskBit(const int loc) const
	{return (int)1 << (slot_width-(loc%slot_width)-1);}

public:

   inline BitVec()
	: length(0), slots(0)
	{slot_width = (sizeof(BitVecType)* (8) );}

   BitVec(const int len);
   BitVec(BitVec const &other)
     : length(other.length),
     slots(other.slots), 
     slot_width(other.slot_width)

  { for(register int i=0;i<slots;i++) bvec[i] = other.bvec[i]; }

   inline ~BitVec() {}

   BitVec const &operator= (BitVec const &other);

   int operator==(BitVec const &other) const;
   int operator!=(BitVec const &other) const;
   int operator>(BitVec const &other) const;
   int operator<(BitVec const &other) const;
   int operator>=(BitVec const &other) const;
   int operator<=(BitVec const &other) const;

   inline int TestBit(const int loc) const
     {
       (static_cast<void>  (( loc >= 0 && loc < length ) ? 0 :	(__assert_fail ("loc >= 0 && loc < length" , "BitVec.h", 90, __PRETTY_FUNCTION__ ), 0))) ;
       return(bvec[GetSlot(loc)] & MaskBit(loc));
     }
   inline void SetBit(const int loc)
     {
       (static_cast<void>  (( loc >= 0 && loc < length ) ? 0 :	(__assert_fail ("loc >= 0 && loc < length" , "BitVec.h", 95, __PRETTY_FUNCTION__ ), 0))) ;
       bvec[GetSlot(loc)] |= MaskBit(loc);
     }
   inline void UnsetBit(const int loc)
     {
       (static_cast<void>  (( loc >= 0 && loc < length ) ? 0 :	(__assert_fail ("loc >= 0 && loc < length" , "BitVec.h", 100, __PRETTY_FUNCTION__ ), 0))) ;
       bvec[GetSlot(loc)] &= ~MaskBit(loc);
     }
   inline void ToggleBit(const int loc)
     {
       (static_cast<void>  (( loc >= 0 && loc < length ) ? 0 :	(__assert_fail ("loc >= 0 && loc < length" , "BitVec.h", 105, __PRETTY_FUNCTION__ ), 0))) ;
       bvec[GetSlot(loc)] ^= MaskBit(loc);
     }
   void SwapBit(const int loc1, const int loc2);

   int IsolateBit(const int loc, const int num=1) const;

   inline void ResetVec(void)
     { register int i; for(i=0;i<slots;i++) bvec[i] = 0;}

   inline void SetVec(void)        
     { register int i; for(i=0;i<slots;i++) bvec[i] = (2<<slot_width) - 1; }



   inline int GetLength(void) const
	{return length;}
   inline int GetSlotWidth(void) const
	{return slot_width;}
   inline int GetSlots(void) const
	{return slots;}

  };


# 21 "sfcIndex.h" 2















class sfcIndex : public BitVec
  {
   friend ostream& operator<<(ostream&, sfcIndex const &);

   short int sfcbasew;
   short int sfcdigitw;

protected:
   short int sfcbase;
   short int sfcdim;
   short int sfclevs;

public:
   inline sfcIndex()
	: BitVec(),
          sfcbasew(0), sfcdigitw(0),
          sfcbase(0), sfcdim(0), sfclevs(0) {} 

   inline sfcIndex(const int dim, const int levs, 
		   const int base = (2) )
	: BitVec(levs*dim*(int)ceil((log( (double)base ))/(log(2.0)) )),
	  sfcbase(base), sfcdim(dim), sfclevs(levs)
     { sfcbasew = (int)ceil((log( (double)base ))/(log(2.0)) ); 
       sfcdigitw = sfcdim*sfcbasew; }

   inline sfcIndex(sfcIndex const &other)
	: BitVec((BitVec const &)other),
          sfcbasew(other.sfcbasew),
          sfcdigitw(other.sfcdigitw),
          sfcbase(other.sfcbase), sfcdim(other.sfcdim), 
          sfclevs(other.sfclevs) {}

   sfcIndex const &operator= (sfcIndex const &other);

   int operator== (sfcIndex const &other) const;
   int operator!= (sfcIndex const &other) const;
   int operator> (sfcIndex const &other) const;
   int operator< (sfcIndex const &other) const;
   int operator>= (sfcIndex const &other) const;
   int operator<= (sfcIndex const &other) const;

    
   int sfcGetDigit(const int level) const;
   void sfcSetDigit(const int level, const int digit);
   void sfcUnsetDigit(const int level);
   void sfcMaxDigit(const int level);

    
   void sfcSwapDigitWd(const int level, const int pos1, const int pos2);
   void sfcToggleDigitWd(const int level, const int pos);

    
   int sfcGetIndex() const;
   int sfcGetIndex(const int lev) const;
   int sfcGetIndex(const int lev, const int nlev) const;

   void sfcSetIndex(const int index);
   void sfcSetIndex(const int index, const int lev);
   void sfcSetIndex(const int index, const int lev, const int nlev);
   void sfcMaxIndex(const int lev);

    
   void sfcCreateLocNum(const int *coords);
   void sfcGetCoords(int *coords) const;
   void sfcGetDigitArray(int *digits) const;

    
   inline int sfcGetBaseW(void) const
	{return sfcbasew;}
   inline int sfcGetDigitW(void) const
	{return sfcdigitw;}

private:
   inline void sfcSetDigitBit(const int level, const int pos)
	{ SetBit((level-1)*sfcdigitw + pos); }
   inline void sfcUnsetDigitBit(const int level, const int pos)
	{ UnsetBit((level-1)*sfcdigitw + pos); }
   inline void sfcToggleDigitBit(const int level, const int pos)
	{ ToggleBit((level-1)*sfcdigitw + pos); }

  };
 
extern ostream&  operator << (ostream& os, sfcIndex const &si);


# 21 "PeanoHilbert.h" 2






class PeanoHilbert : public sfcIndex
  {

public:

    
   inline PeanoHilbert()
	: sfcIndex() {}

    
   inline PeanoHilbert(const int dim, const int levs)
	: sfcIndex(dim,levs,(2) )
	{(static_cast<void>  (( dim<=3 ) ? 0 :	(__assert_fail ("dim<=3" , "PeanoHilbert.h", 39, __PRETTY_FUNCTION__ ), 0))) ;}

    
   inline PeanoHilbert(PeanoHilbert const &other)
  	: sfcIndex((sfcIndex const &)other) {}

    
private:
   void Invert(int *coords) const;

public:
   inline void SetIndex(const int index, const int idxlev)
     { sfcSetIndex(index,idxlev); }
   inline void SetIndex(const int index, const int idxlev, 
			const int nlev)
     { sfcSetIndex(index,idxlev,nlev); }

   void Map(const int *coords);
   void Invert(int *coords, const int index);
   void Invert(int *coords, const int index, const int idxlev);
   void Invert(int *coords, const int index, 
	       const int idxlev, const int nlev);

    

   PeanoHilbert *GetBox(const int lev, const int nlev) const;
   void SetBox(const int lev, const int nlev);

    

   PeanoHilbert *GetMax(const int lev, const int nlev) const;
   void SetMax(const int lev, const int nlev);

    
   void ResetBase(const int lev, const int nlev);
   
    
   void GetCoords(int *coords, const int lev = 1) const;
   int *GetCoords(const int lev = 1) const;

    
   inline int GetCardinality(const int dim, const int lev) const
     {return (int)1<<(lev*dim);}
   inline int GetCardinality(const int lev) const
     {return (int)1<<(lev*sfcdim);}

    
   inline int GetDimCardinality(const int lev) const
     {return (int)1<<(sfclevs-lev);}

    
   inline int GetDimMax(const int lev) const
     {return (((int)1<<lev)-1)*((int)1<<(sfclevs-lev));}
   
private:

 
























   inline void phSwapDir(const int level, const int axis)
     {sfcToggleDigitWd(level,axis-1);}
   inline void phTranslate(const int level, const int axis)
     {sfcToggleDigitWd(level,axis-1);}
   inline void phRotate(const int level, const int from_axis, 
			const int to_axis)
     {sfcSwapDigitWd(level,from_axis-1,to_axis-1);}

   void phOrient(const int level, const int pos);
   int phGray(const int level);
   int phGinv(const int level);

  };


# 18 "ACESfc.h" 2

typedef class PeanoHilbert dMapIndex;




# 42 "GridUnit.h" 2





class GridUnit 
  {
   friend ostream& operator<<(ostream&, const GridUnit&);
   friend ofstream& operator<<(ofstream&, const GridUnit&);
   friend ifstream& operator>>(ifstream&, GridUnit&);
   friend class GridUnitList;

   short int owner;		    



   short int index;		 
   short int rank;		 
   short int baselev; 		 

   short int crslev; 		 
   short int finelev; 		 
   short int maxlev;		  
   short int minlev;		  
   short int levstep;		 

   short int extent;		 
				 

   dMapIndex baseindex; 	 


   BBox fbb;                     

public:
    
   inline GridUnit(void)
        : owner(((-1) ) ), index((-1) ), rank(0), 
          baselev(0), crslev(0), finelev(0), 
          maxlev(0), minlev(0), levstep(0),
          extent(0) { }

   GridUnit(const int nrank, const int clev, const int* bcoords,
	    const int ext, const int mlev, const int lstep, 
	    const int reflev);

   GridUnit(const int nrank, const int clev, const int bindex, 
	    const int ext, const int mlev, const int lstep, 
	    const int reflev);

   inline GridUnit(GridUnit const &other)
        : owner(other.owner), index(other.index),
          rank(other.rank), baselev(other.baselev),
          crslev(other.crslev), finelev(other.finelev),
          maxlev(other.maxlev), minlev(other.minlev), 
          levstep(other.levstep),
          extent(other.extent), baseindex(other.baseindex),
          fbb(other.fbb) 
     { }

   inline ~GridUnit(void) {}

   GridUnit const &operator= (GridUnit const &other);

    
private:
    
    
public:
   inline int guRank(void) const { return (rank); }
   inline int guBaseLev(void) const { return (baselev); }
   inline int guFineLev(void) const { return (finelev); }
   inline int guCrsLev(void) const { return (crslev); }
   inline int guNumLev(void) const { return ((finelev-crslev)/levstep+1); }
   inline int guMaxLev(void) const { return (maxlev); }
   inline int guMinLev(void) const { return (minlev); }
   inline int guLevStep(void) const { return (levstep); }
   inline int guLevels(void) const { return ((maxlev-minlev)/levstep+1); }

   inline int guExtent(const int lev) const
   { return ((lev<=finelev && lev>=crslev && extent>=(finelev-lev)) 
            ? extent-(finelev-lev) : 0); }
   inline int guExtentAbs(const int lev) const
   { return ((extent>=(finelev-lev)) ? extent-(finelev-lev) : 0); }

   inline int guExtentValue(const int lev) const
   { return ((lev<=finelev && lev>=crslev && extent>=(finelev-lev)) 
            ? 1 << (extent-(finelev-lev)) : 1); }
   inline int guExtentAbsValue(const int lev) const
   { return ((extent>=(finelev-lev)) ? 1 << (extent-(finelev-lev)) : 1); }

   unsigned long guNum(const int overlap) const;
   unsigned long guWork(const int overlap) const;
   unsigned long guNum(const int lev, const int overlap) const;
   unsigned long guWork(const int lev, const int overlap) const;

   unsigned long guNum(const short* overlap) const;
   unsigned long guWork(const short* overlap) const;
   unsigned long guNum(const int lev, const short* overlap) const;
   unsigned long guWork(const int lev, const short* overlap) const;

   inline int guContains(const int lev) const
        { return (lev<=finelev && lev>=crslev); }
   inline int guContains(const int minlevel, const int maxlevel) const
        { return (minlevel<=finelev && maxlevel>=crslev); }

   inline int guLevIndex(const int lev) const
        { return ((lev-minlev)/levstep); }

    
   inline void guSetOwner(const int p) { owner = p; }






   inline const dMapIndex& guBaseIndex(void) const { return (baseindex); }

   dMapIndex guTopIndex(const int lev) const;
   dMapIndex guMaxIndex(const int lev) const;

private:
   void guLCoords(int *c, const int lev) const;
   Coords guLCoords(const int lev) const;

   void guUCoords(int *c, const int lev) const;
   Coords guUCoords(const int lev) const;

   void guSetBBox(); 

public:
   const BBox& guBBox() const { return (fbb); }

   BBox guBBox(const int lev, const int olap=0, const int extgh=0) const;
   BBox guBBoxAbs(const int lev, const int olap=0, const int extgh=0) const;

   BBox guBBox(const int lev, const short* olap, const int extgh=0) const;
   BBox guBBoxAbs(const int lev, const short* olap, const int extgh=0) const;

   BBox guBBox(const int minl, const int maxl,
	       const short* olap, const int extgh=0) const;

   int guInside(const BBox& bbox, const int lev) const;

    
   int operator== (GridUnit const &other) const;
   int operator>= (GridUnit const &other) const;
   int operator<= (GridUnit const &other) const;

    
   void guRefine(const int levs = 1);
   void guRefine(GridUnit &gu, const int levs = 1);

   void guCoarsen(const int levs = 1);
   void guCoarsen(GridUnit &gu, const int levs = 1);

   void guDecompose(GridUnit**& gu, int& cnt, const int levs = 1) const;
   void guDecomposeReplicate(GridUnit**& gu, int& cnt, const int minext, 
					const int levs = 1) const;
   
    
    

   void guGetLevels(GridUnit** &gu) const;
   void guGetLevels(GridUnit &gu, const int lev) const;

    
   inline static void guSetDecompose(GridUnit& gu,
			      const int lev,
			      const int cnt)
     { gu.baselev+=lev; gu.extent-=lev; 
       gu.baseindex.SetIndex(cnt,gu.baselev,lev); gu.guSetBBox(); }

   inline static void guSetLevels(GridUnit& gu,
			   const int lev)
     { gu.extent-=(gu.finelev-lev);
       gu.crslev=lev; gu.finelev=lev; 
       gu.baselev = gu.finelev-gu.extent; gu.guSetBBox(); }

   inline static void guSetRefineLevel(GridUnit& gu,
				const int levs=1)
     { gu.crslev=gu.finelev+gu.levstep; gu.finelev+=(levs*gu.levstep);
       gu.extent+=levs*gu.levstep; gu.baselev=gu.finelev-gu.extent; 
       gu.guSetBBox(); }

   inline static void guSetCoarsen(GridUnit& gu,
			    const int levs=1)
     { gu.finelev-=(levs*gu.levstep); gu.extent-=levs*gu.levstep; 
       gu.baselev=gu.finelev-gu.extent; gu.guSetBBox(); }

   inline static void guSetRefine(GridUnit& gu,
			   const int levs=1)
     { gu.finelev+=(levs*gu.levstep); gu.extent+=levs*gu.levstep; 
       gu.baselev=gu.finelev-gu.extent; gu.guSetBBox(); }
  };   

ostream&  operator << (ostream& os, const GridUnit& gu);
ofstream& operator << (ofstream& ofs, const GridUnit& gu);
ifstream& operator >> (ifstream& ifs, GridUnit& gu);


# 20 "ACEDistribution.h" 2

# 1 "GridUnitList.h" 1



 












 





















 



class GridUnitList : public Bucket<GridUnit>, public ObjectCounter
  {
   friend ostream& operator<<(ostream&, const GridUnitList&);
   friend ofstream& operator<<(ofstream&, const GridUnitList&);
   friend ifstream& operator>>(ifstream&, GridUnitList&);

   int num;

private:
   static inline void copytypedata(GridUnit *to, GridUnit const *from)
	{ *to = *from; }

    
    
    
   inline void setstats(void)
     {
      num = 0;
      for (register GridUnit *g=first();g;g=next()) num++;
     }

public:
    
    
    
   GridUnitList()
     : Bucket<GridUnit>((256) ), num(0) {}

    
    
   GridUnitList(const unsigned maxnum, const int dumarg)
     : Bucket<GridUnit>(maxnum), num(0) {}

   GridUnitList(const void* package, const int dumarg)
     : Bucket<GridUnit>(package), num(0) { setstats(); }

   GridUnitList(void *package, const int dumarg)
     : Bucket<GridUnit>(package), num(0) { setstats(); }

   GridUnitList(const void* package, const unsigned size, 
		const int n)
     : Bucket<GridUnit>(package, size, n), num(0) 
     { setstats(); }

   GridUnitList(const GridUnitList& other)
     : Bucket<GridUnit>(other), num(other.num) {}

private:
   GridUnitList(GridUnitList**& levarray);

public:
    
    
    
   GridUnitList& operator = (const GridUnitList&);

    
    
    
   inline ~GridUnitList(void) {}

    
    
    
   inline GridUnitList *alias()
	{ return((GridUnitList *) ObjectCounter::alias()); }

    
    
    
public:
   void operator -= (GridUnitList const &rhs);  
private:
   void operator *= (GridUnitList const &rhs);  
   GridUnitList *operator - (GridUnitList const &rhs);  
   GridUnitList *operator * (GridUnitList const &rhs);  
   GridUnitList *operator + (GridUnitList const &rhs);  

    
    
    
public: 
   void operator *= (BBox const &rhs);  
private: 
   GridUnitList *operator * (BBox const &rhs);  
   GridUnitList *operator * (BBoxList const &rhs);  
 
    
    
    
public:
   void intersect(BBox const &rhs, const int lev, GridUnitList &gul, 
                  const int olap, const int extgh=0);
   void intersect(BBoxList const &rhs, const int lev, GridUnitList &gul, 
                  const int olap, const int extgh=0);
   void intersect(BBox const &rhs, const int lev, GridUnitList &gul, 
                  const short* olap, const int extgh=0);
   void intersect(BBoxList const &rhs, const int lev, GridUnitList &gul,
                  const short* olap, const int extgh=0);

   void intersect_exact(BBox const &rhs, const int lev, GridUnitList &gul, 
			const int olap, const int extgh=0);
   void intersect_exact(BBox const &rhs, const int lev, GridUnitList &gul, 
			const short* olap, const int extgh=0);

    
    
    
public:
   inline int isempty() const { return(num == 0); }
   inline int number() const { return(num); }

   unsigned long load(const int olap);
   unsigned long load(const int lev, const int olap);
   unsigned long numelems(const int olap);
   unsigned long numelems(const int lev, const int olap);
  
   unsigned long load(const short* olap);
   unsigned long load(const int lev, const short* olap);
   unsigned long numelems(const short* olap);
   unsigned long numelems(const int lev, const short* olap);

   int levels(void);
   int finest(void);
   int smallest(const int level);
   int highestbaselevel();
   dMapIndex lowest();
   dMapIndex lowest(const int level, const int owner, const int index);
   int maxindex(void);

    
    
    
private:
   void setindex(void);
   void setindex(const int idx);
   void setindex(const GridUnitList& cgul, const int idx);
   void setbbox();
public:
   void setowner(const int p);
   void setowner(const GridUnitList& cgul, const int p);
    
    
    
   inline void empty(void)
     { Bucket<GridUnit>::empty(); num = 0; }

    
    
    
   inline GridUnit *add() 
     { num++; return (Bucket<GridUnit>::add()); }
   inline GridUnit *add(GridUnit const &gu) 
     { num++; return (Bucket<GridUnit>::add(gu)); }
   inline GridUnit *insert()
     { num++; return (Bucket<GridUnit>::insert()); }
   inline GridUnit *insert(GridUnit const &gu)
     { num++; return (Bucket<GridUnit>::insert(gu)); }
   inline void remove(void)
     { if (current()) { num--; Bucket<GridUnit>::remove(); }}  
             
    
    
    
   void split(GridUnitList &gul);

    
    
    
   void levelarray(GridUnitList **& levarray, const int levels);

    
    
    
   void levellist(GridUnitList &gul, 
		  const int lev);
   void levellist(GridUnitList &gul, 
		  const int minlev, 
		  const int maxlev);
   void levellist(GridUnitList &gul);

    
    
    
public:
   void bboxlistfinest(BBoxList &bbl, const int lev);
   void bboxlist(BBoxList &bbl, const int lev, const int olap);
                  
   void bboxlist(BBoxList &bbl, const int lev, const int olap, 
                 const int levid);  
   void bboxlist(BBoxList &bbl, const int lev, const short* olap,
                 const int extgh);
   void bboxlist(BBoxList &bbl, const int lev, const short* olap, 
                 const int levid, const int extgh);
    
    
    
private:
   GridUnitList *refinelist(const int atlev, const int levs=1);

    
    
    
private:
   GridUnitList *refinelist(BBoxList const &bblist, 
                            const int atlev, 
                            const int minw);
   
public:
   void refinethislist(const BBoxList& bblist, 
                       const int atlev, 
                       const int minw,
		       const int orph);

    
    
    
private:
   inline void refine(const int lev = 1)
	{ (current())->guRefine(lev); }
   inline void coarsen(const int lev = 1)
	{ (current())->guCoarsen(lev); }

public:
   void decompose(const int lev = 1);

    
    
    
    
    
    
  };

ostream&  operator << (ostream& os, const GridUnitList& gul);
ofstream& operator << (ofstream& ofs, const GridUnitList& gul);
ifstream& operator >> (ifstream& ifs, GridUnitList& gul);


# 21 "ACEDistribution.h" 2











 
 
 
typedef unsigned long (*WorkFunc) (const unsigned long *numelems, 
                                   const int *level);
 

class ACESpan 
{
  dMapIndex min;
  dMapIndex max;
  
public:   
  inline ACESpan() {}
  
  inline ACESpan(dMapIndex const &lmin, dMapIndex const &lmax)
    : min(lmin), max(lmax) { }
  
  inline ACESpan(const ACESpan& other)
    : min(other.min), max(other.max) { }
  
  inline int contains(dMapIndex const index) const 
    { return (index >= min && index <= max); }
  
  inline const ACESpan& operator = (const ACESpan& other)
    { min = other.min; max = other.max; return *this; }
};





class ACEDistribution
{
  friend class GridHierarchy;
  friend ifstream& operator >> (ifstream& ifs, GridHierarchy&);
  
  int type; 	                
  
  BBox wbox;                   

   
  
  BBox* boxes;                 
  
  WorkFunc wfunc;              
  
  ACEDistribution(const int disttype, BBoxList& bbl);
  
public:
  inline ACEDistribution(const int disttype) 
    : type(disttype) , boxes(0), wfunc(0) { }
  
  inline ~ACEDistribution() { if (boxes) delete [] boxes; }
   
  void init_partitioner(const int np,
			const int me,
			const int rank,
			const BBox& wholebbox);
  
  void partition(GridUnitList*& globallist, 
		 GridUnitList*& locallist, 
		 const int np, 
		 const int me, 
		 const int minw, 
		 const int maxw, 
		 const int minwk, 
		 const short* olap,
		 const int orphan_flag);
  
  void partition(BBoxList& inbbl,
		 BBoxList** bboxarray,
		 const int levels,
		 const int clevels,
		 const int reflev,
		 const int rank,
		 const int np, 
		 const int me,
		 const int minw, 
		 const int maxw, 
		 const int minwk, 
		 const short* olap,
		 const int orphan_flag);
  
  void partition(const BBox& wbbox, 
		 BBox& mybbox, 
		 const int np, 
		 const int me,
		 const int orphan_flag);
  
private:
  void partition(GridBoxList*& globallist, 
		 GridBoxList*& locallist, 
		 const int np, 
		 const int me, 
		 const int minw, 
		 const int maxw, 
		 const int minwk, 
		 const short* olap,
		 const int orphan_flag);
  
public:
   
   
   
  inline int dist() const 
    { 
      if ((type/ (10) )* (10)  == 
	  (10) ) 
	return (10) ;
      else
	return type; 
    }
  
  inline void set_dist(const int disttype)
    { type = disttype; }
  
  void set_dist(const int disttype, BBoxList& bbl);
  
  inline void set_workfunc( WorkFunc workfunc )
    { wfunc = (WorkFunc) workfunc; }
  
  unsigned long get_load( GridUnitList &list,  const short* olap );
  
private:
  void partitionVampire(BBoxList& inbbl,
			BBoxList** bboxarray,
			const int levels,
			const int clevels,
			const int reflev,
			const int rank,
			const int np, 
			const int me,
			const int minw, 
			const int maxw, 
			const int minwk, 
			const short* olap);
  
  void partitionParMetis(BBoxList& inbbl,
			 BBoxList** bboxarray,
			 const int levels,
			 const int clevels,
			 const int reflev,
			 const int rank,
			 const int np, 
			 const int me,
			 const int minw, 
			 const int maxw, 
			 const int minwk, 
			 const short* olap);
  
  void partitionComposite(GridUnitList*& globallist, 
			  GridUnitList*& locallist, 
			  const int np, 
			  const int me, 
			  const int minw,
			  const int maxw, 
			  const int minwk, 
			  const short* olap,
			  const int orphan);
  
  void partitionBlockOne(const int axis,
			 GridUnitList*& globallist, 
			 GridUnitList*& locallist, 
			 const int np, 
			 const int me, 
			 const int minw, 
			 const int maxw, 
			 const int minwk, 
			 const short* olap);
  
  void partitionBlockTwo(const int axis1, 
			 const int axis2,
			 GridUnitList*& globallist, 
			 GridUnitList*& locallist, 
			 const int np, 
			 const int me, 
			 const int minw, 
			 const int maxw, 
			 const int minwk, 
			 const short* olap);
  
  void partitionBlockAll(GridUnitList*& globallist, 
			 GridUnitList*& locallist, 
			 const int np, 
			 const int me, 
			 const int minw,
			 const int maxw, 
			 const int minwk, 
			 const short* olap);

  void partitionUserDef(GridUnitList*& globallist, 
			GridUnitList*& locallist, 
			const int np, 
			const int me, 
			const int minw, 
			const int maxw, 
			const int minwk, 
			const short* olap);
};


# 11 "ACEDistribution.cpp" 2

 
# 1 "CommServer.h" 1



 













# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/iostream" 1 3
 
 





# 18 "CommServer.h" 2








# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/strstream.h" 1 3
 























 




#pragma interface


# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/strfile.h" 1 3
 





































typedef void *(*_IO_alloc_type)  (size_t  )  ;
typedef void (*_IO_free_type)  (void*)  ;

struct _IO_str_fields
{
  _IO_alloc_type _allocate_buffer;
  _IO_free_type _free_buffer;
};

 




struct _IO_streambuf
{
  struct _IO_FILE _f;
  const void *_vtable;
};

typedef struct _IO_strfile_
{
  struct _IO_streambuf _sbf;
  struct _IO_str_fields _s;
} _IO_strfile;

 



 


# 33 "/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/strstream.h" 2 3


extern "C++" {
class strstreambuf : public streambuf
{
  struct _IO_str_fields _s;
  friend class istrstream;

    void init_dynamic(_IO_alloc_type alloc, _IO_free_type free,
		      int initial_size = 0);
    void init_static(char *ptr, int size, char *pstart);
    void init_readonly(const char *ptr, int size);
  protected:
    virtual int overflow(int = (-1) );
    virtual int underflow();
    virtual int pbackfail(int c);
  public:
    virtual ~strstreambuf();
    strstreambuf() { init_dynamic(0, 0); }
    strstreambuf(int initial_size) { init_dynamic(0, 0, initial_size); }
    strstreambuf(void *(*__alloc)(size_t  ), void (*__free)(void*))
	{ init_dynamic(__alloc, __free); }
    strstreambuf(char *ptr, int size, char *pstart = __null )
	{ init_static(ptr, size, pstart); }
    strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = __null )
	{ init_static((char*)ptr, size, (char*)pstart); }
    strstreambuf(const char *ptr, int size)
	{ init_readonly(ptr, size); }
    strstreambuf(const unsigned char *ptr, int size)
	{ init_readonly((const char*)ptr, size); }
    strstreambuf(signed char *ptr, int size, signed char *pstart = __null )
	{ init_static((char*)ptr, size, (char*)pstart); }
    strstreambuf(const signed char *ptr, int size)
	{ init_readonly((const char*)ptr, size); }
     
    int frozen() { return _flags & 1  ? 1 : 0; }
    void freeze(int n=1)
	{ if ((( this )->_s._allocate_buffer != (_IO_alloc_type)0) )
	    { if (n) _flags |= 1 ; else _flags &= ~1 ; } }
    __ssize_t   pcount();
    char *str();
    virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
};

class strstreambase : virtual public ios {
  protected:
    strstreambuf __my_sb;
  public:
    strstreambuf* rdbuf() { return &__my_sb; }
  protected:
    strstreambase() { init (&__my_sb); }
    strstreambase(char *cp, int n, int mode=ios::out);
};

class istrstream : public strstreambase, public istream {
  public:
    istrstream(const char*, int=0);
};

class ostrstream : public strstreambase, public ostream {
  public:
    ostrstream() { }
    ostrstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
    __ssize_t   pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
    char *str() { return ((strstreambuf*)_strbuf)->str(); }
    void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
    int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
};

class strstream : public strstreambase, public iostream {
  public:
  strstream() { }
    strstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
    __ssize_t   pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
    char *str() { return ((strstreambuf*)_strbuf)->str(); }
    void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
    int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
};
}  


# 26 "CommServer.h" 2




# 1 "/usr/include/assert.h" 1 3
 

















 
























 




# 63 "/usr/include/assert.h" 3


extern "C" { 

 
extern void __assert_fail (__const char *__assertion, __const char *__file,
			   unsigned int __line, __const char *__function)
     throw ()  __attribute__ ((__noreturn__));

 
extern void __assert_perror_fail (int __errnum, __const char *__file,
				  unsigned int __line,
				  __const char *__function)
     throw ()  __attribute__ ((__noreturn__));


 

extern void __assert (const char *__assertion, const char *__file, int __line)
     throw ()  __attribute__ ((__noreturn__));


} 













 















# 30 "CommServer.h" 2



  typedef _IO_ostream_withassign ostream_withassign;
  typedef _IO_istream_withassign istream_withassign;


 



# 64 "CommServer.h"



extern "C" {

# 1 "/usr/include/mpi/mpi.h" 1 3
 






 




 











 

extern "C" {


 
 





 









typedef int MPI_Datatype;













 







 














 













 
typedef int MPI_Comm;



 
typedef int MPI_Group;


 
typedef int MPI_Op;














 
 




 





 







 




 




 


 










 





typedef void (MPI_Handler_function) ();





typedef int MPI_Errhandler;
 


 



 




 
typedef union MPIR_HANDLE *MPI_Request;

 
typedef void (MPI_User_function) ( void *, void *, int *, MPI_Datatype * ); 

 
typedef int (MPI_Copy_function) ( MPI_Comm, int, void *, void *, void *, int * );
typedef int (MPI_Delete_function) ( MPI_Comm, int, void *, void * );





 


 








 
typedef struct MPIR_Info *MPI_Info;




 







 


# 1 "/usr/include/mpi/mpidefs.h" 1 3
 



 

# 1 "/usr/include/mpi/mpi_fortdefs.h" 1 3
 



typedef int MPI_Fint;






# 7 "/usr/include/mpi/mpidefs.h" 2 3




typedef int MPI_Aint;

 



 



typedef struct { 
    int count;
    int MPI_SOURCE;
    int MPI_TAG;
    int MPI_ERROR;



} MPI_Status;

 

 




 










# 1 "/usr/include/mpi/mpio.h" 1 3
 






 




# 1 "/usr/include/mpi/mpi.h" 1 3
 






 

# 671 "/usr/include/mpi/mpi.h" 3


# 13 "/usr/include/mpi/mpio.h" 2 3



extern "C" {




 

typedef struct ADIOI_FileD *MPI_File;

 
typedef struct ADIOI_RequestD *MPIO_Request;  

typedef int MPI_Offset;





















 






























 

 




 
int MPI_File_open(MPI_Comm comm, char *filename, int amode, 
                          MPI_Info info, MPI_File *fh);
int MPI_File_close(MPI_File *fh);
int MPI_File_delete(char *filename, MPI_Info info);
int MPI_File_set_size(MPI_File fh, MPI_Offset size);
int MPI_File_preallocate(MPI_File fh, MPI_Offset size);
int MPI_File_get_size(MPI_File fh, MPI_Offset *size);
int MPI_File_get_group(MPI_File fh, MPI_Group *group);
int MPI_File_get_amode(MPI_File fh, int *amode);
int MPI_File_set_info(MPI_File fh, MPI_Info info);
int MPI_File_get_info(MPI_File fh, MPI_Info *info_used);

 
int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
	         MPI_Datatype filetype, char *datarep, MPI_Info info);
int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, 
                 MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep);

 
int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);
int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);
int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);
int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);

 

 

int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPIO_Request *request);
int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPIO_Request *request);

 
int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype
	     datatype, MPI_Status *status); 
int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype
	     datatype, MPI_Status *status); 
int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype
	      datatype, MPI_Status *status);
int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype
	      datatype, MPI_Status *status);

 

 

int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype
	     datatype, MPIO_Request *request); 
int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype
	      datatype, MPIO_Request *request);

int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
int MPI_File_get_position(MPI_File fh, MPI_Offset *offset);
int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, 
                                     MPI_Offset *disp);

 
int MPI_File_read_shared(MPI_File fh, void *buf, int count, 
                         MPI_Datatype datatype, MPI_Status *status);
int MPI_File_write_shared(MPI_File fh, void *buf, int count, 
                          MPI_Datatype datatype, MPI_Status *status);
int MPI_File_iread_shared(MPI_File fh, void *buf, int count, 
                          MPI_Datatype datatype, MPIO_Request *request);
int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, 
                           MPI_Datatype datatype, MPIO_Request *request);
int MPI_File_read_ordered(MPI_File fh, void *buf, int count, 
                          MPI_Datatype datatype, MPI_Status *status);
int MPI_File_write_ordered(MPI_File fh, void *buf, int count, 
                           MPI_Datatype datatype, MPI_Status *status);
int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence);
int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset);

 
int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
                               int count, MPI_Datatype datatype);
int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
                                int count, MPI_Datatype datatype);
int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, 
                            MPI_Datatype datatype);
int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status);
int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, 
                             MPI_Datatype datatype);
int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status);
int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, 
                                MPI_Datatype datatype);
int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, 
                                 MPI_Datatype datatype);
int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status);

 
int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, 
                                     MPI_Aint *extent);

 
int MPI_File_set_atomicity(MPI_File fh, int flag);
int MPI_File_get_atomicity(MPI_File fh, int *flag);
int MPI_File_sync(MPI_File fh);

 
int MPI_File_set_errhandler( MPI_File, MPI_Errhandler );
int MPI_File_get_errhandler( MPI_File, MPI_Errhandler * );

# 210 "/usr/include/mpi/mpio.h" 3


 


 








 
MPI_File MPI_File_f2c(MPI_Fint fh);
MPI_Fint MPI_File_c2f(MPI_File fh);


 


int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status);
int MPIO_Wait(MPIO_Request *request, MPI_Status *status);
MPI_Fint MPIO_Request_c2f(MPIO_Request request);
MPIO_Request MPIO_Request_f2c(MPI_Fint request);


 
# 267 "/usr/include/mpi/mpio.h" 3





 


 
int PMPI_File_open(MPI_Comm comm, char *filename, int amode, 
                           MPI_Info info, MPI_File *fh);
int PMPI_File_close(MPI_File *fh);
int PMPI_File_delete(char *filename, MPI_Info info);
int PMPI_File_set_size(MPI_File fh, MPI_Offset size);
int PMPI_File_preallocate(MPI_File fh, MPI_Offset size);
int PMPI_File_get_size(MPI_File fh, MPI_Offset *size);
int PMPI_File_get_group(MPI_File fh, MPI_Group *group);
int PMPI_File_get_amode(MPI_File fh, int *amode);
int PMPI_File_set_info(MPI_File fh, MPI_Info info);
int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used);

 
int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, 
    MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info);
int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, 
      MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep);

 
int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPI_Status *status);

 

 

int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPIO_Request *request);
int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf,
	      int count, MPI_Datatype datatype, MPIO_Request *request);

 
int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype
                           datatype, MPI_Status *status); 
int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype
	                       datatype, MPI_Status *status); 
int PMPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype
	                    datatype, MPI_Status *status);
int PMPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype
	                        datatype, MPI_Status *status);

 

 

int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype
	                    datatype, MPIO_Request *request); 
int PMPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype
	                     datatype, MPIO_Request *request);

int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset);
int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, 
                                      MPI_Offset *disp);

 
int PMPI_File_read_shared(MPI_File fh, void *buf, int count, 
                         MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_write_shared(MPI_File fh, void *buf, int count, 
                          MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, 
                          MPI_Datatype datatype, MPIO_Request *request);
int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, 
                           MPI_Datatype datatype, MPIO_Request *request);
int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, 
                          MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, 
                           MPI_Datatype datatype, MPI_Status *status);
int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence);
int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset);

 
int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
                               int count, MPI_Datatype datatype);
int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
                                int count, MPI_Datatype datatype);
int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, 
                            MPI_Datatype datatype);
int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status);
int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, 
                             MPI_Datatype datatype);
int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status);
int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, 
                                MPI_Datatype datatype);
int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, 
                                 MPI_Datatype datatype);
int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status);

 
int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, 
                                      MPI_Aint *extent);

 
int PMPI_File_set_atomicity(MPI_File fh, int flag);
int PMPI_File_get_atomicity(MPI_File fh, int *flag);
int PMPI_File_sync(MPI_File fh);

 
int PMPI_File_set_errhandler( MPI_File, MPI_Errhandler );
int PMPI_File_get_errhandler( MPI_File, MPI_Errhandler * );

# 397 "/usr/include/mpi/mpio.h" 3


 
MPI_File PMPI_File_f2c(MPI_Fint fh);
MPI_Fint PMPI_File_c2f(MPI_File fh);

 
int MPI_File_set_errhandler(MPI_File fh, MPI_Errhandler errhandler);
int MPI_File_get_errhandler(MPI_File fh, MPI_Errhandler *errhandler);


 


int PMPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status);
int PMPIO_Wait(MPIO_Request *request, MPI_Status *status);
MPI_Fint PMPIO_Request_c2f(MPIO_Request request);
MPIO_Request PMPIO_Request_f2c(MPI_Fint request);


 
# 434 "/usr/include/mpi/mpio.h" 3



}



# 49 "/usr/include/mpi/mpidefs.h" 2 3




# 235 "/usr/include/mpi/mpi.h" 2 3


 

 






 






 






 





 

 
 
extern int MPICHX_QOS_BANDWIDTH;
 

 
# 1 "/usr/include/mpi/mpi_errno.h" 1 3

 






 




 






 

 









 




 



 


 





 



 














 
























# 274 "/usr/include/mpi/mpi.h" 2 3

 

 












 




 
  int MPI_Send(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int MPI_Recv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
  int MPI_Get_count(MPI_Status *, MPI_Datatype, int *);
  int MPI_Bsend(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int MPI_Ssend(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int MPI_Rsend(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int MPI_Buffer_attach( void*, int);
  int MPI_Buffer_detach( void*, int*);
  int MPI_Isend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int MPI_Ibsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int MPI_Issend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int MPI_Irsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int MPI_Irecv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int MPI_Wait(MPI_Request *, MPI_Status *);
  int MPI_Test(MPI_Request *, int *, MPI_Status *);
  int MPI_Request_free(MPI_Request *);
  int MPI_Waitany(int, MPI_Request *, int *, MPI_Status *);
  int MPI_Testany(int, MPI_Request *, int *, int *, MPI_Status *);
  int MPI_Waitall(int, MPI_Request *, MPI_Status *);
  int MPI_Testall(int, MPI_Request *, int *, MPI_Status *);
  int MPI_Waitsome(int, MPI_Request *, int *, int *, MPI_Status *);
  int MPI_Testsome(int, MPI_Request *, int *, int *, MPI_Status *);
  int MPI_Iprobe(int, int, MPI_Comm, int *flag, MPI_Status *);
  int MPI_Probe(int, int, MPI_Comm, MPI_Status *);
  int MPI_Cancel(MPI_Request *);
  int MPI_Test_cancelled(MPI_Status *, int *);
  int MPI_Send_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int MPI_Bsend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request *);
  int MPI_Ssend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request *);
  int MPI_Rsend_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request *);
  int MPI_Recv_init(void*, int, MPI_Datatype, int,int, MPI_Comm, MPI_Request *);
  int MPI_Start(MPI_Request *);
  int MPI_Startall(int, MPI_Request *);
  int MPI_Sendrecv(void *, int, MPI_Datatype,int, int, void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
  int MPI_Sendrecv_replace(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status *);
  int MPI_Type_contiguous(int, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_vector(int, int, int, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_hvector(int, int, MPI_Aint, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_indexed(int, int *, int *, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_hindexed(int, int *, MPI_Aint *, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_struct(int, int *, MPI_Aint *, MPI_Datatype *, MPI_Datatype *);
  int MPI_Address(void*, MPI_Aint *);
  int MPI_Type_extent(MPI_Datatype, MPI_Aint *);
 

 
  int MPI_Type_size(MPI_Datatype, int *);
  int MPI_Type_count(MPI_Datatype, int *);
  int MPI_Type_lb(MPI_Datatype, MPI_Aint*);
  int MPI_Type_ub(MPI_Datatype, MPI_Aint*);
  int MPI_Type_commit(MPI_Datatype *);
  int MPI_Type_free(MPI_Datatype *);
  int MPI_Get_elements(MPI_Status *, MPI_Datatype, int *);
  int MPI_Pack(void*, int, MPI_Datatype, void *, int, int *,  MPI_Comm);
  int MPI_Unpack(void*, int, int *, void *, int, MPI_Datatype, MPI_Comm);
  int MPI_Pack_size(int, MPI_Datatype, MPI_Comm, int *);
  int MPI_Barrier(MPI_Comm );
  int MPI_Bcast(void*, int, MPI_Datatype, int, MPI_Comm );
  int MPI_Gather(void* , int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); 
  int MPI_Gatherv(void* , int, MPI_Datatype, void*, int *, int *, MPI_Datatype, int, MPI_Comm); 
  int MPI_Scatter(void* , int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm);
  int MPI_Scatterv(void* , int *, int *,  MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm);
  int MPI_Allgather(void* , int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
  int MPI_Allgatherv(void* , int, MPI_Datatype, void*, int *, int *, MPI_Datatype, MPI_Comm);
  int MPI_Alltoall(void* , int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
  int MPI_Alltoallv(void* , int *, int *, MPI_Datatype, void*, int *, int *, MPI_Datatype, MPI_Comm);
  int MPI_Reduce(void* , void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm);
  int MPI_Op_create(MPI_User_function *, int, MPI_Op *);
  int MPI_Op_free( MPI_Op *);
  int MPI_Allreduce(void* , void*, int, MPI_Datatype, MPI_Op, MPI_Comm);
  int MPI_Reduce_scatter(void* , void*, int *, MPI_Datatype, MPI_Op, MPI_Comm);
  int MPI_Scan(void* , void*, int, MPI_Datatype, MPI_Op, MPI_Comm );
  int MPI_Group_size(MPI_Group group, int *);
  int MPI_Group_rank(MPI_Group group, int *);
  int MPI_Group_translate_ranks (MPI_Group, int, int *, MPI_Group, int *);
  int MPI_Group_compare(MPI_Group, MPI_Group, int *);
  int MPI_Comm_group(MPI_Comm, MPI_Group *);
  int MPI_Group_union(MPI_Group, MPI_Group, MPI_Group *);
  int MPI_Group_intersection(MPI_Group, MPI_Group, MPI_Group *);
  int MPI_Group_difference(MPI_Group, MPI_Group, MPI_Group *);
  int MPI_Group_incl(MPI_Group group, int, int *, MPI_Group *);
  int MPI_Group_excl(MPI_Group group, int, int *, MPI_Group *);
  int MPI_Group_range_incl(MPI_Group group, int, int [][3], MPI_Group *);
  int MPI_Group_range_excl(MPI_Group group, int, int [][3], MPI_Group *);
  int MPI_Group_free(MPI_Group *);
  int MPI_Comm_size(MPI_Comm, int *);
  int MPI_Comm_rank(MPI_Comm, int *);
  int MPI_Comm_compare(MPI_Comm, MPI_Comm, int *);
  int MPI_Comm_dup(MPI_Comm, MPI_Comm *);
  int MPI_Comm_create(MPI_Comm, MPI_Group, MPI_Comm *);
  int MPI_Comm_split(MPI_Comm, int, int, MPI_Comm *);
  int MPI_Comm_free(MPI_Comm *);
  int MPI_Comm_test_inter(MPI_Comm, int *);
  int MPI_Comm_remote_size(MPI_Comm, int *);
  int MPI_Comm_remote_group(MPI_Comm, MPI_Group *);
  int MPI_Intercomm_create(MPI_Comm, int, MPI_Comm, int, int, MPI_Comm * );
  int MPI_Intercomm_merge(MPI_Comm, int, MPI_Comm *);
  int MPI_Keyval_create(MPI_Copy_function *, MPI_Delete_function *, int *, void*);
  int MPI_Keyval_free(int *);
  int MPI_Attr_put(MPI_Comm, int, void*);
  int MPI_Attr_get(MPI_Comm, int, void *, int *);
  int MPI_Attr_delete(MPI_Comm, int);
  int MPI_Topo_test(MPI_Comm, int *);
  int MPI_Cart_create(MPI_Comm, int, int *, int *, int, MPI_Comm *);
  int MPI_Dims_create(int, int, int *);
  int MPI_Graph_create(MPI_Comm, int, int *, int *, int, MPI_Comm *);
  int MPI_Graphdims_get(MPI_Comm, int *, int *);
  int MPI_Graph_get(MPI_Comm, int, int, int *, int *);
  int MPI_Cartdim_get(MPI_Comm, int *);
  int MPI_Cart_get(MPI_Comm, int, int *, int *, int *);
  int MPI_Cart_rank(MPI_Comm, int *, int *);
  int MPI_Cart_coords(MPI_Comm, int, int, int *);
  int MPI_Graph_neighbors_count(MPI_Comm, int, int *);
  int MPI_Graph_neighbors(MPI_Comm, int, int, int *);
  int MPI_Cart_shift(MPI_Comm, int, int, int *, int *);
  int MPI_Cart_sub(MPI_Comm, int *, MPI_Comm *);
  int MPI_Cart_map(MPI_Comm, int, int *, int *, int *);
  int MPI_Graph_map(MPI_Comm, int, int *, int *, int *);
  int MPI_Get_processor_name(char *, int *);
  int MPI_Get_version(int *, int *);
  int MPI_Errhandler_create(MPI_Handler_function *, MPI_Errhandler *);
  int MPI_Errhandler_set(MPI_Comm, MPI_Errhandler);
  int MPI_Errhandler_get(MPI_Comm, MPI_Errhandler *);
  int MPI_Errhandler_free(MPI_Errhandler *);
  int MPI_Error_string(int, char *, int *);
  int MPI_Error_class(int, int *);
  double MPI_Wtime(void);
  double MPI_Wtick(void);

  double PMPI_Wtime(void);
  double PMPI_Wtick(void);

  int MPI_Init(int *, char ***);
  int MPI_Init_thread( int *, char ***, int, int * );
  int MPI_Finalize(void);
  int MPI_Initialized(int *);
  int MPI_Abort(MPI_Comm, int);

 
  int MPI_Comm_set_name(MPI_Comm, char *);
  int MPI_Comm_get_name(MPI_Comm, char *, int *);









  int MPI_Pcontrol(const int, ...);


  int MPIR_null_copy_fn  ( MPI_Comm, int, void *, void *, void *, int * );
  int MPIR_null_delete_fn  ( MPI_Comm, int, void *, void * );
  int MPIR_dup_fn  ( MPI_Comm, int, void *, void *, void *, int * );

 
  int MPI_Status_f2c( MPI_Fint *, MPI_Status * );
  int MPI_Status_c2f( MPI_Status *, MPI_Fint * );
  int MPI_Finalized( int * );
  int MPI_Type_create_indexed_block(int, int, int *, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_get_envelope(MPI_Datatype, int *, int *, int *, int *); 
  int MPI_Type_get_contents(MPI_Datatype, int, int, int, int *, MPI_Aint *, MPI_Datatype *);
  int MPI_Type_create_subarray(int, int *, int *, int *, int, MPI_Datatype, MPI_Datatype *);
  int MPI_Type_create_darray(int, int, int, int *, int *, int *, int *, int, MPI_Datatype, MPI_Datatype *);
  int MPI_Info_create(MPI_Info *);
  int MPI_Info_set(MPI_Info, char *, char *);
  int MPI_Info_delete(MPI_Info, char *);
  int MPI_Info_get(MPI_Info, char *, int, char *, int *);
  int MPI_Info_get_valuelen(MPI_Info, char *, int *, int *);
  int MPI_Info_get_nkeys(MPI_Info, int *);
  int MPI_Info_get_nthkey(MPI_Info, int, char *);
  int MPI_Info_dup(MPI_Info, MPI_Info *);
  int MPI_Info_free(MPI_Info *info);

MPI_Fint MPI_Info_c2f(MPI_Info);
MPI_Info MPI_Info_f2c(MPI_Fint);
MPI_Fint MPI_Request_c2f( MPI_Request );

 
  int MPI_Status_set_cancelled( MPI_Status *, int );
  int MPI_Status_set_elements( MPI_Status *, MPI_Datatype, int );





 

  int PMPI_Send(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int PMPI_Recv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
  int PMPI_Get_count(MPI_Status *, MPI_Datatype, int *);
  int PMPI_Bsend(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int PMPI_Ssend(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int PMPI_Rsend(void*, int, MPI_Datatype, int, int, MPI_Comm);
  int PMPI_Buffer_attach( void* buffer, int);
  int PMPI_Buffer_detach( void* buffer, int*);
  int PMPI_Isend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Ibsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Issend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Irsend(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Irecv(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Wait(MPI_Request *, MPI_Status *);
  int PMPI_Test(MPI_Request *, int *flag, MPI_Status *);
  int PMPI_Request_free(MPI_Request *);
  int PMPI_Waitany(int, MPI_Request *, int *, MPI_Status *);
  int PMPI_Testany(int, MPI_Request *, int *, int *, MPI_Status *);
  int PMPI_Waitall(int, MPI_Request *, MPI_Status *);
  int PMPI_Testall(int, MPI_Request *, int *flag, MPI_Status *);
  int PMPI_Waitsome(int, MPI_Request *, int *, int *, MPI_Status *);
  int PMPI_Testsome(int, MPI_Request *, int *, int *, MPI_Status *);
  int PMPI_Iprobe(int, int, MPI_Comm, int *flag, MPI_Status *);
  int PMPI_Probe(int, int, MPI_Comm, MPI_Status *);
  int PMPI_Cancel(MPI_Request *);
  int PMPI_Test_cancelled(MPI_Status *, int *flag);
  int PMPI_Send_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Bsend_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Ssend_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Rsend_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Recv_init(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
  int PMPI_Start(MPI_Request *);
  int PMPI_Startall(int, MPI_Request *);
  int PMPI_Sendrecv(void *, int, MPI_Datatype, int, int, void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
  int PMPI_Sendrecv_replace(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status *);
  int PMPI_Type_contiguous(int, MPI_Datatype, MPI_Datatype *);
  int PMPI_Type_vector(int, int, int, MPI_Datatype, MPI_Datatype *);
  int PMPI_Type_hvector(int, int, MPI_Aint, MPI_Datatype, MPI_Datatype *);
  int PMPI_Type_indexed(int, int *, int *, MPI_Datatype, MPI_Datatype *);
  int PMPI_Type_hindexed(int, int *, MPI_Aint *, MPI_Datatype, MPI_Datatype *);
  int PMPI_Type_struct(int, int *, MPI_Aint *, MPI_Datatype *, MPI_Datatype *);
  int PMPI_Address(void*, MPI_Aint *);
  int PMPI_Type_extent(MPI_Datatype, MPI_Aint *);
 

 
  int PMPI_Type_size(MPI_Datatype, int *);
  int PMPI_Type_count(MPI_Datatype, int *);
  int PMPI_Type_lb(MPI_Datatype, MPI_Aint*);
  int PMPI_Type_ub(MPI_Datatype, MPI_Aint*);
  int PMPI_Type_commit(MPI_Datatype *);
  int PMPI_Type_free(MPI_Datatype *);
  int PMPI_Get_elements(MPI_Status *, MPI_Datatype, int *);
  int PMPI_Pack(void*, int, MPI_Datatype, void *, int, int *,  MPI_Comm);
  int PMPI_Unpack(void*, int, int *, void *, int, MPI_Datatype, MPI_Comm);
  int PMPI_Pack_size(int, MPI_Datatype, MPI_Comm, int *);
  int PMPI_Barrier(MPI_Comm );
  int PMPI_Bcast(void* buffer, int, MPI_Datatype, int, MPI_Comm );
  int PMPI_Gather(void* , int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); 
  int PMPI_Gatherv(void* , int, MPI_Datatype, void*, int *, int *, MPI_Datatype, int, MPI_Comm); 
  int PMPI_Scatter(void* , int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm);
  int PMPI_Scatterv(void* , int *, int *displs, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm);
  int PMPI_Allgather(void* , int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
  int PMPI_Allgatherv(void* , int, MPI_Datatype, void*, int *, int *, MPI_Datatype, MPI_Comm);
  int PMPI_Alltoall(void* , int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
  int PMPI_Alltoallv(void* , int *, int *, MPI_Datatype, void*, int *, int *, MPI_Datatype, MPI_Comm);
  int PMPI_Reduce(void* , void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm);
  int PMPI_Op_create(MPI_User_function *, int, MPI_Op *);
  int PMPI_Op_free( MPI_Op *);
  int PMPI_Allreduce(void* , void*, int, MPI_Datatype, MPI_Op, MPI_Comm);
  int PMPI_Reduce_scatter(void* , void*, int *, MPI_Datatype, MPI_Op, MPI_Comm);
  int PMPI_Scan(void* , void*, int, MPI_Datatype, MPI_Op, MPI_Comm );
  int PMPI_Group_size(MPI_Group group, int *);
  int PMPI_Group_rank(MPI_Group group, int *);
  int PMPI_Group_translate_ranks (MPI_Group, int, int *, MPI_Group, int *);
  int PMPI_Group_compare(MPI_Group, MPI_Group, int *);
  int PMPI_Comm_group(MPI_Comm, MPI_Group *);
  int PMPI_Group_union(MPI_Group, MPI_Group, MPI_Group *);
  int PMPI_Group_intersection(MPI_Group, MPI_Group, MPI_Group *);
  int PMPI_Group_difference(MPI_Group, MPI_Group, MPI_Group *);
  int PMPI_Group_incl(MPI_Group group, int, int *, MPI_Group *);
  int PMPI_Group_excl(MPI_Group group, int, int *, MPI_Group *);
  int PMPI_Group_range_incl(MPI_Group group, int, int [][3], MPI_Group *);
  int PMPI_Group_range_excl(MPI_Group group, int, int [][3], MPI_Group *);
  int PMPI_Group_free(MPI_Group *);
  int PMPI_Comm_size(MPI_Comm, int *);
  int PMPI_Comm_rank(MPI_Comm, int *);
  int PMPI_Comm_compare(MPI_Comm, MPI_Comm, int *);
  int PMPI_Comm_dup(MPI_Comm, MPI_Comm *);
  int PMPI_Comm_create(MPI_Comm, MPI_Group, MPI_Comm *);
  int PMPI_Comm_split(MPI_Comm, int, int, MPI_Comm *);
  int PMPI_Comm_free(MPI_Comm *);
  int PMPI_Comm_test_inter(MPI_Comm, int *);
  int PMPI_Comm_remote_size(MPI_Comm, int *);
  int PMPI_Comm_remote_group(MPI_Comm, MPI_Group *);
  int PMPI_Intercomm_create(MPI_Comm, int, MPI_Comm, int, int, MPI_Comm *);
  int PMPI_Intercomm_merge(MPI_Comm, int, MPI_Comm *);
  int PMPI_Keyval_create(MPI_Copy_function *, MPI_Delete_function *, int *, void*);
  int PMPI_Keyval_free(int *);
  int PMPI_Attr_put(MPI_Comm, int, void*);
  int PMPI_Attr_get(MPI_Comm, int, void *, int *);
  int PMPI_Attr_delete(MPI_Comm, int);
  int PMPI_Topo_test(MPI_Comm, int *);
  int PMPI_Cart_create(MPI_Comm, int, int *, int *, int, MPI_Comm *);
  int PMPI_Dims_create(int, int, int *);
  int PMPI_Graph_create(MPI_Comm, int, int *, int *, int, MPI_Comm *);
  int PMPI_Graphdims_get(MPI_Comm, int *, int *);
  int PMPI_Graph_get(MPI_Comm, int, int, int *, int *);
  int PMPI_Cartdim_get(MPI_Comm, int *);
  int PMPI_Cart_get(MPI_Comm, int, int *, int *, int *);
  int PMPI_Cart_rank(MPI_Comm, int *, int *);
  int PMPI_Cart_coords(MPI_Comm, int, int, int *);
  int PMPI_Graph_neighbors_count(MPI_Comm, int, int *);
  int PMPI_Graph_neighbors(MPI_Comm, int, int, int *);
  int PMPI_Cart_shift(MPI_Comm, int, int, int *, int *);
  int PMPI_Cart_sub(MPI_Comm, int *, MPI_Comm *);
  int PMPI_Cart_map(MPI_Comm, int, int *, int *, int *);
  int PMPI_Graph_map(MPI_Comm, int, int *, int *, int *);
  int PMPI_Get_processor_name(char *, int *);
  int PMPI_Get_version(int *, int *);
  int PMPI_Errhandler_create(MPI_Handler_function *, MPI_Errhandler *);
  int PMPI_Errhandler_set(MPI_Comm, MPI_Errhandler);
  int PMPI_Errhandler_get(MPI_Comm, MPI_Errhandler *);
  int PMPI_Errhandler_free(MPI_Errhandler *);
  int PMPI_Error_string(int, char *, int *);
  int PMPI_Error_class(int, int *);

  int PMPI_Type_get_envelope(MPI_Datatype, int *, int *, int *, int *); 
  int PMPI_Type_get_contents(MPI_Datatype, int, int, int, int *, MPI_Aint *, MPI_Datatype *);
  int PMPI_Type_create_subarray(int, int *, int *, int *, int, MPI_Datatype, MPI_Datatype *);
  int PMPI_Type_create_darray(int, int, int, int *, int *, int *, int *, int, MPI_Datatype, MPI_Datatype *);
  int PMPI_Info_create(MPI_Info *);
  int PMPI_Info_set(MPI_Info, char *, char *);
  int PMPI_Info_delete(MPI_Info, char *);
  int PMPI_Info_get(MPI_Info, char *, int, char *, int *);
  int PMPI_Info_get_valuelen(MPI_Info, char *, int *, int *);
  int PMPI_Info_get_nkeys(MPI_Info, int *);
  int PMPI_Info_get_nthkey(MPI_Info, int, char *);
  int PMPI_Info_dup(MPI_Info, MPI_Info *);
  int PMPI_Info_free(MPI_Info *);

MPI_Fint PMPI_Info_c2f(MPI_Info);
MPI_Info PMPI_Info_f2c(MPI_Fint);

 
  int PMPI_Init(int *, char ***);
  int PMPI_Init_thread( int *, char ***, int, int * );
  int PMPI_Finalize(void);
  int PMPI_Initialized(int *);
  int PMPI_Abort(MPI_Comm, int);
 
 
 








  int PMPI_Pcontrol(const int, ...);


 
  int PMPI_Status_set_cancelled( MPI_Status *, int );
  int PMPI_Status_set_elements( MPI_Status *, MPI_Datatype, int );


 


}
 
 












# 69 "CommServer.h" 2


}




 
 












class comm_barrier ;

class comm_service {
private:  
   

  static int             init_flag ;
  static int             dce_flag ;

  static int             PMe ;

  static int             NList ;
  static MPI_Request   * RList ;
  static comm_service ** SList ;
  static comm_barrier ** Barrier ;
  static comm_barrier ** BarrierWorld ;

  static ofstream        oflog ;

  static ostream_withassign  olog ;


   
  static int             PNum ;
  static MPI_Comm        Comm ;
  static MPI_Group       Grp  ;

   
  static int             io_flag ;
  static int             PIO ;
  static MPI_Comm        CommIO ;

   
  static MPI_Comm        CommWorld ;
  static int             PWorld ;
  static MPI_Group	 GrpWorld ;

   
  static int		NumCommArray ;
  static MPI_Comm     * CommArray ;

   
  static double Idle_Time ;  
  static double Srvc_Time ;  

  MPI_Request * Req ;

  static int findTag( const int , const int , const int );  
  static int findService( comm_service * const );   
  static int findRequest( const MPI_Request );      

protected:  

  const int Id ;
  const int Tag ;
  const int Src ;

  comm_service( const int I , const int T , const int S= (-2)  );

  virtual ~comm_service();

  virtual void callrecv( const MPI_Status & );  
  virtual const char * name( void ) const ;     

  void setreq(const int, const int, const int);

public:  

   

  static int  init( MPI_Comm c = 0 );
  static void clean();
  static void kill();

   

  static int serve( MPI_Request );  
  static int serve( void );         

  static void barrier( int const type = ((unsigned) 0)  );

   

  MPI_Request * req(void) const { return Req ; }
  int tag(void) const { return Tag ; }

  static ofstream & flog(void)  { return oflog ; }



  static ostream_withassign& log(void)    { return olog ; }


  static int dce(void)      	{ return dce_flag ; }
  static int proc_me(void)      { return PMe ; }

  static int proc_num(void)     { return PNum ; }
  static MPI_Comm comm(void)    { return Comm ; }
  static MPI_Group grp(void)    { return Grp ; }

  static int num_services(void) { return NList ;}

  static int comminit(void)     { return (init_flag == 1); }
  static void set_comminit(void)     { init_flag = 1; }
  static void reset_comminit(void)     { init_flag = 0; }

  static int io_enabled(void)     { return (io_flag == 1); }
  static void set_io_enable(void)     { io_flag = 1; }
  static void reset_io_enable(void)     { io_flag = 0; }
  static int proc_io(void)     { return PIO ; }
  static MPI_Comm comm_io(void)    { return CommIO ; }

  static MPI_Comm comm_world(void)    { return CommWorld ; }
  static int proc_world(void)    { return PWorld; }
  static MPI_Group grp_world(void)    { return GrpWorld ; }

  static MPI_Comm comm(int const id)    { return CommArray[id] ; }
  static int num_comm(void)    { return NumCommArray ; }

  static void add_comm(int const id);
  static void delete_comm(int const id);
  static void reset_comm(int const id);

  static void inc_commarray(int const inc);

  static double idle_time(void) { return Idle_Time ; }
  static double srvc_time(void) { return Srvc_Time ; }

   
  static void error_msg( const char who[] , const char what[] , int R );
  static void error_die( const char who[] , const char what[] , int R );
};


# 13 "ACEDistribution.cpp" 2

 

 
 
 
void partition_one(const BBox& wholebbox, BBox* boxes, const int np, 
                   const int dim);
void partition_two(const BBox& wholebbox, BBox* boxes, const int np, 
                   const int dim1, const int dim2);
void partition_all(const BBox& wholebbox, BBox* boxes, const int np);
void pwalker_partition(const BBox& wholebbox, BBox* boxes, const int np);
 

ACEDistribution::ACEDistribution(const int disttype, BBoxList& bbl)
  : type(disttype), boxes(0), wfunc(0)
{
  boxes = new BBox[bbl.number()];
  register BBox* bb = 0;
  register int cnt = 0;
  for (bb=bbl.first();bb;bb=bbl.next()) {
    boxes[cnt++] = *bb; 
  }
}   

void ACEDistribution::set_dist(const int disttype, BBoxList& bbl)
{
  type = disttype;
  if (boxes) delete [] boxes;
  boxes = new BBox[bbl.number()];
  register BBox* bb = 0;
  register int cnt = 0;
  for (bb=bbl.first();bb;bb=bbl.next()) {
    boxes[cnt++] = *bb; 
  }
}

unsigned long ACEDistribution::get_load(GridUnitList& ggul, 
					const short* olap)
{
  if (wfunc) { 
    unsigned long load = 0, n = 0;
    int levels = ggul.levels();
    for (int l=0;l<levels;l++) 
      load += (*wfunc)(&(n=ggul.numelems(l,olap)),&l);
    return load;
  } 
  else return( ggul.load(olap) );
}

 
 
 
void ACEDistribution::init_partitioner(const int np,
				       const int me,
				       const int rank,
				       const BBox& wholebbox) 
{
  wbox = wholebbox;
  if ((type/ (10) )* (10)  == 
      (10) ) {
# 86 "ACEDistribution.cpp"

    cerr << "VAMPIRE not available !"
	 << "Please recompile GrACE with Vampire libraries" 
	 << endl << flush;
    exit (-1);

  }
  else if (type == (20) ) {
# 114 "ACEDistribution.cpp"

    cerr << "ParMetis not available !"
	 << "Please recompile GrACE with ParMetis libraries" 
	 << endl << flush;
    exit (-1);

  }
  else { 
     
  }
}

void ACEDistribution::partition(GridUnitList*& ggul,
				GridUnitList*& lgul,
				const int np, 
				const int me, 
				const int minw, 
				const int maxw, 
				const int minwk, 
				const short* olap,
				const int orphan_flag)
{
  if (type == (1) ) 
    partitionComposite(ggul,lgul,np,me,minw,maxw,minwk,olap,orphan_flag);
  
  else if (type == (2) ) 
    partitionBlockOne((0) ,ggul,lgul,np,me,minw,maxw,minwk,olap);
  else if (type == (3) ) 
    partitionBlockOne((1) ,ggul,lgul,np,me,minw,maxw,minwk,olap);
  else if (type == (4) ) 
    partitionBlockOne((2) ,ggul,lgul,np,me,minw,maxw,minwk,olap);
  
  else if (type == (5) ) 
    partitionBlockTwo((0) ,(1) ,ggul,lgul,np,me,minw,maxw,minwk,olap);
  else if (type == (6) ) 
    partitionBlockTwo((1) ,(2) ,ggul,lgul,np,me,minw,maxw,minwk,olap);
  else if (type == (7) ) 
    partitionBlockTwo((0) ,(2) ,ggul,lgul,np,me,minw,maxw,minwk,olap);
  
  else if (type == (8) ) 
    partitionBlockAll(ggul,lgul,np,me,minw,maxw,minwk,olap);
  
  else if (type == (9) ) 
    partitionUserDef(ggul,lgul,np,me,minw,maxw,minwk,olap);
  
  else {
    cerr << "Partitioner Not Defined !" << endl << flush;
    (static_cast<void>  (( 0 ) ? 0 :	(__assert_fail ("0" , "ACEDistribution.cpp", 161, __PRETTY_FUNCTION__ ), 0))) ;
  }
}

void ACEDistribution::partition(BBoxList& inbbl,
				BBoxList** bboxarray,
				const int levels,
				const int clevels,
				const int reflev,
				const int rank,
				const int np, 
				const int me,
				const int minw, 
				const int maxw, 
				const int minwk, 
				const short* olap,
				const int orphan_flag)
{

  (static_cast<void>  (( type != (1)  ) ? 0 :	(__assert_fail ("type != (1)" , "ACEDistribution.cpp", 180, __PRETTY_FUNCTION__ ), 0))) ;
  comm_service::log() << "IN PARTITION - The Input List is " << endl
		      << inbbl << endl << flush;

  if ((type/ (10) )* (10)  == 
      (10) ) {
    partitionVampire(inbbl,
		     bboxarray,
		     levels,
		     clevels,
		     reflev,
		     rank,
		     np,
		     me,
		     minw,
		     maxw,
		     minwk,
		     olap);
  }
  else if (type == (20) ) {
    partitionParMetis(inbbl,
		      bboxarray,
		      levels,
		      clevels,
		      reflev,
		      rank,
		      np,
		      me,
		      minw,
		      maxw,
		      minwk,
		      olap);
  }
  else {
    cerr << "Partitioner Not Defined !" << endl << flush;
    (static_cast<void>  (( 0 ) ? 0 :	(__assert_fail ("0" , "ACEDistribution.cpp", 215, __PRETTY_FUNCTION__ ), 0))) ;
  }

    for (int lll=0;lll<levels;lll++) {
      if (bboxarray[lll])
	comm_service::log() << "IN PARTITION - The Output List at level " << lll << "is " << endl 
			    << *bboxarray[lll] 
			    << endl << flush;
    }

}

void ACEDistribution::partition(const BBox& wbbox,
				BBox& mybbox,
				const int np, 
				const int me,
				const int orphan_flag)
{

  (static_cast<void>  (( type != (1)  ) ? 0 :	(__assert_fail ("type != (1)" , "ACEDistribution.cpp", 234, __PRETTY_FUNCTION__ ), 0))) ;

  
  if (type != (9) ) {
    if (boxes) delete [] boxes;
    boxes = new BBox[np];
    
    if (type == (2) ) 
      partition_one(wbbox, boxes, np, (0) );
    else if (type == (3) ) 
      partition_one(wbbox, boxes, np, (1) );
    else if (type == (4) ) 
      partition_one(wbbox, boxes, np, (2) );
    
    else if (type == (5) ) 
      partition_two(wbbox, boxes, np, (0) , (1) );
    else if (type == (6) ) 
      partition_two(wbbox, boxes, np, (1) , (2) );
    else if (type == (7) ) 
      partition_two(wbbox, boxes, np, (0) , (2) );
    
    else if (type == (8) ) 
      partition_all(wbbox, boxes, np);
    else {
      cerr << "Partitioner Not Defined !" << endl << flush;
      (static_cast<void>  (( 0 ) ? 0 :	(__assert_fail ("0" , "ACEDistribution.cpp", 259, __PRETTY_FUNCTION__ ), 0))) ;
    }
  }
  if (me < np) mybbox = boxes[me];
  else mybbox.setempty();
}

 
 
 
void ACEDistribution::partitionVampire(BBoxList& inbbl,
				       BBoxList** bboxarray,
				       const int levels,
				       const int clevels,
				       const int reflev,
				       const int rank,
				       const int np, 
				       const int me,
				       const int minw, 
				       const int maxw, 
				       const int minwk, 
				       const short* olap)
{
# 480 "ACEDistribution.cpp"

  cerr << "VAMPIRE not available !"
       << "Please recompile GrACE with Vampire libraries" 
       << endl << flush;
  exit (-1);

}

 
 
void ACEDistribution::partitionParMetis(BBoxList& inbbl,
					BBoxList** bboxarray,
					const int levels,
					const int clevels,
					const int reflev,
					const int rank,
					const int np, 
					const int me,
					const int minw, 
					const int maxw, 
					const int minwk, 
					const short* olap)
{
# 600 "ACEDistribution.cpp"

    cerr << "ParMetis not available !"
	 << "Please recompile GrACE with ParMetis libraries" 
	 << endl << flush;
    exit (-1);

}
 
 
void ACEDistribution::partitionComposite(GridUnitList*& ggulO,
					 GridUnitList*& lgul,
					 const int np, 
					 const int me, 
					 const int minw, 
					 const int maxw, 
					 const int minwk, 
					 const short* olap,
					 const int orphan_flag)
{

   
  (static_cast<void>  (( ggulO->number() > 0 ) ? 0 :	(__assert_fail ("ggulO->number() > 0" , "ACEDistribution.cpp", 621, __PRETTY_FUNCTION__ ), 0))) ;
  
   
  (static_cast<void>  (( np > 0 ) ? 0 :	(__assert_fail ("np > 0" , "ACEDistribution.cpp", 624, __PRETTY_FUNCTION__ ), 0))) ;

  
   
  
  if (me < np) {
    if (lgul) lgul->empty();
    else {
      lgul = new GridUnitList;
    }
  }

   
   

  GridUnitList theggul;
  GridUnitList* ggul = 0;
  if (orphan_flag == (1) ) {
    ggul = &theggul;
    ggulO->levellist(*ggul);
  }
  else {
    ggul = ggulO;
  }

  unsigned long work = get_load(*ggul,olap);
  
  unsigned long minwork = (unsigned) minwk;
  unsigned long thresh = max(minwork,(unsigned)((1.0*(work/np))+0.5));
  register unsigned long curthresh = thresh;
  
  int p = 0, pcnt = 0;
  unsigned tmpw = 0, w = 0;
  
  register GridUnit *tmpgu = ggul->first();
  






  
  for (int cnt=0;tmpgu;cnt++,tmpgu=ggul->next()) {
    w += (tmpw = tmpgu->guWork(olap));
    
# 678 "ACEDistribution.cpp"

    
    if (w <= curthresh) {
      

      (static_cast<void>  (( p<np ) ? 0 :	(__assert_fail ("p<np" , "ACEDistribution.cpp", 683, __PRETTY_FUNCTION__ ), 0))) ;


      tmpgu->guSetOwner(p); pcnt++;
      if (p == me)  lgul->add(*tmpgu);
       
       
    }
    else if (w-curthresh < tmpw/8) {
      

      (static_cast<void>  (( p<np ) ? 0 :	(__assert_fail ("p<np" , "ACEDistribution.cpp", 694, __PRETTY_FUNCTION__ ), 0))) ;

      tmpgu->guSetOwner(p); pcnt++;
      if (p == me)  lgul->add(*tmpgu);
       
      p++; pcnt = 0;
      curthresh = w + max(minwork,(unsigned)((1.0*((work-w)/(np-p)))+0.5));
    }
    else if (tmpw > thresh && tmpgu->guExtentValue(tmpgu->guCrsLev()) > minw) {
      w -= tmpw;
      cnt--;
      int oldwork = work;
      ggul->decompose();
      work = get_load(*ggul,olap);
      
# 717 "ACEDistribution.cpp"

      
      thresh = max(minwork,(unsigned)((1.0*(work/np))+0.5));
      curthresh = curthresh+max(minwork,(unsigned)((1.0*((work-oldwork)/(np-p)))+0.5));
    }
    else if (pcnt == 0) {
      

      (static_cast<void>  (( p<np ) ? 0 :	(__assert_fail ("p<np" , "ACEDistribution.cpp", 725, __PRETTY_FUNCTION__ ), 0))) ;

      tmpgu->guSetOwner(p); pcnt++;
      if (p == me)  lgul->add(*tmpgu);
       
      p++; pcnt = 0;
      curthresh = w + max(minwork,(unsigned)((1.0*((work-w)/(np-p)))+0.5));
    }
    else  {
      p++; pcnt = 0;
      

      (static_cast<void>  (( p<np ) ? 0 :	(__assert_fail ("p<np" , "ACEDistribution.cpp", 737, __PRETTY_FUNCTION__ ), 0))) ;

      tmpgu->guSetOwner(p);
      if (p == me) lgul->add(*tmpgu);
       
       
      curthresh = (w-tmpw) + max(minwork,(unsigned)((1.0*((work-(w-tmpw))/(np-p)))+0.5));
      if (w >= curthresh) {
	p++; pcnt = 0;
	if (p < np)
	  curthresh = w + max(minwork,(unsigned)((1.0*((work-w)/(np-p)))+0.5));
      }
    }
  }
   
   
  if (orphan_flag == (1) ) {
    *ggulO = *ggul;
  }
}
 
 
void ACEDistribution::partitionBlockOne(const int axis,
					GridUnitList*& ggul,
					GridUnitList*& lgul,
					const int np, 
					const int me, 
					const int minw, 
					const int maxw, 
					const int minwk, 
					const short* olap)
{

   
  (static_cast<void>  (( ggul->number() > 0 ) ? 0 :	(__assert_fail ("ggul->number() > 0" , "ACEDistribution.cpp", 771, __PRETTY_FUNCTION__ ), 0))) ;
  
   
  (static_cast<void>  (( np > 0 ) ? 0 :	(__assert_fail ("np > 0" , "ACEDistribution.cpp", 774, __PRETTY_FUNCTION__ ), 0))) ;

  
  if (boxes) delete [] boxes;
  boxes = new BBox[np];
  
  const int flev = (ggul->first())->guFineLev();
  BBoxList tmpbbl;
  ggul->bboxlist(tmpbbl, flev, 0, 0);
  BBox wbbox = tmpbbl.reduce();
  partition_one(wbbox, boxes, np, axis);
  
  GridUnitList tmpgul;
  for (register int p=0;p<np;p++) {
    ggul->intersect(boxes[p], flev, tmpgul, 0);
    GridUnitList tmpgul(*ggul);
    tmpgul *= boxes[p];
    ggul->setowner(tmpgul,p);
    if (p == me) {
      if (lgul) {
	lgul->empty();
	*lgul = tmpgul;
      }
      else {
	lgul = new GridUnitList(tmpgul);
      }
      lgul->setowner(me);
    } 
  }
}
 
 
void ACEDistribution::partitionBlockTwo(const int axis1, 
					const int axis2,
					GridUnitList*& ggul,
					GridUnitList*& lgul,
					const int np, 
					const int me, 
					const int minw, 
					const int maxw, 
					const int minwk, 
					const short* olap)
{

   
  (static_cast<void>  (( ggul->number() > 0 ) ? 0 :	(__assert_fail ("ggul->number() > 0" , "ACEDistribution.cpp", 819, __PRETTY_FUNCTION__ ), 0))) ;
  
   
  (static_cast<void>  (( np > 0 ) ? 0 :	(__assert_fail ("np > 0" , "ACEDistribution.cpp", 822, __PRETTY_FUNCTION__ ), 0))) ;

  
  if (boxes) delete [] boxes;
  boxes = new BBox[np];
  
  const int flev = (ggul->first())->guFineLev();
  BBoxList tmpbbl;
  ggul->bboxlist(tmpbbl, flev, 0, 0);
  BBox wbbox = tmpbbl.reduce();
  partition_two(wbbox, boxes, np, axis1, axis2);
  
  GridUnitList tmpgul;
  for (register int p=0;p<np;p++) {
    ggul->intersect(boxes[p], flev, tmpgul, 0);
    GridUnitList tmpgul(*ggul);
    tmpgul *= boxes[p];
    ggul->setowner(tmpgul,p);
    if (p == me) {
      if (lgul) {
	lgul->empty();
	*lgul = tmpgul;
      }
      else {
	lgul = new GridUnitList(tmpgul);
      }
      lgul->setowner(me);
    } 
  }
}
 
 
void ACEDistribution::partitionBlockAll(GridUnitList*& ggul,
					GridUnitList*& lgul,
					const int np, 
					const int me, 
					const int minw, 
					const int maxw, 
					const int minwk, 
					const short* olap)
{

   
  (static_cast<void>  (( ggul->number() > 0 ) ? 0 :	(__assert_fail ("ggul->number() > 0" , "ACEDistribution.cpp", 865, __PRETTY_FUNCTION__ ), 0))) ;
  
   
  (static_cast<void>  (( np > 0 ) ? 0 :	(__assert_fail ("np > 0" , "ACEDistribution.cpp", 868, __PRETTY_FUNCTION__ ), 0))) ;


  if (boxes) delete boxes;
  boxes = new BBox[np];
  
  const int flev = (ggul->first())->guFineLev();
  BBoxList tmpbbl;
  ggul->bboxlist(tmpbbl, flev, 0, 0);
  BBox wbbox = tmpbbl.reduce();
  partition_all(wbbox, boxes, np);
  
  GridUnitList tmpgul;
  for (register int p=0;p<np;p++) {
    ggul->intersect(boxes[p], flev, tmpgul, 0);
    GridUnitList tmpgul(*ggul);
    tmpgul *= boxes[p];
    ggul->setowner(tmpgul,p);
    if (p == me) {
      if (lgul) {
	lgul->empty();
	*lgul = tmpgul;
      }
      else {
	lgul = new GridUnitList(tmpgul);
      }
      lgul->setowner(me);
    } 
  }
}
 
 
void ACEDistribution::partitionUserDef(GridUnitList*& ggul,
				       GridUnitList*& lgul,
				       const int np, 
				       const int me, 
				       const int minw, 
				       const int maxw, 
				       const int minwk, 
				       const short* olap)
{

   
  (static_cast<void>  (( boxes ) ? 0 :	(__assert_fail ("boxes" , "ACEDistribution.cpp", 911, __PRETTY_FUNCTION__ ), 0))) ; 
  
   
  (static_cast<void>  (( ggul->number() > 0 ) ? 0 :	(__assert_fail ("ggul->number() > 0" , "ACEDistribution.cpp", 914, __PRETTY_FUNCTION__ ), 0))) ;
  
   
  (static_cast<void>  (( np > 0 ) ? 0 :	(__assert_fail ("np > 0" , "ACEDistribution.cpp", 917, __PRETTY_FUNCTION__ ), 0))) ;

  
  const int flev = (ggul->first())->guFineLev();
  BBoxList tmpbbl;
  ggul->bboxlist(tmpbbl, flev, 0, 0);
  BBox wbbox = tmpbbl.reduce();
  partition_all(wbbox, boxes, np);
  
  GridUnitList tmpgul;
  for (register int p=0;p<np;p++) {
    ggul->intersect(boxes[p], flev, tmpgul, 0);
    GridUnitList tmpgul(*ggul);
    tmpgul *= boxes[p];
    ggul->setowner(tmpgul,p);
    if (p == me) {
      if (lgul) {
	lgul->empty();
	*lgul = tmpgul;
      }
      else {
	lgul = new GridUnitList(tmpgul);
      }
      lgul->setowner(me);
    } 
  }
}
 
 
 










void partition_one(const BBox& wholebbox, 
		   BBox* boxes, 
		   const int np, 
                   const int dim)
{
   
   
   
   
  const int extent = wholebbox.extents(dim);
  

  (static_cast<void>  (( extent >= np ) ? 0 :	(__assert_fail ("extent >= np" , "ACEDistribution.cpp", 969, __PRETTY_FUNCTION__ ), 0))) ;  

  
  const int dx = extent/np;
  const int Xtra = extent%np;
  
  for (register int p=0;p<np;p++) {
    const int dlower = p*dx + min(Xtra,p);
    const int dupper = (np-p-1)*dx + max((Xtra-p-1),0);
    boxes[p] = wholebbox;
    boxes[p].growlower(dim,dlower);
    boxes[p].growupper(dim,-dupper);
  }
}

 
void partition_two(const BBox& wholebbox, 
		   BBox* boxes, 
		   const int np, 
                   const int dim1, 
		   const int dim2)
{
   
  int n1,n2;
  
   
  n1 = np;
  n2 = 1;
  if (n1 % 2 == 0) {
    while (n1 % 2 == 0 && n1 > n2
	   && (abs(n1-n2) >= abs(n1/2-n2*2))) {
      n1 /= 2;
      n2 *= 2;
    }
  } else {
    while (n1 % 3 == 0 && n1 > n2
	   && (abs(n1-n2) >= abs(n1/3-n2*3))) {
      n1 /= 3;
      n2 *= 3;
    }
  }
  
  const int rank = wholebbox.rank;
  const Coords& glb = wholebbox.lower();
   
  const Coords& step = wholebbox.stepsize();
  const Coords& ext = wholebbox.extents();
  
  Coords tmpe(ext);
  const int ld1 = (tmpe(dim1) >= tmpe(dim2)) ? dim1 : dim2; 
  const int ld2 = (tmpe(dim1) < tmpe(dim2)) ? dim1 : dim2;
  
  Coords tmpp(rank,0);
  tmpp(dim1) = n1; tmpp(dim2) = n2;
  const int nn1 = (tmpp(dim1) >= tmpp(dim2)) ? dim1 : dim2; 
  const int nn2 = (tmpp(dim1) < tmpp(dim2)) ? dim1 : dim2;
  
  tmpe(ld1) = tmpp(nn1);
  tmpe(ld2) = tmpp(nn2);
  
  n1 = tmpe(dim1);
  n2 = tmpe(dim2);
  
   
  Coords delt(rank,0); 
  delt(dim1) = (ext(dim1)/n1);
  delt(dim2) = (ext(dim2)/n2);
   

  
   
  Coords cor(rank,0);
  cor(dim1) = ext(dim1)%n1;
  cor(dim2) = ext(dim2)%n2;
   

  
   
  for (register int p=0;p<np;p++) boxes[p] = wholebbox;
  
  for (register int ii=0;ii<n1;ii++) {
    for (register int jj=0;jj<n2;jj++) {
       
      int whichp = ii + jj*n1;
      
      Coords c1(rank,0), c2 (rank,0);
      
      c1(dim1) = (cor(dim1) > ii) ? 1 : 0;
      c1(dim2) = (cor(dim2) > jj) ? 1 : 0;
      
       

      
      c2(dim1) = min(cor(dim1),ii);
      c2(dim2) = min(cor(dim2),jj);
      
      Coords& lb = boxes[whichp].lower();
      Coords& ub = boxes[whichp].upper();
      
      lb(dim1) = glb(dim1) + (ii * (delt(dim1)) + c2(dim1))*step(dim1);
      lb(dim2) = glb(dim2) + (jj * (delt(dim2)) + c2(dim2))*step(dim2);
      
      ub(dim1) = lb(dim1) + (delt(dim1) + c1(dim1) - 1)*step(dim1);
      ub(dim2) = lb(dim2) + (delt(dim2) + c1(dim2) - 1)*step(dim2);
    }
  }
}

 
void partition_all(const BBox& wholebbox, 
		   BBox* boxes, 
		   const int np)
{
   
  int n1,n2,n3;
  
   
  n1 = np;
  n2 = 1;
  n3 = 1;
  for (register int i=0;i<2;i++) {
    int twof = 0;
    if (n1 % 2 == 0) twof = 1;
    if (twof) {
      while (n1 % 2 == 0 && n1 > n2
	     && (abs(n1-n2) >= abs(n1/2-n2*2))) {
	n1 /= 2;
	n2 *= 2;
      }
    } else {
      while (n1 % 3 == 0 && n1 > n2
	     && (abs(n1-n2) >= abs(n1/3-n2*3))) {
	n1 /= 3;
	n2 *= 3;
      }
    }
    twof = 0;
    if (n2 % 2 == 0) twof = 1;
    if (twof) {
      while (n2 % 2 == 0 && n2 > n3
	     && (abs(n2-n3) >= abs(n2/2-n3*2))) {
	n2 /= 2;
	n3 *= 2;
      }
    } else {
      while (n2 % 3 == 0 && n2 > n3
	     && (abs(n2-n3) >= abs(n2/3-n3*3))) {
	n2 /= 3;
	n3 *= 3;
      }
    }
  }
    
  
  const int rank = wholebbox.rank;
  const Coords& glb = wholebbox.lower();
   
  const Coords& step = wholebbox.stepsize();
  const Coords& ext = wholebbox.extents();
  
  Coords tmpe(ext);
  const int ld1 = (tmpe(0) > tmpe(1)) ? 
    ((tmpe(0) > tmpe(2)) ? 0 : 2) : 
    ((tmpe(1) > tmpe(2) ? 1 : 2));
  tmpe(ld1) = 0; 
  const int ld2 = (tmpe(0) > tmpe(1)) ? 
    ((tmpe(0) > tmpe(2)) ? 0 : 2) : 
    ((tmpe(1) > tmpe(2) ? 1 : 2));
  tmpe(ld2) = 0; 
  const int ld3 = (tmpe(0) > tmpe(1)) ? 
    ((tmpe(0) > tmpe(2)) ? 0 : 2) : 
    ((tmpe(1) > tmpe(2) ? 1 : 2));
  
  Coords tmpp(rank,0);
  tmpp(0) = n1; tmpp(1) = n2; tmpp(2) = n3;    
  const int nn1 = (tmpp(0) > tmpp(1)) ? 
    ((tmpp(0) > tmpp(2)) ? 0 : 2) : 
    ((tmpp(1) > tmpp(2) ? 1 : 2));
  tmpp(nn1) = 0; 
  const int nn2 = (tmpp(0) > tmpp(1)) ? 
    ((tmpp(0) > tmpp(2)) ? 0 : 2) : 
    ((tmpp(1) > tmpp(2) ? 1 : 2));
  tmpp(nn2) = 0; 
  const int nn3 = (tmpp(0) > tmpp(1)) ? 
    ((tmpp(0) > tmpp(2)) ? 0 : 2) : 
    ((tmpp(1) > tmpp(2) ? 1 : 2));
  
  tmpp(0) = n1; tmpp(1) = n2; tmpp(2) = n3;    
  tmpe(ld1) = tmpp(nn1);
  tmpe(ld2) = tmpp(nn2);
  tmpe(ld3) = tmpp(nn3);
  
  n1 = tmpe(0);
  n2 = tmpe(1);
  n3 = tmpe(2);
  
   
  Coords delt(rank,0);
  delt(0) = (ext(0)/n1);
  delt(1) = (ext(1)/n2);
  delt(2) = (ext(2)/n3);
   


  
   
  Coords cor(rank,0);
  cor(0) =  (ext(0)%n1);
  cor(1) =  (ext(1)%n2);
  cor(2) =  (ext(2)%n3);
   


  






  
   
  for (register int p=0;p<np;p++) boxes[p] = wholebbox;
  
  for (register int ii=0;ii<n1;ii++) {
    for (register int jj=0;jj<n2;jj++) {
      for (register int kk=0;kk<n3;kk++) {
	 
	int whichp = ii + jj*n1 + kk*n1*n2;
	






	
	Coords c1(rank,0), c2 (rank,0);
	
	c1(0) = (cor(0) > ii) ? 1 : 0;
	c1(1) = (cor(1) > jj) ? 1 : 0;
	c1(2) = (cor(2) > kk) ? 1 : 0;
	
	 


	
	c2(0) = min(cor(0),ii);
	c2(1) = min(cor(1),jj);
	c2(2) = min(cor(2),kk);
	
	Coords& lb = boxes[whichp].lower();
	Coords& ub = boxes[whichp].upper();
	
	lb(0) = glb(0) + (ii * (delt(0)) + c2(0))*step(0);
	lb(1) = glb(1) + (jj * (delt(1)) + c2(1))*step(1);
	lb(2) = glb(2) + (kk * (delt(2)) + c2(2))*step(2);
	
	ub(0) = lb(0) + (delt(0) + c1(0) - 1)*step(0);
	ub(1) = lb(1) + (delt(1) + c1(1) - 1)*step(1);
	ub(2) = lb(2) + (delt(2) + c1(2) - 1)*step(2);
	




	
      }
    }
  }
}

void pwalker_partition(const BBox& wholebbox, 
		       BBox* boxes, 
		       const int np)
{
  Coords glb(wholebbox.lower());
  Coords gub(wholebbox.upper());
   
  int nx,ny,nz;
  
   
  nx = np;
  ny = 1;
  nz = 1;
  for (int i=0;i<2;i++) {
    int twof = 0;
    if (nx % 2 == 0) twof = 1;
    if (twof) {
      while (nx % 2 == 0 && nx > ny
	     && (abs(nx-ny) >= abs(nx/2-ny*2))) {
	nx /= 2;
	ny *= 2;
      }
    } else {
      while (nx % 3 == 0 && nx > ny
	     && (abs(nx-ny) >= abs(nx/3-ny*3))) {
	nx /= 3;
	ny *= 3;
      }
    }
    twof = 0;
    if (ny % 2 == 0) twof = 1;
    if (twof) {
      while (ny % 2 == 0 && ny > nz
	     && (abs(ny-nz) >= abs(ny/2-nz*2))) {
	ny /= 2;
	nz *= 2;
      }
    } else {
      while (ny % 3 == 0 && ny > nz
	     && (abs(ny-nz) >= abs(ny/3-nz*3))) {
	ny /= 3;
	nz *= 3;
      }
    }
  }
    
  
   
  BBox mt(3,0);
  for (int p=0;p<np;p++) boxes[p] = mt;
  
  int ii,jj,kk;
  int *delt = new int[3], *layout = new int[3];
  
   
  layout[0] = nx; layout[1] = ny; layout[2] = nz;
  for (int mm=0;mm<3;mm++) {
    delt[mm] =  (gub(mm)-glb(mm))/layout[mm];
  }
  
  Coords mylb(3,0),myub(3,0);
  for (ii=0;ii<nx;ii++)
    for (jj=0;jj<ny;jj++)
      for (kk=0;kk<nz;kk++) {
	 
	int whichp = ii + jj*nx + kk*nx*ny;
	mylb(0) = delt[0]*ii;
	mylb(1) = delt[1]*jj;
	mylb(2) = delt[2]*kk;
	
	myub(0) = 
	  (ii != nx-1 ? delt[0]*(ii+1)-1 : gub(0));
	myub(1) = 
	  (jj != ny-1 ? delt[1]*(jj+1)-1 : gub(1));
	myub(2) = 
	  (kk != nz-1 ? delt[2]*(kk+1)-1 : gub(2));
	
	boxes[whichp].setlower(mylb);
	boxes[whichp].setupper(myub);
	boxes[whichp].setstepsize(0,1);
	boxes[whichp].setstepsize(1,1);
	boxes[whichp].setstepsize(2,1);
      }
}
>Fix:
    Please tell me how to fix!	
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-12-06 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-06  5:56 preprocessor/5034: Internal compiler error in gcc-2.95.4, but gcc-3.0 gives syntax errors Scott Hawley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).