// /usr/libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1 -quiet util_dp_sim.c -quiet -dumpbase util_dp_sim.c -march=pentium4 -mmmx -msse -msse2 -msse3 -auxbase-strip util_dp_sim.o -O3 -o - -frandom-seed=0 # 1 "util_dp_sim.c" # 1 "" # 1 "" # 1 "util_dp_sim.c" # 1 "/usr/include/stdio.h" 1 3 4 # 28 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 309 "/usr/include/features.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 310 "/usr/include/features.h" 2 3 4 # 332 "/usr/include/features.h" 3 4 # 1 "/usr/include/gnu/stubs.h" 1 3 4 # 333 "/usr/include/features.h" 2 3 4 # 29 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 213 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 3 4 typedef unsigned int size_t; # 35 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types.h" 1 3 4 # 28 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/bits/types.h" 2 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 32 "/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; # 129 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/typesizes.h" 1 3 4 # 130 "/usr/include/bits/types.h" 2 3 4 __extension__ typedef __u_quad_t __dev_t; __extension__ typedef unsigned int __uid_t; __extension__ typedef unsigned int __gid_t; __extension__ typedef unsigned long int __ino_t; __extension__ typedef __u_quad_t __ino64_t; __extension__ typedef unsigned int __mode_t; __extension__ typedef unsigned int __nlink_t; __extension__ typedef long int __off_t; __extension__ typedef __quad_t __off64_t; __extension__ typedef int __pid_t; __extension__ typedef struct { int __val[2]; } __fsid_t; __extension__ typedef long int __clock_t; __extension__ typedef unsigned long int __rlim_t; __extension__ typedef __u_quad_t __rlim64_t; __extension__ typedef unsigned int __id_t; __extension__ typedef long int __time_t; __extension__ typedef unsigned int __useconds_t; __extension__ typedef long int __suseconds_t; __extension__ typedef int __daddr_t; __extension__ typedef long int __swblk_t; __extension__ typedef int __key_t; __extension__ typedef int __clockid_t; __extension__ typedef int __timer_t; __extension__ typedef long int __blksize_t; __extension__ typedef long int __blkcnt_t; __extension__ typedef __quad_t __blkcnt64_t; __extension__ typedef unsigned long int __fsblkcnt_t; __extension__ typedef __u_quad_t __fsblkcnt64_t; __extension__ typedef unsigned long int __fsfilcnt_t; __extension__ typedef __u_quad_t __fsfilcnt64_t; __extension__ typedef int __ssize_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; __extension__ typedef int __intptr_t; __extension__ typedef unsigned int __socklen_t; # 37 "/usr/include/stdio.h" 2 3 4 typedef struct _IO_FILE FILE; # 62 "/usr/include/stdio.h" 3 4 typedef struct _IO_FILE __FILE; # 72 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/libio.h" 1 3 4 # 32 "/usr/include/libio.h" 3 4 # 1 "/usr/include/_G_config.h" 1 3 4 # 14 "/usr/include/_G_config.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 325 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 3 4 typedef long int wchar_t; # 354 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 3 4 typedef unsigned int wint_t; # 15 "/usr/include/_G_config.h" 2 3 4 # 24 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 48 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 49 "/usr/include/wchar.h" 2 3 4 # 1 "/usr/include/bits/wchar.h" 1 3 4 # 51 "/usr/include/wchar.h" 2 3 4 # 76 "/usr/include/wchar.h" 3 4 typedef struct { int __count; union { wint_t __wch; char __wchb[4]; } __value; } __mbstate_t; # 25 "/usr/include/_G_config.h" 2 3 4 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 44 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/gconv.h" 1 3 4 # 28 "/usr/include/gconv.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 48 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 49 "/usr/include/wchar.h" 2 3 4 # 29 "/usr/include/gconv.h" 2 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 32 "/usr/include/gconv.h" 2 3 4 enum { __GCONV_OK = 0, __GCONV_NOCONV, __GCONV_NODB, __GCONV_NOMEM, __GCONV_EMPTY_INPUT, __GCONV_FULL_OUTPUT, __GCONV_ILLEGAL_INPUT, __GCONV_INCOMPLETE_INPUT, __GCONV_ILLEGAL_DESCRIPTOR, __GCONV_INTERNAL_ERROR }; enum { __GCONV_IS_LAST = 0x0001, __GCONV_IGNORE_ERRORS = 0x0002 }; struct __gconv_step; struct __gconv_step_data; struct __gconv_loaded_object; struct __gconv_trans_data; typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *, int, int); typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); typedef int (*__gconv_init_fct) (struct __gconv_step *); typedef void (*__gconv_end_fct) (struct __gconv_step *); typedef int (*__gconv_trans_fct) (struct __gconv_step *, struct __gconv_step_data *, void *, __const unsigned char *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *); typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, __const unsigned char *, unsigned char *, unsigned char *); typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, size_t *); typedef int (*__gconv_trans_init_fct) (void **, const char *); typedef void (*__gconv_trans_end_fct) (void *); struct __gconv_trans_data { __gconv_trans_fct __trans_fct; __gconv_trans_context_fct __trans_context_fct; __gconv_trans_end_fct __trans_end_fct; void *__data; struct __gconv_trans_data *__next; }; struct __gconv_step { struct __gconv_loaded_object *__shlib_handle; __const char *__modname; int __counter; char *__from_name; char *__to_name; __gconv_fct __fct; __gconv_btowc_fct __btowc_fct; __gconv_init_fct __init_fct; __gconv_end_fct __end_fct; int __min_needed_from; int __max_needed_from; int __min_needed_to; int __max_needed_to; int __stateful; void *__data; }; struct __gconv_step_data { unsigned char *__outbuf; unsigned char *__outbufend; int __flags; int __invocation_counter; int __internal_use; __mbstate_t *__statep; __mbstate_t __state; struct __gconv_trans_data *__trans; }; typedef struct __gconv_info { size_t __nsteps; struct __gconv_step *__steps; __extension__ struct __gconv_step_data __data []; } *__gconv_t; # 45 "/usr/include/_G_config.h" 2 3 4 typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); # 33 "/usr/include/libio.h" 2 3 4 # 53 "/usr/include/libio.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 1 3 4 # 43 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 54 "/usr/include/libio.h" 2 3 4 # 166 "/usr/include/libio.h" 3 4 struct _IO_jump_t; struct _IO_FILE; # 176 "/usr/include/libio.h" 3 4 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 199 "/usr/include/libio.h" 3 4 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 267 "/usr/include/libio.h" 3 4 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 315 "/usr/include/libio.h" 3 4 __off64_t _offset; void *__pad1; void *__pad2; int _mode; char _unused2[15 * sizeof (int) - 2 * sizeof (void *)]; }; typedef struct _IO_FILE _IO_FILE; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 354 "/usr/include/libio.h" 3 4 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); # 406 "/usr/include/libio.h" 3 4 extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__)); extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__)); # 444 "/usr/include/libio.h" 3 4 extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); # 474 "/usr/include/libio.h" 3 4 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict) __attribute__ ((__nothrow__)); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list) __attribute__ ((__nothrow__)); extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__)); extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__)); extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__)); extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__)); extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); # 73 "/usr/include/stdio.h" 2 3 4 # 86 "/usr/include/stdio.h" 3 4 typedef _G_fpos_t fpos_t; # 138 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 139 "/usr/include/stdio.h" 2 3 4 extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); extern FILE *tmpfile (void); # 178 "/usr/include/stdio.h" 3 4 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)); extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)); # 196 "/usr/include/stdio.h" 3 4 extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 221 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 235 "/usr/include/stdio.h" 3 4 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes); extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream); # 262 "/usr/include/stdio.h" 3 4 # 273 "/usr/include/stdio.h" 3 4 extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)); # 294 "/usr/include/stdio.h" 3 4 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int printf (__const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); # 388 "/usr/include/stdio.h" 3 4 extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int scanf (__const char *__restrict __format, ...); extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); # 430 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); # 454 "/usr/include/stdio.h" 3 4 extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 465 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 498 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream); extern char *gets (char *__s); # 578 "/usr/include/stdio.h" 3 4 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); extern int puts (__const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); # 631 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream); extern void rewind (FILE *__stream); # 686 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, __const fpos_t *__pos); # 709 "/usr/include/stdio.h" 3 4 # 718 "/usr/include/stdio.h" 3 4 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__)); extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)); extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern void perror (__const char *__s); # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 # 27 "/usr/include/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern __const char *__const sys_errlist[]; # 748 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)); extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); # 767 "/usr/include/stdio.h" 3 4 extern FILE *popen (__const char *__command, __const char *__modes); extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); # 807 "/usr/include/stdio.h" 3 4 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); # 828 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio.h" 1 3 4 # 33 "/usr/include/bits/stdio.h" 3 4 extern __inline int vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline int getchar (void) { return _IO_getc (stdin); } extern __inline int getc_unlocked (FILE *__fp) { return (__builtin_expect ((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end, 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getchar_unlocked (void) { return (__builtin_expect ((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end, 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline int putchar (int __c) { return _IO_putc (__c, stdout); } extern __inline int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect ((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end, 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect ((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end, 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putchar_unlocked (int __c) { return (__builtin_expect ((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end, 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } # 111 "/usr/include/bits/stdio.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x10) != 0); } extern __inline int __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x20) != 0); } # 829 "/usr/include/stdio.h" 2 3 4 # 2 "util_dp_sim.c" 2 # 1 "/usr/include/math.h" 1 3 4 # 29 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/huge_val.h" 1 3 4 # 34 "/usr/include/math.h" 2 3 4 # 46 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathdef.h" 1 3 4 # 47 "/usr/include/math.h" 2 3 4 # 70 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern double acos (double __x) __attribute__ ((__nothrow__)); extern double __acos (double __x) __attribute__ ((__nothrow__)); extern double asin (double __x) __attribute__ ((__nothrow__)); extern double __asin (double __x) __attribute__ ((__nothrow__)); extern double atan (double __x) __attribute__ ((__nothrow__)); extern double __atan (double __x) __attribute__ ((__nothrow__)); extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double cos (double __x) __attribute__ ((__nothrow__)); extern double __cos (double __x) __attribute__ ((__nothrow__)); extern double sin (double __x) __attribute__ ((__nothrow__)); extern double __sin (double __x) __attribute__ ((__nothrow__)); extern double tan (double __x) __attribute__ ((__nothrow__)); extern double __tan (double __x) __attribute__ ((__nothrow__)); extern double cosh (double __x) __attribute__ ((__nothrow__)); extern double __cosh (double __x) __attribute__ ((__nothrow__)); extern double sinh (double __x) __attribute__ ((__nothrow__)); extern double __sinh (double __x) __attribute__ ((__nothrow__)); extern double tanh (double __x) __attribute__ ((__nothrow__)); extern double __tanh (double __x) __attribute__ ((__nothrow__)); # 87 "/usr/include/bits/mathcalls.h" 3 4 extern double acosh (double __x) __attribute__ ((__nothrow__)); extern double __acosh (double __x) __attribute__ ((__nothrow__)); extern double asinh (double __x) __attribute__ ((__nothrow__)); extern double __asinh (double __x) __attribute__ ((__nothrow__)); extern double atanh (double __x) __attribute__ ((__nothrow__)); extern double __atanh (double __x) __attribute__ ((__nothrow__)); extern double exp (double __x) __attribute__ ((__nothrow__)); extern double __exp (double __x) __attribute__ ((__nothrow__)); extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double log (double __x) __attribute__ ((__nothrow__)); extern double __log (double __x) __attribute__ ((__nothrow__)); extern double log10 (double __x) __attribute__ ((__nothrow__)); extern double __log10 (double __x) __attribute__ ((__nothrow__)); extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); # 127 "/usr/include/bits/mathcalls.h" 3 4 extern double expm1 (double __x) __attribute__ ((__nothrow__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__)); extern double log1p (double __x) __attribute__ ((__nothrow__)); extern double __log1p (double __x) __attribute__ ((__nothrow__)); extern double logb (double __x) __attribute__ ((__nothrow__)); extern double __logb (double __x) __attribute__ ((__nothrow__)); # 152 "/usr/include/bits/mathcalls.h" 3 4 extern double pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double sqrt (double __x) __attribute__ ((__nothrow__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__)); extern double hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double cbrt (double __x) __attribute__ ((__nothrow__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__)); extern double ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern int __isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double significand (double __x) __attribute__ ((__nothrow__)); extern double __significand (double __x) __attribute__ ((__nothrow__)); extern double copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 231 "/usr/include/bits/mathcalls.h" 3 4 extern int __isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double j0 (double) __attribute__ ((__nothrow__)); extern double __j0 (double) __attribute__ ((__nothrow__)); extern double j1 (double) __attribute__ ((__nothrow__)); extern double __j1 (double) __attribute__ ((__nothrow__)); extern double jn (int, double) __attribute__ ((__nothrow__)); extern double __jn (int, double) __attribute__ ((__nothrow__)); extern double y0 (double) __attribute__ ((__nothrow__)); extern double __y0 (double) __attribute__ ((__nothrow__)); extern double y1 (double) __attribute__ ((__nothrow__)); extern double __y1 (double) __attribute__ ((__nothrow__)); extern double yn (int, double) __attribute__ ((__nothrow__)); extern double __yn (int, double) __attribute__ ((__nothrow__)); extern double erf (double) __attribute__ ((__nothrow__)); extern double __erf (double) __attribute__ ((__nothrow__)); extern double erfc (double) __attribute__ ((__nothrow__)); extern double __erfc (double) __attribute__ ((__nothrow__)); extern double lgamma (double) __attribute__ ((__nothrow__)); extern double __lgamma (double) __attribute__ ((__nothrow__)); # 265 "/usr/include/bits/mathcalls.h" 3 4 extern double gamma (double) __attribute__ ((__nothrow__)); extern double __gamma (double) __attribute__ ((__nothrow__)); extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double rint (double __x) __attribute__ ((__nothrow__)); extern double __rint (double __x) __attribute__ ((__nothrow__)); extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern int ilogb (double __x) __attribute__ ((__nothrow__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__)); # 71 "/usr/include/math.h" 2 3 4 # 93 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern float acosf (float __x) __attribute__ ((__nothrow__)); extern float __acosf (float __x) __attribute__ ((__nothrow__)); extern float asinf (float __x) __attribute__ ((__nothrow__)); extern float __asinf (float __x) __attribute__ ((__nothrow__)); extern float atanf (float __x) __attribute__ ((__nothrow__)); extern float __atanf (float __x) __attribute__ ((__nothrow__)); extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float cosf (float __x) __attribute__ ((__nothrow__)); extern float __cosf (float __x) __attribute__ ((__nothrow__)); extern float sinf (float __x) __attribute__ ((__nothrow__)); extern float __sinf (float __x) __attribute__ ((__nothrow__)); extern float tanf (float __x) __attribute__ ((__nothrow__)); extern float __tanf (float __x) __attribute__ ((__nothrow__)); extern float coshf (float __x) __attribute__ ((__nothrow__)); extern float __coshf (float __x) __attribute__ ((__nothrow__)); extern float sinhf (float __x) __attribute__ ((__nothrow__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__)); extern float tanhf (float __x) __attribute__ ((__nothrow__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__)); # 87 "/usr/include/bits/mathcalls.h" 3 4 extern float acoshf (float __x) __attribute__ ((__nothrow__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__)); extern float asinhf (float __x) __attribute__ ((__nothrow__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__)); extern float atanhf (float __x) __attribute__ ((__nothrow__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__)); extern float expf (float __x) __attribute__ ((__nothrow__)); extern float __expf (float __x) __attribute__ ((__nothrow__)); extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float logf (float __x) __attribute__ ((__nothrow__)); extern float __logf (float __x) __attribute__ ((__nothrow__)); extern float log10f (float __x) __attribute__ ((__nothrow__)); extern float __log10f (float __x) __attribute__ ((__nothrow__)); extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); # 127 "/usr/include/bits/mathcalls.h" 3 4 extern float expm1f (float __x) __attribute__ ((__nothrow__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__)); extern float log1pf (float __x) __attribute__ ((__nothrow__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__)); extern float logbf (float __x) __attribute__ ((__nothrow__)); extern float __logbf (float __x) __attribute__ ((__nothrow__)); # 152 "/usr/include/bits/mathcalls.h" 3 4 extern float powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float sqrtf (float __x) __attribute__ ((__nothrow__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__)); extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float cbrtf (float __x) __attribute__ ((__nothrow__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__)); extern float ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern int __isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float significandf (float __x) __attribute__ ((__nothrow__)); extern float __significandf (float __x) __attribute__ ((__nothrow__)); extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 231 "/usr/include/bits/mathcalls.h" 3 4 extern int __isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float j0f (float) __attribute__ ((__nothrow__)); extern float __j0f (float) __attribute__ ((__nothrow__)); extern float j1f (float) __attribute__ ((__nothrow__)); extern float __j1f (float) __attribute__ ((__nothrow__)); extern float jnf (int, float) __attribute__ ((__nothrow__)); extern float __jnf (int, float) __attribute__ ((__nothrow__)); extern float y0f (float) __attribute__ ((__nothrow__)); extern float __y0f (float) __attribute__ ((__nothrow__)); extern float y1f (float) __attribute__ ((__nothrow__)); extern float __y1f (float) __attribute__ ((__nothrow__)); extern float ynf (int, float) __attribute__ ((__nothrow__)); extern float __ynf (int, float) __attribute__ ((__nothrow__)); extern float erff (float) __attribute__ ((__nothrow__)); extern float __erff (float) __attribute__ ((__nothrow__)); extern float erfcf (float) __attribute__ ((__nothrow__)); extern float __erfcf (float) __attribute__ ((__nothrow__)); extern float lgammaf (float) __attribute__ ((__nothrow__)); extern float __lgammaf (float) __attribute__ ((__nothrow__)); # 265 "/usr/include/bits/mathcalls.h" 3 4 extern float gammaf (float) __attribute__ ((__nothrow__)); extern float __gammaf (float) __attribute__ ((__nothrow__)); extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float rintf (float __x) __attribute__ ((__nothrow__)); extern float __rintf (float __x) __attribute__ ((__nothrow__)); extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern int ilogbf (float __x) __attribute__ ((__nothrow__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__)); # 94 "/usr/include/math.h" 2 3 4 # 114 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern long double acosl (long double __x) __attribute__ ((__nothrow__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__)); extern long double asinl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__)); extern long double atanl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__)); extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double cosl (long double __x) __attribute__ ((__nothrow__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__)); extern long double sinl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__)); extern long double tanl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__)); extern long double coshl (long double __x) __attribute__ ((__nothrow__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__)); extern long double sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double tanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__)); # 87 "/usr/include/bits/mathcalls.h" 3 4 extern long double acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double expl (long double __x) __attribute__ ((__nothrow__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__)); extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double logl (long double __x) __attribute__ ((__nothrow__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__)); extern long double log10l (long double __x) __attribute__ ((__nothrow__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__)); extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); # 127 "/usr/include/bits/mathcalls.h" 3 4 extern long double expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double logbl (long double __x) __attribute__ ((__nothrow__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__)); # 152 "/usr/include/bits/mathcalls.h" 3 4 extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern int __isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double significandl (long double __x) __attribute__ ((__nothrow__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__)); extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 231 "/usr/include/bits/mathcalls.h" 3 4 extern int __isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double j0l (long double) __attribute__ ((__nothrow__)); extern long double __j0l (long double) __attribute__ ((__nothrow__)); extern long double j1l (long double) __attribute__ ((__nothrow__)); extern long double __j1l (long double) __attribute__ ((__nothrow__)); extern long double jnl (int, long double) __attribute__ ((__nothrow__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__)); extern long double y0l (long double) __attribute__ ((__nothrow__)); extern long double __y0l (long double) __attribute__ ((__nothrow__)); extern long double y1l (long double) __attribute__ ((__nothrow__)); extern long double __y1l (long double) __attribute__ ((__nothrow__)); extern long double ynl (int, long double) __attribute__ ((__nothrow__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__)); extern long double erfl (long double) __attribute__ ((__nothrow__)); extern long double __erfl (long double) __attribute__ ((__nothrow__)); extern long double erfcl (long double) __attribute__ ((__nothrow__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__)); extern long double lgammal (long double) __attribute__ ((__nothrow__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__)); # 265 "/usr/include/bits/mathcalls.h" 3 4 extern long double gammal (long double) __attribute__ ((__nothrow__)); extern long double __gammal (long double) __attribute__ ((__nothrow__)); extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double rintl (long double __x) __attribute__ ((__nothrow__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__)); extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern int ilogbl (long double __x) __attribute__ ((__nothrow__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__)); # 115 "/usr/include/math.h" 2 3 4 # 130 "/usr/include/math.h" 3 4 extern int signgam; # 257 "/usr/include/math.h" 3 4 typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_, _ISOC_ } _LIB_VERSION_TYPE; extern _LIB_VERSION_TYPE _LIB_VERSION; # 282 "/usr/include/math.h" 3 4 struct exception { int type; char *name; double arg1; double arg2; double retval; }; extern int matherr (struct exception *__exc); # 382 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathinline.h" 1 3 4 # 291 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __sgn (double) __attribute__ ((__nothrow__)); extern __inline double __attribute__ ((__nothrow__)) __sgn (double __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } extern __inline float __sgnf (float) __attribute__ ((__nothrow__)); extern __inline float __attribute__ ((__nothrow__)) __sgnf (float __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } extern __inline long double __sgnl (long double) __attribute__ ((__nothrow__)); extern __inline long double __attribute__ ((__nothrow__)) __sgnl (long double __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } # 433 "/usr/include/bits/mathinline.h" 3 4 extern __inline long double __attribute__ ((__nothrow__)) __atan2l (long double __y, long double __x) { return __builtin_atan2l (__y, __x); } # 473 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __attribute__ ((__nothrow__)) fabs (double __x) { return __builtin_fabs (__x); } extern __inline float __attribute__ ((__nothrow__)) fabsf (float __x) { return __builtin_fabsf (__x); } extern __inline long double __attribute__ ((__nothrow__)) fabsl (long double __x) { return __builtin_fabsl (__x); } extern __inline long double __attribute__ ((__nothrow__)) __fabsl (long double __x) { return __builtin_fabsl (__x); } # 506 "/usr/include/bits/mathinline.h" 3 4 extern __inline long double __sgn1l (long double) __attribute__ ((__nothrow__)); extern __inline long double __attribute__ ((__nothrow__)) __sgn1l (long double __x) { __extension__ union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x }; __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; __n.__xi[1] = 0x80000000; __n.__xi[0] = 0; return __n.__xld; } # 530 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __attribute__ ((__nothrow__)) floor (double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline float __attribute__ ((__nothrow__)) floorf (float __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline long double __attribute__ ((__nothrow__)) floorl (long double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } # 541 "/usr/include/bits/mathinline.h" 3 4 extern __inline double __attribute__ ((__nothrow__)) ceil (double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline float __attribute__ ((__nothrow__)) ceilf (float __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline long double __attribute__ ((__nothrow__)) ceill (long double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } # 713 "/usr/include/bits/mathinline.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) __finite (double __x) { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] | 0x800fffffu) + 1) >> 31)); } # 383 "/usr/include/math.h" 2 3 4 # 438 "/usr/include/math.h" 3 4 # 3 "util_dp_sim.c" 2 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 1 3 4 # 105 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; # 4 "util_dp_sim.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 28 "/usr/include/string.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 34 "/usr/include/string.h" 2 3 4 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, __const void *__src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 82 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); # 130 "/usr/include/string.h" 3 4 extern char *strdup (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 165 "/usr/include/string.h" 3 4 extern char *strchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 181 "/usr/include/string.h" 3 4 extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); # 240 "/usr/include/string.h" 3 4 extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 254 "/usr/include/string.h" 3 4 extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); # 281 "/usr/include/string.h" 3 4 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void bcopy (__const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *index (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *rindex (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 325 "/usr/include/string.h" 3 4 extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 348 "/usr/include/string.h" 3 4 extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); # 414 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/string.h" 1 3 4 # 415 "/usr/include/string.h" 2 3 4 # 1 "/usr/include/bits/string2.h" 1 3 4 # 52 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 37 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/endian.h" 1 3 4 # 38 "/usr/include/endian.h" 2 3 4 # 53 "/usr/include/bits/string2.h" 2 3 4 # 394 "/usr/include/bits/string2.h" 3 4 extern void *__rawmemchr (const void *__s, int __c); # 969 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); extern __inline size_t __strcspn_c1 (__const char *__s, int __reject) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject) ++__result; return __result; } extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2); extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) ++__result; return __result; } extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3); extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) ++__result; return __result; } # 1045 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strspn_c1 (__const char *__s, int __accept); extern __inline size_t __strspn_c1 (__const char *__s, int __accept) { register size_t __result = 0; while (__s[__result] == __accept) ++__result; return __result; } extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2); extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) ++__result; return __result; } extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) ++__result; return __result; } # 1121 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, int __accept2); extern __inline char * __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline char * __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } # 1173 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); extern __inline char * __strtok_r_1c (char *__s, char __sep, char **__nextp) { char *__result; if (__s == ((void *)0)) __s = *__nextp; while (*__s == __sep) ++__s; __result = ((void *)0); if (*__s != '\0') { __result = __s++; while (*__s != '\0') if (*__s++ == __sep) { __s[-1] = '\0'; break; } *__nextp = __s; } return __result; } # 1205 "/usr/include/bits/string2.h" 3 4 extern char *__strsep_g (char **__stringp, __const char *__delim); # 1223 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strsep_1c (char **__s, char __reject); extern __inline char * __strsep_1c (char **__s, char __reject) { register char *__retval = *__s; if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) *(*__s)++ = '\0'; return __retval; } extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); extern __inline char * __strsep_2c (char **__s, char __reject1, char __reject2) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3); extern __inline char * __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } # 1299 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/stdlib.h" 1 3 4 # 33 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stddef.h" 1 3 4 # 34 "/usr/include/stdlib.h" 2 3 4 # 582 "/usr/include/stdlib.h" 3 4 extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 961 "/usr/include/stdlib.h" 3 4 # 1300 "/usr/include/bits/string2.h" 2 3 4 extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 1323 "/usr/include/bits/string2.h" 3 4 extern char *__strndup (__const char *__string, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 418 "/usr/include/string.h" 2 3 4 # 426 "/usr/include/string.h" 3 4 # 5 "util_dp_sim.c" 2 # 1 "io_lib_header.h" 1 typedef struct { char *mode; char *comments; int nseq; char **seq_name; float **PW_SD; float **PW_ID; float *SEQ_W; }Weights; typedef struct { int **list; int tot_list; int **stem; int tot_stem; int n_fields; int nseq; int *len; int ***struc; struct Sequence *S; }Structure; struct Sequence { char **file; char **seq_comment; char **aln_comment; char **seq; int *len; int max_len; int min_len; int nseq; int max_nseq; char **name; struct Constraint_list *CL; int contains_gap; char *type; Weights *W; char template_file[100]; struct Template **T; }; typedef struct Sequence Sequence; struct Template { char seq_type[10]; struct X_template *P; struct X_template *S; struct X_template *R; struct X_template *G; struct X_template *RB; }; typedef struct Template Template; struct X_template { char seq_name[100]; char template_type[100]; char template_name[100]; char template_file[100]; struct P_template *VP; struct S_template *VS; struct R_template *VR; struct G_template *VG; struct R_template *VRB; }; typedef struct X_template X_template; struct P_template { char pdb_id[100]; char public_pdb; }; typedef struct P_template P_template; struct S_template { Sequence *S; }; typedef struct S_template S_template; struct R_template { struct Alignment *A; }; typedef struct R_template R_template; struct G_template { Sequence *S; }; typedef struct G_template G_template; typedef struct { int max_len; int alp_size; char *alphabet; int **count3; int **count; int **count2; }Profile; struct Alignment { int max_len; int min_len; int * len; int declared_len; int max_n_seq; int nseq; int len_aln; char **file; char **seq_comment; char **aln_comment; char **name; char **expanded_order; char **tree_order; char **seq_al; int **order; Profile *P; Sequence *S; struct Dp_Result *Dp_result; struct Constraint_list *CL; int **seq_cache; int **cdna_cache; int * score_seq; int ** score_res; int score_aln; int score; int cpu; int finished; int output_res_num; int residue_case; int expand; int used; int num; int **pos; struct Alignment * A; int random_tag; }; typedef struct Alignment Alignment; typedef struct { int in_seq; FILE *fp; int font; int x0; int y0; int x; int y; int n_pages; int max_line_ppage; int n_line; int line; int eop; int in_html_span; char previous_html_color[100]; } FILE_format; typedef struct { float r; float g; float b; char html_color[30]; char html_color_class[30]; int ascii_value; } Color; Sequence * fill_sequence_struc ( int nseq, char **sequences, char **seq_name); Sequence * cw_read_sequences ( char *seq_name); Sequence * get_sequence_type (Sequence *S); Alignment* get_aln_type (Alignment *A); char * get_string_type (char *string); void get_sequence (char *seq_file,int *NSEQ, char ***SEQ, char ***SN, int **sl, int *min, int *max); int ** get_matrix ( char *name, char *format); int ** read_matrice (char *mat_name); int **neg_matrix2pos_matrix ( int **matrix); void print_aln ( Alignment *B); int output_reliability_ps ( Alignment *B,Alignment *S, char *name); int output_reliability_pdf ( Alignment *B,Alignment *S, char *name); int output_reliability_html ( Alignment *B,Alignment *S, char *name); int output_color_ps ( Alignment *B,Alignment *S, char *name); int output_color_pdf ( Alignment *B,Alignment *S, char *name); int output_color_html ( Alignment *B,Alignment *S, char *name); void get_rgb_values(int val, Color *C); int output_reliability_format ( Alignment *B,Alignment *S, char *name, FILE_format *(*vfopen_format) ( char *),FILE_format *(*print_format_string) ( char * ,Color *, Color *, FILE_format*),FILE_format *(*print_format_char) ( int ,Color *, Color *, FILE_format*),void (*get_rgb_values_format) ( int ,Color *),FILE_format* (*vfclose_format) ( FILE_format *)); int output_score_format ( Alignment *B,Alignment *S, char *name, FILE_format *(*vfopen_format) ( char *),FILE_format *(*print_format_string) ( char * ,Color *, Color *, FILE_format*),FILE_format *(*print_format_char) ( int ,Color *, Color *, FILE_format*),void (*get_rgb_values_format) ( int ,Color *),FILE_format* (*vfclose_format) ( FILE_format *)); FILE_format * print_ps_string ( char *s , Color *box, Color *ink, FILE_format *f); FILE_format * print_ps_char ( int c, Color *box, Color *ink, FILE_format *f); void get_rgb_values_ps ( int val, Color *C); FILE_format* vfopen_ps ( char *name); FILE_format* vfclose_ps ( FILE_format *fps); FILE_format *print_html_string( char *s, Color *box, Color *ink, FILE_format *fhtml); FILE_format * print_html_char ( int c, Color *box, Color *ink, FILE_format *f); void get_rgb_values_html ( int val, Color *C); FILE_format* vfopen_html ( char *name); FILE_format* vfclose_html ( FILE_format *fhtml); int output_reliability_ascii ( Alignment *B,Alignment *S, char *name); int output_color_ascii ( Alignment *B,Alignment *S, char *name); FILE_format *print_ascii_string( char *s, Color *box, Color *ink, FILE_format *fascii); FILE_format * print_ascii_char ( int c, Color *box, Color *ink, FILE_format *f); void get_rgb_values_ascii ( int val, Color *C); FILE_format* vfopen_ascii ( char *name); FILE_format* vfclose_ascii ( FILE_format *fascii); int output_seq_reliability_ascii ( Alignment *B,Alignment *S, char *name); # 366 "io_lib_header.h" typedef struct node { struct node *left; struct node *right; struct node *parent; float dist; int leaf; int order; char name[64]; } stree, *treeptr; typedef struct tnode *NT_node; typedef struct tnode{ int visited; char *name; NT_node parent; NT_node left; NT_node right; NT_node bot; int isseq; int seq; int maxnseq; int nseq; int *lseq; int *lseq2; float dist; float bootstrap; float dp; int order; int leaf; int node; int group; float score; }Treenode; NT_node main_prune_tree ( NT_node T, Sequence *S); int prune_tree ( NT_node T, Sequence *S); char *tree2Ngroup (Alignment *A, NT_node T, int max_n, char *fname, char *mat4dist); int tree2group_file ( NT_node T,Sequence *S, int maxnseq, int minsim, char *name); NT_node seq2dpa_tree (Sequence *S, char *align_mode); NT_node tree2dpa_tree (NT_node T, Alignment *A, char *matrix4distance); FILE * tree2group ( NT_node T,Sequence *S,int maxnseq, int mindist,char *name, FILE *fp); NT_node tree2collapsed_tree (NT_node T, int n, char **string); NT_node main_compare_trees ( NT_node T1, NT_node T2, FILE *fp); float compare_trees ( NT_node T1, NT_node T2, int nseq, int mode); float search_node ( NT_node B, NT_node T, int nseq, int mode); float evaluate_node_similarity ( NT_node B, NT_node T, int nseq, int mode); int compare_node ( int *b1, int *b2, int n); void display_node (NT_node N, char *string,int nseq); NT_node recode_tree ( NT_node T, Sequence *S); int compare_branch2 ( int *b1, int *b2, int n); NT_node tree_compute ( Alignment *A, int n, char ** arg_list); NT_node aln2fj_tree(NT_node T, Alignment *A, int limit,char* mode); Alignment * filter_aln4tree (Alignment *A, int n,int fg,char* mode); NT_node aln2tree (Alignment *A); NT_node reset_boot_tree ( NT_node R, int n); NT_node reset_dist_tree ( NT_node R, float n); NT_node free_tree ( NT_node R); NT_node realloc_tree( NT_node R, int n); NT_node free_tree_node ( NT_node R); Sequence * tree2seq (NT_node R, Sequence *S); NT_node rename_seq_in_tree ( NT_node R, char ***list); NT_node balance_tree (NT_node); int tree2nseq ( NT_node R); int tree_file2nseq ( char *file); int tree2nleaf ( NT_node R); int tree2nnode ( NT_node R); FILE* display_tree ( NT_node R, int n, FILE *fp); void clear_tree (NT_node T); void display_leaf ( NT_node T); NT_node reroot_tree ( NT_node TREE, NT_node T); NT_node straighten_tree ( NT_node P, NT_node C, float new_dist); NT_node unroot_tree ( NT_node T); FILE* print_tree ( NT_node T,char *format, FILE *fp); FILE * rec_print_tree ( NT_node T, FILE *fp); NT_node find_longest_branch ( NT_node T, NT_node L); NT_node shift_root ( NT_node R); int ** tree2cluster (NT_node T, float thres); int ** make_sub_tree_list ( NT_node **T, int nseq, int n_node); void make_all_sub_tree_list ( NT_node N, int **list, int *n); void make_one_sub_tree_list ( NT_node T, int *list); NT_node main_read_tree(char *treefile); NT_node** simple_read_tree(char *treefile); NT_node** read_tree(char *treefile, int *nnodes,int nseq, char **seq_names); FILE * create_tree(NT_node ptree, NT_node parent,int *numseq,int *ntotal,int *nnodes,NT_node **lu, FILE *fp); NT_node declare_tree_node (int nseq); void set_info(NT_node p, NT_node parent, int pleaf, char *pname, float pdist, float bootstrap); NT_node insert_tree_node(NT_node pptr); FILE * skip_space(FILE *fd); void create_tree_node(NT_node pptr, NT_node parent); float calc_mean(NT_node nptr, float *maxdist, int nseq,NT_node **lu); NT_node insert_root(NT_node p, float diff); float calc_root_mean(NT_node root, float *maxdist, int neq, NT_node **lu); NT_node reroot(NT_node ptree, int nseq, int ntotal, int nnodes, NT_node **lu); # 504 "io_lib_header.h" typedef int Boolean; # 7 "util_dp_sim.c" 2 # 1 "util_lib_header.h" 1 typedef struct { char *name; char *path; char *suffix; } Fname; struct Tmpname { char *name; struct Tmpname *next; }; double dichotomy (double value, double target_value, double middle, double *bottom,double *top); static void exchange(void *a, void *b, size_t size); void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); # 38 "util_lib_header.h" FILE *hsort_file ( FILE *fp ,int n,int len, size_t size,int first_comp_field, int n_comp_fields,int (*compare)(const void *, const void*,int,int,size_t),void * (*copy)(void *,void*,size_t)); void ** hsort_array ( void **ra,int n,int len, size_t size, int first_comp_field, int n_comp_fields,int (*compare)(const void *, const void*,int,int,size_t),void * (*copy)(void *,void*,size_t)); void **hsort_list_array ( void **L, int len, size_t size, int entry_len,int first_comp_field, int n_comp_fields); FILE *hsort_list_file ( FILE *fp, int len, size_t size, int entry_len,int first_comp_field, int n_comp_fields); int hsort_cmp ( const void *a, const void *b, int first, int clen, size_t size); void *hsort_cpy(void*to, void *from, size_t size); void test_hsort_list_array(); void * bsearch_file ( const void *key,int *p,int comp_first,int comp_len, FILE *fp ,int len, int entry_len,size_t el_size, int (*compare)(const void *, const void*,int, int, size_t)); void * bsearch_array( const void *key,int *p,int comp_first,int comp_len,void**list,int len, int entry_len,size_t el_size, int (*compare)(const void *, const void*,int, int, size_t)); void **search_in_list_file ( void *key,int *p, int comp_len,FILE *fp, int len, size_t size, int entry_len); void **search_in_list_array ( void *key,int *p, int comp_len,void **L , int len, size_t size, int entry_len); # 78 "util_lib_header.h" int **search_in_list_int ( int *key, int k_len, int **list, int ne); void sort_float ( float **V,int N_F, int F, int left, int right); int cmp_float ( const float **a, const float **b); void sort_int_1D ( int *L, int n); char** sort_string_array (char **V, int n); void sort_int ( int **V,int N_F, int F, int left, int right); void sort_list_int ( int **V,int N_F, int F, int left, int right); void sort_int_inv ( int **V,int N_F, int F, int left, int right); void sort_list_int_inv ( int **V,int N_F, int F, int left, int right); int cmp_int ( const int**a, const int**b); int cmp_list_int (const int**a, const int**b); int name_is_in_list ( char *name, char **name_list, int n_name, int len); char * check_list_for_dup ( char **list, int ne); FILE *get_number_list_in_file ( FILE *fp, int *list, int *n, int *max_len); short * set_short ( short *, int n,...); char * set_char ( char *, int n,...); int * set_int ( int *, int n,...); float * set_float ( float *, int n,...); double * set_double( double*, int n,...); short * ga_memcpy_short ( short *array1, short *array2, int n); int * ga_memcpy_int ( int *array1, int *array2, int n); float * ga_memcpy_float ( float *array1, float *array2, int n); double * ga_memcpy_double( double *array1, double *array2, int n); short ** duplicate_short ( short **array , int len, int field); int ** duplicate_int ( int **array , int len, int field); char ** duplicate_char ( char **array , int len, int field); char * duplicate_string ( char *string); float ** duplicate_float ( float **array , int len, int field); double ** duplicate_double( double **array , int len, int field); short ** copy_short ( short **array1, short **array2, int len, int number_field); char ** copy_char ( char **array1, char **array2, int len, int number_field); int ** copy_int ( int **array1, int **array2, int len, int number_field); float ** copy_float ( float **array1, float **array2, int len, int number_field); double ** copy_double( double **array1, double **array2, int len, int number_field); Alignment ** cat_aln_list ( Alignment **list_to_cat,int first, int end, Alignment **rec_list); FILE * output_array_int (int **array, int len, int nf ,FILE *fp); short return_max_short (short ** array, int len_array, int field); char return_max_char( char ** array, int len_array, int field); int return_max_int( int ** array, int len_array, int field); float return_max_float( float ** array, int len_array, int field); double return_max_double( double** array, int len_array, int field); short return_min_short (short ** array, int len_array, int field); char return_min_char( char ** array, int len_array, int field); int return_min_int( int ** array, int len_array, int field); float return_min_float( float ** array, int len_array, int field); double return_min_double( double** array, int len_array, int field); short return_max_coor_short (short ** array, int len_array, int field, int *coor); char return_max_coor_char( char ** array, int len_array, int field, int *coor); int return_max_coor_int( int ** array, int len_array, int field, int *coor); float return_max_coor_float( float ** array, int len_array, int field, int *coor); double return_max_coor_double( double** array, int len_array, int field, int *coor); short return_min_coor_short (short ** array, int len_array, int field, int *coor); char return_min_coor_char( char ** array, int len_array, int field, int *coor); int return_min_coor_int( int ** array, int len_array, int field, int *coor); float return_min_coor_float( float ** array, int len_array, int field, int *coor); double return_min_coor_double( double** array, int len_array, int field, int *coor); short return_2Dmax_short (short ** array, int start, int len_array, int first_field, int number_field); char return_2Dmax_char( char ** array, int start, int len_array, int first_field, int number_field); int return_2Dmax_int( int ** array, int start, int len_array, int first_field, int number_field); float return_2Dmax_float( float ** array, int start, int len_array, int first_field, int number_field); double return_2Dmax_double( double** array, int start, int len_array, int first_field, int number_field); short return_2Dmin_short (short ** array, int start, int len_array, int first_field, int number_field); char return_2Dmin_char( char ** array, int start, int len_array, int first_field, int number_field); int return_2Dmin_int( int ** array, int start, int len_array, int first_field, int number_field); float return_2Dmin_float( float ** array, int start, int len_array, int first_field, int number_field); double return_2Dmin_double( double** array, int start, int len_array, int first_field, int number_field); short return_2Dmax_coor_short ( short ** array,int start1, int end1, int start2, int end2, int *i, int *j ); char return_2Dmax_coor_char( char ** array, int start1, int end1, int start2, int end2, int *i, int *j); int return_2Dmax_coor_int( int ** array, int start1, int end1, int start2, int end2, int *i, int *j); float return_2Dmax_coor_float( float ** array, int start1, int end1, int start2, int end2, int *i, int *j); double return_2Dmax_coor_double( double** array, int start1, int end1, int start2, int end2, int *i, int *j); short return_2Dmin_coor_short ( short ** array, int start1, int end1, int start2, int end2, int *i, int *j); char return_2Dmin_coor_char( char ** array, int start1, int end1, int start2, int end2, int *i, int *j); int return_2Dmin_coor_int( int ** array, int start1, int end1, int start2, int end2, int *i, int *j); float return_2Dmin_coor_float( float ** array, int start1, int end1, int start2, int end2, int *i, int *j); double return_2Dmin_coor_double( double** array, int start1, int end1, int start2, int end2, int *i, int *j); double return_wmean_short ( short ** array, int len, int wfield, int field); double return_wmean_char ( char ** array, int len, int wfield, int field); double return_wmean_int ( int ** array, int len, int wfield, int field); double return_wmean_float ( float ** array, int len, int wfield, int field); double return_wmean_double( double** array, int len, int wfield, int field); double return_mean_short ( short ** array, int len, int field); double return_mean_char ( char ** array, int len, int field); double return_mean_int ( int ** array, int len, int field); double return_mean_float ( float ** array, int len, int field); double return_mean_double ( double** array, int len, int field); short return_sum_short ( short ** array, int len, int field); char return_sum_char ( char ** array, int len, int field); int return_sum_int ( int ** array, int len, int field); float return_sum_float ( float ** array, int len, int field); double return_sum_double( double** array, int len, int field); short return_sd_short ( short ** array, int len, int field, short mean); char return_sd_char ( char ** array, int len, int field, char mean); int return_sd_int ( int ** array, int len, int field, int mean); float return_sd_float ( float ** array, int len, int field, float mean); double return_sd_double( double** array, int len, int field, double mean); double return_z_score ( double x, double sum, double sum2, double n); short* invert_list_short ( short * array, int len ); char* invert_list_char ( char * array, int len ); int* invert_list_int ( int * array, int len ); float* invert_list_float ( float * array, int len ); double* invert_list_double( double* array, int len ); void swap_short ( short * array, short * array2,int len ); void swap_char ( char * array, char * array2,int len ); void swap_int ( int * array, int * array2,int len ); void swap_float ( float * array, float * array2,int len ); void swap_double( double* array, double* array2,int len ); short return_max_short_hor (short ** array, int len_array, int field); char return_max_char_hor (char ** array, int len_array, int field); int return_max_int_hor (int ** array, int len_array, int field); float return_max_float_hor (float ** array, int len_array, int field); double return_max_double_hor(double ** array, int len_array, int field); short return_min_short_hor ( short ** array, int len_array, int field); char return_min_char_hor ( char ** array, int len_array, int field); int return_min_int_hor ( int ** array, int len_array, int field); float return_min_float_hor ( float ** array, int len_array, int field); double return_min_double_hor( double** array, int len_array, int field); short best_short (int n, ...); int best_int (int n, ...); char best_char (int n, ...); float best_float (int n, ...); double best_double(int n, ...); int is_defined_short (int n, ...); int is_defined_int (int n, ...); int is_defined_char (int n, ...); int is_defined_float (int n, ...); int is_defined_double(int n, ...); int return_maxlen ( char ** array, int number); int return_minlen ( char ** array, int number); float return_mean_diff_float ( float **array, int len, int field,float mean); void inverse_int ( int**array, int len, int field, int max, int min); void inverse_float ( float**array, int len, int field, int max, int min); void inverse_2D_float ( float **array, int start, int len, int start_field, int number_field, float max,float min); void **recycle (void **A, int l, int cycle); char* getenv4debug ( const char *var); char* get_env_variable ( const char *var, int mode); void setenv_func ( char *string_name, char *string_value); void get_pwd ( char *name); int pg_is_installed ( char *pg); char *num2plot (int value, int max, int line_len); float grep_function ( char *pattern, char *file); void crash_if ( int val, char *s); void crash ( char *s); int ** make_recursive_combination_table ( int tot_n_param, int *n_param, int *nc, int**table, int field); char ** push_string (char *val, char **stack, int *nval, int mode); int vsrand (int val); int *randomize_list (int *list, int len, int ncycle); int vstrcmp (const char *s1, const char *s2); int vstrncmp (const char *s1, const char *s2, int n); FILE *print_array_char (FILE *out, char **array, int n, char *sep); char *extract_suffixe ( char *array); Fname* parse_fname ( char *array); void string_array_convert ( char **array, int n_strings, int ns, char **sl); void string_convert( char *string, int ns, char **sl); int convert ( char c, int ns, char **sl); int convert2 ( char c, char *list); void string_array_upper ( char **string, int n); void string_array_lower ( char **string, int n); char *upper_string ( char *string); char *lower_string ( char *string); char * substitute ( char *string, char *token, char *replacement); char *after_strstr (char *string, char *token); int str_overlap ( char *string1, char *string2, char x); int get_string_line ( int start, int n_lines, char *in, char *out); FILE * output_string_wrap ( int wrap,char *string, FILE *fp); char * extract_char ( char * array, int first, int len); char** break_list ( char **argv, int *argc, char *separators); char** merge_list ( char **argv, int *argc); int *name_array2index_array ( char **list1, int n1, char **list2, int n2); char ** get_list_of_tokens ( char *string, char *separators, int *n_tokens); char **ungap_array(char ** array, int n); void ungap ( char *seq); char *mark_internal_gaps(char *seq, char symbol); char *list2string (char **list, int n); char *list2string2 (char **list, int n, char* sep); char ** string2list (char *string); char ** string2list2(char *string, char *separators); int * string2num_list( char *string); int * string2num_list2( char *string, char *separators); char **char_array2number ( char ** array, int n); char *char2number ( char * array); long atop(char *); char *invert_string (char *string); int isblanc ( char *buf); void splice_out ( char *seq, char x); int is_number ( char *buf); int is_alpha_line ( char *buf); int is_alnum_line ( char *buf); int case_insensitive_strcmp ( char *string1, char *string2); int get_string_sim ( char *string1, char *string2, char *ignore); int is_gap ( char x); int is_aa ( char x); int is_dna ( char x); char * get_alphabet ( char *seq, char *alphabet); int is_in_set ( char r, char *list); int array_is_in_set (char *array, char *set); char * generate_void ( int x); char * generate_null ( int x); char * generate_string ( int x, char y); char * translate_string (char *string, char *in, char*out); void translate_name ( char *name); int get_longest_string (char **array,int n, int *len, int *index); int get_shortest_string (char **array,int n, int *len, int *index); char **pad_string_array ( char **array, int n, int len, char pad); char * crop_string (char *string, int start, int end); int get_distance2char ( char *x, char *list); FILE* print_cpu_usage (FILE *fp, char *comment); int get_time (); int get_ctime (); int reset_time(); int increase_ref_time(int increase); int evaluate_sys_call_io ( char *out_file, char *com, char *fonc); int my_system_cl (int argc, char *argv[]); int my_system ( char *command); int unpack_perl_script (char *name, char ***unpacked, int n); void unpack_all_perl_script (char *script); FILE * print_command_line (FILE *fp ); char ** standard_initialisation ( char **in_argv, int *in_argc); FILE *fatal_exit ( FILE *fp, int exit_signal, char *string, ...); FILE *add_warning (FILE *fp, char *string, ...); void output_warning_list(); int count_n_res_in_array (char *array, int len); int count_n_gap_in_array (char *array, int len); int count_n_symbol_in_array ( char *array, char *array_list, int len); int count_n_char_x_in_file(char *name, char x); int count_n_char_in_file(char *name); int count_n_line_in_file(char *name); int measure_longest_line_in_file ( char *name ); int file_cat ( char *fname1, char *fname2, char *fname3); FILE* display_file_content (FILE *output, char *name); char ***file2list (char *name, char *sep); char ** file2lines (char *name); char * file2string (char *name); char ** get_parameter ( char *para_name, int *np, char *fname); int get_cl_parameter (int argc, char **argv,FILE **fp, char *para_name, int *set_flag, char *type, int optional, int max_n_val,char *usage, ...); char *input_name (); void check_vtmpnam (); void set_file2remove_off(); void set_file2remove_on(); char * add2file2remove_list ( char *name); FILE * vtmpfile(); char * vtmpnam ( char *s); char * tmpnam_2 (char *s); char * vremove ( char *s); void error_function (); int log_function (char *fname); void clean_function ( ); void sig_clean_function ( int x); char * prepare_cache ( const char *mode); char * get_cache_dir(); void update_cache (); void ignore_cache(); FILE * vfopen ( char *name, char *mode); FILE * vfclose (FILE *fp); int echo ( char *string, char *fname); int **get_file_block_pattern (char *fname, int *n_blocks, int max_n_line); int token_is_in_file (char *fname, char *token); FILE * find_token_in_file_nlines ( char *fname, FILE * fp, char *token, int n_line); FILE * find_token_in_file ( char *fname, FILE * fp, char *token); char * vfgets (char *buf, FILE *fp); FILE * set_fp_after_char ( FILE *fp, char x); FILE * set_fp_id ( FILE *fp, char *id); FILE * skip_commentary_line_in_file ( char com, FILE *fp); char * strip_file_from_comments (char *com, char *in_file); int check_for_update ( char *web_address); int check_program_is_installed ( char *program_name, char *current_path, char *path_variable, char *where2getit, int fatal); FILE * display_output_filename ( FILE *io, char *type, char *format, char *name, int check_output); int filename_is_special ( char *fname); char *check_file_exists ( char *fname); int mkdir ( char *dir); int file_is_empty(char *fname); int file_exists (char *fname); void create_file ( char *name); void delete_file ( char *fname); int util_rename ( char* from, char *to); int util_copy ( char* from, char *to); FILE * output_completion ( FILE *fp,int n, int tot, int n_eports, char *s); void * null_function (int a, ...); int btoi ( int nc,...); float get_geometric_distance ( float ** matrix, int ncoor, int d1, int d2, char *mode); double log_addN ( int N, double *L); double log_add6 (double a, double b, double c, double d, double e, double f ); double log_add5 (double a, double b, double c, double d, double e); double log_add4 (double a, double b, double c, double d); double log_add3 (double a, double b, double c); double log_add2 (double a, double b); double factorial_log ( int start, int end); double M_chooses_Nlog ( int m, int N); double factorial ( int start, int end); double M_chooses_N ( int m, int N); double my_int_log(int a); unsigned long linrand(unsigned long r); unsigned long addrand(unsigned long r); void addrandinit(unsigned long s); static unsigned long mult(unsigned long p,unsigned long q); struct Job_TC { int jobid; int status; struct Job_TC *c; struct Job_TC *p; struct Job_io_TC *io; struct Job_control_TC *control; struct Job_param_TC *param; char **pl; int np; }; typedef struct Job_TC Job_TC; struct Job_control_TC { struct Job_TC* (*submitF) (struct Job_TC*); struct Job_TC* (*retrieveF)(struct Job_TC*); char *mode; }; typedef struct Job_control_TC Job_control_TC; struct Job_io_TC { char *in; char *out; struct Constraint_list *CL; struct Alignment *A; }; typedef struct Job_io_TC Job_io_TC; struct Job_param_TC { char *method; struct TC_method *TCM; char *temp_c; char *aln_c; char *seq_c; char *aln_mode; }; typedef struct Job_param_TC Job_param_TC; Job_TC* print_lib_job ( Job_TC *job,char *string, ...); Job_TC *print_lib_job2 ( Job_TC* job, int n, char **name, char **value); Job_TC *free_queue (Job_TC *job); Job_TC *free_job (Job_TC *job); Job_TC * queue2heap (Job_TC*job); Job_TC * queue2last (Job_TC*job); int queue2n (Job_TC*job); Job_TC * descend_queue (Job_TC*job); Job_TC *queue_cat (Job_TC *P, Job_TC *C); Job_TC *delete_job (Job_TC *job); struct Job_TC* submit_job ( Job_TC *job); struct Job_TC* retrieve_job ( Job_TC *job); struct Dps_result { int njobs; struct Dps_job **dps_job; }; typedef struct Dps_result Dps_result; struct Dps_job { int JobId; struct Constraint_list *CL; char *input_file; char *output_file; }; typedef struct Dps_job Dps_job; struct Dps_result *seq2list_DPS (struct Constraint_list *CL,char *method, char *aln_command, char *seq_command, char *weight, Dps_result *dps_result); struct Constraint_list * gather_results_DPS ( Dps_result *DPS, struct Constraint_list *CL); Dps_result *declare_dps_result ( int naln, Dps_result *dps); # 605 "util_lib_header.h" typedef int (*Profile_cost_func) (int*, int *,struct Constraint_list *); typedef int (*Col_cost_func)(Alignment*, int **, int, int*, int, int **, int, int*, int, struct Constraint_list *); typedef int (*Pair_cost_func)(struct Constraint_list *, int, int, int, int); typedef int (*Pwfunc) (Alignment *, int*, int **,struct Constraint_list *); typedef struct { char blast_server[100]; char db[100]; int min_cov; int min_id; int max_id; } Blast_param; typedef struct { int n_excluded_nb; float similarity_threshold; float rmsd_threshold; float md_threshold; int distance_on_request; char *comparison_io; float maximum_distance; int N_ca; float max_delta ; char *hasch_mode; int scale; int n_extra_param; char **extra_param; char *evaluate_mode; } Pdb_param; typedef struct { int num; int res_num; char res[4]; char type[4]; float x; float y; float z; } Atom; typedef struct { Atom*CA; Atom *C; Atom *N; Atom *CB; } Amino_acid; typedef struct { int **nb; float **d_nb; int max_nb; } Struct_nb; typedef struct { int len; int n_atom; char *name; char *seq; Atom **structure; Atom **ca; Amino_acid **peptide_chain; Struct_nb *Chain; Struct_nb *Bubble; Struct_nb *Transversal; float ** ca_dist; Pdb_param *pdb_param; } Ca_trace; struct Moca { int moca_scale; int (*evaluate_domain)(Alignment*,struct Constraint_list *); int moca_threshold; int ** (*cache_cl_with_domain)(Alignment*, struct Constraint_list *); int **forbiden_residues; Alignment* (*make_nol_aln)(Alignment*, struct Constraint_list *); int moca_start; int moca_len; int moca_interactive; }; typedef struct Moca Moca; struct Distance_matrix { char mode[100]; int **similarity_matrix; int **score_similarity_matrix; int **distance_matrix; }; typedef struct Distance_matrix Distance_matrix; struct Constraint_list { int copy_mode; struct Constraint_list *pCL; Sequence *S; Sequence *STRUC_LIST; char align_pdb_param_file[100]; char align_pdb_hasch_mode[100]; Weights *W; Distance_matrix *DM; Distance_matrix *ktupDM; int *translation; char ** out_aln_format; int n_out_aln_format; int **packed_seq_lu; FILE *fp; int **L; int **M; int ne; char list_name[1000]; int entry_len; size_t el_size; int normalise; int max_ext_value; int max_value; int overweight; int pw_parameters_set; int gop; int gep; int f_gop; int f_gep; int nm_gop; int nm_gep; int nomatch; int TG_MODE; int F_TG_MODE; char dp_mode[100]; int maximise; char matrix_for_aa_group[100]; char method_matrix[100]; float diagonal_threshold; int ktup; int use_fragments; int fasta_step; int lalign_n_top; int sw_min_dist; char **matrices_list; int n_matrices; char tree_mode[100]; char distance_matrix_mode[100]; Alignment *tree_aln; Col_cost_func get_dp_cost; Profile_cost_func profile_mode; char profile_comparison [100]; Pair_cost_func evaluate_residue_pair; Pwfunc pair_wise; int weight_field; int max_n_pair; Blast_param *Prot_Blast; Blast_param *Pdb_Blast; Blast_param *DNA_Blast; int split; int split_nseq_thres; int split_score_thres; int check_pdb_status; char method_log[1000]; char evaluate_mode[1000]; Moca *moca; int ****forbiden_pair_list; int *seq_for_quadruplet; int nseq_for_quadruplet; int extend_jit; int extend_threshold; int do_self; char extend_clean_mode[100]; char extend_compact_mode[100]; # 883 "util_lib_header.h" int residue_indexed; int ***residue_index; int residue_field; int seq_indexed; int **start_index; int **end_index; int max_L_len; int chunk; Ca_trace ** T; int cpu; FILE *local_stderr; char multi_thread[100]; char lib_list[100]; }; typedef struct Constraint_list Constraint_list; struct TC_method { char executable[100]; char in_flag[100]; char out_flag[100]; char aln_mode[100]; char out_mode[100]; char seq_type[100]; char weight[100]; char matrix[100]; int gop; int gep; int minid; int maxid; char param[1000]; char param1[1000]; Constraint_list *PW_CL; }; typedef struct TC_method TC_method; Constraint_list *produce_list ( Constraint_list *CL, Sequence *S, char * method,char *weight,char *mem_mode); Job_TC* method2job_list ( char *method, Sequence *S,char *weight, char *lib_list, Distance_matrix *DM); Job_TC *job_list2multi_thread_job_list (Job_TC* ojob, char *mt, Constraint_list *CL); Job_TC *retrieve_lib_job ( Job_TC *job); Job_TC *submit_lib_job ( Job_TC *job); int is_in_pre_set_method_list (char *fname); char *method_name2method_file (char *method); char *make_aln_command(TC_method *m, char *seq, char *aln); struct TC_method* method_file2TC_method ( char *fname); int TC_method2method_file( struct TC_method*, char *fname ); int vread_clist ( Constraint_list *CL, int a, int b ); int vwrite_clist ( Constraint_list *CL, int a, int b, int x); Constraint_list *index_constraint_list ( Constraint_list *CL); Constraint_list *index_res_constraint_list ( Constraint_list *CL, int field); Constraint_list * add_list_entry2list (Constraint_list *CL, int n_para, ...); Constraint_list * evaluate_constraint_list_reference ( Constraint_list *CL); Constraint_list *add_entry2list ( int *entry, Constraint_list *CL); Constraint_list *insert_entry2list ( int *entry, int pos,Constraint_list *CL); int* extract_entry(int * entry, int pos, Constraint_list *CL); Constraint_list *extend_list_pair (Constraint_list *CLin,char *store_mode, int s1, int s2); Constraint_list *extend_list (Constraint_list *CLin, char *store_mode,char *clean_mode, char *compact_mode,int do_self, Sequence *SUBSET); void get_bounds (Constraint_list *CL, int s1, int s2, int *start, int *end); int ** fill_pos_matrix (Constraint_list *CL, int beg, int end, int slen, int **pos, int *len, int mirrored); FILE * compare_list (FILE *OUT, Constraint_list *CL1,Constraint_list *CL2); int **search_in_list_constraint(int *key, int k_len, int **L, int ne, int ***start_index, int ***end_index); int **main_search_in_list_constraint ( int *key,int *p,int k_len,Constraint_list *CL); Constraint_list *sort_constraint_list_inv (Constraint_list *CL, int start, int len); Constraint_list *invert_constraint_list (Constraint_list *CL, int start,int len); Constraint_list * sort_constraint_list (Constraint_list *CL, int start, int len); Constraint_list * sort_constraint_list_on_n_fields (Constraint_list *CL, int start, int len, int first_field, int n_fields); Constraint_list* read_n_constraint_list(char **fname,int n_list, char *in_mode,char *mem_mode,char *weight_mode,char *type, FILE *local_stderr, Constraint_list *CL, char *seq_source); Constraint_list* read_constraint_list(Constraint_list *CL,char *fname,char *in_mode,char *mem_mode,char *weight_mode); int read_cpu_in_n_list(char **fname, int n); int read_seq_in_list ( char *fname, int *nseq, char ***sequences, char ***seq_name); Sequence * read_seq_in_n_list(char **fname, int n, char *type, char *SeqMode); int read_cpu_in_list ( char *fname); int ** read_list ( char *fname, int **list,int *ne, int *nseq, int *cpu, char ***sequences, char ***seq_name); Constraint_list * read_constraint_list_file(Constraint_list *CL, char *fname); Constraint_list * fast_read_constraint_list_file(Constraint_list *CL, char *fname); FILE * save_extended_constraint_list ( Constraint_list *CL, char *mode, FILE *fp) ; FILE * save_extended_constraint_list_pair ( Constraint_list *CL, char *mode, char* seq1, char * seq2,FILE *fp); FILE * save_constraint_list ( Constraint_list *CL,int start, int len, char *fname, FILE *fp,char *mode,Sequence *S); FILE * save_sub_list_header ( FILE *OUT, int n, char **name, Constraint_list *CL); FILE * save_list_header ( FILE *OUT,Constraint_list *CL); FILE * save_list_footer (FILE *OUT,Constraint_list *CL); FILE * save_constraint_list_ascii ( FILE *OUT,Constraint_list *CL, int start,int len, int *translation); FILE * save_constraint_list_bin ( FILE *OUT,Constraint_list *CL, int start,int len, int *translation); int *seqpair2weight (int s1, int s2, Alignment *A,Constraint_list *CL, char *weight_mode, int *weight); Constraint_list *aln_file2constraint_list (char *alname, Constraint_list *CL,char *weight_mode); Constraint_list *aln2constraint_list (Alignment *A, Constraint_list *CL,char *weight_mode); double **list2mat (Constraint_list *CL,int s1,int s2, double *min, double *max); Constraint_list * constraint_list2bin_file(Constraint_list *clist); FILE * bin_file2constraint_list ( Constraint_list *CL, FILE *fp, char *name); int **list2residue_total_weight ( Constraint_list *CL); int **list2residue_total_extended_weight ( Constraint_list *CL); int **list2residue_partial_extended_weight ( Constraint_list *CL); # 1062 "util_lib_header.h" Constraint_list *clean ( char *clean_mode,Constraint_list *C,int start, int len); Constraint_list * clean_shadow ( Constraint_list *CL, int start, int len); Constraint_list *merge_constraint_list ( Constraint_list *SL, Constraint_list *ML, char *mode); int return_max_constraint_list ( Constraint_list *CL, int field); Constraint_list *modify_weight( Constraint_list *CL,int start, int end, char *modify_mode); Constraint_list *compact_list (Constraint_list *CL, int start, int len, char *compact_mode); Constraint_list *rescale_list_simple (Constraint_list *CL,int start, int len,int new_min, int new_max); Constraint_list *rescale_list (Constraint_list *CL,int start, int len,int max1, int max2); Constraint_list* filter_list (Constraint_list *CL, int start, int len,int T); Constraint_list *undefine_list (Constraint_list *CL); void print_CL_mem(Constraint_list *CL, char *function); int constraint_list_is_sorted ( Constraint_list *CL); void check_seq_pair_in_list(Constraint_list *CL,int seq1, int seq2); Constraint_list * align_coding_nucleotides (char *seq, char *method, char *weight, char *mem_mode, Constraint_list *CL); Constraint_list *weight_constraint_list(Constraint_list * CL, char *seq_weight); Weights* compute_t_coffee_weight(Constraint_list * CL); Constraint_list *re_weight_constraint_list(Constraint_list * CL,Weights *W); Distance_matrix* cl2distance_matrix (Constraint_list *CL, char *in_mode); Distance_matrix *seq2distance_matrix (Constraint_list *CL, char *in_mode); int run_multi_thread_file (char *fname, char *config); int **index_seq_res ( Sequence *S1, Sequence *S2, int **name_index); int **index_seq_name ( Sequence *S1, Sequence *S2); int *get_name_index (char **l1, int n1, char **l2, int n2); int* get_res_index (char *seq1, char *seq2); int change_residue_coordinate ( char *in_seq1, char *in_seq2, int v); int ** minimise_repeat_coor (int **coor, int nseq, Sequence *S); int ** get_nol_seq( Constraint_list *CL,int **coor, int nseq, Sequence *S); int compare_pos_column( int **pos1,int p1, int **pos2,int p2, int nseq); char * seq2alphabet (Sequence *S); char *aln2alphabet (Alignment *A); char *array2alphabet (char **array, int n); Alignment * seq2pdb ( char *name, char *seq,Blast_param *B); Alignment * seq2blast ( char *name, char *seq, Blast_param *B); Sequence * seq2unique_name_seq (Sequence *S); Sequence * seq2blast_profile ( Sequence *S, int n, Blast_param *B); int ** seq2aln_pos (Alignment *A, int *n, int **ls); Alignment *padd_aln ( Alignment *A); char **padd_string ( char **string, int n,char pad); Alignment *local_maln2global_maln (char *seq, Alignment *A); Alignment * seq2profile (Sequence *S, int index); Alignment * aln2profile (Alignment * A); Alignment * aln2collapsed_aln (Alignment * A, int n, char **string); Alignment* aln2sub_aln_file (Alignment *A, int n, char **string); Alignment* aln2sub_seq (Alignment *A, int n, char **string); int * seq2inv_pos ( char *seq); int ** aln2pos_simple (Alignment *A, int n_nseq, ...); int ** aln2pos_simple_2 (Alignment *A); Alignment ** split_seq_in_aln_list ( Alignment **aln, Sequence *S, int l_seq, char **seq_list); Sequence * fill_sequence_struc ( int nseq, char **sequences, char **seq_name); int seq_list2in_file ( TC_method *M, Sequence *S, char *list, char *file); int seq_list2fasta_file( Sequence *S, char *list, char *file); Structure * seq2struc ( Sequence *S, Structure *ST); Alignment *strings2aln (int nseq,...); Alignment * seq2aln ( Sequence *S, Alignment *A,int rm_gap); Alignment *seq_coor2aln ( Sequence *S, Alignment *A, int **coor, int nseq); Alignment *stack_aln (Alignment *A, Alignment *B); Alignment *chseqIaln(char *name, int seq_n, int start,int len,Sequence *S, int seqIaln, Alignment *A); char *dna_aln2cons_seq ( Alignment *A); char *aln2cons_seq ( Alignment *A, int ns, int *ls, int n_groups, char **group_list); char *sub_aln2cons_seq_mat ( Alignment *A,int ns, int *ls, char *mat_name); char *aln2cons_seq_mat ( Alignment*A, char *mat_name); Alignment *aln2short_aln( Alignment *A, char *list, char *new, int spacer); Sequence *keep_residues_in_seq ( Sequence *S,char *list, char replacement); Alignment *keep_residues_in_aln ( Alignment *A,char *list, char replacement); Alignment *filter_keep_residues_in_aln ( Alignment *A,Alignment *ST, int use_cons, int value, char *list, char replacement); Alignment *aln_convert (Alignment *A, Alignment *ST, int use_cons, int value,int n, ...); Alignment *aln2number (Alignment *A); Alignment * filter_aln ( Alignment *A, Alignment *ST, int value); Alignment * filter_aln_lower_upper ( Alignment *A, Alignment *ST,int use_cons, int value); Alignment * filter_aln_upper_lower ( Alignment *A, Alignment *ST, int use_cons,int value); Alignment * filter_aln_convert ( Alignment *A, Alignment *ST, int use_cons,int value, int n_symbol,char** symbol_list); int * count_in_aln ( Alignment *A, Alignment *ST, int value, int n_symbol,char **symbol_list, int *table); Alignment * trim_aln_with_seq ( Alignment *S, Alignment *P); Alignment * add_align_seq2aln ( Alignment *A, char *seq, char *seq_name); Sequence * aln2seq ( Alignment *A); Alignment * thread_profile_files2aln (Alignment *A, char *template_file); Alignment * expand_aln (Alignment *A); Alignment * expand_number_aln (Alignment *A,Alignment *EA); Alignment * remove_gap_column ( Alignment *A, char *mode); Alignment* ungap_sub_aln ( Alignment *A, int nseq, int *ls); Sequence * ungap_seq ( Sequence *A); Alignment * ungap_aln_n ( Alignment *A, int n); Alignment * ungap_aln ( Alignment *A); void compress_aln ( Alignment *A); Alignment* condense_aln (Alignment *A); Alignment * probabilistic_rm_aa ( Alignment *A, int pos, int len); Alignment * aln_gap2random_aa(Alignment *A); Alignment * make_random_aln(Alignment *A,int nseq, int len, char *alphabet); Alignment * add_random_sequence2aln( Alignment *A, char *alphabet); int ** trim_aln_borders ( char **seq1, char **seq2, int nseq); Sequence * trim_aln_seq ( Alignment *A, Alignment *B); Sequence * trim_aln_seq_name ( Alignment *A, Alignment *B); Sequence *get_defined_residues( Alignment *A); Alignment *thread_defined_residues_on_aln ( Alignment *A, Sequence *S1); Sequence *seq2number (Sequence *S); Sequence * merge_seq ( Sequence *IN, Sequence *OUT); char * seq_name2coor ( char *s, int *start, int *end, char sep); Alignment *seq_name2removed_seq_name(Sequence *S, Alignment *NA, float **diff); int seq_name2index (char *name, Sequence *S); Sequence *extract_one_seq(char *n,int start, int end, Alignment *S,int keep_name); Sequence * extract_sub_seq( Sequence *COOR, Sequence *S); Sequence * add_prf2seq (char *alnfile, Sequence *S); int prf_in_seq ( Sequence *S); Sequence * add_sequence ( Sequence *IN, Sequence *OUT, int i); Sequence * trim_seq ( Sequence *A, Sequence *B); Sequence * reorder_seq ( Sequence *A, char **name, int nseq); char * concatenate_seq ( Sequence *S, char *conc, int *order); Sequence * swap_header ( Sequence *S, Sequence *H); Alignment * reorder_aln ( Alignment *A, char **name, int nseq); char ** rm_name_tag (char **name, int nseq, char *tag); char * string_contains_template_tag (char *string); Sequence * seq2template_type(Sequence *Seq); Sequence * seq2template_seq ( Sequence *S, char *template_file); char * seq2template_file (Sequence *S, char *file); int seq2template_file2 (Sequence *S, char *file, char *mode); Sequence * profile_seq2template_seq ( Sequence *S, char *template_file); int seq2n_X_template ( Sequence *S, char *type); struct X_template *fill_X_template (char *name, char *p, char *type); FILE * display_seq_template (Sequence *S, FILE *io); char *template_type2type_name (char *type); FILE * display_sequence_templates ( Sequence *S, int i, FILE *io); FILE * display_X_template (struct X_template *X, FILE *io); struct X_template* free_X_template ( struct X_template *X); struct X_template *fill_P_template (char *name, char *p, Sequence *S); struct X_template *fill_S_template ( char *name,char *p, Sequence *S); struct X_template *fill_R_template (char *name, char *p, Sequence *S); struct X_template *fill_G_template (char *name, char *p, Sequence *S); struct X_template *fill_RB_template(char *name, char *p, Sequence *S); char *seq2T_value ( Sequence *S, int i, char *param_name, char *template_type); Alignment * seq2R_template_profile (Sequence *S, int n); char * seq2P_template_file (Sequence *S, int n); struct X_template * seq_has_template ( Sequence *S, int n, char *type); Alignment * fix_aln_seq ( Alignment *A, Sequence *S); Alignment * rotate_aln ( Alignment *A, char *name); Alignment * invert_aln ( Alignment *A); Alignment * extract_nol_local_aln( Alignment *A, int start, int max_end); Alignment * extract_aln ( Alignment *A, int start, int end); Alignment * extract_aln2 ( Alignment *A, int start, int end, char *seq_name); Alignment * extract_aln3 ( Alignment *A, char *filename); Alignment * trunkate_local_aln ( Alignment *A); int get_nol_aln_border ( Alignment *A, int start, int direction); Alignment ** trim_local_aln ( Alignment *A, int **List, int ne, int **residue_list, Sequence *S); Alignment * aln_cat ( Alignment *A, Alignment *B); Alignment * concatenate_aln ( Alignment *A, Alignment *B); char * extract_defined_seq ( char *in, int in_of, int in_start, int *aa_def, int dir, int *out_start, char *out_seq); int verify_aln ( Alignment *A, Sequence *S, char * error); Alignment * remove_end (Alignment *A); Alignment *adjust_est_aln ( Alignment *PW, Alignment *M, int s); Alignment * rename_seq_in_aln (Alignment *A, char ***list); Sequence * rename_seq_in_seq (Sequence *A, char ***list); float get_seq_fsim ( char *string1, char *string2, char *ignore, char *similarity_groups, int **matrix, int mode); float ** get_fsim_aln_array ( Alignment *A, char *mode); int **sim_array2dist_array ( int **p, int max); int **dist_array2sim_array ( int **p, int max); int aln2most_similar_sequence ( Alignment *A, char *mode); int aln2coverage ( Alignment *A, int ref_seq); int aln2sim ( Alignment *A, char *mode); int aln_is_aligned ( Alignment *A); int* get_cdna_seq_winsim ( int *cache, char *string1, char *string2, char *ignore, char *mode, int *w); int get_cdna_seq_sim ( int *cache, char *string1, char *string2, char *ignore, char *mode); int seq2aln2sim (char *seq1, char *seq2, char *mode_aln, char *mode_id); int* get_seq_winsim( char *string1, char *string2, char *ignore, char *mode, int *w); int get_seq_sim ( char *string1, char *string2, char *ignore, char *mode); int get_seq_sim_2 ( char *string1, char *string2, char *ignore, char **gr, int ng); int get_seq_sim_3 ( char *string1, char *string2, char *ignore, int **mat); int *** get_winsim_aln_array ( Alignment *A, char *mode, int ***w); int ** get_sim_master_aln_array ( Alignment *A,int n, char *mode); int ** aln2sim_mat (Alignment *A, char *mode); int ** get_dist_aln_array ( Alignment *A, char *mode); int ** get_sim_aln_array ( Alignment *A, char *mode); int ** get_cov_aln_array ( Alignment *A, char *mode); int ** get_cov_master_aln_array ( Alignment *A,int n, char *mode); int * get_aln_col_weight ( Alignment *A, char *mode); int analyse_aln_column ( Alignment *B, int col); int **aln2count_mat (Alignment *A); int **sub_aln2count_mat2 (Alignment *A, int ns, int *ls); int **aln2count_mat2 (Alignment *A); char *aln2random_seq (Alignment *A, int noise1, int noise2, int noise3, int gap_noise); Alignment * master_trimseq( Alignment *A, Sequence *S,char *mode); Alignment * trimseq( Alignment *A, Sequence *S, char *mode); float ** get_weight ( Alignment *A, Sequence *S, char *mode); float **seq2pwsim ( Alignment *A, Sequence *S, char *mode); Alignment * trimseq( Alignment *A, Sequence *S,char *mode); Alignment * tc_trimseq( Alignment *A, Sequence *S,char *mode); Alignment* seq2subseq3( Alignment *A, Sequence *S,int use_aln, int lower_sim,int upper_sim, int min_nseq, int trim_direction, char *weight_mode, float ***sim_weight, int *seq_list); Alignment* seq2subseq2( Alignment *A, Sequence *S,int use_aln, int lower_sim,int upper_sim, int max_nseq, int trim_direction, char *weight_mode, float ***weight_table, int *seq_list); float extreme_seq (int direction, Alignment *A,float **sim_weight,int *seq_list, int *seq_index); Alignment* seq2subseq1( Alignment *A, Sequence *S,int use_aln, int percent,int max_nseq,int max_diff, char *weight_mode); int is_in_same_group_aa ( char r1, char r2, int n_group, char **gl, char *mode); int find_group_aa_distribution (char *col, int nseq,int n_group, char **gl, int *distrib, char *mode ); char** make_group_aa (int *ngroup, char *mode); char * test_gene2prot (Constraint_list *CL, int s1); Alignment* gene2prot (Alignment *A); Alignment * dna_aln2_3frame_cdna_aln(Alignment *A,int *ns,int **l_s); Alignment *sar_analyze (Alignment *A, Alignment *SAR, char *name); int aln2sar_column_list ( Alignment *A, char *filter); float get_sar_sim (char *seq1, char *seq2); Alignment *aln2weighted_sar_score ( Alignment *A,Alignment *B, char *weight_file, char *compound); float seq2weighted_sar_score ( char *seq, int **weight); int sar2subsar (Alignment *A, Alignment *S, Alignment **subA, Alignment **subS, char **slist, int nl); int sar2subsar_file ( Alignment *A, Alignment *S, char *aln, char *sar); Alignment *weight2sar (Alignment *A, Alignment *SAR, char *weight_file, int limit); Alignment * sar2simpred (Alignment *A, Alignment *SAR, char *pos, char *compound, int L,int U ); Alignment * sar2simpred2 (Alignment *A, Alignment *SAR, char *seqlist, char *posfile, char *compound, int L1 ); Alignment *display_sar ( Alignment *A, Alignment *SAR, char *compound); NT_node sar2tree (Alignment *A, char *mode); Constraint_list * mask_list_with_aln (Alignment *A,int start, int len,Constraint_list *CL, int new_value); Constraint_list* mask_list_with_aln_pair (Alignment *A,int start, int end,Constraint_list *CL,int new_value); Constraint_list *mask_entry( Constraint_list *CL, int p, int new_value); Constraint_list *prepare_list_and_seq4sw(Constraint_list *I, int n_seq, char **seq_name); int ** get_undefined_list (Constraint_list *CL); int is_never_undefined (Constraint_list *CL,int r); int* do_analyse_list ( Constraint_list *CL); void print_list(Constraint_list *CL); void print_pair (Constraint_list *CL,int p); int** bin_list (Constraint_list *CL,int field, int Threshold); void save_full_list (Constraint_list *CL, char*fname); FILE * output_list ( Constraint_list *CL, FILE *fp); FILE * output_pair (Constraint_list *CL,int p, FILE *fp); NT_node ** seq2cw_tree ( Sequence *S, char *file); NT_node ** make_nj_tree ( Alignment *A,int **distances,int gop, int gep, char **out_seq, char **out_seq_name, int out_nseq, char *tree_file, char *tree_mode); NT_node ** int_dist2nj_tree (int **distances, char **out_seq_name, int out_nseq, char *tree_file); NT_node ** float_dist2nj_tree (float **distances, char **out_seq_name, int out_nseq, char *tree_file); NT_node ** dist2nj_tree (double **distances, char **out_seq_name, int out_nseq, char *tree_file); void nj_tree(char **tree_description, int nseq); void fast_nj_tree(char **tree_description); void slow_nj_tree(char **tree_description); void print_phylip_tree(char **tree_description, FILE *tree, int bootstrap); void two_way_split(char **tree_description, FILE *tree, int start_row, int flag, int bootstrap); void guide_tree(char *fname, double **saga_tmat, char **sag_seq_name, int saga_nseq); typedef struct Tmpname Tmpname; struct Memcontrol { size_t size; size_t size_element; char check[3]; struct Memcontrol *p; struct Memcontrol *n; }; typedef struct Memcontrol Memcontrol; Constraint_list *free_constraint_list4lib_computation (Constraint_list *CL); Constraint_list *duplicate_constraint_list4lib_computation (Constraint_list *CL); Constraint_list * declare_constraint_list_simple ( Sequence *S); Constraint_list * declare_constraint_list ( Sequence *S, char *name, int **L, int ne,FILE *fp, int **M); Constraint_list *cache_dp_value4constraint_list ( char mode[],Constraint_list *CL); Constraint_list *duplicate_constraint_list_soft (Constraint_list *CL); Constraint_list *duplicate_constraint_list (Constraint_list *CL); Constraint_list *copy_constraint_list (Constraint_list *CL, int mode); Sequence * free_constraint_list (Constraint_list *CL); Constraint_list * free_constraint_list_full (Constraint_list *CL); Distance_matrix * free_distance_matrix ( Distance_matrix *DM); Distance_matrix * duplicate_distance_matrix ( Distance_matrix *DMin); Blast_param * duplicate_blast_param ( Blast_param*B); Blast_param * free_blast_param ( Blast_param*B); Moca * duplicate_moca ( Moca *m); Moca * free_moca ( Moca *m); Structure * declare_structure ( int n, char **array); Structure * extend_structure ( Structure *S); Weights* declare_weights ( int nseq); Weights* duplicate_weights (Weights *W); Weights* free_weights ( Weights* W); FILE* print_mem_usage (FILE *fp, char *comment); void set_max_mem (int m); int verify_memory (int s); int my_assert ( void *p, int index); void * vmalloc ( size_t size); void * vcalloc ( size_t nobj, size_t size); void * vcalloc_nomemset ( size_t nobj, size_t size); void * sub_vcalloc ( size_t nobj, size_t size, int MODE); void * vrealloc ( void *p, size_t size); void vfree2 ( void **p); void vfree ( void *p); void * free_arrayN (void *p, int ndim); void vfree_all (); void write_size_short (int x, short *array, int offset); void write_size_char (int x, char *array, int offset); void write_size_int (int x, int *array, int offset); void write_size_float (int x, float *array, int offset); void write_size_double(int x, double *array, int offset); int read_size_short ( void *array, size_t size ); int read_size_char ( void *array, size_t size ); int read_size_int ( void *array, size_t size ); int read_size_float ( void *array, size_t size ); int read_size_double( void *array, size_t size ); int read_array_size ( void *array, size_t size ); int read_array_new ( void *array); int is_dynamic_memory ( void *array); void **realloc_arrayN(int ndim,void **main_array,size_t size, ...); void **realloc_arrayN2 ( int ndim, void ** p, int *A, size_t size); void ** realloc_array (void **array,size_t size, int first, int second, int ext1, int ext2); short ** realloc_short ( short **array, int first, int second, int ext1, int ext2); char ** realloc_char ( char **array, int first, int second, int ext1, int ext2); int ** realloc_int ( int **array, int first, int second, int ext1, int ext2); float ** realloc_float ( float **array, int first, int second, int ext1, int ext2); double ** realloc_double ( double **array, int first, int second, int ext1, int ext2); Alignment ** realloc_aln_array ( Alignment **array, int ext1); short ** new_realloc_short ( short **array, int ext1, int ext2); char ** new_realloc_char ( char **array, int ext1, int ext2); int ** new_realloc_int ( int **array, int ext1, int ext2); float ** new_realloc_float ( float **array, int ext1, int ext2); double ** new_realloc_double ( double **array, int ext1, int ext2); void * declare_arrayNnomemset (int ndim, size_t size, ...); void *declare_arrayN2nomemset ( int ndim, int *A, size_t size); void * declare_arrayN (int ndim, size_t size, ...); void *declare_arrayN2 ( int ndim, int *A, size_t size); void ** declare_array (int first, int second, size_t size); short ** declare_short ( int first, int second); char ** declare_char ( int first, int second); int ** declare_int ( int first, int second); float ** declare_float ( int first, int second); double ** declare_double ( int first, int second); void ** declare_array_nomemset (int first, int second, size_t size); short ** declare_short_nomemset ( int first, int second); char ** declare_char_nomemset ( int first, int second); int ** declare_int_nomemset ( int first, int second); float ** declare_float_nomemset ( int first, int second); double ** declare_double_nomemset ( int first, int second); Alignment ** declare_aln_array ( int first); short ** free_short ( short **array, int first); int ** free_int ( int **array, int first); char ** free_char ( char **array, int first); double ** free_double ( double **array, int first); float ** free_float ( float **array, int first); Alignment ** free_aln_array ( Alignment **array); Sequence *free_Alignment ( Alignment *A); Sequence *free_aln ( Alignment *A); Alignment *declare_Alignment ( Sequence *S); Alignment *realloc_alignment ( Alignment *A, int new_len); Alignment *realloc_alignment2 ( Alignment *A, int new_nseq, int new_len); Alignment *declare_aln ( Sequence *S); Alignment *declare_aln2 (int nseq, int len); Alignment *realloc_aln ( Alignment *A, int new_len); Alignment *realloc_aln2 ( Alignment *A, int new_nseq, int new_len); Alignment *update_aln_random_tag (Alignment *A); Alignment *copy_aln ( Alignment *A, Alignment *B); Alignment* extract_sub_aln2 ( Alignment *A, int nseq, char **list); Alignment* extract_sub_aln ( Alignment *A, int nseq, int *list); Alignment* shrink_aln ( Alignment *A, int nseq, int *list); Profile *copy_profile (Profile *P1); Profile *declare_profile(char *alphabet, int len); Profile * free_profile ( Profile *P); Sequence * declare_sequence ( int min, int max, int nseq); Sequence * realloc_sequence (Sequence *OUT, int new_nseq, int max_len); Sequence * duplicate_sequence (Sequence *S ); Sequence * add_sequence ( Sequence *IN, Sequence *OUT, int i); void free_sequence ( Sequence *LS, int nseq); Fname *declare_fname (); Fname *free_fname ( Fname *F); # 1622 "util_lib_header.h" struct HaschT { int ne; struct Hasch_entry **p; }; typedef struct HaschT HaschT; struct Hasch_entry { struct Hasch_entry *n; struct Hasch_entry *p; int k; struct Hasch_data *data; struct Hasch_data * (*free_data)(struct Hasch_data *); struct Hasch_data * (*declare_data)(struct Hasch_entry*); int tag; }; typedef struct Hasch_entry Hasch_entry; struct Char_node { struct Char_node **c; int key; }; typedef struct Char_node Char_node; HaschT * hcreate ( int n_elements,struct Hasch_data * declare_data(struct Hasch_entry *), struct Hasch_data *free_data(struct Hasch_data *) ); HaschT *hdestroy (HaschT *T,struct Hasch_data * declare_data(struct Hasch_entry *), struct Hasch_data *free_data(struct Hasch_data *) ); Hasch_entry* hsearch (HaschT *T, int k, int action, struct Hasch_data * declare_data(struct Hasch_entry *), struct Hasch_data *free_data(struct Hasch_data *) ); Hasch_entry * extract_hasch_entry_from_list (Hasch_entry *e, struct Hasch_data * declare_data(struct Hasch_entry *), struct Hasch_data *free_data(struct Hasch_data *) ); Hasch_entry * insert_hasch_entry_in_list (Hasch_entry *p, Hasch_entry *e, Hasch_entry *n, struct Hasch_data * declare_data(struct Hasch_entry *), struct Hasch_data *free_data(struct Hasch_data *) ); Hasch_entry * allocate_hasch_entry (Hasch_entry *e, int action,struct Hasch_data * declare_data(struct Hasch_entry *), struct Hasch_data *free_data(struct Hasch_data *) ); int string2key (char *s, Char_node *n); Char_node * declare_char_node (int action); char * normalize_pdb_file (char *name, char *seq,char *out_file); Ca_trace * trim_ca_trace (Ca_trace *st, char *seq ); Ca_trace * read_ca_trace (char *file, char *seq_field ); Ca_trace * simple_read_ca_trace (char *file ); Ca_trace * hasch_ca_trace ( Ca_trace *T); Ca_trace * hasch_ca_trace_nb ( Ca_trace *T); Ca_trace * hasch_ca_trace_bubble ( Ca_trace *T); Ca_trace * hasch_ca_trace_transversal ( Ca_trace *TRACE); float get_atomic_distance ( Atom *A, Atom*B); float ** measure_ca_distances(Ca_trace *T); float** print_contacts ( char *file1, char *file2, float T); char * map_contacts ( char *file1, char *file2, float T); int * identify_contacts (Ca_trace *ST1,Ca_trace *ST2, float T); Sequence *seq2contacts ( Sequence *S, float T); char *string2contacts (char *seq,char *name,char *comment, float T); short **struc2nb (char *name,char *seq, char *comment, float Threshold, char *atom_list); typedef struct { Alignment *A; Alignment *B; Alignment *sim_A; Sequence *S; Structure *ST; char ***grep_list; int n_greps; char *sim_aln; char *alignment1_file; char *alignment2_file; char *io_format; int n_structure; char **struct_file; char **struct_format; int *n_symbol; char ***symbol_list; int **code_A; int **code_B; int n_elementsA; int n_elementsB; int **end_index; int **start_index; int **tot_count; int **pos_count; int ***pw_tot_count; int ***pw_pos_count; int *glob; int **pw_glob; int n_categories; char ***category; char *category_list; int *n_sub_categories; char sep_l; char sep_r; float **sim; float **sim_param; char *sim_matrix; int sim_n_categories; char ***sim_category; char *sim_category_list; int *sim_n_sub_categories; }Result; # 1743 "util_lib_header.h" int aln_compare (int argc, char *argv[]); int **analyse_distance ( Alignment *A, int **dis); Structure * read_structure (char *fname, char *format, Alignment *A,Alignment *B, Structure *ST, int n_symbols, char **symbol_table); int is_in_struct_category ( int s1, int s2, int r1, int r2, Structure *ST, char **cat, int n_sub_cat); char * get_structure_residue (int s, int r, Structure *S); int parse_category_list ( char *category_list, char ***category, int *sub_n_categories); int struc_matches_pattern ( char *struc, char *pattern); float **get_aln_compare_sim ( Alignment *A, Structure *S, char **cat, int n_cat, char *matrix); float **analyse_sim ( Alignment *A, float **dis); FILE *output_format (char *iof, FILE *fp, Result *R); FILE *output_pair_wise_sequence_results (FILE *fp, Result *R); FILE *output_sequence_results (FILE *fp, Result *R); FILE *output_total_results (FILE *fp, Result *R); FILE *output_header (FILE *fp, Result *R); FILE *output_large_header ( FILE *fp, Result *R); int is_a_struc_format (char *format); void get_separating_char ( char s, char *l, char *r); void output_informations (); int check_configuration4program(); typedef struct { Alignment *A; Weights *W; Sequence *S; Structure *RNA_ST; NT_node T; Constraint_list *CL; char format[100]; char file[100]; int rm_gap; }Sequence_data_struc; typedef struct { char **symbol_list; int n_symbol; char *coor_file; int rm_gap; int keep_case; int keep_name; int use_consensus; }Action_data_struc; int set_landscape_msa (int len); int get_msa_line_length (int line, int aln_len); int seq_reformat (int argc, char *argv[]); Sequence_data_struc *read_data_structure ( char *in_format, char *in_file,Action_data_struc *RAD); Alignment * main_read_aln ( char *name, Alignment *A); Sequence * read_sequences ( char *mname); Sequence * main_read_seq ( char *mname); int output_format_aln ( char *format, Alignment *A, Alignment *EA,char *name); int main_output ( Sequence_data_struc *D1, Sequence_data_struc *D2, Sequence_data_struc *DST, char *out_format, char *out_file); char * identify_seq_format ( char *file); char * name2type_name ( char *name); char identify_format (char **fname); char **identify_list_format ( char **list, int n); int format_is_oligo ( char *file); int format_is_msf ( char *file); int format_is_fasta( char *file); int format_is_fasta_aln( char *file); int format_is_fasta_seq( char *file); int format_is_pir ( char *file); int format_is_pir_aln( char *file); int format_is_pir_seq( char *file); int format_is_saga ( char *file); int format_is_swissprot (char *name); int is_seq ( char *name); int is_aln ( char *name); int has_pdb (char *name); int is_blast_file (char *name); int is_sap_file (char *name); int is_pdb_file ( char *name); int is_simple_pdb_file ( char *name); int is_pdb_name ( char *name); char* get_pdb_id(char *name); char* get_pdb_struc(char *name, int start, int end); char* seq_is_pdb_struc ( Sequence *S, int i); char* is_pdb_struc ( char *name); int is_matrix (char *name); int is_lib (char *name); int is_lib_01 (char *name); int is_lib_02 (char *name); int is_single_seq_weight_file (char *fname); int is_newick (char *name); int is_method ( char *file); int is_in_format_list ( char *name); int is_out_format_list ( char *name); int is_struc_in_format_list ( char *name); int is_struc_out_format_list ( char *name); char *** read_rename_file ( char *fname, int mode); void get_barton_list_tc_seq ( char *in_file); int process_barton_entry (char *buf, char *name); Structure *read_rna_struc_number ( Alignment *A, char *fname); Weights* get_amps_sd_scores ( char *fname); Weights *read_seq_weight (char **name, int nseq, char* seq_weight); char ***read_group ( char *file); Sequence* get_pdb_sequence ( char *fname); Sequence* get_struc_gor ( char *fname); Sequence* get_dialign_sequence ( char *fname); Sequence* get_pima_sequence ( char *fname); Sequence* get_sequence_dali ( char *fname); Sequence* get_pir_sequence ( char *fname, char *comment_name); Sequence* perl_reformat2fasta ( char *perl_script, char *file); Sequence* get_fasta_sequence ( char *fname, char *comment_name); Sequence* get_fasta_sequence_num ( char *fname, char *comment_name); Sequence* get_gor_sequence ( char *fname, char *comment_name); Sequence* get_swissprot_sequence ( char *fname, char *comment_name); void read_check ( Alignment *A, char *check_file); void read_aln ( char *fname, Alignment *A); void read_number_aln ( char *fname, Alignment *A); Alignment *read_blast_aln ( char *fname, Alignment *A); void read_msf_aln ( char *fname, Alignment *A); void read_amps_aln ( char *in_file, Alignment *A); int get_amps_seq_name ( char **name, char* fname); Alignment *read_gotoh_aln ( char *fname, Alignment *A); # 1902 "util_lib_header.h" int output_freq_mat ( char *outfile, Alignment *A); float output_maln_pval ( char *outfile, Alignment *A); void output_similarities (char *file, Alignment *A, char *mode); void output_statistics (char *file, Alignment *A, char *mode); void output_pw_weights4saga ( Weights *W, float **w_list, char *wfile); int output_seq_weights ( Weights *W, char *wfile); FILE * display_weights (Weights *W, FILE *fp); FILE * display_sequences_names (Sequence *S, FILE *fp, int check_pdb_status, int print_templates); void output_pir_seq1 (char *fname, Alignment*A ); void output_pir_seq (char *fname, Alignment*A ); void output_gor_seq (char *fname, Alignment*A ); void output_mult_fasta_seq (char *fname, Alignment*A, int n ); void output_fasta_seq1 (char *fname, Alignment*A ); char *output_fasta_seqX (char *name, char *mode, Sequence *S, Alignment *A, int i); void output_pir_check (char *fname,int nseq, char **A ); void output_fasta_seq (char *fname, Alignment*A ); void output_gotoh_seq (char *fname, Alignment*A ); void output_est_prf (char *fname, Alignment *A); void output_gor_seq (char *fname, Alignment*A ); void output_pir_aln ( char *fname,Alignment*A); void output_model_aln ( char *fname,Alignment*A ); void output_fasta_aln ( char *fname,Alignment*A); void output_msf_aln ( char *fname,Alignment*B); void output_clustal_aln( char *name, Alignment*B); void output_saga_aln ( char *name, Alignment*B); void output_phylip_aln ( char *name, Alignment*B); void output_mocca_aln ( char *name, Alignment*B,Alignment*S); void output_rnalign (char *out_file, Alignment*A,Sequence *STRUC); void output_pw_lib_saga_aln (char *lib_name, Alignment *A ); void output_lib (char *lib_name, Alignment *A ); void output_compact_aln( char *name, Alignment *B); void print_aln ( Alignment *B); FILE * output_aln( Alignment *B, FILE *fp); FILE * output_aln_score ( Alignment *B, FILE *fp); FILE * output_aln_with_res_number ( Alignment *B, FILE *fp); FILE* output_Alignment ( Alignment *B, FILE *fp); FILE* output_Alignment_without_header ( Alignment *B, FILE *fp); FILE * output_Alignment_score ( Alignment *B, FILE *fp); FILE * output_Alignment_with_res_number ( Alignment *B, FILE *fp); void output_constraints ( char *fname, char *mode, Alignment *A); void output_glalign ( char *name, Alignment *B, Alignment *S); void output_lalign_header( char *name, Alignment *B); void output_lalign ( char *name, Alignment *B); void output_lalign_aln ( char *name, Alignment *B); int is_blast_matrix (char *fname); int is_pavie_matrix (char *fname); int **seq2latmat ( Sequence *S, char *fname); int output_mat (int **mat, char *fname, char *alp, int offset); int ** read_blast_matrix ( char *mat_name); int output_blast_mat (int **mat, char *fname); void output_pavie_mat (int **mat, char *fname, double gep, char *alp); int ** read_pavie_matrix ( char *mat_name); # 2010 "util_lib_header.h" Structure * declare_rna_structure_num (Sequence *SA); char *thread_aa_seq_on_dna_seq( char *s); void thread_seq_struc2aln ( Alignment *A, Sequence *ST); Alignment *thread_dnaseq_on_prot_aln (Sequence *S, Alignment *A); void cache_id ( Alignment *A); int process_est_sequence ( Sequence *S, int *cluster_list); char * invert_seq ( char *seq); int get_best_match ( char *seq1, char *seq2); int** extract_m_diag_streches ( int ** m, int l1, int l2,char *seq1, char *seq2, int *n_mdiag); int is_strech ( char *AA, char *seq1, char *seq2, int len, int x, int y); int search_for_cluster ( int seq, int cluster_number, int *cluster_list, int T, int nseq, int **S); int * SHC ( int nseq, int **NST, int **ST); int mutate_sol (int *sol, int nseq); int evaluate_sol ( int*sol, int nseq, int **ST, int **NST); char **make_symbols ( char *name, int *n); Alignment *code_dna_aln (Alignment *A); char* back_translate_dna_codon ( char aa, int deterministic); int translate_dna_codon ( char *seq, char stop); char* mutate_amino_acid ( char aa, char *mode); Alignment * mutate_aln ( Alignment *A, char *r); Alignment *translate_splice_dna_aln (Alignment *A,Alignment *ST ); Alignment * mutate_cdna_aln ( Alignment *A); char * translate_dna_seq_on3frame ( char *dna_seq, char stop, char *prot); char * translate_dna_seq ( char *dna_seq, int frame, char stop, char *prot); char * back_translate_dna_seq ( char *in_seq,char *out_seq, int mode); Alignment *back_translate_dna_aln (Alignment *A); Alignment *translate_dna_aln (Alignment *A, int frame); Alignment *clean_gdna_aln (Alignment *A); Alignment *clean_cdna_aln (Alignment *A); Alignment *clean_est (Alignment *A); void modify_data (Sequence_data_struc *D1, Sequence_data_struc *D2, Sequence_data_struc *DST, char **action_list,int n_actions, Action_data_struc *RAD); # 8 "util_dp_sim.c" 2 # 1 "define_header.h" 1 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/float.h" 1 3 4 # 5 "define_header.h" 2 # 9 "util_dp_sim.c" 2 # 1 "dp_lib_header.h" 1 struct CL_node { int copy_mode; struct CL_node *c; struct CL_node *p; struct CL_node *l; struct CL_node *r; int seq; int res; int free; }; typedef struct CL_node CL_node; Alignment * add_constraint2aln ( Alignment *A, int s1, int r1, int s2, int r2); Alignment * graph_aln (Alignment *A, Constraint_list *CL, Sequence *S); Alignment* graph2aln (Alignment *A, CL_node *G, Sequence *S); CL_node ***add_constraint2graph_aln (CL_node ***G, int s1, int r1, int s2, int r2); CL_node * shift_segment ( CL_node *S, int segL, int shiftL); int is_graph_gap_column(CL_node *S); CL_node * remove_graph_gap_column (CL_node *S); CL_node * swap_gap_in_graph ( CL_node*S, CL_node *E); CL_node * declare_cl_nodes ( int len, int seq); CL_node * insert_gap_columns (CL_node *S, int d); int get_node_distance ( CL_node *S, CL_node *E); CL_node ***aln2graph (Alignment *A); CL_node *vfree_graph (CL_node *S); CL_node *vfree_cl_node ( CL_node *N); int gotoh_pair_wise_lalign ( Alignment *A, int*ns, int **l_s,Constraint_list *CL); Constraint_list * undefine_sw_aln ( Alignment *A, Constraint_list *CL); Constraint_list * undefine_sw_pair ( Constraint_list *CL, int s1, int r1, int s2, int r2); int sw_pair_is_defined ( Constraint_list *CL, int s1, int r1, int s2, int r2); int gotoh_pair_wise_sw (Alignment *A,int*ns, int **l_s,Constraint_list *CL); Alignment * get_best_local_aln ( Alignment *IN,Constraint_list *CL,int gop, int gep, int sw_t, int sw_l, int sw_z, int greedy); Alignment * get_best_nol_local_aln ( Alignment *IN, Constraint_list *CL, int gop, int gep,int sw_t,int sw_l, int sw_z, int mode); double compute_penalty (Constraint_list *CL, char *mode, int len); double compute_scale ( Constraint_list *CL,char *mode, int len); int evaluate_penalty (Alignment *A, Constraint_list *CL, int *scale,char *scale_mode, int *penalty, char *penalty_mode, int len_seq); Alignment ** t_coffee_lalign (Constraint_list *CL, int scale, int penalty,int maximise,Sequence *S, int sw_t, int sw_l, int sw_z,int *sw_n, int sw_io); Alignment * add_seq2aln (Constraint_list *CL, Alignment *IN,Sequence *S); struct Dp_Model { int *diag; int TG_MODE; int F_TG_MODE; int gop; int gep; int f_gop; int f_gep; int nstate; int START; int END; char**model_comments; int **model; int **model_properties; int **bounded_model; int (***model_emission_function)(Alignment*, int **, int, int*, int, int **, int, int*, int, struct Constraint_list *); int LEN_I; int LEN_J; int DELTA_I; int DELTA_J; int EMISSION; int START_EMISSION; int TERM_EMISSION; int ALN_TYPE; Constraint_list *CL; int UM; int TYPE; int F0; int F1; int NON_CODING; int INSERTION; int DELETION; int CODING0; int CODING1; int CODING2; }; typedef struct Dp_Model Dp_Model; struct Dp_Result { int *traceback; int len; int score; Dp_Model *Dp_model; }; typedef struct Dp_Result Dp_Result; Dp_Result * make_fast_generic_dp_pair_wise (Alignment *A, int*ns, int **l_s,Dp_Model *M); Constraint_list* free_dp_model (Dp_Model *D); Dp_Result * free_dp_result (Dp_Result *D ); int ** evaluate_diagonals_for_two_sequences ( char *seq1, char *seq2,int maximise,Constraint_list *CL,int ktup); int ** evaluate_diagonals ( Alignment *A, int *ns, int **l_s, Constraint_list *CL,int maximise,int n_groups, char **group_list,int ktup); int ** evaluate_segments_with_ktup ( Alignment *A, int *ns, int **l_s, Constraint_list *CL,int maximise,int n_groups, char **group_list,int ktup); int ** evaluate_diagonals_with_ktup ( Alignment *A, int *ns, int **l_s, Constraint_list *CL,int maximise,int n_groups, char **group_list,int ktup); int ** evaluate_diagonals_with_clist ( Alignment *A, int *ns, int **l_s, Constraint_list *CL,int maximise,int n_groups, char **group_list,int ktup); int * flag_diagonals (int l1, int l2, int **sorted_diag,float T, int window); int * extract_N_diag (int l1, int l2, int **sorted_diag, int n_chosen_diag, int window); int hasch_seq(char *seq1, int **hs, int **lu,int ktup, char *alph); int fasta_gotoh_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int cfasta_gotoh_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int very_fast_gotoh_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int make_fasta_gotoh_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL, int *diag); int precomputed_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int ktup_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int ktup_comparison ( char *seq1, char *seq2, int ktup); HaschT* hasch_sequence ( char *seq1, int ktup); int cfasta_gotoh_pair_wise_sw (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int fasta_gotoh_pair_wise_sw (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int make_fasta_gotoh_pair_wise_sw (Alignment *A,int*ns, int **l_s,Constraint_list *CL, int *diag); int gotoh_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int subop1_pair_wise ( Alignment *A, int *ns, int **ls, Constraint_list *CL); int subop2_pair_wise ( Alignment *A, int *ns, int **ls, Constraint_list *CL); int cfasta_cdna_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); int fasta_cdna_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); Dp_Model* initialize_dna_dp_model (Constraint_list *CL); Dp_Result * make_fast_dp_pair_wise (Alignment *A,int*ns, int **l_s, Constraint_list *CL,Dp_Model *M); int make_fasta_cdna_pair_wise (Alignment *B,Alignment *A,int*ns, int **l_s,Constraint_list *CL, int *diag); int ** evaluate_diagonals_cdna ( Alignment *A, int *ns, int **l_s, Constraint_list *CL,int maximise,int n_groups, char **group_list, int ktup); int cfasta_cdna_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL); Alignment *clean_maln ( Alignment *A, Alignment *I, int T, int n_it); Alignment *realign_segment (int seq, int start, int len,Alignment *A, Alignment *C); Dp_Model * initialize_seg2prf_model(int left_tg_mode, int right_tg_mode, Constraint_list *CL); int get_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_start_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_term_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); Dp_Model * initialize_sseq_model(int left_tg_mode, int right_tg_mode, Constraint_list *CL); int ssec_pwaln_maln (Alignment *A, int *ns, int **ls, Constraint_list *CL); int get_turn_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_turn_start_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_turn_term_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_alpha_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_alpha_start_gep_cost(Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_alpha_term_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_beta_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_beta_start_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_beta_term_gep_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_alpha_sub_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_beta_sub_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_turn_sub_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_ssec_no_cost (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int sim_pair_wise_lalign (Alignment *in_A, int *in_ns, int **in_l_s, Constraint_list *in_CL); int myers_miller_pair_wise (Alignment *A, int *ns, int **l_s,Constraint_list *CL); int diff (Alignment *A, int *ns, int **ls, int s1, int M,int s2, int N , int tb, int te, Constraint_list *CL, int **pos); int evaluate_est_order (Sequence *S, char *concat, Constraint_list *CL, int ktuple); Constraint_list *prepare_cl_for_moca ( Constraint_list *CL); Alignment ** moca_aln ( Constraint_list *CL); Alignment * extract_domain ( Constraint_list *CL); Alignment * interactive_domain_extraction ( Constraint_list *CL); int print_moca_interactive_choices (); Alignment * approximate_domain ( int min_start, int max_start, int step_start,int min_len, int max_len, int step_len, int *best_start, int *best_len, int *best_score, Constraint_list *CL); int measure_domain_length ( Constraint_list *CL,Alignment *IN, int start, int min_size, int max_size, int step); Alignment *extract_domain_with_coordinates ( Alignment *RESULT,int start, int len, Constraint_list *CL); int get_starting_point ( Constraint_list *CL); Alignment * find_domain_coordinates (Constraint_list *CL, int *start, int *len); Alignment * extend_domain ( Constraint_list *CL, int *start, int *len, int dstart, int dlen); Alignment * modify_domain ( Constraint_list *CL, Alignment *IN, int *start, int *len, int dstart, int dlen); int * analyse_sequence ( Constraint_list *CL); # 233 "dp_lib_header.h" Constraint_list *profile2list ( Job_TC *job,int nprf); Constraint_list *seq2list (Job_TC *Job); Constraint_list *method2pw_cl (TC_method *M, Constraint_list *CL); int method_uses_structure( char *method); Alignment * compute_prrp_aln (Alignment *A, Constraint_list *CL); Alignment * compute_clustalw_aln (Alignment *A, Constraint_list *CL); Alignment * compute_tcoffee_aln_quick (Alignment *A, Constraint_list *CL); Alignment * seq2clustalw_aln (Sequence *S); Alignment * aln2clustalw_aln (Alignment *A, Constraint_list *CL); Alignment * realign_block ( Alignment *A, int col1, int col2, char *pg); Constraint_list * align_coding_nucleotides (char *seq, char *method, char *weight, char *mem_mode, Constraint_list *CL); Constraint_list *align_pdb_pair (char *seq_in, char *dp_mode,char *evaluate_mode, char *file, Constraint_list *CL, Job_TC *job); Constraint_list * align_pdb_pair_2 (char *seq, Constraint_list *CL); Constraint_list * fugue_pair ( char *seq, Constraint_list *CL); Constraint_list * fugue_pair2 (int s1, int s2, Constraint_list *CL); Constraint_list * sap_pair (char *seq, Constraint_list *CL); Constraint_list * lsqman_pair (char *seq, Constraint_list *CL); Constraint_list * thread_pair (char *seq, Constraint_list *CL); Constraint_list * sap_pair_rs (char *seq, Constraint_list *CL); Alignment * fast_pair (Job_TC *job); void toggle_case_in_align_two_sequences(int value); Alignment * align_two_sequences ( char *seq1, char *seq2, char *matrix, int gop, int gep, char *align_mode); Alignment * align_two_aln ( Alignment *A1, Alignment *A2, char *in_matrix, int gop, int gep, char *in_align_mode); NT_node ** make_tree ( Alignment *A,Constraint_list *CL,int gop, int gep,Sequence *S, char *tree_file, int maximise); int ** get_pw_distances ( Alignment *A,Constraint_list *CL,int gop, int gep, char **out_seq, char **out_seq_name, int out_nseq, char *tree_file, char *tree_mode, int maximise); Alignment *build_progressive_nol_aln_with_seq_coor(Constraint_list *CL,int gop, int gep,Sequence *S, int **seq_coor, int nseq); Alignment *build_progressive_aln_with_seq_coor (Constraint_list*CL,int gop, int gep, Sequence *S, int **coor, int nseq); Alignment *build_progressive_aln(Alignment *A, Constraint_list *CL, int gop, int gep); Alignment *est_progressive_aln(Alignment *A, Constraint_list *CL, int gop, int gep); void analyse_seq ( Alignment *A, int s); Alignment *tsp_aln (Alignment *A, Constraint_list *iCL, Sequence *S); Alignment *iterate_aln ( Alignment*A, int nit, Constraint_list *CL); Alignment *realign_aln ( Alignment*A, Constraint_list *CL); Alignment *very_fast_aln (Alignment*A, int nseq, Constraint_list *CL); NT_node* tree_aln ( NT_node LT, NT_node RT, Alignment*A, int nseq, Constraint_list *CL); int split_condition (int nseq, int score, Constraint_list *CL); int pair_wise (Alignment *A, int*ns, int **l_s,Constraint_list *CL ); int empty_pair_wise ( Alignment *A, int *ns, int **l_s, Constraint_list *CL, int glocal); Pwfunc get_pair_wise_function (Pwfunc func, char *dp_mode, int *glocal); char *build_consensus ( char *seq1, char *seq2, char *dp_mode); int domain_pair_wise (Alignment *A,int*ns, int **l_s,Constraint_list *CL ); Alignment *domain_match_list2aln ( Alignment *A,int *ns,int **l_s,int **ml, int nseq, int len); Alignment * domain_seq2domain (Constraint_list *CL,int scale,int gop,int gep,Alignment *SEQ_DOMAIN, Alignment *TARGET); int custom_pair_score_function1 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function2 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function3 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function4 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function5 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function6 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function7 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function8 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function9 (Constraint_list *CL, int s1, int r1, int s2, int r2); int custom_pair_score_function10 (Constraint_list *CL, int s1, int r1, int s2, int r2); int apdb (int argc, char *argv[]); Constraint_list * set_constraint_list4align_pdb (Constraint_list *inCL,int seq, char *dp_mode, char *hasch_mode, char *param_file); int evaluate_ca_trace_sap2_bubble (Constraint_list *CL, int s1, int r1, int s2, int r2); int evaluate_ca_trace_nb (Constraint_list *CL, int s1, int s2, int r1, int r2); int evaluate_ca_trace_bubble (Constraint_list *CL, int s1, int s2, int r1, int r2); int evaluate_ca_trace_sap1_bubble (Constraint_list *CL, int s1, int s2, int r1, int r2); int evaluate_ca_trace_3D_bubble (Constraint_list *CL, int s1, int s2, int r1, int r2); int evaluate_ca_trace_transversal (Constraint_list *CL, int s1, int s2, int r1, int r2); int evaluate_ca_trace_bubble_2 (Constraint_list *CL, int s1, int s2, int r1, int r2); int evaluate_ca_trace_bubble_3 (Constraint_list *CL, int s1, int s2, int r1, int r2); float matrix_match (Constraint_list *CL, int s1, int s2, int r1, int r2, Struct_nb *nbs1, Struct_nb *nbs2); float transversal_match (Constraint_list *CL, int s1, int s2, int r1, int r2, Struct_nb *nbs1, Struct_nb *nbs2); float neighborhood_match (Constraint_list *CL, int s1, int s2, int r1, int r2,Struct_nb *nbs1, Struct_nb *nbs2); float sap1_neighborhood_match (Constraint_list *CL, int s1, int s2, int r1, int r2, Struct_nb *nbs1, Struct_nb *nbs2); float sap2_neighborhood_match (Constraint_list *CL, int s1, int s2, int r1, int r2, Struct_nb *nbs1, Struct_nb *nbs2); Alignment * analyse_pdb ( Alignment *A, Alignment *ST); float *** analyse_pdb_residues ( Alignment *A, Constraint_list *CL, Pdb_param *pdb_param); float square_atom ( Atom *X); Atom* reframe_atom ( Atom *X, Atom*Y, Atom *Z, Atom *IN, Atom *R); Atom* add_atom ( Atom *A, Atom*B, Atom *R); Atom* diff_atom ( Atom *A, Atom*B, Atom *R); Atom * copy_atom ( Atom *A, Atom*R); int evaluate_aln_gibbs ( Alignment *A, Constraint_list *CL); int evaluate_moca_domain ( Alignment *A, Constraint_list *CL); int moca_residue_pair_extended_list ( Constraint_list *CL, int s1, int r1, int s2, int r2); int moca_evaluate_matrix_score ( Constraint_list *CL, int s1, int r1, int s2, int r2); int moca_slow_get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int **cache_cl_with_moca_domain (Alignment *A, Constraint_list *CL); Alignment *make_moca_nol_aln ( Alignment *A, Constraint_list *CL); int evaluate_domain_aln_z_score (Alignment *A, int start, int end,Constraint_list *CL, char *alphabet); int evaluate_domain_aln ( Alignment *A, int start, int end,Constraint_list *CL); int unpack_seq_residues ( int *s1, int *r1, int *s2, int *r2, int **packed_seq_lu); Alignment * unpack_seq_aln ( Alignment *A,Constraint_list *C); typedef struct { int N_COMPONENT; double *double_logB_alpha; double *exponant_list; double **ALPHA; double *DM_Q; double *alpha_tot; int n_aa; int tot_n; } Mixture; double int_logB (int *i, int n); double float_logB (float *i, int n); double double_logB (double *x, int n); double *** make_lup_table ( Mixture *D); double double_logB2(int j, double *n,Mixture *D); double compute_exponant ( double *n, int j, Mixture *D); double *compute_matrix_p ( double *n,int Nseq); double* compute_dirichlet_p ( double *n,int Nseq); void precompute_log_B ( double *table,Mixture *D); double compute_X (double *n,int i,Mixture *D); Mixture *read_dirichlet ( char *name); int dirichlet_code( char aa); double lgamma2 ( double x); double lgamma_r(double x, int *signgamp); Alignment * main_coffee_evaluate_output ( Alignment *IN,Constraint_list *CL, const char *mode ); int sub_aln2sub_aln_score ( Alignment *IN,Constraint_list *CL, const char *mode, int *ns, int **ls); Alignment * main_coffee_evaluate_output_sub_aln ( Alignment *IN,Constraint_list *CL, const char *mode, int *ns, int **ls); Alignment * categories_evaluate_output ( Alignment *IN,Constraint_list *CL); Alignment * matrix_evaluate_output ( Alignment *IN,Constraint_list *CL); Alignment * fast_coffee_evaluate_output ( Alignment *IN,Constraint_list *CL); int slow_coffee_evaluate_sub_aln ( Alignment *IN,int *ns, int **ls, Constraint_list *CL); Alignment * slow_coffee_evaluate_output ( Alignment *IN,Constraint_list *CL); Alignment * non_extended_t_coffee_evaluate_output( Alignment *IN,Constraint_list *CL); Alignment * heuristic_coffee_evaluate_output ( Alignment *IN,Constraint_list *CL); Alignment * coffee_evaluate_output ( Alignment *IN,Constraint_list *CL); Profile_cost_func get_profile_mode_function (char *name, Profile_cost_func func); int generic_evaluate_profile_score (Constraint_list *CL,Alignment *Prf1, int s1, int r1, Alignment *Prf2, int s2, int r2, Profile_cost_func prf_prf); int cw_profile_profile (int *prf1, int *prf2, Constraint_list *CL); int muscle_profile_profile (int *prf1, int *prf2, Constraint_list *CL); int evaluate_blast_profile_score (Constraint_list *CL, int s1, int r1, int s2, int r2); int evaluate_aln_profile_score (Constraint_list *CL, int s1, int r1, int s2, int r2); int evaluate_profile_score ( Constraint_list *CL,Alignment *Prf1, int s1, int r1, Alignment *Prf2, int s2, int r2); int evaluate_cdna_matrix_score ( Constraint_list *CL, int s1, int r1, int s2, int r2); int evaluate_matrix_score ( Constraint_list *CL, int s1, int r1, int s2, int r2); int evaluate_combined_matrix_score ( Constraint_list *CL, int s1, int r1, int s2, int r2); int evaluate_physico_score ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_non_extended_list ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_extended_list ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_extended_list_g_coffee_quadruplet ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_extended_list_g_coffee ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_extended_list_quadruplet ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_extended_list_mixt ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_test_function ( Constraint_list *CL, int s1, int r1, int s2, int r2); int extend_residue_pair ( Constraint_list *CL, int s1, int r1, int s2, int r2); int residue_pair_relative_extended_list ( Constraint_list *CL, int s1, int r1, int s2, int r2 ); int get_dp_cost_blosum_matrix (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_dp_cost_pam_matrix (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_dp_cost_pw_matrix (Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_cdna_best_frame_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_dp_cost_quadruplet ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int very_fast_get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int super_fast_get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int super_fast_get_dp_cost2 ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int fast_get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int fast_get_dp_cost_2 ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int fast_get_dp_cost_quadruplet ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int slow_get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int slow_get_dp_cost_test ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int sw_get_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2, Constraint_list *CL); int get_domain_dp_cost ( Alignment *A, int**pos1, int ns1, int*list1, int col1, int**pos2, int ns2, int*list2, int col2,Constraint_list *CL , int scale , int gop, int gep); float ** initialise_aa_physico_chemical_property_table (int *n); int aln2n_res ( Alignment *A, int start, int end); float get_gop_scaling_factor ( int **matrix,float id, int l1, int l2); float get_avg_matrix_mm ( int **matrix, char *alphabet); float get_avg_matrix_match ( int **matrix, char *alphabet); float get_avg_matrix_diff ( int **matrix1,int **matrix2, char *alphabet); float measure_matrix_enthropy (int **matrix,char *alphabet); float measure_matrix_pos_avg (int **matrix,char *alphabet); float evaluate_random_match (char *matrix, int n, int len,char *alp); float compare_two_mat (char *mat1,char*mat2, int n, int len,char *alp); float compare_two_mat_array (int **matrix1,int **matrix2, int n, int len,char *alp); int ** rescale_two_mat (char *mat1,char*mat2, int n, int len,char *alp); int ** rescale_matrix ( int **mat, float lambda, char *alp); void output_matrix_header ( char *name, int **matrix, char *alp); float evaluate_random_match2 (int **matrix, int n, int len,char *alp); float measure_lambda2(char *mat1,char*mat2, int n, int len,char *alp); float measure_lambda(char *mat1,char*mat2, int n, int len,char *alp); Constraint_list * choose_extension_mode ( char *extend_mode, Constraint_list *CL); int ** combine_two_matrices ( int **mat1, int **mat2); int ** show_pair(int istart, int iend, int jstart, int jend, int *seqlen_array, char **seq_array, int dna_ktup, int dna_window, int dna_wind_gap, int dna_signif,int prot_ktup, int prot_window,int prot_wind_gap,int prot_signif, int nseqs,int dnaflag, int max_aa, int max_aln_length ); struct Hmm { double freeT; double forbiden; int start; int end; int nS; int order; struct HmmState **S; double **T; int **fromM; int **toM; }; typedef struct Hmm Hmm; struct HmmAln { Hmm *H; int *state_list; }; typedef struct HmmAln HmmAln; typedef double (*Generic_em_func)(struct Hmm*, struct HmmState*, int); struct HmmState { char name[100]; char state; int DJ; int DI; double em; Col_cost_func em_func; double *em2; Generic_em_func em_func2; int nT; struct StateTrans **T; }; typedef struct HmmState HmmState; struct StateTrans { char name[101]; double tr; }; typedef struct StateTrans StateTrans; struct MatState { int i; int j; int st; int pst; double sc; struct MatState *n; struct MatState *p; struct MatState *m; struct MatState *s; struct MatState *Hn; struct MatState *Hp; struct MatState *Mn; struct MatState *Mp; int free; }; typedef struct MatState MatState; # 610 "dp_lib_header.h" int seq_viterbi_pair_wise (Alignment *A,int*ns, int **ls,Constraint_list *CL); # 620 "dp_lib_header.h" int viterbi_pair_wise (Alignment *A,int*ns, int **ls,Constraint_list *CL); Alignment * viterbipath2aln (Alignment *A, int *ns,int **ls,int *tb, Hmm *H); double*** viterbi_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL); int * viterbi2path (int l1,int l2, Hmm *H, double ***M); int viterbiL_pair_wise (Alignment *A,int*ns, int **ls,Constraint_list *CL); MatState* RviterbiL_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E); MatState* viterbiL_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL, MatState *S, MatState *E); int viterbiD_pair_wise (Alignment *A,int*ns, int **ls,Constraint_list *CL); double lu_RviterbiD_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E, int **seg_list); MatState* RviterbiD_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E, int **seg_list); MatState* viterbiD_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL, MatState *S, MatState *E, int **seg_list); int **seglist2table ( int **seglist,int l1, int l2); int *seglist2line ( int **seglist, int line, int start, int end); int * traceback (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E, int **seg_list); int viterbiDGL_pair_wise (Alignment *A,int*ns, int **ls,Constraint_list *CL); double lu_RviterbiDGL_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E, int **seg_list); MatState* RviterbiDGL_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E, int **seg_list); MatState* viterbiDGL_hmm (Alignment *A,int *ns, int **ls, Hmm *H, Constraint_list *CL,MatState *S, MatState *E, int **seg_list); # 656 "dp_lib_header.h" int MatStateAreIdentical (MatState*I, MatState*O); int MaxDeltaMatState (MatState*I, MatState*O); int MinDeltaMatState (MatState*I, MatState*O); MatState * ManageMatState(int Mode, MatState *C); MatState* CopyMatState ( MatState*I, MatState*O); Hmm* read_hmm(char *file); Hmm* declare_hmm(int n); Hmm* free_Hmm(Hmm*H); void DisplayHmm ( Hmm *H); # 675 "dp_lib_header.h" Hmm* define_two_mat_model(Constraint_list *CL); Hmm* define_probcons_model(Constraint_list *CL); Hmm* define_simple_model(Constraint_list *CL); Hmm * bound_hmm ( Hmm *H); Sequence *pavie_seq2random_seq (Sequence *S, char *subst); float **pavie_seq2pavie_aln(Sequence *S,char *mat, char *mode); int **pavie_seq2trained_pavie_mat(Sequence *S, char *param); int pavie_pair_wise (Alignment *A,int *ns, int **l_s,Constraint_list *CL ); # 10 "util_dp_sim.c" 2 void* sim_vcalloc( size_t nobj, size_t size); void sim_free_all (); int sim_reset_static_variable (); Constraint_list *CL; static int * ns; static int **l_s; static Alignment *Aln; static int **pos; static int *seqc0, *seqc1; static int min0,min1,max0,max1,mins; int gscore; static int q, r; static int qr; typedef struct ONE { int COL ; struct ONE *NEXT ;} pair, *pairptr; pairptr *row, z, z1; static int tt; typedef struct SIM_NODE { int SIM_SCORE; int SIM_STARI; int SIM_STARJ; int SIM_ENDI; int SIM_ENDJ; int SIM_TOP; int SIM_BOT; int SIM_LEFT; int SIM_RIGHT; } vertex, *vertexptr; vertexptr *LIST; vertexptr low = 0; vertexptr most = 0; static int numnode; static int *CC, *DD; static int *RR, *SS, *EE, *FF; static int *HH, *WW; static int *II, *JJ, *XX, *YY; static int m1, mm, n1, nn; static int rl, cl; static int lmin; static int flag; # 99 "util_dp_sim.c" static int diff_sim(), display(),calcons(); static int zero = 0; static int *sapp; static int last; static int I, J; static int no_mat; static int no_mis; static int al_len; # 149 "util_dp_sim.c" int sim_pair_wise_lalign (Alignment *in_A, int *in_ns, int **in_l_s,Constraint_list *in_CL) { int endi, endj, stari, starj; int score; int count; int i; int *S; int nc, nident; vertexptr cur; vertexptr findmax(); double percent; int t1, t2, g1, g2, r1, r2; int a, b, c, d, e; int CEDRIC_MAX_N_ALN=999; int CEDRIC_THRESHOLD=50; int *A, *B; int M, N, K, maxl; int nseq; int R, Q; Alignment *DA; DA=in_A; Aln=copy_aln (in_A, ((void *)0)); l_s=in_l_s; ns=in_ns; CL=in_CL; K=CL->lalign_n_top; M=strlen (Aln->seq_al[l_s[0][0]]); N=strlen (Aln->seq_al[l_s[1][0]]); maxl=M+N+1; pos=aln2pos_simple (Aln,-1, ns, l_s); seqc0=(int*)sim_vcalloc (maxl,sizeof (int)); A=(int*)sim_vcalloc (maxl,sizeof (int)); for ( a=0; agop) >(-CL->gop)) ? (CL->gop):(-CL->gop))*10; R=(((CL->gep) >(-CL->gep)) ? (CL->gep):(-CL->gep))*10; if ( K==CEDRIC_MAX_N_ALN)K--; else if ( K<0) { CEDRIC_THRESHOLD=-K; K=CEDRIC_MAX_N_ALN; } CC = ( int * ) sim_vcalloc(N+1, sizeof(int)); DD = ( int * ) sim_vcalloc(N+1, sizeof(int)); RR = ( int * ) sim_vcalloc(N+1, sizeof(int)); SS = ( int * ) sim_vcalloc(N+1, sizeof(int)); EE = ( int * ) sim_vcalloc(N+1, sizeof(int)); FF = ( int * ) sim_vcalloc(N+1, sizeof(int)); HH = ( int * ) sim_vcalloc(M + 1, sizeof(int)); WW = ( int * ) sim_vcalloc(M + 1, sizeof(int)); II = ( int * ) sim_vcalloc(M + 1, sizeof(int)); JJ = ( int * ) sim_vcalloc(M + 1, sizeof(int)); XX = ( int * ) sim_vcalloc(M + 1, sizeof(int)); YY = ( int * ) sim_vcalloc(M + 1, sizeof(int)); S = ( int * ) sim_vcalloc(((M)<=(N) ? (M) : (N))*5/4+1, sizeof (int)); row = ( pairptr * ) sim_vcalloc( (M + 1), sizeof(pairptr)); if (nseq == 2) for ( i = 1; i <= M; i++ ) row[i]= (pairptr)((void *)0); else { z = ( pairptr )sim_vcalloc (M,(int)sizeof(pair)); for ( i = 1; i <= M; i++,z++) { row[i] = z; z->COL = i; z->NEXT = (pairptr)((void *)0); } } q = Q; r = R; qr = q + r; LIST = ( vertexptr * ) sim_vcalloc( K, sizeof(vertexptr)); for ( i = 0; i < K ; i++ ) LIST[i] = ( vertexptr )sim_vcalloc( 1, sizeof(vertex)); numnode = lmin = 0; big_pass(A,B,M,N,K,nseq); # 270 "util_dp_sim.c" for ( count = K - 1; count >= 0; count-- ) { if ( numnode == 0 ) { padd_aln (in_A); sim_free_all(); return 1; } cur = findmax(); score = cur->SIM_SCORE; if ( K==CEDRIC_MAX_N_ALN && scoreSIM_STARI; starj = ++cur->SIM_STARJ; endi = cur->SIM_ENDI; endj = cur->SIM_ENDJ; m1 = cur->SIM_TOP; mm = cur->SIM_BOT; n1 = cur->SIM_LEFT; nn = cur->SIM_RIGHT; rl = endi - stari + 1; cl = endj - starj + 1; I = stari - 1; J = starj - 1; sapp = S; last = 0; al_len = 0; no_mat = 0; no_mis = 0; diff_sim(&A[stari]-1, &B[starj]-1,rl,cl,q,q); min0 = stari; min1 = starj; max0 = stari+rl-1; max1 = starj+cl-1; calcons(A+1,M,B+1,N,S,&nc,&nident, Aln,ns, l_s, CL); percent = (double)nident*100.0/(double)nc; if (!DA->A)DA->A=copy_aln(Aln, DA->A); DA->A=realloc_alignment (DA->A,nc+1); DA=DA->A; DA->A=((void *)0); for ( c=0; c< 2; c++) { for ( a=0; a< ns[c]; a++) { e=(c==0)?min0:min1; for ( d=0; dorder[l_s[c][a]][1]+=1-is_gap(Aln->seq_al[l_s[c][a]][d]); } } } for ( t1=min0,t2=min1,a=0; aM)?0:1; g2=(r2==-1 || r2>N)?0:1; t1+=g1; t2+=g2; for (b=0; bseq_al[l_s[0][b]][a]=(g1)?Aln->seq_al[l_s[0][b]][A[t1-1]]:'-'; for (b=0; bseq_al[l_s[1][b]][a]=(g2)?Aln->seq_al[l_s[1][b]][B[t2-1]]:'-'; } for (b=0; bseq_al[l_s[0][b]][a]='\0';} for (b=0; bseq_al[l_s[1][b]][a]='\0';} DA->nseq=ns[0]+ns[1]; DA->len_aln=nc; DA->score=percent; DA->score_aln=score; fflush(stdout); if ( count ) { flag = 0; locate(A,B,nseq); if ( flag ) small_pass(A,B,count,nseq); } } padd_aln (in_A); sim_free_all(); # 376 "util_dp_sim.c" free_int (pos, -1); free_aln (Aln); return 1; } int sim_reset_static_variable () { CC=DD=RR=SS=EE=FF=HH=WW=II=JJ=XX=YY=sapp=((void *)0); min0=min1=max0=max1=mins=q=r=qr=tt=numnode=m1=n1=nn=rl=cl=lmin=flag=zero=last=I=J=no_mat=no_mis=al_len=0; most=low=((void *)0); LIST=((void *)0); return 0; } big_pass(A,B,M,N,K,nseq) int A[],B[]; int M,N,K,nseq; { register int i, j; register int c; register int f; register int d; register int p; register int ci, cj; register int di, dj; register int fi, fj; register int pi, pj; int addnode(); # 415 "util_dp_sim.c" for ( j = 1; j <= N ; j++ ) { CC[j] = 0; RR[j] = 0; EE[j] = j; DD[j] = - (q); SS[j] = 0; FF[j] = j; } for ( i = 1; i <= M; i++) { c = 0; f = - (q); ci = fi = i; if ( nseq == 2 ) { p = 0; pi = i - 1; cj = fj = pj = 0; } else { p = CC[i]; pi = RR[i]; pj = EE[i]; cj = fj = i; } for ( j = (nseq == 2 ? 1 : (i+1)) ; j <= N ; j++ ) { f = f - r; c = c - qr; { if ( f < c ) { f = c; fi = ci; fj = cj; } else if ( f == c ) { if ( fi < ci ) { fi = ci; fj = cj; } else if ( fi == ci && fj < cj ) fj = cj; } } c = CC[j] - qr; ci = RR[j]; cj = EE[j]; d = DD[j] - r; di = SS[j]; dj = FF[j]; { if ( d < c ) { d = c; di = ci; dj = cj; } else if ( d == c ) { if ( di < ci ) { di = ci; dj = cj; } else if ( di == ci && dj < cj ) dj = cj; } } c = 0; { for ( tt = 1, z = row[(i)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (j) ) { tt = 0; break; } if ( tt ) c = ( p+((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[i-1], pos, ns[1], l_s[1], B[j-1], CL)) ); } if ( c <= 0 ) { c = 0; ci = i; cj = j; } else { ci = pi; cj = pj; } { if ( c < d ) { c = d; ci = di; cj = dj; } else if ( c == d ) { if ( ci < di ) { ci = di; cj = dj; } else if ( ci == di && cj < dj ) cj = dj; } } { if ( c < f ) { c = f; ci = fi; cj = fj; } else if ( c == f ) { if ( ci < fi ) { ci = fi; cj = fj; } else if ( ci == fi && cj < fj ) cj = fj; } } p = CC[j]; CC[j] = c; pi = RR[j]; pj = EE[j]; RR[j] = ci; EE[j] = cj; DD[j] = d; SS[j] = di; FF[j] = dj; if ( c > lmin ) lmin = addnode(c, ci, cj, i, j, K, lmin); } } return 1; } locate(A,B,nseq) int A[],B[]; int nseq; { register int i, j; register int c; register int f; register int d; register int p; register int ci, cj; register int di, dj; register int fi, fj; register int pi, pj; int cflag, rflag; int addnode(); int limit; # 503 "util_dp_sim.c" for ( j = nn; j >= n1 ; j-- ) { CC[j] = 0; EE[j] = j; DD[j] = - (q); FF[j] = j; if ( nseq == 2 || j > mm ) RR[j] = SS[j] = mm + 1; else RR[j] = SS[j] = j; } for ( i = mm; i >= m1; i-- ) { c = p = 0; f = - (q); ci = fi = i; pi = i + 1; cj = fj = pj = nn + 1; if ( nseq == 2 || n1 > i ) limit = n1; else limit = i + 1; for ( j = nn; j >= limit ; j-- ) { f = f - r; c = c - qr; { if ( f < c ) { f = c; fi = ci; fj = cj; } else if ( f == c ) { if ( fi < ci ) { fi = ci; fj = cj; } else if ( fi == ci && fj < cj ) fj = cj; } } c = CC[j] - qr; ci = RR[j]; cj = EE[j]; d = DD[j] - r; di = SS[j]; dj = FF[j]; { if ( d < c ) { d = c; di = ci; dj = cj; } else if ( d == c ) { if ( di < ci ) { di = ci; dj = cj; } else if ( di == ci && dj < cj ) dj = cj; } } c = 0; { for ( tt = 1, z = row[(i)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (j) ) { tt = 0; break; } if ( tt ) c = ( p+((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[i-1], pos, ns[1], l_s[1], B[j-1], CL)) ); } if ( c <= 0 ) { c = 0; ci = i; cj = j; } else { ci = pi; cj = pj; } { if ( c < d ) { c = d; ci = di; cj = dj; } else if ( c == d ) { if ( ci < di ) { ci = di; cj = dj; } else if ( ci == di && cj < dj ) cj = dj; } } { if ( c < f ) { c = f; ci = fi; cj = fj; } else if ( c == f ) { if ( ci < fi ) { ci = fi; cj = fj; } else if ( ci == fi && cj < fj ) cj = fj; } } p = CC[j]; CC[j] = c; pi = RR[j]; pj = EE[j]; RR[j] = ci; EE[j] = cj; DD[j] = d; SS[j] = di; FF[j] = dj; if ( c > lmin ) flag = 1; } if ( nseq == 2 || i < n1 ) { HH[i] = CC[n1]; II[i] = RR[n1]; JJ[i] = EE[n1]; WW[i] = DD[n1]; XX[i] = SS[n1]; YY[i] = FF[n1]; } } for ( rl = m1, cl = n1; ; ) { for ( rflag = cflag = 1; ( rflag && m1 > 1 ) || ( cflag && n1 > 1 ) ; ) { if ( rflag && m1 > 1 ) { rflag = 0; m1--; c = p = 0; f = - (q); ci = fi = m1; pi = m1 + 1; cj = fj = pj = nn + 1; for ( j = nn; j >= n1 ; j-- ) { f = f - r; c = c - qr; { if ( f < c ) { f = c; fi = ci; fj = cj; } else if ( f == c ) { if ( fi < ci ) { fi = ci; fj = cj; } else if ( fi == ci && fj < cj ) fj = cj; } } c = CC[j] - qr; ci = RR[j]; cj = EE[j]; d = DD[j] - r; di = SS[j]; dj = FF[j]; { if ( d < c ) { d = c; di = ci; dj = cj; } else if ( d == c ) { if ( di < ci ) { di = ci; dj = cj; } else if ( di == ci && dj < cj ) dj = cj; } } c = 0; { for ( tt = 1, z = row[(m1)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (j) ) { tt = 0; break; } if ( tt ) c = ( ((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[m1-1], pos, ns[1], l_s[1], B[j-1], CL)) ); } if ( c <= 0 ) { c = 0; ci = m1; cj = j; } else { ci = pi; cj = pj; } { if ( c < d ) { c = d; ci = di; cj = dj; } else if ( c == d ) { if ( ci < di ) { ci = di; cj = dj; } else if ( ci == di && cj < dj ) cj = dj; } } { if ( c < f ) { c = f; ci = fi; cj = fj; } else if ( c == f ) { if ( ci < fi ) { ci = fi; cj = fj; } else if ( ci == fi && cj < fj ) cj = fj; } } p = CC[j]; CC[j] = c; pi = RR[j]; pj = EE[j]; RR[j] = ci; EE[j] = cj; DD[j] = d; SS[j] = di; FF[j] = dj; if ( c > lmin ) flag = 1; if ( ! rflag && ( ci > rl && cj > cl || di > rl && dj > cl || fi > rl && fj > cl ) ) rflag = 1; } HH[m1] = CC[n1]; II[m1] = RR[n1]; JJ[m1] = EE[n1]; WW[m1] = DD[n1]; XX[m1] = SS[n1]; YY[m1] = FF[n1]; if ( ! cflag && ( ci > rl && cj > cl || di > rl && dj > cl || fi > rl && fj > cl ) ) cflag = 1; } if ( nseq == 1 && n1 == (m1 + 1) && ! rflag ) cflag = 0; if ( cflag && n1 > 1 ) { cflag = 0; n1--; c = 0; f = - (q); cj = fj = n1; if ( nseq == 2 || mm < n1 ) { p = 0; ci = fi = pi = mm + 1; pj = n1 + 1; limit = mm; } else { p = HH[n1]; pi = II[n1]; pj = JJ[n1]; ci = fi = n1; limit = n1 - 1; } for ( i = limit; i >= m1 ; i-- ) { f = f - r; c = c - qr; { if ( f < c ) { f = c; fi = ci; fj = cj; } else if ( f == c ) { if ( fi < ci ) { fi = ci; fj = cj; } else if ( fi == ci && fj < cj ) fj = cj; } } c = HH[i] - qr; ci = II[i]; cj = JJ[i]; d = WW[i] - r; di = XX[i]; dj = YY[i]; { if ( d < c ) { d = c; di = ci; dj = cj; } else if ( d == c ) { if ( di < ci ) { di = ci; dj = cj; } else if ( di == ci && dj < cj ) dj = cj; } } c = 0; { for ( tt = 1, z = row[(i)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (n1) ) { tt = 0; break; } if ( tt ) c = ( p+((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[i-1], pos, ns[1], l_s[1], B[n1-1], CL)) ); } if ( c <= 0 ) { c = 0; ci = i; cj = n1; } else { ci = pi; cj = pj; } { if ( c < d ) { c = d; ci = di; cj = dj; } else if ( c == d ) { if ( ci < di ) { ci = di; cj = dj; } else if ( ci == di && cj < dj ) cj = dj; } } { if ( c < f ) { c = f; ci = fi; cj = fj; } else if ( c == f ) { if ( ci < fi ) { ci = fi; cj = fj; } else if ( ci == fi && cj < fj ) cj = fj; } } p = HH[i]; HH[i] = c; pi = II[i]; pj = JJ[i]; II[i] = ci; JJ[i] = cj; WW[i] = d; XX[i] = di; YY[i] = dj; if ( c > lmin ) flag = 1; if ( ! cflag && ( ci > rl && cj > cl || di > rl && dj > cl || fi > rl && fj > cl ) ) cflag = 1; } CC[n1] = HH[m1]; RR[n1] = II[m1]; EE[n1] = JJ[m1]; DD[n1] = WW[m1]; SS[n1] = XX[m1]; FF[n1] = YY[m1]; if ( ! rflag && ( ci > rl && cj > cl || di > rl && dj > cl || fi > rl && fj > cl ) ) rflag = 1; } } if ( m1 == 1 && n1 == 1 || no_cross() ) break; } m1--; n1--; return 1; } small_pass(A,B,count,nseq) int A[], B[]; int count, nseq; { register int i, j; register int c; register int f; register int d; register int p; register int ci, cj; register int di, dj; register int fi, fj; register int pi, pj; int addnode(); int limit; for ( j = n1 + 1; j <= nn ; j++ ) { CC[j] = 0; RR[j] = m1; EE[j] = j; DD[j] = - (q); SS[j] = m1; FF[j] = j; } for ( i = m1 + 1; i <= mm; i++) { c = 0; f = - (q); ci = fi = i; if ( nseq == 2 || i <= n1 ) { p = 0; pi = i - 1; cj = fj = pj = n1; limit = n1 + 1; } else { p = CC[i]; pi = RR[i]; pj = EE[i]; cj = fj = i; limit = i + 1; } for ( j = limit ; j <= nn ; j++ ) { f = f - r; c = c - qr; { if ( f < c ) { f = c; fi = ci; fj = cj; } else if ( f == c ) { if ( fi < ci ) { fi = ci; fj = cj; } else if ( fi == ci && fj < cj ) fj = cj; } } c = CC[j] - qr; ci = RR[j]; cj = EE[j]; d = DD[j] - r; di = SS[j]; dj = FF[j]; { if ( d < c ) { d = c; di = ci; dj = cj; } else if ( d == c ) { if ( di < ci ) { di = ci; dj = cj; } else if ( di == ci && dj < cj ) dj = cj; } } c = 0; { for ( tt = 1, z = row[(i)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (j) ) { tt = 0; break; } if ( tt ) c = ( p+((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[i-1], pos, ns[1], l_s[1], B[j-1], CL)) ); } if ( c <= 0 ) { c = 0; ci = i; cj = j; } else { ci = pi; cj = pj; } { if ( c < d ) { c = d; ci = di; cj = dj; } else if ( c == d ) { if ( ci < di ) { ci = di; cj = dj; } else if ( ci == di && cj < dj ) cj = dj; } } { if ( c < f ) { c = f; ci = fi; cj = fj; } else if ( c == f ) { if ( ci < fi ) { ci = fi; cj = fj; } else if ( ci == fi && cj < fj ) cj = fj; } } p = CC[j]; CC[j] = c; pi = RR[j]; pj = EE[j]; RR[j] = ci; EE[j] = cj; DD[j] = d; SS[j] = di; FF[j] = dj; if ( c > lmin ) lmin = addnode(c, ci, cj, i, j, count, lmin); } } return 1; } int addnode(c, ci, cj, i, j, K, cost) int c, ci, cj, i, j, K, cost; { int found; register int d; found = 0; if ( most != 0 && most->SIM_STARI == ci && most->SIM_STARJ == cj ) found = 1; else for ( d = 0; d < numnode ; d++ ) { most = LIST[d]; if ( most->SIM_STARI == ci && most->SIM_STARJ == cj ) { found = 1; break; } } if ( found ) { if ( most->SIM_SCORE < c ) { most->SIM_SCORE = c; most->SIM_ENDI = i; most->SIM_ENDJ = j; } if ( most->SIM_TOP > i ) most->SIM_TOP = i; if ( most->SIM_BOT < i ) most->SIM_BOT = i; if ( most->SIM_LEFT > j ) most->SIM_LEFT = j; if ( most->SIM_RIGHT < j ) most->SIM_RIGHT = j; } else { if ( numnode == K ) most = low; else most = LIST[numnode++]; most->SIM_SCORE = c; most->SIM_STARI = ci; most->SIM_STARJ = cj; most->SIM_ENDI = i; most->SIM_ENDJ = j; most->SIM_TOP = most->SIM_BOT = i; most->SIM_LEFT = most->SIM_RIGHT = j; } if ( numnode == K ) { if ( low == most || ! low ) { for ( low = LIST[0], d = 1; d < numnode ; d++ ) if ( LIST[d]->SIM_SCORE < low->SIM_SCORE ) low = LIST[d]; } return ( low->SIM_SCORE ) ; } else return cost; } vertexptr findmax() { vertexptr cur; register int i, j; for ( j = 0, i = 1; i < numnode ; i++ ) if ( LIST[i]->SIM_SCORE > LIST[j]->SIM_SCORE ) j = i; cur = LIST[j]; if ( j != --numnode ) { LIST[j] = LIST[numnode]; LIST[numnode] = cur; } most = LIST[0]; if ( low == cur ) low = LIST[0]; return ( cur ); } no_cross() { vertexptr cur; register int i; for ( i = 0; i < numnode; i++ ) { cur = LIST[i]; if ( cur->SIM_STARI <= mm && cur->SIM_STARJ <= nn && cur->SIM_BOT >= m1-1 && cur->SIM_RIGHT >= n1-1 && ( cur->SIM_STARI < rl || cur->SIM_STARJ < cl )) { if ( cur->SIM_STARI < rl ) rl = cur->SIM_STARI; if ( cur->SIM_STARJ < cl ) cl = cur->SIM_STARJ; flag = 1; break; } } if ( i == numnode ) return 1; else return 0; } int diff_sim(A,B,M,N,tb,te) int *A, *B; int M, N; int tb, te; { int midi, midj, type; int midc; { register int i, j; register int c, e, d, s; int t; if (N <= 0) { if (M > 0) { I += M; al_len += M; if (last < 0) last = sapp[-1] -= (M); else last = *sapp++ = -(M); } return - ((M) <= 0 ? 0 : q+r*(M)); } if (M <= 1) { if (M <= 0) { { J += N; al_len += N; if (last < 0) { sapp[-1] = (N); *sapp++ = last; } else last = *sapp++ = (N); }; return - ((N) <= 0 ? 0 : q+r*(N)); } if (tb > te) tb = te; midc = - (tb + r + ((N) <= 0 ? 0 : q+r*(N)) ); midj = 0; for (j = 1; j <= N; j++) { for ( tt = 1, z = row[I+1]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == j+J ) { tt = 0; break; } if ( tt ) { c = ((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[0], pos, ns[1], l_s[1], B[j-1], CL)) - ( ((j-1) <= 0 ? 0 : q+r*(j-1)) + ((N-j) <= 0 ? 0 : q+r*(N-j)) ); if (c > midc) { midc = c; midj = j; } } } if (midj == 0) { { J += N; al_len += N; if (last < 0) { sapp[-1] = (N); *sapp++ = last; } else last = *sapp++ = (N); } { I += 1; al_len += 1; if (last < 0) last = sapp[-1] -= (1); else last = *sapp++ = -(1); } } else { if (midj > 1) { J += midj-1; al_len += midj-1; if (last < 0) { sapp[-1] = (midj-1); *sapp++ = last; } else last = *sapp++ = (midj-1); } { last = *sapp++ = 0; al_len += 1; } if ( A[1] == B[midj] ) no_mat += 1; else no_mis += 1; I++; J++; z = ( pairptr )sim_vcalloc(1,sizeof(pair)); z->COL = J; z->NEXT = row[I]; row[I] = z; if (midj < N) { J += N-midj; al_len += N-midj; if (last < 0) { sapp[-1] = (N-midj); *sapp++ = last; } else last = *sapp++ = (N-midj); } } return midc; } midi = M/2; CC[0] = 0; t = -q; for (j = 1; j <= N; j++) { CC[j] = t = t-r; DD[j] = t-q; } t = -tb; for (i = 1; i <= midi; i++) { s = CC[0]; CC[0] = c = t = t-r; e = t-q; for (j = 1; j <= N; j++) { if ((c = c - qr) > (e = e - r)) e = c; if ((c = CC[j] - qr) > (d = DD[j] - r)) d = c; { for ( tt = 1, z = row[(i+I)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (j+J) ) { tt = 0; break; } if ( tt ) c = ( s+((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[i-1], pos, ns[1], l_s[1], B[j-1], CL)) ); } if (c < d) c = d; if (c < e) c = e; s = CC[j]; CC[j] = c; DD[j] = d; } } DD[0] = CC[0]; RR[N] = 0; t = -q; for (j = N-1; j >= 0; j--) { RR[j] = t = t-r; SS[j] = t-q; } t = -te; for (i = M-1; i >= midi; i--) { s = RR[N]; RR[N] = c = t = t-r; e = t-q; for (j = N-1; j >= 0; j--) { if ((c = c - qr) > (e = e - r)) e = c; if ((c = RR[j] - qr) > (d = SS[j] - r)) d = c; { for ( tt = 1, z = row[(i+1+I)]; z != (pairptr)((void *)0); z = z->NEXT ) if ( z->COL == (j+1+J) ) { tt = 0; break; } if ( tt ) c = ( s+((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], A[i], pos, ns[1], l_s[1], B[j], CL)) ); } if (c < d) c = d; if (c < e) c = e; s = RR[j]; RR[j] = c; SS[j] = d; } } SS[N] = RR[N]; midc = CC[0]+RR[0]; midj = 0; type = 1; for (j = 0; j <= N; j++) if ((c = CC[j] + RR[j]) >= midc) if (c > midc || CC[j] != DD[j] && RR[j] == SS[j]) { midc = c; midj = j; } for (j = N; j >= 0; j--) if ((c = DD[j] + SS[j] + q) > midc) { midc = c; midj = j; type = 2; } } if (type == 1) { diff_sim(A,B,midi,midj,tb,q); diff_sim(A+midi,B+midj,M-midi,N-midj,q,te); } else { diff_sim(A,B,midi-1,midj,tb,zero); { I += 2; al_len += 2; if (last < 0) last = sapp[-1] -= (2); else last = *sapp++ = -(2); }; diff_sim(A+midi+1,B+midj,M-midi-1,N-midj,zero,te); } return midc; } int calcons(int *aa0,int n0,int *aa1,int n1,int *res,int *nc,int *nident, Alignment *A, int *ns, int **l_s, Constraint_list CL) { int i0, i1; int op, nid, lenc, nd; int *sp0, *sp1; int *rp; int a, b, id_col, tot_col, r0, r1; min0--; min1--; sp0 = seqc0+mins; sp1 = seqc1+mins; rp = res; lenc = nid = op = 0; i0 = min0; i1 = min1; while (i0 < max0 || i1 < max1) { if (op == 0 && *rp == 0) { op = *rp++; *sp0 = aa0[i0++]; *sp1 = aa1[i1++]; for (id_col=tot_col=0,a=0; a< ns[0]; a++) for ( b=0; b< ns[1]; b++) { r0=Aln->seq_al[l_s[0][a]][*sp0-1]; r1=Aln->seq_al[l_s[1][a]][*sp1-1]; if ( !is_gap(r0) && r1==r0)id_col++; if ( !is_gap(r0) && !is_gap(r1))tot_col++; } nid+=(tot_col)?(id_col/tot_col):0; lenc++; sp0++; sp1++; } else { if (op==0) op = *rp++; if (op>0) { *sp0++ = -1; *sp1++ = aa1[i1++]; op--; lenc++; } else { *sp0++ = aa0[i0++]; *sp1++ = -1; op++; lenc++; } } } *nident = nid; *nc = lenc; nd = 0; return mins+lenc+nd; } struct Mem { void *p; struct Mem *next; }; typedef struct Mem Mem; Mem *first_mem; Mem *last_mem; void *sim_vcalloc ( size_t nobj, size_t size) { void *p; Mem *new_mem; p=vcalloc (nobj, size); new_mem=vcalloc (1, sizeof (Mem)); if ( last_mem==((void *)0))first_mem=last_mem=new_mem; else { last_mem->next=new_mem; last_mem=new_mem; } last_mem->p=p; return p; } void sim_free_all() { Mem *p1, *p2; p1=first_mem; while (p1) { p2=p1->next; vfree(p1->p); vfree(p1); p1=p2; } first_mem=last_mem=((void *)0); sim_reset_static_variable(); }