public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/10763: -O2 flag causes internal error
@ 2003-05-13 6:51 steven
0 siblings, 0 replies; 3+ messages in thread
From: steven @ 2003-05-13 6:51 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, sls
Synopsis: -O2 flag causes internal error
State-Changed-From-To: open->closed
State-Changed-By: steven
State-Changed-When: Tue May 13 06:51:58 2003
State-Changed-Why:
Reported fixed for 3.3
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10763
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/10763: -O2 flag causes internal error
@ 2003-05-13 5:26 Dara Hazeghi
0 siblings, 0 replies; 3+ messages in thread
From: Dara Hazeghi @ 2003-05-13 5:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/10763; it has been noted by GNATS.
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: sls@usc.edu, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: optimization/10763: -O2 flag causes internal error
Date: Mon, 12 May 2003 22:20:09 -0700
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-
trail&database=gcc&pr=10763
Hello,
I can reproduce the bug reported here on gcc 3.2 but not on 3.3 branch
or mainline (20030511) on i686-linux, so I think this report can be
closed (the next available release of gcc, 3.3, will not have this bug).
Dara
^ permalink raw reply [flat|nested] 3+ messages in thread
* optimization/10763: -O2 flag causes internal error
@ 2003-05-13 2:26 sls
0 siblings, 0 replies; 3+ messages in thread
From: sls @ 2003-05-13 2:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 10763
>Category: optimization
>Synopsis: -O2 flag causes internal error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue May 13 02:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Steven L. Scott
>Release: gcc version 3.2 20020927 (prerelease)
>Organization:
>Environment:
cygwin (latest version... updated 5 minutes ago)
Pentium 4
>Description:
~/stevelib/random[505] gcc -O2 -c draw_dir_hp.c
draw_dir_hp.c: In function `post_dir_hp':
draw_dir_hp.c:130: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
gcc -c -O2 draw_dir_hp.c
>Fix:
gcc -c -O draw_dir_hp.c
(i.e. reduced optimization level works fine)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="draw_dir_hp.preproc"
Content-Disposition: inline; filename="draw_dir_hp.preproc"
# 1 "draw_dir_hp.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "draw_dir_hp.c"
# 1 "/usr/include/stdio.h" 1 3
# 29 "/usr/include/stdio.h" 3
# 1 "/usr/include/_ansi.h" 1 3
# 15 "/usr/include/_ansi.h" 3
# 1 "/usr/include/newlib.h" 1 3
# 16 "/usr/include/_ansi.h" 2 3
# 1 "/usr/include/sys/config.h" 1 3
# 1 "/usr/include/machine/ieeefp.h" 1 3
# 5 "/usr/include/sys/config.h" 2 3
# 17 "/usr/include/_ansi.h" 2 3
# 30 "/usr/include/stdio.h" 2 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 203 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 3
typedef unsigned int size_t;
# 35 "/usr/include/stdio.h" 2 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stdarg.h" 1 3
# 44 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 38 "/usr/include/stdio.h" 2 3
# 1 "/usr/include/sys/reent.h" 1 3
# 14 "/usr/include/sys/reent.h" 3
# 1 "/usr/include/sys/_types.h" 1 3
# 12 "/usr/include/sys/_types.h" 3
typedef long _off_t;
__extension__ typedef long long _off64_t;
typedef int _ssize_t;
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 323 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 3
typedef unsigned int wint_t;
# 23 "/usr/include/sys/_types.h" 2 3
typedef struct
{
int __count;
union
{
wint_t __wch;
unsigned char __wchb[4];
} __value;
} _mbstate_t;
typedef int _flock_t;
# 15 "/usr/include/sys/reent.h" 2 3
typedef unsigned long __ULong;
# 40 "/usr/include/sys/reent.h" 3
struct _Bigint
{
struct _Bigint *_next;
int _k, _maxwds, _sign, _wds;
__ULong _x[1];
};
struct __tm
{
int __tm_sec;
int __tm_min;
int __tm_hour;
int __tm_mday;
int __tm_mon;
int __tm_year;
int __tm_wday;
int __tm_yday;
int __tm_isdst;
};
# 68 "/usr/include/sys/reent.h" 3
struct _atexit {
struct _atexit *_next;
int _ind;
void (*_fns[32])(void);
void *_fnargs[32];
__ULong _fntypes;
};
# 91 "/usr/include/sys/reent.h" 3
struct __sbuf {
unsigned char *_base;
int _size;
};
typedef long _fpos_t;
typedef _off64_t _fpos64_t;
# 156 "/usr/include/sys/reent.h" 3
struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void * _cookie;
_ssize_t __attribute__((__cdecl__)) (*_read) (void * _cookie, char *_buf, int _n);
_ssize_t __attribute__((__cdecl__)) (*_write) (void * _cookie, const char *_buf, int _n);
_fpos_t __attribute__((__cdecl__)) (*_seek) (void * _cookie, _fpos_t _offset, int _whence);
int __attribute__((__cdecl__)) (*_close) (void * _cookie);
struct __sbuf _ub;
unsigned char *_up;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
int _offset;
struct _reent *_data;
_flock_t _lock;
};
struct __sFILE64 {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
struct _reent *_data;
void * _cookie;
_ssize_t __attribute__((__cdecl__)) (*_read) (void * _cookie, char *_buf, int _n);
_ssize_t __attribute__((__cdecl__)) (*_write) (void * _cookie, const char *_buf, int _n);
_fpos_t __attribute__((__cdecl__)) (*_seek) (void * _cookie, _fpos_t _offset, int _whence);
int __attribute__((__cdecl__)) (*_close) (void * _cookie);
struct __sbuf _ub;
unsigned char *_up;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
int _flags2;
_off64_t _offset;
_fpos64_t __attribute__((__cdecl__)) (*_seek64) (void * _cookie, _fpos64_t _offset, int _whence);
_flock_t _lock;
};
typedef struct __sFILE64 __FILE;
struct _glue
{
struct _glue *_next;
int _niobs;
__FILE *_iobs;
};
# 280 "/usr/include/sys/reent.h" 3
struct _rand48 {
unsigned short _seed[3];
unsigned short _mult[3];
unsigned short _add;
};
# 530 "/usr/include/sys/reent.h" 3
struct _reent
{
int _errno;
__FILE *_stdin, *_stdout, *_stderr;
int _inc;
char _emergency[25];
int _current_category;
const char *_current_locale;
int __sdidinit;
void __attribute__((__cdecl__)) (*__cleanup) (struct _reent *);
struct _Bigint *_result;
int _result_k;
struct _Bigint *_p5s;
struct _Bigint **_freelist;
int _cvtlen;
char *_cvtbuf;
union
{
struct
{
unsigned int _unused_rand;
char * _strtok_last;
char _asctime_buf[26];
struct __tm _localtime_buf;
int _gamma_signgam;
__extension__ unsigned long long _rand_next;
struct _rand48 _r48;
_mbstate_t _mblen_state;
_mbstate_t _mbtowc_state;
_mbstate_t _wctomb_state;
char _l64a_buf[8];
char _signal_buf[24];
int _getdate_err;
_mbstate_t _mbrlen_state;
_mbstate_t _mbrtowc_state;
_mbstate_t _mbsrtowcs_state;
_mbstate_t _wcrtomb_state;
_mbstate_t _wcsrtombs_state;
} _reent;
struct
{
unsigned char * _nextf[30];
unsigned int _nmalloc[30];
} _unused;
} _new;
struct _atexit *_atexit;
struct _atexit _atexit0;
void (**(_sig_func))(int);
struct _glue __sglue;
__FILE __sf[3];
};
# 726 "/usr/include/sys/reent.h" 3
extern struct _reent *_impure_ptr ;
void _reclaim_reent (struct _reent *);
# 46 "/usr/include/stdio.h" 2 3
# 1 "/usr/include/sys/types.h" 1 3
# 24 "/usr/include/sys/types.h" 3
typedef short int __int16_t;
typedef unsigned short int __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef long long __int64_t;
__extension__ typedef unsigned long long __uint64_t;
# 55 "/usr/include/sys/types.h" 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 149 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 3
typedef int ptrdiff_t;
# 296 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 3
typedef short unsigned int wchar_t;
# 56 "/usr/include/sys/types.h" 2 3
# 1 "/usr/include/machine/types.h" 1 3
# 36 "/usr/include/machine/types.h" 3
typedef long int __off_t;
typedef int __pid_t;
__extension__ typedef long long int __loff_t;
# 57 "/usr/include/sys/types.h" 2 3
# 78 "/usr/include/sys/types.h" 3
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long clock_t;
typedef long time_t;
struct timespec {
time_t tv_sec;
long tv_nsec;
};
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
typedef long daddr_t;
typedef char * caddr_t;
# 166 "/usr/include/sys/types.h" 3
typedef int pid_t;
typedef long key_t;
typedef _ssize_t ssize_t;
# 187 "/usr/include/sys/types.h" 3
typedef unsigned short nlink_t;
# 209 "/usr/include/sys/types.h" 3
typedef long fd_mask;
typedef struct _types_fd_set {
fd_mask fds_bits[(((64)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))];
} _types_fd_set;
# 245 "/usr/include/sys/types.h" 3
typedef unsigned long clockid_t;
typedef unsigned long timer_t;
typedef long useconds_t;
# 1 "/usr/include/sys/features.h" 1 3
# 259 "/usr/include/sys/types.h" 2 3
# 363 "/usr/include/sys/types.h" 3
# 1 "/usr/include/cygwin/types.h" 1 3
# 20 "/usr/include/cygwin/types.h" 3
# 1 "/usr/include/sys/sysmacros.h" 1 3
# 21 "/usr/include/cygwin/types.h" 2 3
typedef struct timespec timespec_t;
typedef struct timespec timestruc_t;
typedef long __off32_t;
typedef long long __off64_t;
typedef __off32_t off_t;
typedef short __dev16_t;
typedef unsigned long __dev32_t;
typedef __dev16_t dev_t;
typedef long blksize_t;
typedef long __blkcnt32_t;
typedef long long __blkcnt64_t;
typedef __blkcnt32_t blkcnt_t;
typedef unsigned short __uid16_t;
typedef unsigned long __uid32_t;
typedef __uid16_t uid_t;
typedef unsigned short __gid16_t;
typedef unsigned long __gid32_t;
typedef __gid16_t gid_t;
# 97 "/usr/include/cygwin/types.h" 3
typedef unsigned long ino_t;
# 106 "/usr/include/cygwin/types.h" 3
typedef unsigned long vm_offset_t;
typedef unsigned long vm_size_t;
typedef char int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
typedef unsigned char uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
typedef unsigned char u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef unsigned long uintptr_t;
typedef long intptr_t;
typedef __int32_t register_t;
typedef char *addr_t;
typedef unsigned mode_t;
typedef struct __pthread_t {char __dummy;} *pthread_t;
typedef struct __pthread_mutex_t {char __dummy;} *pthread_mutex_t;
typedef struct __pthread_key_t {char __dummy;} *pthread_key_t;
typedef struct __pthread_attr_t {char __dummy;} *pthread_attr_t;
typedef struct __pthread_mutexattr_t {char __dummy;} *pthread_mutexattr_t;
typedef struct __pthread_condattr_t {char __dummy;} *pthread_condattr_t;
typedef struct __pthread_cond_t {char __dummy;} *pthread_cond_t;
typedef struct
{
pthread_mutex_t mutex;
int state;
}
pthread_once_t;
typedef struct __pthread_rwlock_t {char __dummy;} *pthread_rwlock_t;
typedef struct __pthread_rwlockattr_t {char __dummy;} *pthread_rwlockattr_t;
# 364 "/usr/include/sys/types.h" 2 3
# 47 "/usr/include/stdio.h" 2 3
typedef __FILE FILE;
typedef _fpos_t fpos_t;
# 65 "/usr/include/stdio.h" 3
# 1 "/usr/include/sys/stdio.h" 1 3
# 66 "/usr/include/stdio.h" 2 3
# 170 "/usr/include/stdio.h" 3
FILE * __attribute__((__cdecl__)) tmpfile (void);
char * __attribute__((__cdecl__)) tmpnam (char *);
int __attribute__((__cdecl__)) fclose (FILE *);
int __attribute__((__cdecl__)) fflush (FILE *);
FILE * __attribute__((__cdecl__)) freopen (const char *, const char *, FILE *);
void __attribute__((__cdecl__)) setbuf (FILE *, char *);
int __attribute__((__cdecl__)) setvbuf (FILE *, char *, int, size_t);
int __attribute__((__cdecl__)) fprintf (FILE *, const char *, ...);
int __attribute__((__cdecl__)) fscanf (FILE *, const char *, ...);
int __attribute__((__cdecl__)) printf (const char *, ...);
int __attribute__((__cdecl__)) scanf (const char *, ...);
int __attribute__((__cdecl__)) sscanf (const char *, const char *, ...);
int __attribute__((__cdecl__)) vfprintf (FILE *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) vprintf (const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) vsprintf (char *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) fgetc (FILE *);
char * __attribute__((__cdecl__)) fgets (char *, int, FILE *);
int __attribute__((__cdecl__)) fputc (int, FILE *);
int __attribute__((__cdecl__)) fputs (const char *, FILE *);
int __attribute__((__cdecl__)) getc (FILE *);
int __attribute__((__cdecl__)) getchar (void);
char * __attribute__((__cdecl__)) gets (char *);
int __attribute__((__cdecl__)) putc (int, FILE *);
int __attribute__((__cdecl__)) putchar (int);
int __attribute__((__cdecl__)) puts (const char *);
int __attribute__((__cdecl__)) ungetc (int, FILE *);
size_t __attribute__((__cdecl__)) fread (void *, size_t _size, size_t _n, FILE *);
size_t __attribute__((__cdecl__)) fwrite (const void * , size_t _size, size_t _n, FILE *);
int __attribute__((__cdecl__)) fgetpos (FILE *, fpos_t *);
int __attribute__((__cdecl__)) fseek (FILE *, long, int);
int __attribute__((__cdecl__)) fsetpos (FILE *, const fpos_t *);
long __attribute__((__cdecl__)) ftell ( FILE *);
void __attribute__((__cdecl__)) rewind (FILE *);
void __attribute__((__cdecl__)) clearerr (FILE *);
int __attribute__((__cdecl__)) feof (FILE *);
int __attribute__((__cdecl__)) ferror (FILE *);
void __attribute__((__cdecl__)) perror (const char *);
FILE * __attribute__((__cdecl__)) fopen (const char *_name, const char *_type);
int __attribute__((__cdecl__)) sprintf (char *, const char *, ...);
int __attribute__((__cdecl__)) remove (const char *);
int __attribute__((__cdecl__)) rename (const char *, const char *);
int __attribute__((__cdecl__)) asprintf (char **, const char *, ...);
int __attribute__((__cdecl__)) fseeko (FILE *, off_t, int);
off_t __attribute__((__cdecl__)) ftello ( FILE *);
int __attribute__((__cdecl__)) vfiprintf (FILE *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) iprintf (const char *, ...);
int __attribute__((__cdecl__)) fiprintf (FILE *, const char *, ...);
int __attribute__((__cdecl__)) siprintf (char *, const char *, ...);
char * __attribute__((__cdecl__)) tempnam (const char *, const char *);
int __attribute__((__cdecl__)) vasprintf (char **, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) vsnprintf (char *, size_t, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) vfscanf (FILE *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) vscanf (const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) vsscanf (const char *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) fcloseall (void);
int __attribute__((__cdecl__)) snprintf (char *, size_t, const char *, ...);
# 239 "/usr/include/stdio.h" 3
FILE * __attribute__((__cdecl__)) fdopen (int, const char *);
int __attribute__((__cdecl__)) fileno (FILE *);
int __attribute__((__cdecl__)) getw (FILE *);
int __attribute__((__cdecl__)) pclose (FILE *);
FILE * __attribute__((__cdecl__)) popen (const char *, const char *);
int __attribute__((__cdecl__)) putw (int, FILE *);
void __attribute__((__cdecl__)) setbuffer (FILE *, char *, int);
int __attribute__((__cdecl__)) setlinebuf (FILE *);
int __attribute__((__cdecl__)) getc_unlocked (FILE *);
int __attribute__((__cdecl__)) getchar_unlocked (void);
void __attribute__((__cdecl__)) flockfile (FILE *);
int __attribute__((__cdecl__)) ftrylockfile (FILE *);
void __attribute__((__cdecl__)) funlockfile (FILE *);
int __attribute__((__cdecl__)) putc_unlocked (int, FILE *);
int __attribute__((__cdecl__)) putchar_unlocked (int);
int __attribute__((__cdecl__)) _asprintf_r (struct _reent *, char **, const char *, ...);
int __attribute__((__cdecl__)) _fcloseall_r (struct _reent *);
FILE * __attribute__((__cdecl__)) _fdopen_r (struct _reent *, int, const char *);
FILE * __attribute__((__cdecl__)) _fopen_r (struct _reent *, const char *, const char *);
int __attribute__((__cdecl__)) _fscanf_r (struct _reent *, FILE *, const char *, ...);
int __attribute__((__cdecl__)) _getchar_r (struct _reent *);
char * __attribute__((__cdecl__)) _gets_r (struct _reent *, char *);
int __attribute__((__cdecl__)) _iprintf_r (struct _reent *, const char *, ...);
int __attribute__((__cdecl__)) _mkstemp_r (struct _reent *, char *);
char * __attribute__((__cdecl__)) _mktemp_r (struct _reent *, char *);
void __attribute__((__cdecl__)) _perror_r (struct _reent *, const char *);
int __attribute__((__cdecl__)) _printf_r (struct _reent *, const char *, ...);
int __attribute__((__cdecl__)) _putchar_r (struct _reent *, int);
int __attribute__((__cdecl__)) _puts_r (struct _reent *, const char *);
int __attribute__((__cdecl__)) _remove_r (struct _reent *, const char *);
int __attribute__((__cdecl__)) _rename_r (struct _reent *, const char *_old, const char *_new);
int __attribute__((__cdecl__)) _scanf_r (struct _reent *, const char *, ...);
int __attribute__((__cdecl__)) _sprintf_r (struct _reent *, char *, const char *, ...);
int __attribute__((__cdecl__)) _snprintf_r (struct _reent *, char *, size_t, const char *, ...);
int __attribute__((__cdecl__)) _sscanf_r (struct _reent *, const char *, const char *, ...);
char * __attribute__((__cdecl__)) _tempnam_r (struct _reent *, const char *, const char *);
FILE * __attribute__((__cdecl__)) _tmpfile_r (struct _reent *);
char * __attribute__((__cdecl__)) _tmpnam_r (struct _reent *, char *);
int __attribute__((__cdecl__)) _vasprintf_r (struct _reent *, char **, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vfprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vprintf_r (struct _reent *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vsprintf_r (struct _reent *, char *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vsnprintf_r (struct _reent *, char *, size_t, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vfscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vscanf_r (struct _reent *, const char *, __gnuc_va_list);
int __attribute__((__cdecl__)) _vsscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list);
ssize_t __attribute__((__cdecl__)) __getdelim (char **, size_t *, int, FILE *);
ssize_t __attribute__((__cdecl__)) __getline (char **, size_t *, FILE *);
# 319 "/usr/include/stdio.h" 3
int __attribute__((__cdecl__)) __srget (FILE *);
int __attribute__((__cdecl__)) __swbuf (int, FILE *);
FILE *__attribute__((__cdecl__)) funopen (const void * _cookie, int (*readfn)(void * _cookie, char *_buf, int _n), int (*writefn)(void * _cookie, const char *_buf, int _n), fpos_t (*seekfn)(void * _cookie, fpos_t _off, int _whence), int (*closefn)(void * _cookie));
# 344 "/usr/include/stdio.h" 3
static __inline__ int __sgetc(FILE *__p)
{
int __c = (--(__p)->_r < 0 ? __srget(__p) : (int)(*(__p)->_p++));
if ((__p->_flags & 0x4000) && (__c == '\r'))
{
int __c2 = (--(__p)->_r < 0 ? __srget(__p) : (int)(*(__p)->_p++));
if (__c2 == '\n')
__c = __c2;
else
ungetc(__c2, __p);
}
return __c;
}
# 426 "/usr/include/stdio.h" 3
# 2 "draw_dir_hp.c" 2
# 1 "/usr/include/math.h" 1 3
# 1 "/usr/include/machine/ieeefp.h" 1 3
# 8 "/usr/include/math.h" 2 3
union __dmath
{
__ULong i[2];
double d;
};
extern __attribute__((dllimport)) const union __dmath __infinity[];
# 35 "/usr/include/math.h" 3
extern double atan (double);
extern double cos (double);
extern double sin (double);
extern double tan (double);
extern double tanh (double);
extern double frexp (double, int *);
extern double modf (double, double *);
extern double ceil (double);
extern double fabs (double);
extern double floor (double);
extern double acos (double);
extern double asin (double);
extern double atan2 (double, double);
extern double cosh (double);
extern double sinh (double);
extern double exp (double);
extern double ldexp (double, int);
extern double log (double);
extern double log10 (double);
extern double pow (double, double);
extern double sqrt (double);
extern double fmod (double, double);
# 72 "/usr/include/math.h" 3
typedef float float_t;
typedef double double_t;
# 82 "/usr/include/math.h" 3
extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);
# 121 "/usr/include/math.h" 3
extern double infinity (void);
extern double nan (void);
extern int isnan (double);
extern int isinf (double);
extern int finite (double);
extern double copysign (double, double);
extern int ilogb (double);
extern double asinh (double);
extern double cbrt (double);
extern double nextafter (double, double);
extern double rint (double);
extern double scalbn (double, int);
extern double exp2 (double);
extern double scalbln (double, long int);
extern double tgamma (double);
extern double nearbyint (double);
extern long int lrint (double);
extern double round (double);
extern long int lround (double);
extern double trunc (double);
extern double remquo (double, double, int *);
extern double copysign (double, double);
extern double fdim (double, double);
extern double fmax (double, double);
extern double fmin (double, double);
extern double fma (double, double, double);
extern void sincos (double, double *, double *);
extern double log1p (double);
extern double expm1 (double);
extern double acosh (double);
extern double atanh (double);
extern double remainder (double, double);
extern double gamma (double);
extern double gamma_r (double, int *);
extern double lgamma (double);
extern double lgamma_r (double, int *);
extern double erf (double);
extern double erfc (double);
extern double y0 (double);
extern double y1 (double);
extern double yn (int, double);
extern double j0 (double);
extern double j1 (double);
extern double jn (int, double);
extern double hypot (double, double);
extern double cabs();
extern double drem (double, double);
# 189 "/usr/include/math.h" 3
extern float atanf (float);
extern float cosf (float);
extern float sinf (float);
extern float tanf (float);
extern float tanhf (float);
extern float frexpf (float, int *);
extern float modff (float, float *);
extern float ceilf (float);
extern float fabsf (float);
extern float floorf (float);
extern float acosf (float);
extern float asinf (float);
extern float atan2f (float, float);
extern float coshf (float);
extern float sinhf (float);
extern float expf (float);
extern float ldexpf (float, int);
extern float logf (float);
extern float log10f (float);
extern float powf (float, float);
extern float sqrtf (float);
extern float fmodf (float, float);
# 221 "/usr/include/math.h" 3
extern float exp2f (float);
extern float scalblnf (float, long int);
extern float tgammaf (float);
extern float nearbyintf (float);
extern long int lrintf (float);
extern float roundf (float);
extern long int lroundf (float);
extern float truncf (float);
extern float remquof (float, float, int *);
extern float copysignf (float, float);
extern float fdimf (float, float);
extern float fmaxf (float, float);
extern float fminf (float, float);
extern float fmaf (float, float, float);
extern float infinityf (void);
extern float nanf (void);
extern int isnanf (float);
extern int isinff (float);
extern int finitef (float);
extern float copysignf (float, float);
extern int ilogbf (float);
extern float asinhf (float);
extern float cbrtf (float);
extern float nextafterf (float, float);
extern float rintf (float);
extern float scalbnf (float, int);
extern float log1pf (float);
extern float expm1f (float);
extern void sincosf (float, float *, float *);
extern float acoshf (float);
extern float atanhf (float);
extern float remainderf (float, float);
extern float gammaf (float);
extern float gammaf_r (float, int *);
extern float lgammaf (float);
extern float lgammaf_r (float, int *);
extern float erff (float);
extern float erfcf (float);
extern float y0f (float);
extern float y1f (float);
extern float ynf (int, float);
extern float j0f (float);
extern float j1f (float);
extern float jnf (int, float);
extern float hypotf (float, float);
extern float cabsf();
extern float dremf (float, float);
extern int *__signgam (void);
# 290 "/usr/include/math.h" 3
struct exception
{
int type;
char *name;
double arg1;
double arg2;
double retval;
int err;
};
extern int matherr (struct exception *e);
# 345 "/usr/include/math.h" 3
enum __fdlibm_version
{
__fdlibm_ieee = -1,
__fdlibm_svid,
__fdlibm_xopen,
__fdlibm_posix
};
extern __attribute__((dllimport)) const enum __fdlibm_version __fdlib_version;
# 365 "/usr/include/math.h" 3
# 3 "draw_dir_hp.c" 2
# 1 "/steve/stevelib/steve.h" 1
# 1 "/usr/include/stdlib.h" 1 3
# 14 "/usr/include/stdlib.h" 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 15 "/usr/include/stdlib.h" 2 3
# 1 "/usr/include/machine/stdlib.h" 1 3
# 18 "/usr/include/stdlib.h" 2 3
# 1 "/usr/include/alloca.h" 1 3
# 20 "/usr/include/stdlib.h" 2 3
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long quot;
long rem;
} ldiv_t;
# 45 "/usr/include/stdlib.h" 3
extern __attribute__((dllimport)) int __mb_cur_max;
void __attribute__((__cdecl__)) abort (void) __attribute__ ((noreturn));
int __attribute__((__cdecl__)) abs (int);
int __attribute__((__cdecl__)) atexit (void (*__func)(void));
double __attribute__((__cdecl__)) atof (const char *__nptr);
float __attribute__((__cdecl__)) atoff (const char *__nptr);
int __attribute__((__cdecl__)) atoi (const char *__nptr);
long __attribute__((__cdecl__)) atol (const char *__nptr);
void * __attribute__((__cdecl__)) bsearch (const void * __key, const void * __base, size_t __nmemb, size_t __size, int (* __attribute__((__cdecl__)) _compar) (const void *, const void *));
void * __attribute__((__cdecl__)) calloc (size_t __nmemb, size_t __size);
div_t __attribute__((__cdecl__)) div (int __numer, int __denom);
void __attribute__((__cdecl__)) exit (int __status) __attribute__ ((noreturn));
void __attribute__((__cdecl__)) free (void *);
char * __attribute__((__cdecl__)) getenv (const char *__string);
char * __attribute__((__cdecl__)) _getenv_r (struct _reent *, const char *__string);
char * __attribute__((__cdecl__)) _findenv (const char *, int *);
char * __attribute__((__cdecl__)) _findenv_r (struct _reent *, const char *, int *);
long __attribute__((__cdecl__)) labs (long);
ldiv_t __attribute__((__cdecl__)) ldiv (long __numer, long __denom);
void * __attribute__((__cdecl__)) malloc (size_t __size);
int __attribute__((__cdecl__)) mblen (const char *, size_t);
int __attribute__((__cdecl__)) _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *);
int __attribute__((__cdecl__)) mbtowc (wchar_t *, const char *, size_t);
int __attribute__((__cdecl__)) _mbtowc_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *);
int __attribute__((__cdecl__)) wctomb (char *, wchar_t);
int __attribute__((__cdecl__)) _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *);
size_t __attribute__((__cdecl__)) mbstowcs (wchar_t *, const char *, size_t);
size_t __attribute__((__cdecl__)) _mbstowcs_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *);
size_t __attribute__((__cdecl__)) wcstombs (char *, const wchar_t *, size_t);
size_t __attribute__((__cdecl__)) _wcstombs_r (struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *);
int __attribute__((__cdecl__)) mkstemp (char *);
char * __attribute__((__cdecl__)) mktemp (char *);
void __attribute__((__cdecl__)) qsort (void * __base, size_t __nmemb, size_t __size, int(*_compar)(const void *, const void *));
int __attribute__((__cdecl__)) rand (void);
void * __attribute__((__cdecl__)) realloc (void * __r, size_t __size);
void __attribute__((__cdecl__)) srand (unsigned __seed);
double __attribute__((__cdecl__)) strtod (const char *__n, char **__end_PTR);
double __attribute__((__cdecl__)) _strtod_r (struct _reent *,const char *__n, char **__end_PTR);
float __attribute__((__cdecl__)) strtof (const char *__n, char **__end_PTR);
long __attribute__((__cdecl__)) strtol (const char *__n, char **__end_PTR, int __base);
long __attribute__((__cdecl__)) _strtol_r (struct _reent *,const char *__n, char **__end_PTR, int __base);
unsigned long __attribute__((__cdecl__)) strtoul (const char *__n, char **__end_PTR, int __base);
unsigned long __attribute__((__cdecl__)) _strtoul_r (struct _reent *,const char *__n, char **__end_PTR, int __base);
int __attribute__((__cdecl__)) system (const char *__string);
long __attribute__((__cdecl__)) a64l (const char *__input);
char * __attribute__((__cdecl__)) l64a (long __input);
char * __attribute__((__cdecl__)) _l64a_r (struct _reent *,long __input);
int __attribute__((__cdecl__)) on_exit (void (*__func)(int, void *),void * __arg);
void __attribute__((__cdecl__)) _Exit (int __status) __attribute__ ((noreturn));
int __attribute__((__cdecl__)) putenv (const char *__string);
int __attribute__((__cdecl__)) _putenv_r (struct _reent *, const char *__string);
int __attribute__((__cdecl__)) setenv (const char *__string, const char *__value, int __overwrite);
int __attribute__((__cdecl__)) _setenv_r (struct _reent *, const char *__string, const char *__value, int __overwrite);
char * __attribute__((__cdecl__)) gcvt (double,int,char *);
char * __attribute__((__cdecl__)) gcvtf (float,int,char *);
char * __attribute__((__cdecl__)) fcvt (double,int,int *,int *);
char * __attribute__((__cdecl__)) fcvtf (float,int,int *,int *);
char * __attribute__((__cdecl__)) ecvt (double,int,int *,int *);
char * __attribute__((__cdecl__)) ecvtbuf (double, int, int*, int*, char *);
char * __attribute__((__cdecl__)) fcvtbuf (double, int, int*, int*, char *);
char * __attribute__((__cdecl__)) ecvtf (float,int,int *,int *);
char * __attribute__((__cdecl__)) dtoa (double, int, int, int *, int*, char**);
int __attribute__((__cdecl__)) rand_r (unsigned *__seed);
double __attribute__((__cdecl__)) drand48 (void);
double __attribute__((__cdecl__)) _drand48_r (struct _reent *);
double __attribute__((__cdecl__)) erand48 (unsigned short [3]);
double __attribute__((__cdecl__)) _erand48_r (struct _reent *, unsigned short [3]);
long __attribute__((__cdecl__)) jrand48 (unsigned short [3]);
long __attribute__((__cdecl__)) _jrand48_r (struct _reent *, unsigned short [3]);
void __attribute__((__cdecl__)) lcong48 (unsigned short [7]);
void __attribute__((__cdecl__)) _lcong48_r (struct _reent *, unsigned short [7]);
long __attribute__((__cdecl__)) lrand48 (void);
long __attribute__((__cdecl__)) _lrand48_r (struct _reent *);
long __attribute__((__cdecl__)) mrand48 (void);
long __attribute__((__cdecl__)) _mrand48_r (struct _reent *);
long __attribute__((__cdecl__)) nrand48 (unsigned short [3]);
long __attribute__((__cdecl__)) _nrand48_r (struct _reent *, unsigned short [3]);
unsigned short *
__attribute__((__cdecl__)) seed48 (unsigned short [3]);
unsigned short *
__attribute__((__cdecl__)) _seed48_r (struct _reent *, unsigned short [3]);
void __attribute__((__cdecl__)) srand48 (long);
void __attribute__((__cdecl__)) _srand48_r (struct _reent *, long);
long long __attribute__((__cdecl__)) strtoll (const char *__n, char **__end_PTR, int __base);
long long __attribute__((__cdecl__)) _strtoll_r (struct _reent *, const char *__n, char **__end_PTR, int __base);
unsigned long long __attribute__((__cdecl__)) strtoull (const char *__n, char **__end_PTR, int __base);
unsigned long long __attribute__((__cdecl__)) _strtoull_r (struct _reent *, const char *__n, char **__end_PTR, int __base);
char * __attribute__((__cdecl__)) realpath (const char *, char *);
void __attribute__((__cdecl__)) unsetenv (const char *__string);
void __attribute__((__cdecl__)) _unsetenv_r (struct _reent *, const char *__string);
int __attribute__((__cdecl__)) random (void);
long __attribute__((__cdecl__)) srandom (unsigned __seed);
char * __attribute__((__cdecl__)) ptsname (int);
int __attribute__((__cdecl__)) grantpt (int);
int __attribute__((__cdecl__)) unlockpt (int);
char * __attribute__((__cdecl__)) _dtoa_r (struct _reent *, double, int, int, int *, int*, char**);
int __attribute__((__cdecl__)) _system_r (struct _reent *, const char *);
void __attribute__((__cdecl__)) __eprintf (const char *, const char *, unsigned int, const char *);
# 213 "/usr/include/stdlib.h" 3
# 6 "/steve/stevelib/steve.h" 2
# 1 "/steve/stevelib/nrutil.h" 1
# 9 "/steve/stevelib/nrutil.h"
static float sqrarg;
static double dsqrarg;
static double dmaxarg1,dmaxarg2;
static double dminarg1,dminarg2;
static float maxarg1,maxarg2;
static float minarg1,minarg2;
static long lmaxarg1,lmaxarg2;
static long lminarg1,lminarg2;
static int imaxarg1,imaxarg2;
static int iminarg1,iminarg2;
void nrerror(char error_text[]);
float *vector(long nl, long nh);
int *ivector(long nl, long nh);
unsigned char *cvector(long nl, long nh);
long *lvector(long nl, long nh);
double *dvector(long nl, long nh);
float **matrix(long nrl, long nrh, long ncl, long nch);
double **dmatrix(long nrl, long nrh, long ncl, long nch);
int **imatrix(long nrl, long nrh, long ncl, long nch);
long **lmatrix(long nrl, long nrh, long ncl, long nch);
unsigned long **ulmatrix(long nrl, long nrh, long ncl, long nch);
double **subdmatrix(double **a, long oldrl, long oldrh, long oldcl, long oldch,
long newrl, long newcl);
float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch,
long newrl, long newcl);
float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch);
float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
void free_vector(float *v, long nl, long nh);
void free_ivector(int *v, long nl, long nh);
void free_cvector(unsigned char *v, long nl, long nh);
void free_lvector(long *v, long nl, long nh);
void free_dvector(double *v, long nl, long nh);
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch);
void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch);
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch);
void free_lmatrix(long **m, long nrl, long nrh, long ncl, long nch);
void free_ulmatrix(unsigned long **m, long nrl, long nrh, long ncl, long nch);
void free_subdmatrix(double **, long);
void free_submatrix(float **, long );
void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch);
void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh);
# 8 "/steve/stevelib/steve.h" 2
# 17 "/steve/stevelib/steve.h"
# 1 "/steve/stevelib/meschach.h" 1
# 75 "/steve/stevelib/meschach.h"
# 1 "/usr/include/malloc.h" 1 3
# 10 "/usr/include/malloc.h" 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 11 "/usr/include/malloc.h" 2 3
# 1 "/usr/include/machine/malloc.h" 1 3
# 14 "/usr/include/malloc.h" 2 3
# 22 "/usr/include/malloc.h" 3
struct mallinfo {
int arena;
int ordblks;
int smblks;
int hblks;
int hblkhd;
int usmblks;
int fsmblks;
int uordblks;
int fordblks;
int keepcost;
};
extern void * malloc (size_t);
extern void free (void *);
extern void * realloc (void *, size_t);
extern void * calloc (size_t, size_t);
extern void * memalign (size_t, size_t);
extern struct mallinfo mallinfo (void);
extern void malloc_stats (void);
extern int mallopt (int, int);
extern size_t malloc_usable_size (void *);
# 112 "/usr/include/malloc.h" 3
extern void * valloc (size_t);
extern void * pvalloc (size_t);
extern int malloc_trim (size_t);
# 138 "/usr/include/malloc.h" 3
extern void mstats (char *);
# 76 "/steve/stevelib/meschach.h" 2
# 99 "/steve/stevelib/meschach.h"
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 100 "/steve/stevelib/meschach.h" 2
# 1 "/usr/include/string.h" 1 3
# 14 "/usr/include/string.h" 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stddef.h" 1 3
# 15 "/usr/include/string.h" 2 3
void * __attribute__((__cdecl__)) memchr (const void *, int, size_t);
int __attribute__((__cdecl__)) memcmp (const void *, const void *, size_t);
void * __attribute__((__cdecl__)) memcpy (void *, const void *, size_t);
void * __attribute__((__cdecl__)) memmove (void *, const void *, size_t);
void * __attribute__((__cdecl__)) memset (void *, int, size_t);
char *__attribute__((__cdecl__)) strcat (char *, const char *);
char *__attribute__((__cdecl__)) strchr (const char *, int);
int __attribute__((__cdecl__)) strcmp (const char *, const char *);
int __attribute__((__cdecl__)) strcoll (const char *, const char *);
char *__attribute__((__cdecl__)) strcpy (char *, const char *);
size_t __attribute__((__cdecl__)) strcspn (const char *, const char *);
char *__attribute__((__cdecl__)) strerror (int);
size_t __attribute__((__cdecl__)) strlen (const char *);
char *__attribute__((__cdecl__)) strncat (char *, const char *, size_t);
int __attribute__((__cdecl__)) strncmp (const char *, const char *, size_t);
char *__attribute__((__cdecl__)) strncpy (char *, const char *, size_t);
char *__attribute__((__cdecl__)) strpbrk (const char *, const char *);
char *__attribute__((__cdecl__)) strrchr (const char *, int);
size_t __attribute__((__cdecl__)) strspn (const char *, const char *);
char *__attribute__((__cdecl__)) strstr (const char *, const char *);
char *__attribute__((__cdecl__)) strtok (char *, const char *);
size_t __attribute__((__cdecl__)) strxfrm (char *, const char *, size_t);
char *__attribute__((__cdecl__)) strtok_r (char *, const char *, char **);
int __attribute__((__cdecl__)) bcmp (const void *, const void *, size_t);
void __attribute__((__cdecl__)) bcopy (const void *, void *, size_t);
void __attribute__((__cdecl__)) bzero (void *, size_t);
int __attribute__((__cdecl__)) ffs (int);
char *__attribute__((__cdecl__)) index (const char *, int);
void * __attribute__((__cdecl__)) memccpy (void *, const void *, int, size_t);
void * __attribute__((__cdecl__)) mempcpy (void *, const void *, size_t);
char *__attribute__((__cdecl__)) rindex (const char *, int);
int __attribute__((__cdecl__)) strcasecmp (const char *, const char *);
char *__attribute__((__cdecl__)) strdup (const char *);
char *__attribute__((__cdecl__)) _strdup_r (struct _reent *, const char *);
char *__attribute__((__cdecl__)) strndup (const char *, size_t);
char *__attribute__((__cdecl__)) _strndup_r (struct _reent *, const char *, size_t);
char *__attribute__((__cdecl__)) strerror_r (int, char *, size_t);
size_t __attribute__((__cdecl__)) strlcat (char *, const char *, size_t);
size_t __attribute__((__cdecl__)) strlcpy (char *, const char *, size_t);
int __attribute__((__cdecl__)) strncasecmp (const char *, const char *, size_t);
size_t __attribute__((__cdecl__)) strnlen (const char *, size_t);
char *__attribute__((__cdecl__)) strsep (char **, const char *);
char *__attribute__((__cdecl__)) strlwr (char *);
char *__attribute__((__cdecl__)) strupr (char *);
const char *__attribute__((__cdecl__)) strsignal (int __signo);
int __attribute__((__cdecl__)) strtosigno (const char *__name);
# 98 "/usr/include/string.h" 3
# 101 "/steve/stevelib/meschach.h" 2
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/float.h" 1 3
# 102 "/steve/stevelib/meschach.h" 2
# 227 "/steve/stevelib/meschach.h"
extern int isatty(int);
# 265 "/steve/stevelib/meschach.h"
# 1 "/usr/include/setjmp.h" 1 3
# 10 "/usr/include/setjmp.h" 3
# 1 "/usr/include/machine/setjmp.h" 1 3
# 189 "/usr/include/machine/setjmp.h" 3
typedef int jmp_buf[(13 * 4)];
# 1 "/usr/include/signal.h" 1 3
# 1 "/usr/include/sys/signal.h" 1 3
# 19 "/usr/include/sys/signal.h" 3
typedef unsigned long sigset_t;
# 109 "/usr/include/sys/signal.h" 3
typedef void (*_sig_func_ptr)(int);
struct sigaction
{
_sig_func_ptr sa_handler;
sigset_t sa_mask;
int sa_flags;
};
# 139 "/usr/include/sys/signal.h" 3
int __attribute__((__cdecl__)) sigprocmask (int how, const sigset_t *set, sigset_t *oset);
int __attribute__((__cdecl__)) pthread_sigmask (int how, const sigset_t *set, sigset_t *oset);
# 153 "/usr/include/sys/signal.h" 3
int __attribute__((__cdecl__)) kill (int, int);
int __attribute__((__cdecl__)) killpg (pid_t, int);
int __attribute__((__cdecl__)) sigaction (int, const struct sigaction *, struct sigaction *);
int __attribute__((__cdecl__)) sigaddset (sigset_t *, const int);
int __attribute__((__cdecl__)) sigdelset (sigset_t *, const int);
int __attribute__((__cdecl__)) sigismember (const sigset_t *, int);
int __attribute__((__cdecl__)) sigfillset (sigset_t *);
int __attribute__((__cdecl__)) sigemptyset (sigset_t *);
int __attribute__((__cdecl__)) sigpending (sigset_t *);
int __attribute__((__cdecl__)) sigsuspend (const sigset_t *);
int __attribute__((__cdecl__)) sigpause (int);
int __attribute__((__cdecl__)) pthread_kill (pthread_t thread, int sig);
# 6 "/usr/include/signal.h" 2 3
typedef int sig_atomic_t;
struct _reent;
_sig_func_ptr __attribute__((__cdecl__)) _signal_r (struct _reent *, int, _sig_func_ptr);
int __attribute__((__cdecl__)) _raise_r (struct _reent *, int);
_sig_func_ptr __attribute__((__cdecl__)) signal (int, _sig_func_ptr);
int __attribute__((__cdecl__)) raise (int);
# 196 "/usr/include/machine/setjmp.h" 2 3
typedef int sigjmp_buf[(13 * 4)+2];
# 11 "/usr/include/setjmp.h" 2 3
void __attribute__((__cdecl__)) longjmp (jmp_buf __jmpb, int __retval);
int __attribute__((__cdecl__)) setjmp (jmp_buf __jmpb);
# 266 "/steve/stevelib/meschach.h" 2
extern jmp_buf restart;
# 288 "/steve/stevelib/meschach.h"
extern int ev_err(char *,int,int,char *,int);
extern int set_err_flag(int flag);
extern int count_errs(int true_false);
extern int err_list_attach(int list_num, int list_len,
char **err_ptr,int warn);
extern int err_is_list_attached(int list_num);
extern int err_list_free(int list_num);
# 484 "/steve/stevelib/meschach.h"
typedef struct {
long bytes;
int numvar;
} MEM_ARRAY;
int mem_info_is_on(void);
int mem_info_on(int sw);
long mem_info_bytes(int type,int list);
int mem_info_numvar(int type,int list);
void mem_info_file(FILE * fp,int list);
void mem_bytes_list(int type,int old_size,int new_size,
int list);
void mem_numvar_list(int type, int num, int list);
int mem_stat_reg_list(void **var,int type,int list);
int mem_stat_mark(int mark);
int mem_stat_free_list(int mark,int list);
int mem_stat_show_mark(void);
void mem_stat_dump(FILE *fp,int list);
int mem_attach_list(int list,int ntypes,char *type_names[],
int (*free_funcs[])(), MEM_ARRAY info_sum[]);
int mem_free_vars(int list);
int mem_is_list_attached(int list);
void mem_dump_list(FILE *fp,int list);
int mem_stat_reg_vars(int list,int type,...);
# 556 "/steve/stevelib/meschach.h"
typedef struct {
char **type_names;
int (**free_funcs)();
unsigned ntypes;
MEM_ARRAY *info_sum;
} MEM_CONNECT;
# 615 "/steve/stevelib/meschach.h"
typedef struct {
u_int dim, max_dim;
double *ve;
} VEC;
typedef struct {
u_int m, n;
u_int max_m, max_n, max_size;
double **me,*base;
} MAT;
typedef struct {
MAT *mat;
int lb,ub;
} BAND;
typedef struct {
u_int size, max_size, *pe;
} PERM;
typedef struct {
u_int dim, max_dim;
int *ive;
} IVEC;
# 659 "/steve/stevelib/meschach.h"
void m_version( void );
# 735 "/steve/stevelib/meschach.h"
extern VEC *v_get(int), *v_resize(VEC *,int);
extern MAT *m_get(int,int), *m_resize(MAT *,int,int);
extern PERM *px_get(int), *px_resize(PERM *,int);
extern IVEC *iv_get(int), *iv_resize(IVEC *,int);
extern BAND *bd_get(int,int,int), *bd_resize(BAND *,int,int,int);
extern int iv_free(IVEC *);
extern int m_free(MAT *),v_free(VEC *),px_free(PERM *);
extern int bd_free(BAND *);
# 847 "/steve/stevelib/meschach.h"
void v_foutput(FILE *fp,VEC *x),
m_foutput(FILE *fp,MAT *A),
px_foutput(FILE *fp,PERM *px);
void iv_foutput(FILE *fp,IVEC *ix);
VEC *v_finput(FILE *fp,VEC *out);
MAT *m_finput(FILE *fp,MAT *out);
PERM *px_finput(FILE *fp,PERM *out);
IVEC *iv_finput(FILE *fp,IVEC *out);
int fy_or_n(FILE *fp,char *s);
int yn_dflt(int val);
int fin_int(FILE *fp,char *s,int low,int high);
double fin_double(FILE *fp,char *s,double low,double high);
int skipjunk(FILE *fp);
# 931 "/steve/stevelib/meschach.h"
extern MAT *_m_copy(MAT *in,MAT *out,u_int i0,u_int j0),
* m_move(MAT *in, int, int, int, int, MAT *out, int, int),
*vm_move(VEC *in, int, MAT *out, int, int, int, int);
extern VEC *_v_copy(VEC *in,VEC *out,u_int i0),
* v_move(VEC *in, int, int, VEC *out, int),
*mv_move(MAT *in, int, int, int, int, VEC *out, int);
extern PERM *px_copy(PERM *in,PERM *out);
extern IVEC *iv_copy(IVEC *in,IVEC *out),
*iv_move(IVEC *in, int, int, IVEC *out, int);
extern BAND *bd_copy(BAND *in,BAND *out);
# 958 "/steve/stevelib/meschach.h"
extern VEC *v_zero(VEC *), *v_rand(VEC *), *v_ones(VEC *);
extern MAT *m_zero(MAT *), *m_ident(MAT *), *m_rand(MAT *),
*m_ones(MAT *);
extern PERM *px_ident(PERM *);
extern IVEC *iv_zero(IVEC *);
# 977 "/steve/stevelib/meschach.h"
extern VEC *sv_mlt(double,VEC *,VEC *),
*mv_mlt(MAT *,VEC *,VEC *),
*vm_mlt(MAT *,VEC *,VEC *),
*v_add(VEC *,VEC *,VEC *),
*v_sub(VEC *,VEC *,VEC *),
*px_vec(PERM *,VEC *,VEC *),
*pxinv_vec(PERM *,VEC *,VEC *),
*v_mltadd(VEC *,VEC *,double,VEC *),
*v_map(double (*f)(),VEC *,VEC *),
*_v_map(double (*f)(),void *,VEC *,VEC *),
*v_lincomb(int,VEC **,double *,VEC *),
*v_linlist(VEC *out,VEC *v1,double a1,...);
extern double v_min(VEC *, int *),
v_max(VEC *, int *),
v_sum(VEC *);
extern VEC *v_star(VEC *, VEC *, VEC *),
*v_slash(VEC *, VEC *, VEC *),
*v_sort(VEC *, PERM *);
extern double _in_prod(VEC *x,VEC *y,u_int i0),
__ip__(double *,double *,int);
extern void __mltadd__(double *,double *,double,int),
__add__(double *,double *,double *,int),
__sub__(double *,double *,double *,int),
__smlt__(double *,double,double *,int),
__zero__(double *,int);
# 1040 "/steve/stevelib/meschach.h"
extern double _v_norm1(VEC *x,VEC *scale),
_v_norm2(VEC *x,VEC *scale),
_v_norm_inf(VEC *x,VEC *scale);
extern double m_norm1(MAT *A), m_norm_inf(MAT *A), m_norm_frob(MAT *A);
# 1072 "/steve/stevelib/meschach.h"
extern MAT *sm_mlt(double s,MAT *A,MAT *out),
*m_mlt(MAT *A,MAT *B,MAT *out),
*mmtr_mlt(MAT *A,MAT *B,MAT *out),
*mtrm_mlt(MAT *A,MAT *B,MAT *out),
*m_add(MAT *A,MAT *B,MAT *out),
*m_sub(MAT *A,MAT *B,MAT *out),
*sub_mat(MAT *A,u_int,u_int,u_int,u_int,MAT *out),
*m_transp(MAT *A,MAT *out),
*ms_mltadd(MAT *A,MAT *B,double s,MAT *out);
extern BAND *bd_transp(BAND *in, BAND *out);
extern MAT *px_rows(PERM *px,MAT *A,MAT *out),
*px_cols(PERM *px,MAT *A,MAT *out),
*swap_rows(MAT *,int,int,int,int),
*swap_cols(MAT *,int,int,int,int),
*_set_col(MAT *A,u_int i,VEC *out,u_int j0),
*_set_row(MAT *A,u_int j,VEC *out,u_int i0);
extern VEC *get_row(MAT *,u_int,VEC *),
*get_col(MAT *,u_int,VEC *),
*sub_vec(VEC *,int,int,VEC *),
*mv_mltadd(VEC *x,VEC *y,MAT *A,double s,VEC *out),
*vm_mltadd(VEC *x,VEC *y,MAT *A,double s,VEC *out);
# 1119 "/steve/stevelib/meschach.h"
extern PERM *px_mlt(PERM *px1,PERM *px2,PERM *out),
*px_inv(PERM *px,PERM *out),
*px_transp(PERM *px,u_int i,u_int j);
extern int px_sign(PERM *);
# 1138 "/steve/stevelib/meschach.h"
extern IVEC *iv_add(IVEC *ix,IVEC *iy,IVEC *out),
*iv_sub(IVEC *ix,IVEC *iy,IVEC *out),
*iv_sort(IVEC *ix, PERM *order);
# 1158 "/steve/stevelib/meschach.h"
double square(double x),
cube(double x),
mrand(void);
void smrand(int seed),
mrandlist(double *x, int len);
void m_dump(FILE *fp,MAT *a), px_dump(FILE *,PERM *px),
v_dump(FILE *fp,VEC *x), iv_dump(FILE *fp, IVEC *ix);
MAT *band2mat(BAND *bA, MAT *A);
BAND *mat2band(MAT *A, int lb,int ub, BAND *bA);
# 1186 "/steve/stevelib/meschach.h"
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stdarg.h" 1 3
# 111 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 1187 "/steve/stevelib/meschach.h" 2
int v_get_vars(int dim,...);
int iv_get_vars(int dim,...);
int m_get_vars(int m,int n,...);
int px_get_vars(int dim,...);
int v_resize_vars(int new_dim,...);
int iv_resize_vars(int new_dim,...);
int m_resize_vars(int m,int n,...);
int px_resize_vars(int new_dim,...);
int v_free_vars(VEC **,...);
int iv_free_vars(IVEC **,...);
int px_free_vars(PERM **,...);
int m_free_vars(MAT **,...);
# 1323 "/steve/stevelib/meschach.h"
extern MAT *BKPfactor(MAT *A,PERM *pivot,PERM *blocks),
*CHfactor(MAT *A),
*LUfactor(MAT *A,PERM *pivot),
*QRfactor(MAT *A,VEC *diag),
*QRCPfactor(MAT *A,VEC *diag,PERM *pivot),
*LDLfactor(MAT *A),
*Hfactor(MAT *A,VEC *diag1,VEC *diag2),
*MCHfactor(MAT *A,double tol),
*m_inverse(MAT *A,MAT *out);
extern double LUcondest(MAT *A,PERM *pivot),
QRcondest(MAT *A);
extern MAT *makeQ(MAT *A,VEC *diag,MAT *Qout),
*makeR(MAT *A,MAT *Rout),
*makeHQ(MAT *A,VEC *diag1,VEC *diag2,MAT *Qout),
*makeH(MAT *A,MAT *Hout);
extern MAT *LDLupdate(MAT *A,VEC *u,double alpha),
*QRupdate(MAT *Q,MAT *R,VEC *u,VEC *v);
# 1378 "/steve/stevelib/meschach.h"
extern VEC *BKPsolve(MAT *A,PERM *pivot,PERM *blocks,VEC *b,VEC *x),
*CHsolve(MAT *A,VEC *b,VEC *x),
*LDLsolve(MAT *A,VEC *b,VEC *x),
*LUsolve(MAT *A,PERM *pivot,VEC *b,VEC *x),
*_Qsolve(MAT *A,VEC *,VEC *,VEC *, VEC *),
*QRsolve(MAT *A,VEC *,VEC *b,VEC *x),
*QRTsolve(MAT *A,VEC *,VEC *b,VEC *x),
*Usolve(MAT *A,VEC *b,VEC *x,double diag_val),
*Lsolve(MAT *A,VEC *b,VEC *x,double diag_val),
*Dsolve(MAT *A,VEC *b,VEC *x),
*LTsolve(MAT *A,VEC *b,VEC *x,double diag_val),
*UTsolve(MAT *A,VEC *b,VEC *x,double diag_val),
*LUTsolve(MAT *A,PERM *,VEC *,VEC *),
*QRCPsolve(MAT *QR,VEC *diag,PERM *pivot,VEC *b,VEC *x);
extern BAND *bdLUfactor(BAND *A,PERM *pivot),
*bdLDLfactor(BAND *A);
extern VEC *bdLUsolve(BAND *A,PERM *pivot,VEC *b,VEC *x),
*bdLDLsolve(BAND *A,VEC *b,VEC *x);
extern VEC *hhvec(VEC *,u_int,double *,VEC *,double *);
extern VEC *hhtrvec(VEC *,double,u_int,VEC *,VEC *);
extern MAT *hhtrrows(MAT *,u_int,u_int,VEC *,double);
extern MAT *hhtrcols(MAT *,u_int,u_int,VEC *,double);
extern void givens(double,double,double *,double *);
extern VEC *rot_vec(VEC *,u_int,u_int,double,double,VEC *);
extern MAT *rot_rows(MAT *,u_int,u_int,double,double,MAT *);
extern MAT *rot_cols(MAT *,u_int,u_int,double,double,MAT *);
extern VEC *trieig(VEC *a,VEC *b,MAT *Q),
*symmeig(MAT *A,MAT *Q,VEC *out);
extern MAT *schur(MAT *A,MAT *Q);
extern void schur_evals(MAT *A,VEC *re_part,VEC *im_part);
extern MAT *schur_vecs(MAT *T,MAT *Q,MAT *X_re,MAT *X_im);
VEC *bisvd(VEC *a,VEC *b,MAT *U,MAT *V),
*svd(MAT *A,MAT *U,MAT *V,VEC *out);
MAT *_m_pow(MAT *,int,MAT *,MAT *);
MAT *m_pow(MAT *,int, MAT *);
MAT *m_exp(MAT *,double,MAT *);
MAT *_m_exp(MAT *,double,MAT *,int *,int *);
MAT *m_poly(MAT *,VEC *,MAT *);
void fft(VEC *,VEC *);
void ifft(VEC *,VEC *);
# 1505 "/steve/stevelib/meschach.h"
typedef struct row_elt {
int col, nxt_row, nxt_idx;
double val;
} row_elt;
typedef struct SPROW {
int len, maxlen, diag;
row_elt *elt;
} SPROW;
typedef struct SPMAT {
int m, n, max_m, max_n;
char flag_col, flag_diag;
SPROW *row;
int *start_row;
int *start_idx;
} SPMAT;
typedef struct pair { int pos; double val; } pair;
typedef struct SPVEC {
int dim, max_dim;
pair *elt;
} SPVEC;
# 1547 "/steve/stevelib/meschach.h"
int sp_get_vars(int m,int n,int deg,...);
int sp_resize_vars(int m,int n,...);
int sp_free_vars(SPMAT **,...);
# 1591 "/steve/stevelib/meschach.h"
SPMAT *sp_get(int,int,int), *sp_copy(SPMAT *),
*sp_copy2(SPMAT *,SPMAT *),
*sp_zero(SPMAT *), *sp_resize(SPMAT *,int,int),
*sp_compact(SPMAT *,double);
double sp_get_val(SPMAT *,int,int), sp_set_val(SPMAT *,int,int,double);
VEC *sp_mv_mlt(SPMAT *,VEC *,VEC *), *sp_vm_mlt(SPMAT *,VEC *,VEC *);
int sp_free(SPMAT *);
SPMAT *sp_col_access(SPMAT *);
SPMAT *sp_diag_access(SPMAT *);
int chk_col_access(SPMAT *);
SPMAT *sp_finput(FILE *);
void sp_foutput(FILE *,SPMAT *), sp_foutput2(FILE *,SPMAT *);
SPMAT *sp_smlt(SPMAT *A,double alpha,SPMAT *B),
*sp_add(SPMAT *A,SPMAT *B,SPMAT *C),
*sp_sub(SPMAT *A,SPMAT *B,SPMAT *C),
*sp_mltadd(SPMAT *A,SPMAT *B,double alpha,SPMAT *C);
SPROW *sprow_get(int), *sprow_xpd(SPROW *r,int n,int type),
*sprow_resize(SPROW *r,int n,int type),
*sprow_merge(SPROW *,SPROW *,SPROW *,int type),
*sprow_copy(SPROW *,SPROW *,SPROW *,int type),
*sprow_mltadd(SPROW *,SPROW *,double,int,SPROW *,int type);
SPROW *sprow_add(SPROW *r1,SPROW *r2, int j0,SPROW *r_out, int type),
*sprow_sub(SPROW *r1,SPROW *r2, int j0,SPROW *r_out, int type),
*sprow_smlt(SPROW *r1,double alpha, int j0,SPROW *r_out, int type);
double sprow_set_val(SPROW *,int,double);
int sprow_free(SPROW *);
int sprow_idx(SPROW *,int);
void sprow_foutput(FILE *,SPROW *);
void sp_dump(FILE *fp, SPMAT *A);
void sprow_dump(FILE *fp, SPROW *r);
MAT *sp_m2dense(SPMAT *A,MAT *out);
# 1720 "/steve/stevelib/meschach.h"
SPMAT *spCHfactor(SPMAT *), *spICHfactor(SPMAT *), *spCHsymb(SPMAT *);
VEC *spCHsolve(SPMAT *,VEC *,VEC *);
SPMAT *spLUfactor(SPMAT *,PERM *,double);
SPMAT *spILUfactor(SPMAT *,double);
VEC *spLUsolve(SPMAT *,PERM *,VEC *,VEC *),
*spLUTsolve(SPMAT *,PERM *,VEC *,VEC *);
SPMAT *spBKPfactor(SPMAT *, PERM *, PERM *, double);
VEC *spBKPsolve(SPMAT *, PERM *, PERM *, VEC *, VEC *);
VEC *pccg(VEC *(*A)(),void *A_par,VEC *(*M_inv)(),void *M_par,VEC *b,
double tol,VEC *x);
VEC *sp_pccg(SPMAT *,SPMAT *,VEC *,double,VEC *);
VEC *cgs(VEC *(*A)(),void *A_par,VEC *b,VEC *r0,double tol,VEC *x);
VEC *sp_cgs(SPMAT *,VEC *,VEC *,double,VEC *);
VEC *lsqr(VEC *(*A)(),VEC *(*AT)(),void *A_par,VEC *b,double tol,VEC *x);
VEC *sp_lsqr(SPMAT *,VEC *,double,VEC *);
int cg_set_maxiter(int);
void lanczos(VEC *(*A)(),void *A_par,int m,VEC *x0,VEC *a,VEC *b,
double *beta_m1,MAT *Q);
void sp_lanczos(SPMAT *,int,VEC *,VEC *,VEC *,double *,MAT *);
VEC *lanczos2(VEC *(*A)(),void *A_par,int m,VEC *x0,VEC *evals,
VEC *err_est);
VEC *sp_lanczos2(SPMAT *,int,VEC *,VEC *,VEC *);
extern void scan_to(SPMAT *,IVEC *,IVEC *,IVEC *,int);
extern row_elt *chase_col(SPMAT *,int,int *,int *,int);
extern row_elt *chase_past(SPMAT *,int,int *,int *,int);
extern row_elt *bump_col(SPMAT *,int,int *,int *);
# 1824 "/steve/stevelib/meschach.h"
typedef VEC *(*Fun_Ax)(void *,VEC *,VEC *);
typedef struct Iter_data {
int shared_x;
int shared_b;
unsigned k;
int limit;
int steps;
double eps;
VEC *x;
VEC *b;
Fun_Ax Ax;
void *A_par;
Fun_Ax ATx;
void *AT_par;
Fun_Ax Bx;
void *B_par;
# 1867 "/steve/stevelib/meschach.h"
void (*info)();
int (*stop_crit)();
# 1883 "/steve/stevelib/meschach.h"
double init_res;
} ITER;
typedef void (*Fun_info)(ITER *, double, VEC *,VEC *);
typedef int (*Fun_stp_crt)(ITER *, double, VEC *,VEC *);
# 1930 "/steve/stevelib/meschach.h"
void iter_std_info(ITER *ip,double nres,VEC *res,VEC *Bres);
int iter_std_stop_crit(ITER *ip, double nres, VEC *res,VEC *Bres);
ITER *iter_get(int lenb, int lenx);
ITER *iter_resize(ITER *ip,int lenb,int lenx);
int iter_free(ITER *ip);
void iter_dump(FILE *fp,ITER *ip);
ITER *iter_copy(ITER *ip1, ITER *ip2);
ITER *iter_copy2(ITER *ip1,ITER *ip2);
SPMAT *iter_gen_sym(int n, int nrow);
SPMAT *iter_gen_nonsym(int m,int n,int nrow,double diag);
SPMAT *iter_gen_nonsym_posdef(int n,int nrow);
# 1971 "/steve/stevelib/meschach.h"
VEC *iter_cg(ITER *ip);
VEC *iter_cg1(ITER *ip);
VEC *iter_spcg(SPMAT *A,SPMAT *LLT,VEC *b,double eps,VEC *x,int limit,
int *steps);
VEC *iter_cgs(ITER *ip,VEC *r0);
VEC *iter_spcgs(SPMAT *A,SPMAT *B,VEC *b,VEC *r0,double eps,VEC *x,
int limit, int *steps);
VEC *iter_lsqr(ITER *ip);
VEC *iter_splsqr(SPMAT *A,VEC *b,double tol,VEC *x,
int limit,int *steps);
VEC *iter_gmres(ITER *ip);
VEC *iter_spgmres(SPMAT *A,SPMAT *B,VEC *b,double tol,VEC *x,int k,
int limit, int *steps);
MAT *iter_arnoldi_iref(ITER *ip,double *h,MAT *Q,MAT *H);
MAT *iter_arnoldi(ITER *ip,double *h,MAT *Q,MAT *H);
MAT *iter_sparnoldi(SPMAT *A,VEC *x0,int k,double *h,MAT *Q,MAT *H);
VEC *iter_mgcr(ITER *ip);
VEC *iter_spmgcr(SPMAT *A,SPMAT *B,VEC *b,double tol,VEC *x,int k,
int limit, int *steps);
void iter_lanczos(ITER *ip,VEC *a,VEC *b,double *beta2,MAT *Q);
void iter_splanczos(SPMAT *A,int m,VEC *x0,VEC *a,VEC *b,double *beta2,
MAT *Q);
VEC *iter_lanczos2(ITER *ip,VEC *evals,VEC *err_est);
VEC *iter_splanczos2(SPMAT *A,int m,VEC *x0,VEC *evals,VEC *err_est);
VEC *iter_cgne(ITER *ip);
VEC *iter_spcgne(SPMAT *A,SPMAT *B,VEC *b,double eps,VEC *x,
int limit,int *steps);
# 2062 "/steve/stevelib/meschach.h"
typedef struct {
double re,im;
} complex;
typedef struct {
u_int dim, max_dim;
complex *ve;
} ZVEC;
typedef struct {
u_int m, n;
u_int max_m, max_n, max_size;
complex *base;
complex **me;
} ZMAT;
# 2090 "/steve/stevelib/meschach.h"
int zv_get_vars(int dim,...);
int zm_get_vars(int m,int n,...);
int zv_resize_vars(int new_dim,...);
int zm_resize_vars(int m,int n,...);
int zv_free_vars(ZVEC **,...);
int zm_free_vars(ZMAT **,...);
# 2111 "/steve/stevelib/meschach.h"
extern ZMAT *_zm_copy(ZMAT *in,ZMAT *out,u_int i0,u_int j0);
extern ZMAT * zm_move(ZMAT *, int, int, int, int, ZMAT *, int, int);
extern ZMAT *zvm_move(ZVEC *, int, ZMAT *, int, int, int, int);
extern ZVEC *_zv_copy(ZVEC *in,ZVEC *out,u_int i0);
extern ZVEC * zv_move(ZVEC *, int, int, ZVEC *, int);
extern ZVEC *zmv_move(ZMAT *, int, int, int, int, ZVEC *, int);
extern complex z_finput(FILE *fp);
extern ZMAT *zm_finput(FILE *fp,ZMAT *a);
extern ZVEC *zv_finput(FILE *fp,ZVEC *x);
extern ZMAT *zm_add(ZMAT *mat1,ZMAT *mat2,ZMAT *out);
extern ZMAT *zm_sub(ZMAT *mat1,ZMAT *mat2,ZMAT *out);
extern ZMAT *zm_mlt(ZMAT *A,ZMAT *B,ZMAT *OUT);
extern ZMAT *zmma_mlt(ZMAT *A,ZMAT *B,ZMAT *OUT);
extern ZMAT *zmam_mlt(ZMAT *A,ZMAT *B,ZMAT *OUT);
extern ZVEC *zmv_mlt(ZMAT *A,ZVEC *b,ZVEC *out);
extern ZMAT *zsm_mlt(complex scalar,ZMAT *matrix,ZMAT *out);
extern ZVEC *zvm_mlt(ZMAT *A,ZVEC *b,ZVEC *out);
extern ZMAT *zm_adjoint(ZMAT *in,ZMAT *out);
extern ZMAT *zswap_rows(ZMAT *A,int i,int j,int lo,int hi);
extern ZMAT *zswap_cols(ZMAT *A,int i,int j,int lo,int hi);
extern ZMAT *mz_mltadd(ZMAT *A1,ZMAT *A2,complex s,ZMAT *out);
extern ZVEC *zmv_mltadd(ZVEC *v1,ZVEC *v2,ZMAT *A,complex alpha,ZVEC *out);
extern ZVEC *zvm_mltadd(ZVEC *v1,ZVEC *v2,ZMAT *A,complex alpha,ZVEC *out);
extern ZVEC *zv_zero(ZVEC *x);
extern ZMAT *zm_zero(ZMAT *A);
extern ZMAT *zm_get(int m,int n);
extern ZVEC *zv_get(int dim);
extern ZMAT *zm_resize(ZMAT *A,int new_m,int new_n);
extern complex _zin_prod(ZVEC *x,ZVEC *y,u_int i0,u_int flag);
extern ZVEC *zv_resize(ZVEC *x,int new_dim);
extern ZVEC *zv_mlt(complex scalar,ZVEC *vector,ZVEC *out);
extern ZVEC *zv_add(ZVEC *vec1,ZVEC *vec2,ZVEC *out);
extern ZVEC *zv_mltadd(ZVEC *v1,ZVEC *v2,complex scale,ZVEC *out);
extern ZVEC *zv_sub(ZVEC *vec1,ZVEC *vec2,ZVEC *out);
extern ZVEC *zv_map(complex (*f)(complex),ZVEC *x,ZVEC *out);
extern ZVEC *_zv_map(complex (*f)(void *,complex),void *params,ZVEC *x,ZVEC *out);
extern ZVEC *zv_lincomb(int n,ZVEC *v[],complex a[],ZVEC *out);
extern ZVEC *zv_linlist(ZVEC *out,ZVEC *v1,complex a1,...);
extern ZVEC *zv_star(ZVEC *x1, ZVEC *x2, ZVEC *out);
extern ZVEC *zv_slash(ZVEC *x1, ZVEC *x2, ZVEC *out);
extern int zm_free(ZMAT *mat);
extern int zv_free(ZVEC *vec);
extern ZVEC *zv_rand(ZVEC *x);
extern ZMAT *zm_rand(ZMAT *A);
extern ZVEC *zget_row(ZMAT *A, int i, ZVEC *out);
extern ZVEC *zget_col(ZMAT *A, int j, ZVEC *out);
extern ZMAT *zset_row(ZMAT *A, int i, ZVEC *in);
extern ZMAT *zset_col(ZMAT *A, int j, ZVEC *in);
extern ZVEC *px_zvec(PERM *pi, ZVEC *in, ZVEC *out);
extern ZVEC *pxinv_zvec(PERM *pi, ZVEC *in, ZVEC *out);
extern void __zconj__(complex zp[], int len);
extern complex __zip__(complex zp1[],complex zp2[],int len,int flag);
extern void __zmltadd__(complex zp1[],complex zp2[],
complex s,int len,int flag);
extern void __zmlt__(complex zp[],complex s,complex out[],int len);
extern void __zadd__(complex zp1[],complex zp2[],complex out[],int len);
extern void __zsub__(complex zp1[],complex zp2[],complex out[],int len);
extern void __zzero__(complex zp[],int len);
extern void z_foutput(FILE *fp,complex z);
extern void zm_foutput(FILE *fp,ZMAT *a);
extern void zv_foutput(FILE *fp,ZVEC *x);
extern void zm_dump(FILE *fp,ZMAT *a);
extern void zv_dump(FILE *fp,ZVEC *x);
extern double _zv_norm1(ZVEC *x, VEC *scale);
extern double _zv_norm2(ZVEC *x, VEC *scale);
extern double _zv_norm_inf(ZVEC *x, VEC *scale);
extern double zm_norm1(ZMAT *A);
extern double zm_norm_inf(ZMAT *A);
extern double zm_norm_frob(ZMAT *A);
complex zmake(double real, double imag);
double zabs(complex z);
complex zadd(complex z1,complex z2);
complex zsub(complex z1,complex z2);
complex zmlt(complex z1,complex z2);
complex zinv(complex z);
complex zdiv(complex z1,complex z2);
complex zsqrt(complex z);
complex zexp(complex z);
complex zlog(complex z);
complex zconj(complex z);
complex zneg(complex z);
# 2347 "/steve/stevelib/meschach.h"
extern ZVEC *zUsolve(ZMAT *matrix, ZVEC *b, ZVEC *out, double diag);
extern ZVEC *zLsolve(ZMAT *matrix, ZVEC *b, ZVEC *out, double diag);
extern ZVEC *zUAsolve(ZMAT *U, ZVEC *b, ZVEC *out, double diag);
extern ZVEC *zDsolve(ZMAT *A, ZVEC *b, ZVEC *x);
extern ZVEC *zLAsolve(ZMAT *L, ZVEC *b, ZVEC *out, double diag);
extern ZVEC *zhhvec(ZVEC *,int,double *,ZVEC *,complex *);
extern ZVEC *zhhtrvec(ZVEC *,double,int,ZVEC *,ZVEC *);
extern ZMAT *zhhtrrows(ZMAT *,int,int,ZVEC *,double);
extern ZMAT *zhhtrcols(ZMAT *,int,int,ZVEC *,double);
extern ZMAT *zHfactor(ZMAT *,ZVEC *);
extern ZMAT *zHQunpack(ZMAT *,ZVEC *,ZMAT *,ZMAT *);
extern ZMAT *zQRfactor(ZMAT *A, ZVEC *diag);
extern ZMAT *zQRCPfactor(ZMAT *A, ZVEC *diag, PERM *px);
extern ZVEC *_zQsolve(ZMAT *QR, ZVEC *diag, ZVEC *b, ZVEC *x, ZVEC *tmp);
extern ZMAT *zmakeQ(ZMAT *QR, ZVEC *diag, ZMAT *Qout);
extern ZMAT *zmakeR(ZMAT *QR, ZMAT *Rout);
extern ZVEC *zQRsolve(ZMAT *QR, ZVEC *diag, ZVEC *b, ZVEC *x);
extern ZVEC *zQRAsolve(ZMAT *QR, ZVEC *diag, ZVEC *b, ZVEC *x);
extern ZVEC *zQRCPsolve(ZMAT *QR,ZVEC *diag,PERM *pivot,ZVEC *b,ZVEC *x);
extern ZVEC *zUmlt(ZMAT *U, ZVEC *x, ZVEC *out);
extern ZVEC *zUAmlt(ZMAT *U, ZVEC *x, ZVEC *out);
extern double zQRcondest(ZMAT *QR);
extern ZVEC *zLsolve(ZMAT *, ZVEC *, ZVEC *, double);
extern ZMAT *zset_col(ZMAT *, int, ZVEC *);
extern ZMAT *zLUfactor(ZMAT *A, PERM *pivot);
extern ZVEC *zLUsolve(ZMAT *A, PERM *pivot, ZVEC *b, ZVEC *x);
extern ZVEC *zLUAsolve(ZMAT *LU, PERM *pivot, ZVEC *b, ZVEC *x);
extern ZMAT *zm_inverse(ZMAT *A, ZMAT *out);
extern double zLUcondest(ZMAT *LU, PERM *pivot);
extern void zgivens(complex, complex, double *, complex *);
extern ZMAT *zrot_rows(ZMAT *A, int i, int k, double c, complex s,
ZMAT *out);
extern ZMAT *zrot_cols(ZMAT *A, int i, int k, double c, complex s,
ZMAT *out);
extern ZVEC *rot_zvec(ZVEC *x, int i, int k, double c, complex s,
ZVEC *out);
extern ZMAT *zschur(ZMAT *A,ZMAT *Q);
# 18 "/steve/stevelib/steve.h" 2
MAT * nr2m(double **, long, long, long, long, MAT *);
MAT * m2nr(double **, long, long, long, long, MAT *);
VEC * nr2v(double *, long, long, VEC *);
VEC * v2nr(double *, long, long, VEC *);
MAT *makeQfull(MAT *, VEC *, MAT *);
# 35 "/steve/stevelib/steve.h"
# 1 "/steve/stevelib/Rmath.h" 1
# 38 "/steve/stevelib/Rmath.h"
# 1 "/usr/include/errno.h" 1 3
typedef int error_t;
# 1 "/usr/include/sys/errno.h" 1 3
# 15 "/usr/include/sys/errno.h" 3
extern int *__errno (void);
extern __attribute__((dllimport)) const char * const _sys_errlist[];
extern __attribute__((dllimport)) int _sys_nerr;
extern __attribute__((dllimport)) const char * const sys_errlist[];
extern __attribute__((dllimport)) int sys_nerr;
# 7 "/usr/include/errno.h" 2 3
# 39 "/steve/stevelib/Rmath.h" 2
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h" 1 3
# 11 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h" 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/syslimits.h" 1 3
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h" 1 3
# 132 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h" 3
# 1 "/usr/include/limits.h" 1 3
# 133 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h" 2 3
# 8 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/syslimits.h" 2 3
# 12 "/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h" 2 3
# 40 "/steve/stevelib/Rmath.h" 2
# 166 "/steve/stevelib/Rmath.h"
typedef enum {FALSE = 0, TRUE } Rboolean;
# 314 "/steve/stevelib/Rmath.h"
double R_log(double x);
double R_pow(double x, double y);
double R_pow_di(double, int);
double norm_rand(void);
double unif_rand(void);
double exp_rand(void);
void set_seed(unsigned int, unsigned int);
# 333 "/steve/stevelib/Rmath.h"
double dnorm4(double, double, double, int);
double pnorm5(double, double, double, int, int);
double qnorm5(double, double, double, int, int);
double rnorm(double, double);
void pnorm_both(double, double *, double *, int, int);
double dunif(double, double, double, int);
double punif(double, double, double, int, int);
double qunif(double, double, double, int, int);
double runif(double, double);
double dgamma(double, double, double, int);
double pgamma(double, double, double, int, int);
double qgamma(double, double, double, int, int);
double rgamma(double, double);
double dbeta(double, double, double, int);
double pbeta(double, double, double, int, int);
double qbeta(double, double, double, int, int);
double rbeta(double, double);
double pbeta_raw(double, double, double, int);
double dlnorm(double, double, double, int);
double plnorm(double, double, double, int, int);
double qlnorm(double, double, double, int, int);
double rlnorm(double, double);
double dchisq(double, double, int);
double pchisq(double, double, int, int);
double qchisq(double, double, int, int);
double rchisq(double);
double dnchisq(double, double, double, int);
double pnchisq(double, double, double, int, int);
double qnchisq(double, double, double, int, int);
double rnchisq(double, double);
double df(double, double, double, int);
double pf(double, double, double, int, int);
double qf(double, double, double, int, int);
double rf(double, double);
double dt(double, double, int);
double pt(double, double, int, int);
double qt(double, double, int, int);
double rt(double);
double dbinom(double, double, double, int);
double pbinom(double, double, double, int, int);
double qbinom(double, double, double, int, int);
double rbinom(double, double);
double dcauchy(double, double, double, int);
double pcauchy(double, double, double, int, int);
double qcauchy(double, double, double, int, int);
double rcauchy(double, double);
double dexp(double, double, int);
double pexp(double, double, int, int);
double qexp(double, double, int, int);
double rexp(double);
double dgeom(double, double, int);
double pgeom(double, double, int, int);
double qgeom(double, double, int, int);
double rgeom(double);
double dhyper(double, double, double, double, int);
double phyper(double, double, double, double, int, int);
double qhyper(double, double, double, double, int, int);
double rhyper(double, double, double);
double dnbinom(double, double, double, int);
double pnbinom(double, double, double, int, int);
double qnbinom(double, double, double, int, int);
double rnbinom(double, double);
double dpois(double, double, int);
double ppois(double, double, int, int);
double qpois(double, double, int, int);
double rpois(double);
double dweibull(double, double, double, int);
double pweibull(double, double, double, int, int);
double qweibull(double, double, double, int, int);
double rweibull(double, double);
double dlogis(double, double, double, int);
double plogis(double, double, double, int, int);
double qlogis(double, double, double, int, int);
double rlogis(double, double);
double dnbeta(double, double, double, double, int);
double pnbeta(double, double, double, double, int, int);
double qnbeta(double, double, double, double, int, int);
double rnbeta(double, double, double);
double pnf(double, double, double, double, int, int);
double qnf(double, double, double, double, int, int);
double pnt(double, double, double, int, int);
double qnt(double, double, double, int, int);
double ptukey(double, double, double, double, int, int);
double qtukey(double, double, double, double, int, int);
double dwilcox(double, double, double, int);
double pwilcox(double, double, double, int, int);
double qwilcox(double, double, double, int, int);
double rwilcox(double, double);
double dsignrank(double, double, int);
double psignrank(double, double, int, int);
double qsignrank(double, double, int, int);
double rsignrank(double);
double gammafn(double);
double lgammafn(double);
double digamma(double);
double trigamma(double);
double tetragamma(double);
double pentagamma(double);
double beta(double, double);
double lbeta(double, double);
double choose(double, double);
double lchoose(double, double);
double bessel_i(double, double, double);
double bessel_j(double, double);
double bessel_k(double, double, double);
double bessel_y(double, double);
double pythag(double, double);
double log1p(double);
int imax2(int, int);
int imin2(int, int);
double fmax2(double, double);
double fmin2(double, double);
double sign(double);
double fprec(double, double);
double fround(double, double);
double fsign(double, double);
double ftrunc(double);
# 554 "/steve/stevelib/Rmath.h"
int R_IsNaNorNA(double);
int R_finite(double);
# 36 "/steve/stevelib/steve.h" 2
# 47 "/steve/stevelib/steve.h"
double my_rgam_fix(double, double);
double my_dgam_fix(double, double, double, int);
double my_pgam_fix(double, double, double, int, int);
double my_qgam_fix(double, double, double, int, int);
double my_rexp_fix(double);
double my_dexp_fix(double,double,int);
double my_pexp_fix(double,double,int,int);
double my_pexp_fixqexp(double,double,int,int);
# 67 "/steve/stevelib/steve.h"
# 1 "/steve/stevelib/fftw.h" 1
# 46 "/steve/stevelib/fftw.h"
typedef double fftw_real;
typedef struct {
fftw_real re, im;
} fftw_complex;
typedef enum {
FFTW_FORWARD = -1, FFTW_BACKWARD = 1
} fftw_direction;
typedef fftw_complex FFTW_COMPLEX;
typedef fftw_real FFTW_REAL;
# 81 "/steve/stevelib/fftw.h"
typedef enum {
FFTW_SUCCESS = 0, FFTW_FAILURE = -1
} fftw_status;
typedef void (fftw_notw_codelet)
(const fftw_complex *, fftw_complex *, int, int);
typedef void (fftw_twiddle_codelet)
(fftw_complex *, const fftw_complex *, int,
int, int);
typedef void (fftw_generic_codelet)
(fftw_complex *, const fftw_complex *, int,
int, int, int);
typedef void (fftw_real2hc_codelet)
(const fftw_real *, fftw_real *, fftw_real *,
int, int, int);
typedef void (fftw_hc2real_codelet)
(const fftw_real *, const fftw_real *,
fftw_real *, int, int, int);
typedef void (fftw_hc2hc_codelet)
(fftw_real *, const fftw_complex *,
int, int, int);
typedef void (fftw_rgeneric_codelet)
(fftw_real *, const fftw_complex *, int,
int, int, int);
# 116 "/steve/stevelib/fftw.h"
enum fftw_node_type {
FFTW_NOTW, FFTW_TWIDDLE, FFTW_GENERIC, FFTW_RADER,
FFTW_REAL2HC, FFTW_HC2REAL, FFTW_HC2HC, FFTW_RGENERIC
};
typedef struct {
const char *name;
void (*codelet) ();
int size;
fftw_direction dir;
enum fftw_node_type type;
int signature;
int ntwiddle;
const int *twiddle_order;
} fftw_codelet_desc;
# 151 "/steve/stevelib/fftw.h"
extern const char * fftw_version;
# 166 "/steve/stevelib/fftw.h"
typedef struct fftw_twiddle_struct {
int n;
const fftw_codelet_desc *cdesc;
fftw_complex *twarray;
struct fftw_twiddle_struct *next;
int refcnt;
} fftw_twiddle;
typedef struct fftw_rader_data_struct {
struct fftw_plan_struct *plan;
fftw_complex *omega;
int g, ginv;
int p, flags, refcount;
struct fftw_rader_data_struct *next;
fftw_codelet_desc *cdesc;
} fftw_rader_data;
typedef void (fftw_rader_codelet)
(fftw_complex *, const fftw_complex *, int,
int, int, fftw_rader_data *);
typedef struct fftw_plan_node_struct {
enum fftw_node_type type;
union {
struct {
int size;
fftw_notw_codelet *codelet;
const fftw_codelet_desc *codelet_desc;
} notw;
struct {
int size;
fftw_twiddle_codelet *codelet;
fftw_twiddle *tw;
struct fftw_plan_node_struct *recurse;
const fftw_codelet_desc *codelet_desc;
} twiddle;
struct {
int size;
fftw_generic_codelet *codelet;
fftw_twiddle *tw;
struct fftw_plan_node_struct *recurse;
} generic;
struct {
int size;
fftw_rader_codelet *codelet;
fftw_rader_data *rader_data;
fftw_twiddle *tw;
struct fftw_plan_node_struct *recurse;
} rader;
struct {
int size;
fftw_real2hc_codelet *codelet;
const fftw_codelet_desc *codelet_desc;
} real2hc;
struct {
int size;
fftw_hc2real_codelet *codelet;
const fftw_codelet_desc *codelet_desc;
} hc2real;
struct {
int size;
fftw_direction dir;
fftw_hc2hc_codelet *codelet;
fftw_twiddle *tw;
struct fftw_plan_node_struct *recurse;
const fftw_codelet_desc *codelet_desc;
} hc2hc;
struct {
int size;
fftw_direction dir;
fftw_rgeneric_codelet *codelet;
fftw_twiddle *tw;
struct fftw_plan_node_struct *recurse;
} rgeneric;
} nodeu;
int refcnt;
} fftw_plan_node;
typedef enum {
FFTW_NORMAL_RECURSE = 0,
FFTW_VECTOR_RECURSE = 1
} fftw_recurse_kind;
struct fftw_plan_struct {
int n;
int refcnt;
fftw_direction dir;
int flags;
int wisdom_signature;
enum fftw_node_type wisdom_type;
struct fftw_plan_struct *next;
fftw_plan_node *root;
double cost;
fftw_recurse_kind recurse_kind;
int vector_size;
};
typedef struct fftw_plan_struct *fftw_plan;
# 301 "/steve/stevelib/fftw.h"
extern fftw_plan fftw_create_plan_specific(int n, fftw_direction dir,
int flags,
fftw_complex *in, int istride,
fftw_complex *out, int ostride);
extern fftw_plan fftw_create_plan(int n, fftw_direction dir, int flags);
extern void fftw_print_plan(fftw_plan plan);
extern void fftw_destroy_plan(fftw_plan plan);
extern void fftw(fftw_plan plan, int howmany, fftw_complex *in, int istride,
int idist, fftw_complex *out, int ostride, int odist);
extern void fftw_one(fftw_plan plan, fftw_complex *in, fftw_complex *out);
extern void fftw_die(const char *s);
extern void *fftw_malloc(size_t n);
extern void fftw_free(void *p);
extern void fftw_check_memory_leaks(void);
extern void fftw_print_max_memory_usage(void);
typedef void *(*fftw_malloc_type_function) (size_t n);
typedef void (*fftw_free_type_function) (void *p);
typedef void (*fftw_die_type_function) (const char *errString);
extern fftw_malloc_type_function fftw_malloc_hook;
extern fftw_free_type_function fftw_free_hook;
extern fftw_die_type_function fftw_die_hook;
extern size_t fftw_sizeof_fftw_real(void);
extern void fftw_forget_wisdom(void);
extern void fftw_export_wisdom(void (*emitter) (char c, void *), void *data);
extern fftw_status fftw_import_wisdom(int (*g) (void *), void *data);
extern void fftw_export_wisdom_to_file(FILE *output_file);
extern fftw_status fftw_import_wisdom_from_file(FILE *input_file);
extern char *fftw_export_wisdom_to_string(void);
extern fftw_status fftw_import_wisdom_from_string(const char *input_string);
extern void fftw_fprint_plan(FILE *f, fftw_plan plan);
typedef struct {
int is_in_place;
int rank;
int *n;
fftw_direction dir;
int *n_before;
int *n_after;
fftw_plan *plans;
int nbuffers, nwork;
fftw_complex *work;
} fftwnd_data;
typedef fftwnd_data *fftwnd_plan;
extern fftwnd_plan fftw2d_create_plan(int nx, int ny, fftw_direction dir,
int flags);
extern fftwnd_plan fftw3d_create_plan(int nx, int ny, int nz,
fftw_direction dir, int flags);
extern fftwnd_plan fftwnd_create_plan(int rank, const int *n,
fftw_direction dir,
int flags);
extern fftwnd_plan fftw2d_create_plan_specific(int nx, int ny,
fftw_direction dir,
int flags,
fftw_complex *in, int istride,
fftw_complex *out, int ostride);
extern fftwnd_plan fftw3d_create_plan_specific(int nx, int ny, int nz,
fftw_direction dir, int flags,
fftw_complex *in, int istride,
fftw_complex *out, int ostride);
extern fftwnd_plan fftwnd_create_plan_specific(int rank, const int *n,
fftw_direction dir,
int flags,
fftw_complex *in, int istride,
fftw_complex *out, int ostride);
extern void fftwnd_destroy_plan(fftwnd_plan plan);
extern void fftwnd_fprint_plan(FILE *f, fftwnd_plan p);
extern void fftwnd_print_plan(fftwnd_plan p);
extern void fftwnd(fftwnd_plan plan, int howmany,
fftw_complex *in, int istride, int idist,
fftw_complex *out, int ostride, int odist);
extern void fftwnd_one(fftwnd_plan p, fftw_complex *in, fftw_complex *out);
# 68 "/steve/stevelib/steve.h" 2
fftw_complex cmult(fftw_complex, fftw_complex);
fftw_complex cmultstar(fftw_complex, fftw_complex);
double real_cmult(fftw_complex, fftw_complex);
double real_cmultstar(fftw_complex, fftw_complex);
typedef enum {FULL=0, DIAG=1, sigsqI=2} VMAT_TYPE;
double rgamma2(double, double);
double mgamma(double, double);
double trun_norm(double);
double rtrun_norm(double, double, double, int);
double dtrun_norm(double, double, double, double, int, int);
double dtrun_norm_2(double, double, double, double, double, int);
void rmvn(double *, long, long, double **);
void rmvn2(double *, long, long, double **, double *);
int rmvn_suf(double *, double **, double *, long, long);
double mvnsuf2mvi(double *, double **, double *, double **, double **,
double *, double **, long, long);
double dmvn(double *, double *, double **, double *, long, long, long);
double mvn_likelihood(double *, double *, double **, double *, long, long,
double *, double **, int);
double pmvn(long, double *, double **, long *);
void rdirichlet(double *, long, long, double *, long);
double ddirichlet(double *, long, long, double *, long);
double mdirichlet(double *, long, long, double *);
double dirichlet_loglike(double *, double *, double, long, long,
double *, double **, int, int);
void Wish(double **, double **, double **, long, long);
double dWish(double **, double **, double, long, long, long);
void Wishinv_low(double **, double **, long, long);
double dstudent(double, double, double, double, int);
double rstudent(double, double, double);
double dmvt(double *, double *, double **, double *, double, long, long, long);
void rmvt(double *, long, long, double **, double);
void rmvt2(double *, long, long, double **, double *, double);
double trunc_expdev(double, double);
double rtrap(double, double, double, double);
double rtriangle(double, double, double);
double dtriangle(double, double, double, double, int);
double ptriangle(double, double, double, double, int);
double qtriangle(double, double, double, double);
double gamma_loglike(double, double, double, double, double,
double *, double **, int);
double trun_norm_2(double, double, double);
double *rpois_proc(double, double, double (*)(double), long *,
double, long);
double rpois_wait(double, double (*)(double));
double *rpois_proc_thin(double, double, double (*)(double), long *, double);
void draw_cormat(double **, double *, double *, double **, double,
double *, long, long, long);
void rpermute(long *, long, long);
double **center_sumsq(double **, double *, double *, double , double **,
long, long, double **, VMAT_TYPE);
void draw_mu_sigsq_1(double, double, double, double, double, double,
double, double *, double *);
double draw_sigsq_1(double, double, double, double, double, double);
double draw_mu_1(double, double, double, double, double);
void draw_mu_Sigma(double **, double *, double, double, double **,
double *, double **, double *, double **, double **,
long, long, VMAT_TYPE, long, double *, double *);
void draw_mu(double *, double, double *, double **, double *, double **,
long, long, long, double *);
double draw_Sigma(double **, double *, double, double, double, double **,
double *, double **, double **, long, long,
VMAT_TYPE vtype, long, long, double *);
double post_Sigma(double **, double **, double *, double, double, double,
double **, double *, long, long, VMAT_TYPE, long, long);
double post_mu(double *, double *, double, double *, double **, double **,
long, long, long);
long draw_dir_hp(double *, long, long, long, double *, double, double, double);
double post_dir_hp(double *, double, long, long, double *, double, double,
double, long, long);
double guess_dhp_rough(double **, double *, long, long, double *);
long draw_dir_hp2(double *, double, double, long, long, double *, double *,
double **, double, double);
double post_dir_hp2(double *, double, double, long, long, double *, double *,
double **, double, double, long, long);
int gam_hp_mom(double *, long, long, double *, double *);
int draw_gam_hp(double *, long, long, double *, double *, double, long,
long *);
int draw_gam_hp2(double *, long, long, double *, double *, double, long,
long *);
int draw_chisq_df(double *, double *, long, long, long, double, double,
long, long, double);
double post_chisq_df(double, double *, long, long, long, double, double, long);
double *rmmpp(double, double, long *, long, double (*)(double, long),
double (*)(double, long), double (*)(double, long), double *);
long rmulti(double *, long, long);
double logprob2prob(double *, long, long);
void update_seed(long, char *);
void get_seed(long *, char *);
void rmarkov(long *, long, double *, double **, long, long);
long get_stat_dist(double **, double *, long, long);
void gsd2(double **, double *, long, long);
void mv_reg(double **, double **, double **, double **, long,long,
long);
int MH(double *, long, double, long *,
double (*)(double *, double *, double **, int), long);
double MH_post(double *, long, double,
double (*)(double *, double *, double **, int),
long, long);
double lap(long, double **, long *, long *, double *, double *);
double lap_lh(long, long, double **, long *, long *, double *, double *);
double lsfit(double **, double *, long, long, double *);
double reg_suf(double *, double **, long, long, double *, double **, long);
double est_sigsq(double *, double, double, double *, double **, double, long);
void Breg_sigsq(double *, double, double *, double **, double,
double **, double **, double *, double **, long);
double Breg(double *, long, long, double *, double **, double, double **,
double **, double *, double **, double, double);
void eigen_gen(double **, long, long, double *, double *,
double **, double **);
void tred2(double **, long, double *, double *);
void tqli(double *, double *, long, double **);
long eigen_sym(double **, long, double *, double **);
double max_1d(double, double, double *, double,
double (*)(double, double *, double *, int));
double max_nr1(double *, double *, double *, long *, double, double,
double (*)(double , double *, double *, int), int , FILE *);
double max_nd(double *, double *, double **, long, long *, double, double,
double (*)(double *, double *, double **, int), int, FILE *);
double max_no_derivs(double *, double **, double, long *, double,
double (*)(double *, double *, double **, int),
int, FILE *);
long conj_grad(double *, int, double, long *, double *,
double (*)(double *), double (*)(double *, double *),
int, long, FILE *);
double newton_raphson(double *, double *, double **, long, long *,
double, double,
double (*)(double *, double *, double **),
int, FILE *);
void quasi_newton(double *, long, double, long *, double *,
double(*)(double *), double (*)(double *, double *),
int, long, FILE *);
void svdcmp(double **, long, long, double *, double **);
long vsrch1(double *, long, double, long);
long vsrch0(double *, unsigned long, double);
double det(double **, long);
double det_lh(double **, long, long);
double nr_det(double **, long);
double logdet(double **, long, long);
double logdet_safe(double **, long, long);
void dludcmp(double **, long ,long *,double *);
void dlubksb(double **, long ,long *, double *);
void dmatxvec(double **, long, long, long, long, double *, double *);
void dsolve(double **, long, double*);
double detd(double **, long n);
void dinverse(double **, long n, double **);
void dprintmat(double **, long, long, long, long);
void dcholdc(double **, long , double *);
void dcholsl(double **, long , double *, double *, double *);
void ludcmp(double **, long ,long *,double *);
int ludcmp_safe(double **, long ,long *,double *);
void lubksb(double **, long ,long *, double *);
void matxvec(double **, long, long, long, long, double *, double *);
void solve(double **, long, double*);
void inverse(double **, long, double **);
void nr_inverse(double **, long, double **);
int nr_inverse_safe(double **, long, double **);
void nr_inverse_offset(double **, long, long, double **);
void printmat(double **, long, long, long, long);
void fprintmat(FILE *, double **, long, long, long, long);
void choldc(double **, long , double *);
long choldc_safe(double **, long , double *);
long choldc_safe_offset(double **, long, long, double *);
void choldc2(double **, long);
void cholsl(double **, long , double *, double *, double *);
void cholinv(double **, long, double *);
void low_lowt(double **, double **, long , long );
void qrdcmp(double **, long, double *, double *, long *);
double stable_sum(double *, long);
void sweep(double **, long, long, long);
void reverse_sweep(double **, long, long, long);
double *get_nr_col(double **, long, long);
double Mdist(double **, double *, double *, long, long);
void set_diag(double **, double, long, long);
void mes_inv(double **, long, long, double **);
void transform_derivs(double *, double **, double **, double ***,
long, long, int);
# 343 "/steve/stevelib/steve.h"
double log_sum_exp(double *, long, long);
double dpsi(double);
double psi(double, long);
double psi_inv(double, double);
double nr_erff(double);
double nr_erffc(double);
double gammp(double, double);
double gammq(double a, double);
void gser(double *, double , double , double *);
void gcf(double *, double, double , double *);
double gammln(double);
double factrl(long);
void calc_acf(double *, long, long, long, long, double *);
double integrate(double (*)(double), double, double, double, int);
void polint(double *, double *, long, double, double *, double *);
double qromb(double (*)(double), double, double);
double trapzd(double (*)(double),double,double, long);
double integrate_stepfun(double (*)(double), double, double, double, double);
double rtsafe(void (*)(double,double *,double *), double,
double, double);
int odeint(double *, long, double, double, double,
double, double, long *, long *,
void (*)(double, double *, double *),
int (*)(double *, double *, long, double *, double, double,
double *, double *, double *,
void (*)(double, double *, double *)));
int bsstep(double *, double *, long, double *, double, double, double *,
double *, double *, void (*)(double, double *, double *));
int rkqs(double *, double *, long, double *, double, double, double *,
double *, double *, void (*)(double, double *, double *));
typedef enum{ EQ_SPACE = 0,
EQ_CDF = 1,
UNIF_CDF = 2 }KNOT_METHOD;
typedef struct{
double **x;
long **xmap;
double **knots;
long nk;
long p;
long n;
long P;
long order;
} SPLINE_DESIGN;
double find_range(double *, double *, double *, long, long);
double *make_knots(double *, long, long, KNOT_METHOD);
void free_knots(double *);
SPLINE_DESIGN design2spline(double **, long, long, long, long, long,
KNOT_METHOD, long, char);
double predict_spline(double **, long, long, long, double *);
double **Bspline(double *, long, double *, long, long, long, long);
double **Nspline(double *, double *, long, long, long, long);
double **plot_spline(double *, double **, double **, double,
long, long, long, long, long);
typedef enum{READ=0, WRITE=1, STREAM=2, CLOSE_STREAM,
WRITEBIN, READBIN, STREAMBIN, CLEAR} IO;
int io_vector(char *, double *, long, long, IO);
int io_matrix(char *, double **, long, long, long, long, IO);
int io_arr3(char *, double ***, long, long, long,
long, long, long, IO);
int io_ragged_2d(char *, double **, long, long, long, long *, IO);
void get_date(char *);
void start_time(void);
double print_time(FILE *);
double print_total_time(FILE *);
double machine_time(void);
void sort(unsigned long, double *);
void rsort(unsigned long, double *);
void indexx(unsigned long, double *, unsigned long *);
double select(unsigned long k, unsigned long n, double *arr);
void indx_lh(double *, long, long, long *);
void indx_gen(void **arr, long lo, long hi, long *indx,
int (*comp)(void *, void*));
typedef struct{
double **x;
double *y;
long nrow;
long ncol;
char **vnames;
char **ylevels;
}datmat;
datmat design(char *, long *, long, long, char **, long);
char *kill_white(char *);
char **input_vnames(long, ...);
void copy_file(char *, FILE *);
long count_fields(char *);
long count_lines(char *);
long scout_lines(char *, long *);
int skip_comments(FILE *, char *, long, char);
long count_fields_in_file(char *, long);
long get_last_line(char *, char *, long);
char *gll2(char *);
int str2vec(char *, double *, long, long);
long *is_cont_var(double **, long, long, long, long, char, long *);
char *downcase(char *);
char * reverse_string(char *);
typedef struct CATNODE{
char *lab;
long val, nlev;
struct CATNODE *left, *right;
}catnode;
catnode *catlook(char *, long *, catnode *);
catnode * free_tree(catnode *);
char **vec_cat(catnode *);
long steve_round(double);
double ymd2rab(char *);
int rab2ymd(double, long *, long *, long *);
int month_day(double, int, long *, long *);
long flast(char *, char *, char *, long);
char *drop_path(const char *);
int recursive_mkdir(char *, long);
FILE *fopen_steve(const char *, const char *, long);
FILE *gfopen(char *, const char *);
double **drop_col(double **, long,long,long,long,long);
double **drop_cols(double **, long *,long,long,long,long);
double **drop_row(double **, long,long,long,long,long);
# 4 "draw_dir_hp.c" 2
static double alpha, *pi, *suf, z, sigma;
static long dim, n;
static double TDF;
static double delta_logpost(double *, double *, double **, int);
static void d2nu(double *, double *);
static double nu2d(double *, double *);
static void free_crosshess(double ***);
static double ***fill_crosshess(double, double *, double **);
static double **fill_jacobian(double, double *);
static void set_params(double, double, long, long, double,
double *, double);
static double draw_alpha(double);
static double gh_alpha(double, double *, double *, int);
static int draw_pi(double *);
static double gh_delta(double *, double *, double **, int);
# 39 "draw_dir_hp.c"
long draw_dir_hp(double *NU, long nobs, long lo, long hi,
double *sumlogpi, double z0, double SIGMA,
double Tdf){
# 66 "draw_dir_hp.c"
long i, acc=0;
int err;
double *delta, *nu;
set_params(z0, SIGMA, lo, hi, nobs, sumlogpi, Tdf);
nu= NU+1-lo;
delta=dvector(1, dim);
nu2d(delta, nu);
err=MH(delta, dim, Tdf, &acc, delta_logpost, 0);
if(err){
fprintf((_impure_ptr->_stderr), "trouble maximizing delta_logpost in draw_dir_hp\n");
exit(0);}
if(acc) d2nu(delta, nu);
free_dvector(delta, 1, dim);
return acc;
}
double post_dir_hp(double *NUSTAR, double nobs, long lo, long hi,
double *sumlogpi, double z0, double SIGMA,
double Tdf, long niter, long logscale){
double *dstar, *nustar, *pi, **J, tmp, ans;
long i, j, burn, err=0;
set_params(z0, SIGMA, lo, hi, nobs, sumlogpi, Tdf);
nustar=NUSTAR+1-lo;
burn=niter/100;
dstar=dvector(1, dim);
nu2d(dstar, nustar);
ans=delta_logpost(dstar, ((void *)0), ((void *)0), 0);
free_dvector(dstar, 1, dim);
return;
# 130 "draw_dir_hp.c"
}
double guess_dhp_rough(double **x, double *pi, long nobs, long dim,
double *suf){
# 143 "draw_dir_hp.c"
double *var, tmp_alpha, alpha;
long i, j;
var=dvector(1, dim);
for(j=1; j<=dim; ++j){
pi[j]=suf[j]=var[j]=0;
for(i=1; i<=nobs; ++i){
var[j]+= x[i][j]*x[i][j];
pi[j]+= x[i][j];
suf[j]+= log(x[i][j]);}}
for(j=1; j<=dim; ++j) pi[j]/=nobs;
for(j=1; j<=dim; ++j) var[j] = (var[j]- nobs*pi[j]*pi[j])/(nobs-1);
for(j=1, alpha=0; j<=dim; ++j){
tmp_alpha = (var[j]>0? pi[j]*(1-pi[j])/var[j] : 0);
alpha+= tmp_alpha;}
alpha/=dim;
if(alpha>1) alpha-= 1.0;
free_dvector(var, 1, dim);
return alpha;
}
double delta_logpost(double *delta, double *g, double **h, int lev){
double **J, ***crosshess, ans, alpha, tmp, sigsq, *nu, phi;
long i;
nu=dvector(1, dim);
pi=dvector(1, dim);
d2nu(delta, nu);
alpha=exp(delta[dim]);
for(i=1; i<=dim; ++i) pi[i]=nu[i]/alpha;
ans=dirichlet_loglike(nu, suf, n, 1, dim, g, h, lev, 1);
if(lev>0) J=fill_jacobian(alpha, pi);
if(lev>1) crosshess=fill_crosshess(alpha, pi, J);
transform_derivs(g, h, J, crosshess, 1, dim, lev);
tmp=z+alpha;
ans += delta[dim] + log(z)-2*log(tmp);
if(lev>0){
g[dim]+= 1-2*alpha/tmp;
if(lev>1) h[dim][dim]-= 2*z*alpha/(tmp*tmp);}
sigsq=sigma*sigma;
for(i=1; i<dim; ++i){
ans+= dnorm4(delta[i], 0, sigma, 1);
if(lev>0) g[i]-= delta[i]/sigsq;
if(lev>1) h[i][i]-= 1.0/sigsq;}
if(lev>1) free_crosshess(crosshess);
if(lev>0) free_dmatrix(J, 1, dim, 1, dim);
free_dvector(nu, 1, dim);
free_dvector(pi, 1, dim);
return ans;
}
void d2nu(double *delta, double *nu){
double alpha, sum;
long i, j;
alpha=exp(delta[dim]);
for(i=1, sum=1.0; i<dim; ++i) sum+= exp(delta[i]);
for(i=1; i<dim; ++i) nu[i]= alpha*exp(delta[i])/sum;
nu[dim]= alpha/sum;
}
double nu2d(double *delta, double *nu){
double alpha, sum, tmp;
long i;
tmp=log(nu[dim]);
for(i=1, alpha=0; i<dim; ++i){
alpha+=nu[i];
delta[i]=log(nu[i])-tmp;}
alpha+= nu[dim];
delta[dim]=log(alpha);
return alpha;
}
double ***fill_crosshess(double alpha, double *pi, double **J){
# 234 "draw_dir_hp.c"
double ***ans;
long i, j, k, p;
p=dim;
ans= (double ***) malloc((1+dim)*sizeof(double**));
for(i=1; i<=dim; ++i) ans[i]=dmatrix(1, dim, 1, dim);
for(i=1; i<=dim;++i){
for(j=1; j<=dim; ++j){
for(k=1; k<=dim; ++k){
if(j==p) ans[i][j][k] = J[i][k];
else{
ans[i][j][k] = (((j)==(k))?1:0)*J[i][j];
ans[i][j][k]-= J[i][j]*pi[k];
ans[i][j][k]-= J[i][k]*pi[j];
ans[i][j][k]+= (((i)==(p))?1:0)*alpha*pi[j]*pi[k];}}}}
return ans;
}
void free_crosshess(double ***ch){
long i;
for(i=1; i<=dim; ++i) free_dmatrix(ch[i], 1, dim, 1, dim);
free(ch);}
double **fill_jacobian(double alpha, double *pi){
long i, j, p;
double **J;
p=dim;
J=dmatrix(1, dim, 1, dim);
for(i=1; i<=dim; ++i){
for(j=1; j<=dim; ++j){
if(i==dim) J[i][j]=alpha*pi[j];
else J[i][j] = alpha *((((i)==(j))?1:0)*pi[i]-pi[i]*pi[j]);}}
return J;
}
void set_params(double z0, double SIGMA, long lo, long hi,
double nobs, double *sumlogpi, double Tdf){
dim=hi-lo+1;
n=nobs;
z=z0;
sigma=SIGMA;
suf=sumlogpi+1-lo;
TDF=Tdf;
}
double draw_alpha(double alpha){
double x1, x2, mean, ivar, lalpha, num, denom, cand, sd;
lalpha=log(alpha);
x1=lalpha, x2=x1*(1.1);
max_1d(x1, x2, &mean, 1.0e-5, gh_alpha);
gh_alpha(mean, &x1, &ivar, 2);
ivar*= (-1);
sd=sqrt(1.0/ivar);
cand = TDF>0?rstudent(mean, sd, TDF) : rnorm(mean,sd);
num= gh_alpha(cand, &x1, &x2, 0)-gh_alpha(lalpha, &x1, &x2, 0);
if(TDF>0){
denom = dstudent(cand, mean, sd, TDF, 1);
denom-=dstudent(lalpha, mean, sd, TDF, 1);
} else{
denom= dnorm4(cand, mean, sd, 1);
denom-= dnorm4(lalpha, mean, sd, 1);
}
if(log(runif(0,1))<= num-denom){
return exp(cand);
}else{
return alpha;
}
}
double gh_alpha(double logalpha, double *d1, double *d2, int lev){
double loglike, alpha;
long i;
alpha=exp(logalpha);
loglike=n*gammln(alpha)+ log(z)-2*log(alpha+z) + logalpha;
if(lev>=1){
*d1= n*psi(alpha, 0) + 1/alpha - 2/(alpha+z);
if(lev>=2) *d2= n*psi(alpha, 1) -1/(alpha*alpha) + 2/pow(alpha+z, 2);}
for(i=1; i<=dim; ++i){
loglike+= suf[i]*(alpha*pi[i]-1) -n*gammln(alpha*pi[i]);
if(lev>=1){
(*d1) += pi[i]*(suf[i] - n*psi(alpha*pi[i], 0));
if(lev>=2) (*d2) -= n*psi(alpha*pi[i], 1)*pi[i]*pi[i];}}
if(lev>=1){
(*d1)*=alpha;
if(lev>=2) (*d2)=(*d2)*alpha*alpha + (*d1);
}
return loglike;
}
int draw_pi(double *pi){
double *mean, *cand, *grad, **ivar, **var, *delta, num, sum;
double denom, ldsi;
long i, err=0, j, dimm=dim-1;
# 349 "draw_dir_hp.c"
mean=dvector(1, dimm);
cand=dvector(1, dimm);
grad=dvector(1, dimm);
delta=dvector(1, dimm);
ivar=dmatrix(1, dimm, 1, dimm);
var=dmatrix(1, dimm, 1, dimm);
for(i=1; i<=dimm; ++i) mean[i]=delta[i]=log(pi[i]/pi[dim]);
max_nd(mean, grad, ivar, dimm, &err, 1.0e-2, 1.0e-2, gh_delta,
0, (_impure_ptr->_stdout));
for(i=1; i<=dimm; ++i) for(j=1; j<=dimm; ++j) ivar[i][j]*= -1;
nr_inverse(ivar, dimm, var);
if(TDF>0) rmvt2(cand, 1, dimm, var, mean, TDF);
else rmvn2(cand, 1, dimm, var, mean);
num=gh_delta(cand, grad, var, 0)-gh_delta(delta, grad, var, 0);
ldsi=logdet(ivar, 1, dimm);
if(TDF>0){
denom= dmvt(cand, mean, ivar, &ldsi, TDF, 1, dimm, 1);
denom-= dmvt(delta, mean, ivar, &ldsi, TDF, 1, dimm, 1);
}else{
denom= dmvn(cand, mean, ivar, &ldsi, 1, dimm, 1);
denom-=dmvn(delta, mean, ivar, &ldsi, 1, dimm, 1);
}
if(log(runif(0,1))<num-denom){
for(i=1, sum=1.0; i<=dimm; ++i){
pi[i]=exp(cand[i]);
sum+=pi[i];}
pi[dim]=1.0;
for(i=1; i<=dim; ++i) pi[i]/=sum;
}
free_dvector(mean, 1, dimm);
free_dvector(cand, 1, dimm);
free_dvector(grad, 1, dimm);
free_dvector(delta, 1, dimm);
free_dmatrix(var, 1, dimm, 1, dimm);
free_dmatrix(ivar, 1, dimm, 1, dimm);
return err;
}
# 405 "draw_dir_hp.c"
double gh_delta(double *d, double *grad, double **hess, int lev){
double *pi, *g, **h, sum, ans, sigsq;
long i, j, dimm=dim-1, r, s;
sigsq=sigma*sigma;
pi=dvector(1, dim);
if(lev>=1){
g=dvector(1, dim);
if(lev >=2) h=dmatrix(1, dim, 1, dim);}
for(i=1, sum=1.0; i<=dimm; ++i){
pi[i]=exp(d[i]);
sum+=pi[i];}
pi[dim]=1.0;
for(i=1; i<=dim; ++i) pi[i]/=sum;
ans= n*gammln(alpha);
for(i=1; i<=dim; ++i){
ans+= (alpha*pi[i]-1)*suf[i] - n*gammln(alpha*pi[i]);
if(lev>=1){
g[i]= -n*alpha*psi(alpha*pi[i], 0) + alpha*suf[i];
if(lev>=2){
for(j=1; j<=dim; ++j){
h[i][j]=(i==j? -n*alpha*alpha*psi(alpha*pi[i], 1):0);}}}}
if(lev>=1){
for(i=1; i<=dimm; ++i){
grad[i]=0;
for(j=1; j<=dim; ++j){
grad[i]+=(((i)==(j)? pi[i]:0) -pi[i]*pi[j])*g[j];}}
if(lev>=2){
for(i=1; i<=dimm; ++i){
for(j=1; j<=dimm; ++j){
hess[i][j]=0;
for(r=1; r<=dim; ++r){
for(s=1; s<=dim; ++s){
hess[i][j]+= (((i)==(r)? pi[i]:0) -pi[i]*pi[r])*
(h[r][s]*(((j)==(s)? pi[j]:0) -pi[j]*pi[s]) + g[s]*(((((j)==(s))?1:0)*((((r)==(s))?1:0)*pi[r] - pi[r]*pi[s]))-( pi[s]*((((j)==(r))?1:0)*pi[j] - pi[j]*pi[r])+((((r)==(s))?1:0)*pi[r] - pi[r]*pi[s])*pi[j])));}}}}}}
for(i=1; i<=dimm; ++i){
ans+= -0.5*d[i]*d[i]/sigsq;
if(lev>=1){
grad[i]+= -d[i]/sigsq;
if(lev>=2) for(j=1; j<=dimm; ++j) hess[i][j] -= (((i)==(j))?1:0)/sigsq;}}
free_dvector(pi, 1, dim);
if(lev>=1){
free_dvector(g, 1, dim);
if(lev>=2) free_dmatrix(h, 1, dim, 1, dim);}
return ans;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-13 6:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-13 6:51 optimization/10763: -O2 flag causes internal error steven
-- strict thread matches above, loose matches on Subject: below --
2003-05-13 5:26 Dara Hazeghi
2003-05-13 2:26 sls
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).